Skip to content

I/Q and complex baseband

One carrier can carry two messages, on its cosine and its sine. Two mixers separate them, and a carrier offset spins the constellation.

Before this18.2 · 27.1 · 27.2 · 3 more
Chapter 27 · Lesson 3 of 5

First, the picture

One carrier can carry two messages, one on its cosine and one on its sine. Watch the two mixers below take them apart: each filtered line settles on its own dashed message, and the other drops out.

Two mixers, a quarter turn apart

x_I = 0.8 sin(2πn/400) and x_Q = 0.6 cos(2πn/160) on a carrier of 0.1 cycles/sample; 800 samples.

The received signal: two messages on one 0.1-cycle carrier, indistinguishable by eye.

largest error I
—
largest error Q
—
0.00 / 12.00 s
Describe this picture

xI=0.8sin⁡(2πn/400)x_\text{I}=0.8\sin(2\pi n/400) and xQ=0.6cos⁡(2πn/160)x_\text{Q}=0.6\cos(2\pi n/160) on a carrier of 0.1 cycles/sample, 800 samples. Three stacked panels share the axis nn, from 0 to 799. The first shows the received x[n]x[n] as a thin solid line, from −1.1 to 1.1. The other two, the I branch and the Q branch, run from −1.7 to 1.7. Each holds the mixer’s output as a faint thin line, the filter’s output as a solid line, and the sent message dashed, shifted by the filter’s 9-sample delay. The readouts are the largest error in I and in Q, to three decimals, measured after the filter. There is no control. The 12 s clip opens on the received signal alone: two messages on one carrier, indistinguishable by eye. From 3 s the two mixer outputs draw in: multiplied by 2 cos and by −2 sin, each branch holds its message plus ripple at twice the carrier. From 7 s the filtered outputs and the sent messages draw over them. At the end each branch returns its own message, I within 0.003 and Q within 0.009, and the readouts show 0.002 and 0.008.

One carrier, two messages

In Amplitude modulation (27.1), one message rode on a cosine carrier. “Mix it down, filter it out” got it back: multiply by the carrier again, then keep only the slow part with a low-pass filter.

A cosine carrier leaves room for a second message. The sine at the same frequency runs a quarter turn behind the cosine, as you saw in “A point that keeps spinning” of Complex exponentials & phasors (3.4). Put one message on the cosine and another on the sine, and add:

x[n]=xI[n]cos⁡Ω1n−xQ[n]sin⁡Ω1n.x[n]=x_\text{I}[n]\cos\Omega_1n-x_\text{Q}[n]\sin\Omega_1n.

Here Ω1\Omega_1 is the carrier’s frequency in rad/sample, as in 27.1. The message on the cosine, xI[n]x_\text{I}[n], is the in-phase part. The message on the sine, xQ[n]x_\text{Q}[n], is the quadrature part: “quadrature” is an old word for a quarter-turn offset. Together they are called I/Q.

The minus sign is a convention; it makes the complex form later on this page come out neatly.

A signal like x[n]x[n] lives in a band around the carrier, so it is called a passband signal. Think of two conversations on one telephone line, one whispered in each ear. Both are on the line at once, and each listener hears only their own.

The example on this page

I use two slow messages, xI[n]=0.8sin⁡(2πn/400)x_\text{I}[n]=0.8\sin(2\pi n/400) and xQ[n]=0.6cos⁡(2πn/160)x_\text{Q}[n]=0.6\cos(2\pi n/160). The carrier makes 0.1 cycles per sample, so Ω1=2π⋅0.1=0.2π\Omega_1=2\pi\cdot0.1=0.2\pi rad/sample. One carrier cycle takes 10 samples, while the messages take 400 and 160.

The sum swings between −0.975 and 0.975 over the 800 samples I draw. By eye you cannot tell the two messages apart in it.

Mixing with the cosine

To get xIx_\text{I} back, multiply by 2cos⁡Ω1n2\cos\Omega_1n. Two rules from trigonometry do the work, 2cos⁡2θ=1+cos⁡2θ2\cos^2\theta=1+\cos2\theta and 2sin⁡θcos⁡θ=sin⁡2θ2\sin\theta\cos\theta=\sin2\theta:

