DSPRelated.com
Forums

Code for I/Q mismatch calibration

Started by Peter Mairhofer July 14, 2016
Like Eric I question whether IQ imbalance is your problem.  I suspect the i=
mage shown in your spectrum is due to IQ imbalance but because it is far ou=
t of the desired signal band the imbalance is not your problem. =20

Your receiver (at least the analog portions thereof) is not direct conversi=
on and images due to quadrature imbalance only become an issue with direct =
conversion or near zero-IF receivers because in that case the IF is in the =
range of the signal bandwidth.  Further, the digital mix to DC is perfectly=
 balanced (per your equation) so no images will be introduced there either.

<lito844@gmail.com> wrote:

>Like Eric I question whether IQ imbalance is your problem. I suspect >the image shown in your spectrum is due to IQ imbalance but because it >is far out of the desired signal band the imbalance is not your problem.
>Your receiver (at least the analog portions thereof) is not direct >conversion and images due to quadrature imbalance only become an issue >with direct conversion or near zero-IF receivers because in that case >the IF is in the range of the signal bandwidth.
I'm not sure I agree. A superhet receiver that ultimatley converts to baseband will face I/Q imbalance issues in its final mixer. Whereas, a low-IF receiver that never converts to baseband before digitizing will not face I/Q imbalance issues. The only architectures that do not exhibit I/Q imbalance are direct digitization of RF, and low-IF with direct digitization from IF. Steve
On Friday, July 15, 2016 at 5:43:24 PM UTC-4, Steve Pope wrote:
> <lito844@gmail.com> wrote: >=20 > >Like Eric I question whether IQ imbalance is your problem. I suspect > >the image shown in your spectrum is due to IQ imbalance but because it > >is far out of the desired signal band the imbalance is not your problem. >=20 > >Your receiver (at least the analog portions thereof) is not direct > >conversion and images due to quadrature imbalance only become an issue > >with direct conversion or near zero-IF receivers because in that case > >the IF is in the range of the signal bandwidth. =20 >=20 > I'm not sure I agree. >=20 > A superhet receiver that ultimatley converts to baseband will > face I/Q imbalance issues in its final mixer. Whereas, a low-IF > receiver that never converts to baseband before digitizing=20 > will not face I/Q imbalance issues. =20 >=20 > The only architectures that do not exhibit I/Q imbalance are > direct digitization of RF, and low-IF with direct digitization > from IF. >=20 > Steve
I guess what I'm trying to say is the performance of any receiver (hetrodyn= e or homodyne alike) can be degraded by inband interference due to IQ imbal= ance if the final analog mix has an IF less than the signal bandwidth. If = the IF is much higher than the signal bandwidth the images due to IQ imbala= nce do not overlap the signal and therefore can be removed by filtering. I= claim that in these cases, where no inband interference is generated, the = imbalance itself is not an issue.
<lito844@gmail.com> wrote:

