iqimb

Capsim Block Documentation

Short Description

Model IQ imbalance specifying amplitude mismatch (percent) and phase (degrees).

Top
Input Connections
Port Type Name
0 complex inStream
Top
Output Connections
Port Type Name
0 complex outStream
Top
Parameters
Num Description Type Name Default Value
0 Amplitude Mismatch(percent) float amplitudeMismatch 10.0
1 Phase Mismatch(Deg) float phaseMismatch 2.0
Top
States
Num Type Name Initial Value Description
0 float IA
1 float QA
2 float iampe
3 float qampe
4 complex ipe
5 complex qpe
Top

Declarations


 

  complex tmpIn;
  complex iqout;
  complex tmpIP;
  complex tmpQP;



Top

Initialization Code



 

  iampe = 1-0.5*amplitudeMismatch/100.;
  qampe = 1+0.5*amplitudeMismatch/100.;
  ipe.re = cos(-PI*phaseMismatch/360.);
  ipe.im = sin(-PI*phaseMismatch/360.);
  qpe.re = cos(PI*phaseMismatch/360.);
  qpe.im = sin(PI*phaseMismatch/360.);	




Top

Main Code



 


  while( AVAIL(0) ) {
    IT_IN(0);

	tmpIn = INCX(0,0);

	IA=tmpIn.re*iampe;
	QA=tmpIn.im*qampe;

	tmpIP.re=IA*ipe.re;
	tmpIP.im=IA*ipe.im;
	tmpQP.im=QA*qpe.re;
	tmpQP.re=-QA*qpe.im;
	
	iqout.re=tmpIP.re+tmpQP.re;
	iqout.im=tmpIP.im+tmpQP.im;

    if (IT_OUT(0)){
	   KrnOverflow("iqimb",0);
	   return(99);
    }

	OUTCX(0,0) = iqout;
  }





Top

Wrapup Code



 





Top

License



/*
 * (c) 2007 XCAD Corporation, Portland, Oregon, All Rights Reserved.
 * Acknowledgement Dr. Yoon
 */




Top

Description