2x[n]cos⁡Ω1n=xI[n]+xI[n]cos⁡2Ω1n−xQ[n]sin⁡2Ω1n.\begin{aligned} 2x[n]\cos\Omega_1n&=x_\text{I}[n]\\ &\quad+x_\text{I}[n]\cos2\Omega_1n\\ &\quad-x_\text{Q}[n]\sin2\Omega_1n. \end{aligned}

The first term is the in-phase message itself. The other two ripple at twice the carrier, 0.2 cycles per sample, and a low-pass filter removes them. That is 27.1’s coherent demodulation, unchanged.

Mixing with the sine

For xQx_\text{Q}, multiply by −2sin⁡Ω1n-2\sin\Omega_1n instead. With 2sin⁡2θ=1−cos⁡2θ2\sin^2\theta=1-\cos2\theta:

−2x[n]sin⁡Ω1n=xQ[n]−xQ[n]cos⁡2Ω1n−xI[n]sin⁡2Ω1n.\begin{aligned} -2x[n]\sin\Omega_1n&=x_\text{Q}[n]\\ &\quad-x_\text{Q}[n]\cos2\Omega_1n\\ &\quad-x_\text{I}[n]\sin2\Omega_1n. \end{aligned}

Again the message comes out on its own, plus ripple at twice the carrier. Why does the other message drop out? Because cosine and sine are a quarter turn apart, their product cos⁡θsin⁡θ\cos\theta\sin\theta averages to 0. Over one carrier cycle of 10 samples, cos⁡2\cos^2 and sin⁡2\sin^2 each add up to 5, but cos⁡⋅sin⁡\cos\cdot\sin adds up to 0.

The low-pass filter

For the filter I use the moving average of “A longer average: less noise, more delay” in Simple smoothing filters (18.2), twice in a row. Each one averages 10 samples. A wave at 0.2 cycles per sample makes exactly two cycles in 10 samples, so the average of its ripple is exactly 0.

Two averages in a row make one filter with 19 taps. They rise 0.01, 0.02 and so on up to 0.10 at the centre, then fall again: a triangle, adding up to 1.

18.2 showed that a 10-sample average reports each change 4.5 samples late. Two of them make a delay of 9 samples, a whole number, so I can lay the output over the message sent 9 samples earlier. The slow messages pass almost unchanged: the filter’s gain is 0.9980 at the in-phase message’s frequency and 0.9873 at the quadrature one’s.

Two mixers, a quarter turn apart

The picture at the top of the page runs this receiver on the example: the cosine mixer, the sine mixer and the 19-tap filter on each branch.

Notice the end of the clip: the recovered I is within 0.003 of the sent one, and Q within 0.009. The filtered lines sit on the dashed ones. I measure from sample 18 on, once the 19-tap filter has filled up.

Most of the remaining error is the filter’s own gain, not leftover ripple. The gain 0.9980 shrinks the in-phase message’s peak of 0.8 by 0.0016; the gain 0.9873 shrinks the quadrature peak of 0.6 by 0.0076.

What if the Q branch used the cosine as well? Then both branches return xIx_\text{I}, and the Q branch misses its own message by up to 1.367. The quarter turn between the two mixers is what tells the messages apart.

One complex number: complex baseband

I and Q always travel as a pair, and a pair of numbers is one complex number, as in Complex numbers for signals (3.3). So let’s join them:

xbb[n]=xI[n]+jxQ[n].x_\text{bb}[n]=x_\text{I}[n]+jx_\text{Q}[n].

This is the complex baseband signal. “Baseband” means it sits around 0 Hz, not around the carrier.

Now multiply it by the spinning point ejΩ1n=cos⁡Ω1n+jsin⁡Ω1ne^{j\Omega_1n}=\cos\Omega_1n+j\sin\Omega_1n of 3.4. The real part of the product is xIcos⁡Ω1n−xQsin⁡Ω1nx_\text{I}\cos\Omega_1n-x_\text{Q}\sin\Omega_1n, which is our passband signal:

x[n]=Re{xbb[n]ejΩ1n}.x[n]=\mathrm{Re}\{x_\text{bb}[n]e^{j\Omega_1n}\}.

Here is the picture. “Multiplying two complex numbers: rotate and scale” in 3.3 says that the product turns and stretches. So xbb[n]x_\text{bb}[n] sets the length and the starting angle of an arrow, and ejΩ1ne^{j\Omega_1n} spins it at the carrier. The passband signal is the arrow’s shadow on the real axis.