>On Friday, July 15, 2016 at 5:43:24 PM UTC-4, Steve Pope wrote:
>> A superhet receiver that ultimatley converts to baseband will >> face I/Q imbalance issues in its final mixer. Whereas, a low-IF >> receiver that never converts to baseband before digitizing >> will not face I/Q imbalance issues.
>> The only architectures that do not exhibit I/Q imbalance are >> direct digitization of RF, and low-IF with direct digitization >> from IF.
>I guess what I'm trying to say is the performance of any receiver >(hetrodyne or homodyne alike) can be degraded by inband interference due >to IQ imbalance if the final analog mix has an IF less than the signal >bandwidth. If the IF is much higher than the signal bandwidth the >images due to IQ imbalance do not overlap the signal and therefore can >be removed by filtering. I claim that in these cases, where no inband >interference is generated, the imbalance itself is not an issue.
This makes sense, althogh I am not sure of the utility of it. So an example of what you are saying is: the RF center frequency is 1 MHz, the bandwidth is 20 KHz such that one might have a transmitted tone at 1.01 MHz. If you then have a quadrature mixer at 100 KHz, you would have the (now complex) signal of interest at 110 KHz, and if there IQ imbalance a stray signal at 90 KHz which could be filtered out. After filtering this signal could then be digitized (both I and Q channels) and one could translate to baseband in the digial domain resulting in a clean signal. But I'm not sure of the advantage of this compared to a conventional low-IF architecture -- in the latter, the mixer is simpler and the A/D requirement is similar. Steve
On Saturday, July 16, 2016 at 2:44:11 PM UTC-4, Steve Pope wrote:
> <lito844@gmail.com> wrote: >=20 > >On Friday, July 15, 2016 at 5:43:24 PM UTC-4, Steve Pope wrote: >=20 > >> A superhet receiver that ultimatley converts to baseband will > >> face I/Q imbalance issues in its final mixer. Whereas, a low-IF > >> receiver that never converts to baseband before digitizing=20 > >> will not face I/Q imbalance issues. =20 >=20 > >> The only architectures that do not exhibit I/Q imbalance are > >> direct digitization of RF, and low-IF with direct digitization > >> from IF. >=20 > >I guess what I'm trying to say is the performance of any receiver > >(hetrodyne or homodyne alike) can be degraded by inband interference due > >to IQ imbalance if the final analog mix has an IF less than the signal > >bandwidth. If the IF is much higher than the signal bandwidth the > >images due to IQ imbalance do not overlap the signal and therefore can > >be removed by filtering. I claim that in these cases, where no inband > >interference is generated, the imbalance itself is not an issue. >=20 > This makes sense, althogh I am not sure of the utility of it. >=20 > So an example of what you are saying is: the RF center frequency is 1 MHz=
,=20
> the bandwidth is 20 KHz such that one might have a transmitted tone=20 > at 1.01 MHz. =20 >=20 > If you then have a quadrature mixer at 100 KHz, you would have > the (now complex) signal of interest at 110 KHz, and if there > IQ imbalance a stray signal at 90 KHz which could be filtered out. > After filtering this signal could then be digitized (both I and > Q channels) and one could translate to baseband in the digial domain=20 > resulting in a clean signal. >=20 > But I'm not sure of the advantage of this compared to a conventional > low-IF architecture -- in the latter, the mixer is simpler and > the A/D requirement is similar. >=20 > Steve
I think the single most important thing to understand about the effect of I= Q gain and phase imbalance is the spectral image it generates. Specificall= y the image is a spectrally flipped and attenuated copy of the signal which= would have been produced by a perfectly balanced system. Regarding advantages, cost is driving the outrageous growth in the direct c= onversion receiver market these days. Single chip do-it-all receivers are = now available at a fraction of the cost of their super-het counterparts. F= urther, due to their lower power consumption and smaller size, direct conve= rsion is often the best fit for low SWaP systems. But there's performance = trade-offs too. Dynamic range, DC offset, and IQ imbalance are a few that = immediately come to mind. DC and IQ are correctable by factory or online ca= librations. In your example IQ imbalance is not a problem because the IF (100 kHz) is l= arger than the signal bandwidth (20 kHz). However in a zero-IF receiver th= ere would be a problem. I'll try to illustrate using your example. First, your scenario. You started with an RF center frequency of 1 MHz, a = 20kHz passband, a tone at 1.01 MHz and a quadrature mixer at 100 kHz which = I interpret as the IF so that its LO would be at flo=3D1.1 MHz for high sid= e injection.=20 So we have: frf =3D 1 MHz frftone =3D 1.01 MHz fif =3D 100 kHz BW =3D 20 kHz flo =3D 1.1 MHz If the mixer were perfectly balanced the output would be tones at: 90 kHz (flo-ftone) 2.11 MHz (flo+ftone) But with IQ imbalance you get additional images at: -90 kHz (-1)*(flo-ftone) -2.11 MHz (-1)*(flo+ftone) Presumbably you'd digitize the result and digitally mix by -80 kHz to baseb= and which moves the signals and images to: 10 kHz (mixing product) 2.03 MHz (mixing product) -170 kHz (IQ imbalance image) 2.19 MHz (IQ imbalance image) Since the signal bandwidth (passband) is less than fif the unwanted images = are easily filtered. At baseband it is straightforward to remove all but t= he 10 kHz tone. Next consider a zero-IF (or a direct conversion) receiver. Now flo =3D frf =3D 1 MHz and we mix to DC. If the mixer were perfectly balanced the output would be tones at: 10 kHz (flo-ftone) 2.01 MHz (flo+ftone) But with IQ imbalance you get additional images at: -10 kHz (-1)*(flo-ftone) -2.01 MHz (-1)*(flo+ftone) Notice that the first IQ image (-10 kHz) is inside the 20 kHz passband. Th= is is a problem which if uncorrected could lead to an irreducible BER floor= in a digital system or audible artifacts in an FM system. Mathematically if a signal x(t) is input to a quadrature mixer with gain im= balance alpha and phase imbalance phi then the output is: xunbal =3D {[ x*(1+alpha*exp(-j*phi)) * (exp(j*(wlo+w)) + exp(j*(wlo-w)))] + [ conj(x)*(1-alpha*exp(-j*phi)) * (exp(-j*(wlo+w)) + exp(-j*(wlo-w)))]} The first term of the sum (the (1+alpha) term) is the desired signal, the s= econd is the image (the (1-alpha) term). So if alpha and phi are 0 the system is balanced and the image is cancelled= . x =3D I(t) + j*Q(t) alpha =3D amplitude_of_Q / amplitude_of_I =3D Gain Imbalance phi =3D phase offset from pi/2 of the mixer on Q branch =3D Phase imbalance conj(x) is the complex conjugate of x w =3D 2*pi*f
<lito844@gmail.com> wrote:

>First, your scenario. You started with an RF center frequency of 1 MHz, >a 20kHz passband, a tone at 1.01 MHz and a quadrature mixer at 100 kHz >which I interpret as the IF so that its LO would be at flo=1.1 MHz for >high side injection. > >So we have: >frf = 1 MHz >frftone = 1.01 MHz >fif = 100 kHz >BW = 20 kHz >flo = 1.1 MHz > >If the mixer were perfectly balanced the output would be tones at: >90 kHz (flo-ftone) >2.11 MHz (flo+ftone) > >But with IQ imbalance you get additional images at: >-90 kHz (-1)*(flo-ftone) >-2.11 MHz (-1)*(flo+ftone) > >Presumbably you'd digitize the result and digitally mix by -80 kHz to >baseband which moves the signals and images to: >10 kHz (mixing product) >2.03 MHz (mixing product) >-170 kHz (IQ imbalance image) >2.19 MHz (IQ imbalance image) > >Since the signal bandwidth (passband) is less than fif the unwanted >images are easily filtered. At baseband it is straightforward to remove >all but the 10 kHz tone. > >Next consider a zero-IF (or a direct conversion) receiver. >Now flo = frf = 1 MHz and we mix to DC. > >If the mixer were perfectly balanced the output would be tones at: >10 kHz (flo-ftone) >2.01 MHz (flo+ftone) > >But with IQ imbalance you get additional images at: >-10 kHz (-1)*(flo-ftone) >-2.01 MHz (-1)*(flo+ftone) > >Notice that the first IQ image (-10 kHz) is inside the 20 kHz passband. >This is a problem which if uncorrected could lead to an irreducible BER >floor in a digital system or audible artifacts in an FM system.
Yes, but my thought was you need to compare it to the conventional low-IF scenario: Mix (non-quadrature) with a 980 KHz local oscillator; low pass filter to remove the component at 1.98 MHz; then digitize (with a single ADC) to obtain the signal from 10 KHz - 30 KHz (again, non-complex) which can be quadrature-mixed to baseband in the digital domain. Steve
On Saturday, July 16, 2016 at 5:59:07 PM UTC-4, Steve Pope wrote:
> <lito844@gmail.com> wrote: > > >First, your scenario. You started with an RF center frequency of 1 MHz, > >a 20kHz passband, a tone at 1.01 MHz and a quadrature mixer at 100 kHz > >which I interpret as the IF so that its LO would be at flo=1.1 MHz for > >high side injection. > > > >So we have: > >frf = 1 MHz > >frftone = 1.01 MHz > >fif = 100 kHz > >BW = 20 kHz > >flo = 1.1 MHz > > > >If the mixer were perfectly balanced the output would be tones at: > >90 kHz (flo-ftone) > >2.11 MHz (flo+ftone) > > > >But with IQ imbalance you get additional images at: > >-90 kHz (-1)*(flo-ftone) > >-2.11 MHz (-1)*(flo+ftone) > > > >Presumbably you'd digitize the result and digitally mix by -80 kHz to > >baseband which moves the signals and images to: > >10 kHz (mixing product) > >2.03 MHz (mixing product) > >-170 kHz (IQ imbalance image) > >2.19 MHz (IQ imbalance image) > > > >Since the signal bandwidth (passband) is less than fif the unwanted > >images are easily filtered. At baseband it is straightforward to remove > >all but the 10 kHz tone. > > > >Next consider a zero-IF (or a direct conversion) receiver. > >Now flo = frf = 1 MHz and we mix to DC. > > > >If the mixer were perfectly balanced the output would be tones at: > >10 kHz (flo-ftone) > >2.01 MHz (flo+ftone) > > > >But with IQ imbalance you get additional images at: > >-10 kHz (-1)*(flo-ftone) > >-2.01 MHz (-1)*(flo+ftone) > > > >Notice that the first IQ image (-10 kHz) is inside the 20 kHz passband. > >This is a problem which if uncorrected could lead to an irreducible BER > >floor in a digital system or audible artifacts in an FM system. > > Yes, but my thought was you need to compare it to the conventional > low-IF scenario: Mix (non-quadrature) with a 980 KHz local oscillator; > low pass filter to remove the component at 1.98 MHz; then > digitize (with a single ADC) to obtain the signal from 10 KHz - 30 KHz > (again, non-complex) which can be quadrature-mixed to baseband > in the digital domain. > > Steve
The receiver architecture you're describing indeed does not suffer from IQ imbalance issues. For me as a baseband physical layer modem guy that type of architecture is utopia. Unfortunately the bean counters think it's too costly for high volume applications like consumer electronics. And they're right. Also, the "pack as many receivers as you can in the smallest space possible" systems guys also shy away from that architecture. But for pure performance I prefer multiple conversion heterodyne architectures over direct conversion every time. Many fewer headaches for us DSP guys.
<lito844@gmail.com> wrote:

