intermediatecore concept~24 min

Signal Acquisition & Tracking

Finding a whisper in two dimensions, then never letting go

Why it matters

Acquisition and tracking are the origin of every GNSS observable. Without them there is no pseudorange to trilaterate and no carrier phase to resolve; the sensitivity of acquisition sets whether a receiver works indoors or under trees, and the tracking loops determine measurement quality, the moment carrier phase begins, and where the integer ambiguity comes from.

Prerequisites

The assumption every lesson quietly made

Look back at everything we have built. Pseudoranges feeding trilateration. Carrier phase with its integer ambiguity. Kalman filters smoothing a stream of fixes. Every one of them began with a measurement already in hand — a pseudorange that existed, a carrier phase that was being counted. But where did that first measurement come from? How does a receiver, switched on cold in your pocket, go from an antenna full of noise to "I am locked onto satellite 7, its code phase is 520 chips, its Doppler is +1500 hertz"?

That bootstrapping step is the one piece of the chain we have never opened. Code ranging showed the key idea — slide a replica code until it correlates — but it told the story statically and in one dimension. The real world breaks that picture in two ways, and fixing them is the whole of acquisition and tracking.

The idea, before any mathematics

The first complication is motion. A GPS satellite is not sitting still; it is screaming across the sky at nearly four kilometres per second, and your own receiver clock is a cheap oscillator that is never exactly on frequency. The combined effect shifts the received carrier by a Doppler offset of up to several kilohertz. This matters more than it sounds: correlation only works if the replica matches the incoming signal in both code phase and frequency. A replica at the wrong frequency drifts out of step with the signal during the integration and the correlation washes out, even with the code perfectly aligned. So the search is not a line, it is a plane: every combination of code phase and Doppler must be tried until one cell lights up.

The second complication is the one code ranging already hinted at: the signal is below the noise floor. You cannot simply look for it. What saves you is that correlation against the known code is a matched filter — summing the signal over time makes the real signal add up coherently while the noise, being random, partly cancels. The longer you integrate, the more the peak rises above the noise. This is processing gain, and it is the entire reason a signal a hundred-quadrillionth of a watt strong can be found at all.

Put those together and acquisition is this: sweep a two-dimensional grid of code phase and Doppler, correlate in each cell, integrate long enough that a true peak would clear the noise, and declare the satellite found when one cell stands clearly above the rest.

Acquisition is a two-dimensional treasure hunt — code phase on one axis, Doppler on the other — and the shovel is integration time. You are not making the signal louder; you are listening longer in exactly the right pattern until it rises out of the noise.

But finding the peak once is not the end — it is the beginning. The satellite keeps moving, the clocks keep drifting, and the code phase and carrier frequency you just measured are already going stale. So the receiver hands the peak to tracking loops that follow it: tiny feedback controllers that nudge the replica continuously to stay aligned, and in doing so emit a fresh, clean measurement every millisecond. The code-tracking loop produces the continuous pseudorange. The carrier-tracking loop produces the continuous carrier phase — and, as we will see, cannot help but leave its integer count unknown.

Seeing it

Picture a dark grid, code phase left-to-right and Doppler top-to-bottom, flickering with noise. Turn up the signal power, or integrate longer, and watch a single bright spike punch up out of the speckle at one spot — that spot is the satellite's code phase and Doppler. Now zoom into tracking: the correlation peak is a triangle, and three correlators ride it — one early, one prompt at the top, one late. When the replica slips, the early and late samples go lopsided, and that imbalance is the error signal that shoves the loop back to the top of the triangle.

Try it yourself

The heatmap is the live acquisition search; the lower panel is the tracking loop riding the autocorrelation triangle.

acquisition search — code phase × DopplerACQUIRED
Doppler ↑↓   code phase →
Post-corr SNR
17.0 dB
Peak ratio
2.02
Code phase
520
Doppler
1500 Hz
tracking — early / prompt / late correlators and the DLL discriminatorEPLdiscriminator = (E−L)/(E+L)code error (chips) →

