D128 of 14
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 fn 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 fn) 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?

Name it

The loop

  1. A phase detector measures the phase error of each received sample against the local oscillator's.
  2. A loop filter, here proportional plus integral, smooths that error and accumulates it.
  3. A numerically controlled oscillator (NCO) advances its phase by the filter's output each sample.

In software, for each corrected sample y=ze−jθ:

e=Im⁡(y)sign⁡(Re⁡(y)),f←f+kie,θ←θ+f+kpe

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 ωn and damping ζ. A frequency step Δω gives a phase error

θe(t)=Δωωne−ζωntsin⁡(1−ζ2ωnt)1−ζ2

whose peak at ζ = 0.707 is e−π/4Δf/fn = 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
  1. Total error. The two crystals together can be off by up to 40 ppm.
  2. At 1800 Hz. Δf=1800×40×10−6=0.072Hz harmless in this audio modem.
  3. At 2.4 GHz. Δf=2.4×109×40×10−6=96kHz many times a narrow loop's bandwidth.
  4. 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 fn = 10 Hz and ζ = 0.707 meets a 5 Hz frequency step. What's its peak phase error?

Show the solution
  1. Peak phase error. For ζ = 0.707 it is 0.456 times the step over the natural frequency: θpk=0.456×510=0.228rad=13.1∘
  2. Compare with the slip point. That's well short of the 90° where a BPSK Costas loop could slip.
  3. 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
  1. Decay rate of the transients. ζωn=0.707×2π×10=44s−1
  2. Settling time. ts≈4ζωn≈90ms
  3. In bits. At 1200 baud that's roughly 110 bits.
  4. 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 fn = 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?

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.