nonlinsaleh

Capsim Block Documentation

Short Description

Models non linear amplifiers (e.g. TWT) with AM-AM and AM-PM.

Top
Input Connections
Port Type Name
0 float r
1 float scos
2 float ssin
Top
Output Connections
Port Type Name
0 float y
Top
Parameters
Num Description Type Name Default Value
0 alphaA float alphaA 1.0
1 betaA float betaA 0.0
2 alphaPhi float alphaPhi 0.0
3 betaPhi float betaPhi 0.0
Top
States
Num Type Name Initial Value Description
0 int stateVariable 0
Top

Declarations


 

   	int i,k;
   	double sgcos;
	double sgsin;
	double sample;
        double rs;
        double Ar;
        double Phir;
        double Pr;
        double Qr;



Top

Initialization Code



 





Top

Main Code



 




for(k=(MIN_AVAIL());k >0; --k) {
       IT_IN(0);
       IT_IN(1);
       IT_IN(2);
       
       
       rs=r(0);
       sgcos=scos(0);
       sgsin=ssin(0);
       
       Ar=alphaA*rs/(1+betaA*rs*rs);
       Phir=alphaPhi*rs*rs/(1+betaPhi*rs*rs);
       Pr=Ar*cos(Phir);
       Qr=Ar*sin(Phir);
       
       sample=Pr*sgcos-Qr*sgsin;
       
  
       
   	   /*
	    * ready output buffer for sample
	    * check for overflow
	    */
	   if(IT_OUT(0)) {
				KrnOverflow("nonlinsaleh",0);
				return(99);
	   }
	   /*
	    * output the sample
	    */
	   y(0)=sample;


}
    




Top

Wrapup Code



 





Top

License



/*
 * (c) XCAD  Corporation, Portland, Oregon, All Rights Reserved
 */



Top

Description



 

/*
 * 		nonlinsaleh()
 *
 * Generated by blockgen
 *
 * Models Nonlinear Amplifiers with AM-AM and AM-PM (TWT's)
 *
 * Reference:
 * Saleh, A., "Frequency-Independent and Frequency-Dependent Nonlinear Models of TWT Amplifiers
 * IEEE Transactions on Communications 
 * Volume 29,  Issue 11,  Date: Nov 1981,  Pages:  1715 - 1720
 *    
 * Programmer: Sasan Ardalan 
 * Date: June 27, 2007
 * Modified: 
 *
 */