A GPS signal arrives below the noise floor, and worse, Doppler-shifted by up to ±5 kHz as the satellite races overhead. So the receiver searches a two-dimensional grid of code phase and frequency, correlating a replica in each cell. Start weak: the heatmap is pure noise. Now raise C/N₀ or lengthen the integration and a single peak erupts — each doubling of integration adds about 3 dB of processing gain, the matched-filter magic that lifts the whisper into a spike. Add the interferer and notice the peak stays put: a different code barely correlates, so satellites share one frequency (CDMA). Once the peak is found, tracking takes over. The early and late correlators straddle the prompt on the autocorrelation triangle; when the replica drifts, one grows and the other shrinks, and their normalized difference — the S-curve — is the error signal that steers the loop back to zero, regenerating the pseudorange continuously. The carrier loop does the same for phase, and its blindness to the data bit’s 180° flips is exactly why carrier phase comes with an unknown integer — the ambiguity resolved later by LAMBDA.

Start with a weak C/N₀: the heatmap is pure noise and the verdict reads searching. Raise the power, or drag integration longer, and a single peak erupts at the true code phase and Doppler — each doubling of integration buys about 3 dB of processing gain. Move true Doppler and watch the peak slide vertically; move true code phase and it slides horizontally. Switch on the interferer: a stronger satellite on a different code barely dents the surface, because different codes do not correlate — that is CDMA protecting the weak from the strong. Then work the lower panel: drag the code error and watch the early and late correlators trade height while the S-curve below reads out the discriminator. At zero error it is zero; lean either way and it pushes back — the restoring force that keeps the pseudorange locked.

Now the mathematics

Acquisition. For a trial code phase τ\tau and Doppler ff, the receiver correlates the incoming samples against a replica, producing a complex correlation whose magnitude is, ideally,

∣R(τ,f)∣  ∝  A ∣Rcode(τ−τ0)∣  ∣sinc((f−f0) T)∣,|R(\tau, f)| \;\propto\; A\,\big|R_{\text{code}}(\tau - \tau_0)\big|\;\big|\mathrm{sinc}\big((f - f_0)\,T\big)\big|,

where τ0,f0\tau_0, f_0 are the true code phase and Doppler, RcodeR_{\text{code}} is the sharp PRN autocorrelation from code ranging, TT is the coherent integration time, and AA is the signal amplitude. The code term is a spike one chip wide; the Doppler term is a sinc\mathrm{sinc} that is full at zero frequency error and nulls completely when the error reaches one cycle over the integration — 1 kHz1\,\text{kHz} for a 1 ms1\,\text{ms} integration. That null is why the Doppler axis must be searched in bins, and why longer integration demands finer bins.

Processing gain. Correlating against the known code is matched filtering, so the post-correlation signal-to-noise ratio is

SNR=2 CN0 T,\mathrm{SNR} = 2\,\frac{C}{N_0}\,T,

with C/N0C/N_0 the carrier-to-noise-density ratio (a receiver-independent measure of signal quality in Hz, usually quoted in dB-Hz). Every doubling of TT adds ≈3 dB\approx 3\,\text{dB}. A signal hopelessly buried at 1 ms1\,\text{ms} becomes a clean peak at 20 ms20\,\text{ms} — purely by listening longer.

Code tracking (DLL). Once locked, two extra correlators sit a fraction of a chip early and late of the prompt. On the autocorrelation triangle R(ε)=1−∣ε∣R(\varepsilon) = 1 - |\varepsilon|, their normalized difference is the delay-lock-loop discriminator

DDLL=E−LE+L,E=R ⁣(ε+d2),    L=R ⁣(ε−d2),D_{\text{DLL}} = \frac{E - L}{E + L}, \qquad E = R\!\left(\varepsilon + \tfrac{d}{2}\right),\;\; L = R\!\left(\varepsilon - \tfrac{d}{2}\right),

for correlator spacing dd. At perfect alignment ε=0\varepsilon = 0 the early and late samples are equal and DDLL=0D_{\text{DLL}} = 0; any slip tips the balance and the sign of DDLLD_{\text{DLL}} tells the loop which way to slide. The tracked code phase is the continuous pseudorange, now refined to a small fraction of a chip — metres rather than the ~293 m of a raw chip.

Carrier tracking (PLL) and the birth of the ambiguity. The carrier loop keeps a replica sinusoid aligned so the signal collapses onto the in-phase arm, letting the receiver count carrier cycles — the carrier phase. But the navigation message flips the signal's sign every data bit, a 180∘180^\circ phase reversal. To keep tracking through those flips the loop uses a Costas discriminator, essentially atan⁡(Q/I)\operatorname{atan}(Q/I), which is deliberately blind to a sign change: a flip of π\pi looks identical to no error. That very blindness means the loop locks the fractional phase beautifully but has no idea how many whole cycles have elapsed. And there it is — the integer ambiguity, arising not as an abstraction but as a direct consequence of how the carrier is tracked, the same ambiguity LAMBDA later resolves.

