Field Guide · algorithm

Also known as: Costas loop

A Costas loop is a phase-locked feedback structure that recovers the phase and frequency of a suppressed carrier — one with no discrete tone to lock onto — enabling coherent demodulation of PSK and related phase-modulated signals.1 It is a close relative of the phase-locked loop, but instead of tracking a pilot tone it derives its phase error directly from the I and Q baseband components of the data itself, which is why it works when the carrier has been fully absorbed into the modulation.

in × × LPF I LPF Q × I (data) loop filt error NCO cos / sin feedback 90°
A Costas loop mixes the input against a local oscillator and its 90° copy, multiplies the I and Q arms to form a phase error, and feeds that through a loop filter to an NCO that drives the error to zero.

How it works

The input signal is split into two arms and mixed against a locally generated carrier: one arm against the in-phase reference (cosine), the other against a 90°-shifted quadrature reference (sine). After lowpass filtering, the in-phase arm carries the recovered data symbol and the quadrature arm carries mostly the residual phase error. The classic BPSK phase detector multiplies the two arms together (I × Q). When the loop is aligned this product is near zero; a small carrier offset tilts the constellation and produces a signed error proportional to sin(2·Δφ) for small angles — an S-curve that tells the loop which way to turn. Because the detector uses the product of I and Q rather than the sign of a pilot, the error is insensitive to the data bits over the region where it is monotonic, so it recovers phase even though the carrier is suppressed by the modulation.

That error passes through a loop filter and drives a numerically controlled oscillator (the digital equivalent of a VCO), closing the feedback path:

  • Loop-filter order sets the memory. A first-order (proportional-only) loop tracks a static phase offset but leaves a standing error under a constant frequency offset. A second-order loop adds an integrator, so it drives both residual phase and frequency error to zero and holds lock against slow drift — the usual choice for SDR. The loop bandwidth trades acquisition speed and pull-in range against noise: a wide loop grabs a carrier quickly but lets in more phase jitter.
  • Lock and hang-up. Once locked the constellation stops rotating and the I arm delivers clean symbols. A Costas loop has a phase ambiguity equal to the modulation’s symmetry (180° for BPSK, 90° for QPSK), because the detector cannot tell those rotations apart — downstream differential decoding or a known sync word resolves it. Loops can also hang up near a metastable point of the S-curve, stalling acquisition until noise nudges them off it.

Variants

The BPSK Costas loop generalises by changing the phase detector. QPSK/π4-DQPSK loops use a fourth-power or decision-directed detector that exhibits the same error sign across all four quadrants. A decision-directed detector slices the I/Q sample to the nearest symbol and measures the angle to that decision, giving lower jitter at high SNR at the cost of needing reliable decisions. When only frequency — not phase — must be pulled in first, a frequency-locked loop is often run ahead of the Costas loop to reduce the initial offset into the loop’s narrower pull-in range. A blind CMA equalizer is frequently paired with a Costas loop: the equaliser opens the eye while the Costas loop removes the residual carrier rotation the equaliser leaves behind.

Relevance to SDR

Coherent carrier recovery is a prerequisite for demodulating phase-modulated trunking and data waveforms — P25 C4FM/CQPSK, the π/4-DQPSK layer in P25 and TETRA, and PSK links in satellite and telemetry systems. Named for John P. Costas, the loop (or an equivalent PLL-style carrier tracker) stabilises a constellation that would otherwise spin from local-oscillator offset. GopherTrunk’s C4FM/PSK demodulators perform carrier and residual-frequency correction of this kind so the symbol slicer sees a stationary constellation; the exact tracker is an implementation detail, but the Costas loop is the canonical textbook form of what that stage does.

Sources

  1. Costas loop — Wikipedia, on the I/Q carrier-recovery feedback loop for coherent PSK demodulation, its phase detector, and its relation to the PLL. 

See also