## IQ imbalance

Discussions related to schematic capture, PCB layout, signal integrity, and RF development

Moderator: robert.ghilduta

Nrekcah
Posts: 12
Joined: Mon Jun 08, 2015 3:14 am

### IQ imbalance

Dear all,

Is it possible to model under Matlab the effect of the IQ imbalance by the following local oscillator:

LO(t) = cos(2*pi*Fc*t) + 1j * G * sin(2*pi*Fc*t+phi).

Where: Fc: Carrier frequency.
G: Gain imbalance.
phi: Phase imbalance.

Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

### Re: IQ imbalance

I have an impairment model that I threw together really quickly:

Code: Select all

``````% x is the input sample
% mag      imbalance in dB
% phase    imbalance in degrees
% dc       complex number which represents the complex DC offset
% freq     frequency offset to add for the resultant samplerate
% speed    offset in normalized value (1.0 = no change, 0.99 means 1%
%          slower, 1.01 means 1% faster) for sample clock differences
function y = impair(x, mag, phase, dc, freq, speed)
% Magnitude imbalance
y_mag = real(x).*10^(0.5/20*mag) + ...
imag(x).*10^(-0.5/20*mag)*1j ;

% Phase imbalance
y_phi = real(y_mag).*exp(-0.5*1j*pi*phase/180) + ...
imag(y_mag).*exp(1j*(pi/2+0.5*pi*phase/180)) ;

% DC offset
y_dc = y_phi + dc ;

% Samplerate speed offset
[n,d] = rat(speed) ;
y_speed = resample(y_dc,n,d) ;

% Frequency offset impairment
y = y_speed .* exp(1j*2*pi*freq*[0:length(y_speed)-1]) ;

end``````
Hopefully this works correctly and helps you out.

Brian

Nrekcah
Posts: 12
Joined: Mon Jun 08, 2015 3:14 am

### Re: IQ imbalance

Thank you Brian,

But when you add the frequency offset impairment, you suppose that it hasn't an effect at the start of the signal. The obvious question is where to choose the start of the signal ?
Then choosing the start of the signal at sample number X give a different effect from the case of starting the signal at the sample number X+1000 for example.