D12 · Lesson 8 · Carrier recovery
Why a receiver's carrier never quite matches the transmitter's, the constellation spinning under a frequency offset, the phase-locked loop with its phase detector, loop filter and oscillator, the Costas detector that ignores the data, loop bandwidth and damping, and the 180° ambiguity
Coherent demodulation needs the receiver's carrier to match the transmitter's in frequency and phase. It never does: two crystals differ by tens of parts per million, which at 2.4 GHz is tens of kilohertz, and the path delay sets an arbitrary phase. Any frequency offset makes the constellation spin. A phase-locked loop measures the leftover rotation of each received symbol and steers its own oscillator to cancel it, the same feedback idea as a thermostat applied to phase.
- The phase error of a second-order PLL after the incoming carrier jumps in frequency by Δf, for a loop of natural frequency and damping ζ.
- The error rises, overshoots and settles back to zero: a loop with an integrator in its filter tracks a frequency offset with no lasting phase error.
- A slow loop (small ) lets a big error build first. Past the dashed line at 90°, a BPSK Costas loop can slip to the wrong lock point and invert every bit.
Predict
A 1200 baud BPSK receiver's carrier is 12 Hz off. How far does the constellation rotate from one symbol to the next?
360° × 12 Hz/1200 symbols per second = 3.6° per symbol. After 25 symbols it has turned 90° and BPSK decisions are coin tosses; after 50 every bit is inverted. Even a tiny offset defeats a fixed phase reference, so the receiver must track continuously.
Name it
The loop
- A phase detector measures the phase error of each received sample against the local oscillator's.
- A loop filter, here proportional plus integral, smooths that error and accumulates it.
- A numerically controlled oscillator (NCO) advances its phase by the filter's output each sample.
In software, for each corrected sample :
The integral path f learns the frequency offset, so in the steady state the phase error is zero.
Dynamics
With the integrator, the loop is second order, with natural frequency and damping ζ. A frequency step Δω gives a phase error
whose peak at ζ = 0.707 is = 0.456 Δf/f_n radians. A wide loop follows offsets and jitter quickly but lets more noise through; a narrow one is quiet but slow. A loop without the integrator (first order, gain K) is left with a steady error of Δω/K.
Costas loops and ambiguity
The data flips BPSK's phase by 180°, which would confuse a plain phase detector. The Costas detector multiplies by the sign of the decision, so both phases give the same error. The price is that the loop can lock at 0° or 180° equally, inverting every bit. Links resolve it with a known preamble or with differential encoding, where the bit is the change in phase. QPSK uses the same idea with a four-way ambiguity.
Worked example
A transmitter and receiver each have 20 ppm crystals. What's the worst carrier offset at 1800 Hz and at 2.4 GHz?
Show the solution
- Total error. The two crystals together can be off by up to 40 ppm.
- At 1800 Hz. harmless in this audio modem.
- At 2.4 GHz. many times a narrow loop's bandwidth.
- How radios cope. Radios estimate and remove most of such an offset from the preamble first, then let the PLL track what's left.
Answer up to 0.072 Hz at 1800 Hz, and up to 96 kHz at 2.4 GHz.
Worked example
A loop with = 10 Hz and ζ = 0.707 meets a 5 Hz frequency step. What's its peak phase error?
Show the solution
- Peak phase error. For ζ = 0.707 it is 0.456 times the step over the natural frequency:
- Compare with the slip point. That's well short of the 90° where a BPSK Costas loop could slip.
- A slower loop. The same step on a 2 Hz loop would peak at 65°.
Answer 0.228 rad, or 13.1°.
Worked example
About how long does the 10 Hz, ζ = 0.707 Costas loop take to lock?
Show the solution
- Decay rate of the transients.
- Settling time.
- In bits. At 1200 baud that's roughly 110 bits.
- What it means for the preamble. The preamble must be at least that long, or the first bits arrive before the loop is ready.
Answer about 90 ms, roughly 110 bits at 1200 baud.
Check
Write a Costas loop that locks onto a spinning BPSK constellation.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A receiver's carrier is 5 Hz off and symbols arrive at 300 per second. How far does the constellation rotate per symbol?
Check
A PLL with natural frequency 10 Hz and damping 0.707 meets a 5 Hz frequency step. What's the peak phase error?
Check
A first-order PLL with loop gain 1000 s⁻¹ tracks a 50 Hz frequency offset. What steady phase error does it settle at?
Check
Each end's crystal is within 20 ppm, at a carrier of 1.8 kHz.
(a)
What is the worst carrier offset?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
(b)
How many 1200 Hz bit rates is that?
Check
A loop with = 10 Hz and ζ = 0.5 meets a 5 Hz frequency step.
(a)
About how long does it take to settle?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
(b)
Roughly what peak phase error does it reach (using 0.456 Δω/ω_n)?
Explain why
Why does a Costas loop for BPSK have a 180° ambiguity, and how do links deal with it?
BPSK sends data by flipping the carrier's phase by 180°, so a received signal at some phase looks exactly like the opposite data at the phase 180° away. The Costas detector is built to ignore the data by multiplying the error by the sign of each decision, which means it also can't tell those two phase references apart, and the loop settles happily at either one. If it settles at the wrong one, every bit comes out inverted. Links resolve this either by sending a known pattern such as a sync word and checking whether it arrives inverted, or by differential encoding, where each bit is carried by whether the phase changed, which is the same whichever reference the loop chose.
Practice
Keep practicing
7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.