Skip to content

PRN codes: how a GNSS receiver finds a signal

Navigation signals arriving at an antenna overlap in time and frequency. A receiver needs a way to search for a particular signal and estimate its timing. Known ranging codes make that possible.

Pseudorandom does not mean unpredictable

PRN stands for pseudorandom noise. A PRN sequence is deterministic: a receiver can generate the same sequence locally. It looks noise-like, but its correlation properties allow a matching replica to stand out when it is aligned with a received signal.

In GNSS discussions, a PRN number identifies a code assignment in a particular system and signal context. It should not be treated as a permanent, universal identifier for a physical satellite across every constellation and signal.

GPS L1 C/A as a concrete example

The GPS L1 C/A code contains 1,023 chips and runs at 1.023 million chips per second, so one code period lasts one millisecond. Its generation uses two ten-stage shift registers. The official IS-GPS-200N interface specification defines the sequences and assignments.

A chip is one element of a spreading code. It is distinct from a navigation data bit. The same interface specification defines the legacy navigation data rate as 50 bits per second; a data bit therefore spans multiple C/A periods. These numbers describe GPS L1 C/A, rather than every GNSS signal.

Searching with correlation

Represent code chips as \(+1\) and \(-1\). A simplified acquisition metric for complex samples \(r[n]\) is:

\[ R(\tau,f)=\left|\sum_{n=0}^{N-1} r[n]c^*[n-\tau]e^{-j2\pi fn/f_s}\right|^2. \]

The local code \(c[n]\) has been sampled at the receiver sample rate \(f_s\). The trial delay \(\tau\) is expressed in samples, and the trial frequency offset \(f\) in hertz. The asterisk denotes complex conjugation. This introductory expression assumes the correct signal structure and sufficiently stable phase over the integration interval.

When the code and frequency align, contributions can add coherently. A mismatched code or delay generally produces a smaller response. Actual correlation sidelobes and cross-correlation are nonzero, so a peak needs a detection rule and supporting evidence.

Satellite motion and receiver oscillator error shift the observed carrier frequency. Even with the correct code delay, a residual frequency offset rotates the samples during integration and can reduce the accumulated result. Acquisition therefore searches a grid of code delay and frequency hypotheses.

The search range, frequency spacing, integration time and threshold are receiver design choices. Longer coherent integration can help under suitable conditions, but frequency error, dynamics and navigation-bit transitions limit it. A universal threshold cannot be inferred from the code length alone.

A peak is a starting point

An acquisition result should record the signal and PRN searched, estimated delay, estimated frequency offset, integration settings and detection metric. Repeating the search on independent intervals helps expose transient or ambiguous detections.

Tracking then maintains code and carrier alignment. Code phase is periodic: the one-millisecond C/A repetition does not by itself provide the full transmission time. Navigation timing and additional receiver processing are needed to form useful pseudoranges and eventually a position solution.

Connecting this to a real capture

For an RTL-SDR experiment, preserve the original IQ format and sample-rate settings before interpreting correlation output. A format mismatch or wrong sample rate can invalidate the local replica even when the code generator is correct. Treat a receiver log as evidence to analyse, and distinguish acquisition, tracking, decoded data and positioning.

For the broader receiver chain, continue with GNSS fundamentals. For a mathematical treatment of code measurements, see ESA's GNSS basic observables.

Share on LinkedIn ↗