The two mixers are one multiplication

Look at the two mixers together. The cosine mixer and the sine mixer are the real and imaginary parts of one complex multiplication:

2x[n]e−jΩ1n=2x[n]cos⁡Ω1n−j 2x[n]sin⁡Ω1n.\begin{aligned} 2x[n]e^{-j\Omega_1n}&=2x[n]\cos\Omega_1n\\ &\quad-j\,2x[n]\sin\Omega_1n. \end{aligned}

“Slide the spectrum round the circle” in Properties of the DTFT (12.3) says what multiplying by e−jΩ1ne^{-j\Omega_1n} does: it slides the whole spectrum down by Ω1\Omega_1.

Our x[n]x[n] is real, so its spectrum has two mirror halves, one around +Ω1+\Omega_1 and one around −Ω1-\Omega_1. Slide down by Ω1\Omega_1, and the positive half lands at 0, while the negative half lands at −2Ω1-2\Omega_1. Written out, with the conjugate ∗^* of 3.3:

2x[n]e−jΩ1n=xbb[n]+xbb∗[n] e−j2Ω1n.\begin{aligned} 2x[n]e^{-j\Omega_1n}&=x_\text{bb}[n]\\ &\quad+x_\text{bb}^*[n]\,e^{-j2\Omega_1n}. \end{aligned}

The low-pass keeps the half at 0 and removes the one at twice the carrier. What is left is xbb[n]x_\text{bb}[n]: the I branch is its real part and the Q branch its imaginary part.

Compare this with “Add a quarter turn, lose the negative half” in The Hilbert transform and the analytic signal (27.2). The analytic signal kept the positive half where it was. Complex baseband keeps the same half and moves it down to 0.

So xan[n]=xbb[n]ejΩ1nx_\text{an}[n]=x_\text{bb}[n]e^{j\Omega_1n}, as long as the band around the carrier stays clear of 0 and of π\pi. For our example the two sides agree to within 10−1310^{-13}.

Everything about x[n]x[n] is in xbb[n]x_\text{bb}[n], and xbb[n]x_\text{bb}[n] changes slowly. Here its messages take 400 and 160 samples per cycle, against the carrier’s 10. So a receiver can keep xbbx_\text{bb} at a much lower sample rate than the carrier would need.

Symbols as points

Digital radios send bits, not slow sine waves. Since each moment of xbbx_\text{bb} is a point in the complex plane, a radio can send a point. A symbol is one point held for a fixed time, the symbol time. I write AmA_m for the symbol sent at symbol time mm.

The simplest choice with two bits per symbol is QPSK, for “quadrature phase-shift keying”. The first bit sets the sign of the real part, the second the sign of the imaginary part:

Am=±1±j2.A_m=\frac{\pm1\pm j}{\sqrt2}.

The four points sit on the unit circle at the angles π/4\pi/4, 3π/43\pi/4, −3π/4-3\pi/4 and −π/4-\pi/4. A plot of a radio’s possible points is its constellation. The receiver reads a symbol by its quarter of the plane: the sign of its real part gives the first bit, and the sign of its imaginary part the second.

On this page a symbol lasts L=8L=8 samples, at a sample rate fsf_s of 1 MHz, so 125 000 symbols arrive every second. How a symbol’s 8 samples are shaped is the subject of 27.5. Here I look at one complex number per symbol.

Noise and the clusters

The received symbols carry noise. I add it at a signal-to-noise ratio of 20 dB, as in “Signal and noise, in decibels” of How big is a signal (1.3). The symbols have power 1, so the noise has power 0.01, an RMS size of 0.1, split equally between the real and imaginary parts.

That is the nominal level. Measured on this page’s draws, the noise’s RMS size is 0.0961 and the ratio 20.3 dB. Each sent point gets its own small cloud of received points around it.

A receiver that is a little off

The receiver mixes with its own oscillator, the local oscillator of 27.1. Suppose it runs Δf\Delta f hertz below the carrier, so it multiplies by e−j(Ω1−ΔΩ)ne^{-j(\Omega_1-\Delta\Omega)n} with ΔΩ=2πΔf/fs\Delta\Omega=2\pi\Delta f/f_s. Then the slide of 12.3 stops ΔΩ\Delta\Omega short of 0, and the receiver gets xbb[n]ejΔΩnx_\text{bb}[n]e^{j\Delta\Omega n} instead of xbb[n]x_\text{bb}[n].

