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.
Describe this picture
and on a carrier of 0.1 cycles/sample, 800 samples. Three stacked panels share the axis , from 0 to 799. The first shows the received 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:
Here is the carrier’s frequency in rad/sample, as in 27.1. The message on the cosine, , is the in-phase part. The message on the sine, , 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 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, and . The carrier makes 0.1 cycles per sample, so 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 back, multiply by . Two rules from trigonometry do the work, and :
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 , multiply by instead. With :
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 averages to 0. Over one carrier cycle of 10 samples, and each add up to 5, but 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 , 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:
This is the complex baseband signal. “Baseband” means it sits around 0 Hz, not around the carrier.
Now multiply it by the spinning point of 3.4. The real part of the product is , which is our passband signal:
Here is the picture. “Multiplying two complex numbers: rotate and scale” in 3.3 says that the product turns and stretches. So sets the length and the starting angle of an arrow, and 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:
“Slide the spectrum round the circle” in Properties of the DTFT (12.3) says what multiplying by does: it slides the whole spectrum down by .
Our is real, so its spectrum has two mirror halves, one around and one around . Slide down by , and the positive half lands at 0, while the negative half lands at . Written out, with the conjugate of 3.3:
The low-pass keeps the half at 0 and removes the one at twice the carrier. What is left is : 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 , as long as the band around the carrier stays clear of 0 and of . For our example the two sides agree to within .
Everything about is in , and changes slowly. Here its messages take 400 and 160 samples per cycle, against the carrier’s 10. So a receiver can keep 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 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 for the symbol sent at symbol time .
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:
The four points sit on the unit circle at the angles , , and . 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 samples, at a sample rate 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 hertz below the carrier, so it multiplies by with . Then the slide of 12.3 stops short of 0, and the receiver gets instead of .
That extra factor is 3.4’s spinning point. It turns the whole constellation, times a second. A positive turns it anticlockwise, a negative one clockwise.
Symbol arrives at sample , so it is turned by
radians. Each symbol is turned 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.
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 , 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 , 141 %, the value for points spread evenly round the circle.
Undoing the spin
If the receiver knows , the cure is one more multiplication. Multiply symbol by , 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 . 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 is 12.3’s frequency shift, so the whole baseband spectrum slides by .
Worked example
1. Turn per symbol. At Hz, with and Hz, each symbol turns more than the last. Over 255 steps that is . At 1000 Hz both are ten times larger: 2.880° and 734.4°, a little over two full turns.
2. Mixing by hand. Write . Since , the I mixer turns into . Since , it turns into . Only is slow; the low-pass keeps it.
3. One symbol, followed. Take the symbol , at angle (45°), with no noise and an offset of 100 Hz. Symbol 100 is turned by , so it lands at 73.8°, at . Both parts are still positive: it is read correctly.
Symbol 157 is turned by 45.2°, so it lands at 90.2°, at . 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 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 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
| Quantity | Formula | Notes |
|---|---|---|
| Passband from I and Q | two messages, one carrier | |
| Complex baseband | , | slow; holds everything |
| I mixer | , then low-pass | real part of |
| Q mixer | , then low-pass | imaginary part of |
| QPSK symbol | two bits; read by quarter | |
| Carrier offset | turn per symbol | constellation spins times a second |
| Undo the offset | multiply by | needs ; estimated in practice |