>On Saturday, July 16, 2016 at 5:59:07 PM UTC-4, Steve Pope wrote:
>> <lito844@gmail.com> wrote: >> >> >First, your scenario. You started with an RF center frequency of 1 MHz, >> >a 20kHz passband, a tone at 1.01 MHz and a quadrature mixer at 100 kHz >> >which I interpret as the IF so that its LO would be at flo=1.1 MHz for >> >high side injection. >> > >> >So we have: >> >frf = 1 MHz >> >frftone = 1.01 MHz >> >fif = 100 kHz >> >BW = 20 kHz >> >flo = 1.1 MHz >> > >> >If the mixer were perfectly balanced the output would be tones at: >> >90 kHz (flo-ftone) >> >2.11 MHz (flo+ftone) >> > >> >But with IQ imbalance you get additional images at: >> >-90 kHz (-1)*(flo-ftone) >> >-2.11 MHz (-1)*(flo+ftone) >> > >> >Presumbably you'd digitize the result and digitally mix by -80 kHz to >> >baseband which moves the signals and images to: >> >10 kHz (mixing product) >> >2.03 MHz (mixing product) >> >-170 kHz (IQ imbalance image) >> >2.19 MHz (IQ imbalance image) >> > >> >Since the signal bandwidth (passband) is less than fif the unwanted >> >images are easily filtered. At baseband it is straightforward to remove >> >all but the 10 kHz tone. >> > >> >Next consider a zero-IF (or a direct conversion) receiver. >> >Now flo = frf = 1 MHz and we mix to DC. >> > >> >If the mixer were perfectly balanced the output would be tones at: >> >10 kHz (flo-ftone) >> >2.01 MHz (flo+ftone) >> > >> >But with IQ imbalance you get additional images at: >> >-10 kHz (-1)*(flo-ftone) >> >-2.01 MHz (-1)*(flo+ftone) >> > >> >Notice that the first IQ image (-10 kHz) is inside the 20 kHz passband. >> >This is a problem which if uncorrected could lead to an irreducible BER >> >floor in a digital system or audible artifacts in an FM system. >> >> Yes, but my thought was you need to compare it to the conventional >> low-IF scenario: Mix (non-quadrature) with a 980 KHz local oscillator; >> low pass filter to remove the component at 1.98 MHz; then >> digitize (with a single ADC) to obtain the signal from 10 KHz - 30 KHz >> (again, non-complex) which can be quadrature-mixed to baseband >> in the digital domain. >> >> Steve > >The receiver architecture you're describing indeed does not suffer from >IQ imbalance issues. For me as a baseband physical layer modem guy that >type of architecture is utopia. Unfortunately the bean counters think >it's too costly for high volume applications like consumer electronics. >And they're right. Also, the "pack as many receivers as you can in the >smallest space possible" systems guys also shy away from that >architecture. But for pure performance I prefer multiple conversion >heterodyne architectures over direct conversion every time. Many fewer >headaches for us DSP guys.
I agree a superhet is usually the best choice. That does not preclude the final analog mixer being low-IF (as I describe) as opposed to your "quadrature low-IF" approach, and I do not see a clear difference in cost. Nor does it preclude using an SSB mixer to lessen filtering requirements, ahead of the final analog mixer. Steve
On Saturday, July 16, 2016 at 6:27:23 PM UTC-4, Steve Pope wrote:
> <lito844@gmail.com> wrote: >=20 > >On Saturday, July 16, 2016 at 5:59:07 PM UTC-4, Steve Pope wrote: >=20 > >> <lito844@gmail.com> wrote: > >>=20 > >> >First, your scenario. You started with an RF center frequency of 1 M=
Hz,
> >> >a 20kHz passband, a tone at 1.01 MHz and a quadrature mixer at 100 kH=
z
> >> >which I interpret as the IF so that its LO would be at flo=3D1.1 MHz =
for
> >> >high side injection.=20 > >> > > >> >So we have: > >> >frf =3D 1 MHz > >> >frftone =3D 1.01 MHz > >> >fif =3D 100 kHz > >> >BW =3D 20 kHz > >> >flo =3D 1.1 MHz > >> > > >> >If the mixer were perfectly balanced the output would be tones at: > >> >90 kHz (flo-ftone) > >> >2.11 MHz (flo+ftone) > >> > > >> >But with IQ imbalance you get additional images at: > >> >-90 kHz (-1)*(flo-ftone) > >> >-2.11 MHz (-1)*(flo+ftone) > >> > > >> >Presumbably you'd digitize the result and digitally mix by -80 kHz to > >> >baseband which moves the signals and images to: > >> >10 kHz (mixing product) > >> >2.03 MHz (mixing product) > >> >-170 kHz (IQ imbalance image) > >> >2.19 MHz (IQ imbalance image) > >> > > >> >Since the signal bandwidth (passband) is less than fif the unwanted > >> >images are easily filtered. At baseband it is straightforward to rem=
ove
> >> >all but the 10 kHz tone. > >> > > >> >Next consider a zero-IF (or a direct conversion) receiver. > >> >Now flo =3D frf =3D 1 MHz and we mix to DC. > >> > > >> >If the mixer were perfectly balanced the output would be tones at: > >> >10 kHz (flo-ftone) > >> >2.01 MHz (flo+ftone) > >> > > >> >But with IQ imbalance you get additional images at: > >> >-10 kHz (-1)*(flo-ftone) > >> >-2.01 MHz (-1)*(flo+ftone) > >> > > >> >Notice that the first IQ image (-10 kHz) is inside the 20 kHz passban=
d.=20
> >> >This is a problem which if uncorrected could lead to an irreducible B=
ER
> >> >floor in a digital system or audible artifacts in an FM system. > >>=20 > >> Yes, but my thought was you need to compare it to the conventional > >> low-IF scenario: Mix (non-quadrature) with a 980 KHz local oscillator;=
=20
> >> low pass filter to remove the component at 1.98 MHz; then > >> digitize (with a single ADC) to obtain the signal from 10 KHz - 30 KHz > >> (again, non-complex) which can be quadrature-mixed to baseband > >> in the digital domain. > >>=20 > >> Steve > > > >The receiver architecture you're describing indeed does not suffer from > >IQ imbalance issues. For me as a baseband physical layer modem guy that > >type of architecture is utopia. Unfortunately the bean counters think > >it's too costly for high volume applications like consumer electronics.=
=20
> >And they're right. Also, the "pack as many receivers as you can in the > >smallest space possible" systems guys also shy away from that > >architecture. But for pure performance I prefer multiple conversion > >heterodyne architectures over direct conversion every time. Many fewer > >headaches for us DSP guys. >=20 > I agree a superhet is usually the best choice. That does not > preclude the final analog mixer being low-IF (as I describe) as > opposed to your "quadrature low-IF" approach, and I do not see > a clear difference in cost. >=20 > Nor does it preclude using an SSB mixer to lessen filtering=20 > requirements, ahead of the final analog mixer. >=20 > Steve
To recap: IQ imbalance is an issue for some architectures: Quadrature analog mix to baseband Quadrature analog mix to near zero-IF Direct conversion to digital I/Q It is not an issue for other architectures: Single ended analog IF output=20 Same as above but digitzed then quad mixed to low-IF or baseband On that I think we agree. Question: Why are IQ imbalance issues being discussed these days? Answer: Mostly because of the proliferation of low-cost, low SWaP direct co= nversion receivers. They're literally everywhere. I'm all ears if you can point me to a low cost do-it-all receiver using one= of the architectures you cited which is immune to IQ imbalance. Honestly = I'd love to stick it in our bean counters face and tell them what they can = do with their direct-conversion. Do you know of any?
<lito844@gmail.com> wrote:

>To recap: > >IQ imbalance is an issue for some architectures: > Quadrature analog mix to baseband > Quadrature analog mix to near zero-IF > Direct conversion to digital I/Q > >It is not an issue for other architectures: > Single ended analog IF output > Same as above but digitzed then quad mixed to low-IF or baseband
>On that I think we agree.
>Question: Why are IQ imbalance issues being discussed these days? >Answer: Mostly because of the proliferation of low-cost, low SWaP direct >conversion receivers. They're literally everywhere.
>I'm all ears if you can point me to a low cost do-it-all receiver using >one of the architectures you cited which is immune to IQ imbalance. >Honestly I'd love to stick it in our bean counters face and tell them >what they can do with their direct-conversion. Do you know of any?
No, what you ask is impossible. If lowest cost means only one mixer, then you are confined to either direct conversion or low-IF, each with major performance disadvantages relative to any reasonable superhet. This is compounded by the fact that standards often underspecify receiver selectivity, so lower-performance designs tend to win. S.