That extra factor is 3.4’s spinning point. It turns the whole constellation, Δf\Delta f times a second. A positive Δf\Delta f turns it anticlockwise, a negative one clockwise.

Symbol mm arrives at sample mLmL, so it is turned by

2πΔf mLfs2\pi\Delta f\,\frac{mL}{f_s}

radians. Each symbol is turned 2πΔf L/fs2\pi\Delta f\,L/f_s more than the one before.

A carrier offset spins the constellation

A carrier offset spins the constellation

256 QPSK symbols (bits from seed 273), noise at 20 dB SNR (seed 2730; measured 20.3 dB); 8 samples per symbol at 1 MHz.

No offset: four tight clusters, one per symbol value; the spread is the noise.

offset
0 Hz
turn per symbol
0.000°
turn, first to last
0.0°
error vector
9.6 %
0.00 / 13.00 s
Describe this picture

256 QPSK symbols (bits from seed 273), with noise at 20 dB SNR (seed 2730; measured 20.3 dB), 8 samples per symbol at 1 MHz. One square panel, I against Q, both from −1.4 to 1.4. The received symbols are small filled dots and the four sent points open rings. The readouts are the offset in hertz, the turn per symbol and the turn from first to last in degrees, and the error vector. That is the arrow from each sent point to its received point, as an RMS size over all 256 symbols, in percent of the symbols’ size 1. The 13 s clip opens with no offset: four tight clusters, one per symbol value, whose spread is the noise; the readouts show 0 Hz, 0.000°, 0.0° and 9.6 %. From 3.5 s the offset moves to 100 Hz and each dot slides to its turned place: each symbol turns 0.288° more than the last, 73.4° in all, the error vector is 72.1 %, and the clusters stretch into arcs. From 8 s it moves on to 1000 Hz: 2.880° per symbol, 734.4° in all, 139.7 %, and the four points smear into a ring whose symbols cannot be read. When the clip ends, a slider “Carrier offset” runs from −2000 to 2000 Hz in steps of 10 Hz, starting at 1000 Hz (arrow keys 10 Hz, Page Up and Page Down 100 Hz). The caption then gives the turn per symbol and from first to last. At 500 Hz they are 1.440° and 367.2°.

Watch the four clusters as the offset grows: at 100 Hz they stretch into arcs, and at 1000 Hz they smear into a ring.

Notice the 100 Hz frame. The turn per symbol is only 0.288°, yet over the 255 steps from the first symbol to the last it adds up to 73.4°. In radians that is 0.00503 per symbol and 1.28 in all.

When the arcs cross a boundary

A sent point sits an angle π/4\pi/4, or 45°, away from each axis that borders its quarter. At 100 Hz the turn passes 45° at symbol 157, so from there on even a noiseless point lands in the next quarter.

On this record, 99 of the 256 symbols are read in the wrong quarter at 100 Hz: 94 from symbol 157 on, and 5 earlier ones that the noise pushed over. At 1000 Hz it is 189, and at 0 Hz none.

The error vector tells the same story. With no offset it is 9.6 %, the noise’s own size. At 1000 Hz the points are spread round the whole ring, and it reads 139.7 %. That is close to 2\sqrt2, 141 %, the value for points spread evenly round the circle.

Undoing the spin

If the receiver knows Δf\Delta f, the cure is one more multiplication. Multiply symbol mm by e−j2πΔf mL/fse^{-j2\pi\Delta f\,mL/f_s}, and it turns back by exactly the amount it was turned. At 1000 Hz the error vector falls back to 9.6 %.

Real receivers do not know Δf\Delta f. They estimate it from the symbols and keep correcting it, often with a phase-locked loop, a feedback loop that steers an oscillator until its phase matches the received one.

The offset shows in the spectrum too. Multiplying by ejΔΩne^{j\Delta\Omega n} is 12.3’s frequency shift, so the whole baseband spectrum slides by Δf\Delta f.

Worked example

