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.
IQ 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:
Hopefully this works correctly and helps you out.
Brian
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
Brian
-
- 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.
Thank you in advance.
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.
Thank you in advance.
-
- Posts: 303
- Joined: Mon Mar 04, 2013 4:53 pm
Re: IQ imbalance
Your two radios will be offset from each other in an absolute manner (without including any type of Doppler for moving systems) so choosing the first sample isn't arbitrary but just normal since there is a bulk frequency offset between the radios at all times. Starting to have a decent frequency offset somewhere in the middle of a transmission usually doesn't happen unless you have something that goes from not moving to moving very fast, very quickly.
Hope this helps.
Brian
Hope this helps.
Brian