From the idea to working code

@gnerd/gnss-core models both stages. acquisitionSearch builds the real 2D surface — authentic C/A autocorrelation on the code axis, the sinc\mathrm{sinc} Doppler loss, seeded noise scaled by the processing-gain SNR — and reports the peak and whether it clears the detection threshold. The tracking discriminators are exposed directly:

import {
  acquisitionSearch,
  postCorrelationSnrDb,
  dllDiscriminator,
  costasDiscriminator,
} from "@gnerd/gnss-core";

// A weak signal is invisible in one millisecond, but processing gain finds it at sixteen.
const short = acquisitionSearch({ prn: 1, trueCodePhaseChips: 311, trueDopplerHz: 0, cn0_dbHz: 33 });
const long = acquisitionSearch({ prn: 1, trueCodePhaseChips: 311, trueDopplerHz: 0, cn0_dbHz: 33, integrationTime_s: 16e-3 });
// short.acquired -> false,  long.acquired -> true,  long.codePhaseChips -> 311
postCorrelationSnrDb(33, 16e-3); // ~ +15 dB more than the 1 ms case

// Tracking: zero at lock, restoring sign off-lock; the carrier loop is blind to the pi data flip.
dllDiscriminator(0.0, 0.5);          // 0 - locked
dllDiscriminator(0.1, 0.5);          // negative - pull back
costasDiscriminator(0.3) === costasDiscriminator(0.3 + Math.PI); // true - the ambiguity's origin

The same engineering discipline as every module in the course: the measurement formation (correlation) is separate from the detection decision (the threshold), the processing-gain relationship is an explicit, documented formula rather than a tuned constant, and the discriminators are small, pure functions you can plot and reason about.

Check your understanding

  • Why must acquisition search Doppler as well as code phase, and what sets how finely the Doppler axis must be sampled? (A frequency-mismatched replica decorrelates; the sinc null at 1/T1/T means longer integration needs finer Doppler bins.)
  • A satellite is undetectable at 1 ms of integration but appears at 10 ms, with no change in antenna or power. What happened? (Processing gain: coherent integration raised the post-correlation SNR by ~10 dB, lifting the peak above the noise.)
  • The carrier loop tracks the fractional phase perfectly yet cannot report the total range. Which property of its discriminator is responsible, and what later step repairs it? (Its blindness to 180∘180^\circ data flips leaves the whole-cycle count unknown; integer ambiguity resolution fixes it.)

Where this goes next

With acquisition and tracking in place, the GNSS story is now complete end to end: a signal is found in noise, locked and followed, and turned into the code and carrier measurements that feed everything from a single-point fix to centimetre RTK. From here the frontiers are about doing this better and more robustly — longer and non-coherent integration for high-sensitivity and indoor acquisition, vector tracking that couples the loops to the navigation solution so weak satellites help each other, and multi-frequency, multi-constellation receivers that acquire dozens of signals at once. But the core you have just seen — correlate, integrate, lock, follow — is the beating heart inside every one of them, and inside the chip in your pocket.

Common misconceptions

  • Finding the code phase is enough to acquire a satellite. The signal is also Doppler-shifted by up to several kHz; a replica at the wrong frequency will not correlate, so the search is two-dimensional.
  • A bigger antenna is what pulls the signal out of the noise. The signal is below the noise floor; correlating against the known code (matched filtering) is what provides the processing gain.
  • Once you find the peak, you are done. The satellite and clocks drift continuously; tracking loops must follow the peak to produce continuous measurements, and that is where carrier phase begins.

Key takeaways

  • Acquisition searches two dimensions at once - code phase and carrier Doppler.
  • Processing gain from coherent integration lifts a below-noise signal into a detectable peak.
  • The delay-lock loop's early-minus-late discriminator keeps the code phase (pseudorange) aligned.
  • The carrier loop produces carrier phase; its blindness to data flips is the root of the ambiguity.
  • Every observable used downstream is born here, in the receiver's correlators.

Continue exploring