1. Turn per symbol. At Δf=100\Delta f=100 Hz, with L=8L=8 and fs=106f_s=10^6 Hz, each symbol turns 360°⋅100⋅8/106=0.288°360°\cdot100\cdot8/10^6=0.288° more than the last. Over 255 steps that is 255⋅0.288°=73.4°255\cdot0.288°=73.4°. At 1000 Hz both are ten times larger: 2.880° and 734.4°, a little over two full turns.

2. Mixing by hand. Write θ=Ω1n\theta=\Omega_1n. Since 2cos⁡2θ=1+cos⁡2θ2\cos^2\theta=1+\cos2\theta, the I mixer turns xIcos⁡θx_\text{I}\cos\theta into xI+xIcos⁡2θx_\text{I}+x_\text{I}\cos2\theta. Since −2sin⁡θcos⁡θ=−sin⁡2θ-2\sin\theta\cos\theta=-\sin2\theta, it turns −xQsin⁡θ-x_\text{Q}\sin\theta into −xQsin⁡2θ-x_\text{Q}\sin2\theta. Only xIx_\text{I} is slow; the low-pass keeps it.

3. One symbol, followed. Take the symbol (1+j)/2(1+j)/\sqrt2, at angle π/4\pi/4 (45°), with no noise and an offset of 100 Hz. Symbol 100 is turned by 100⋅0.288°=28.8°100\cdot0.288°=28.8°, so it lands at 73.8°, at 0.279+0.960j0.279+0.960j. Both parts are still positive: it is read correctly.

Symbol 157 is turned by 45.2°, so it lands at 90.2°, at −0.004+1.000j-0.004+1.000j. Its real part has turned negative, so its first bit is read wrong.

Where you’ll meet this

Wi-Fi, LTE and GPS receivers mix their antenna signal down with a cosine and a sine, and work on I and Q. Wi-Fi and LTE use QPSK as one of their constellations, alongside larger ones that 27.5 builds.

The offsets they face are far larger than this page’s slider. Wi-Fi allows a transmitter’s carrier to be off by 20 parts per million, which at 2.4 GHz is 48 kHz. So a receiver must estimate the offset and undo it before it reads a single symbol.

A software-defined radio takes this furthest. Its hardware only mixes, filters and digitises I and Q; everything after that is code on a computer. Free software such as GNU Radio does the rest: filtering, tracking the offset and reading the symbols.

Next, the phase of xbbx_\text{bb} carries the message itself in Frequency and phase modulation (27.4). More points per symbol, and many carriers at once, come in Digital modulation and OFDM (27.5).

The maths behind it · orthogonal vectors

Over whole carrier periods, the cosine and the sine at the carrier are orthogonal vectors. Mixing and averaging takes the coordinates of xx in that two-vector basis, and a phase offset is a rotation of the basis.

The maths behind it · two-dimensional Gaussian noise

The noise on a constellation point is a two-dimensional Gaussian cloud, like the cloud of “A cloud that leans: correlation” in Random variables for signals (24.1). The error vector’s RMS is its spread. A symbol is misread when its cloud reaches the next quarter.

Reference card

QuantityFormulaNotes
Passband from I and QxIcos⁡Ω1n−xQsin⁡Ω1nx_\text{I}\cos\Omega_1n-x_\text{Q}\sin\Omega_1ntwo messages, one carrier
Complex basebandxbb=xI+jxQx_\text{bb}=x_\text{I}+jx_\text{Q}, x=Re{xbbejΩ1n}x=\mathrm{Re}\{x_\text{bb}e^{j\Omega_1n}\}slow; holds everything
I mixer2xcos⁡Ω1n2x\cos\Omega_1n, then low-passreal part of 2xe−jΩ1n2xe^{-j\Omega_1n}
Q mixer−2xsin⁡Ω1n-2x\sin\Omega_1n, then low-passimaginary part of 2xe−jΩ1n2xe^{-j\Omega_1n}
QPSK symbolAm=(±1±j)/2A_m=(\pm1\pm j)/\sqrt2two bits; read by quarter
Carrier offsetturn 2πΔf L/fs2\pi\Delta f\,L/f_s per symbolconstellation spins Δf\Delta f times a second
Undo the offsetmultiply by e−j2πΔf mL/fse^{-j2\pi\Delta f\,mL/f_s}needs Δf\Delta f; estimated in practice

End of lesson 27.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look