GPS L1 C/A software receiver

Simulated antenna samples through acquisition, tracking, navigation-message decoding and a position fix. DSP engine in C++, compiled to WebAssembly.

0.000 sSignal time
–Speed vs real time
–Receiver GPS time
1

RF front end and digitization

The antenna sees every satellite on the same 1575.42 MHz carrier, 20 dB or more under thermal noise. The mixer shifts that band down to an intermediate frequency, a band-pass filter limits the noise, and the ADC quantizes what is left. Everything after the ADC is software.

Frequency plan

C/A signal lobeLO and imageIF filter band

ADC output levels

Sample histogram after AGC. Coarse quantizers cost a little C/N₀: about 2 dB for 1-bit, 0.5 dB for 2-bit.

Digitized IF spectrum Welch average of the ADC output, dB relative to the noise floor

Measured (signal + noise)Sum of all satellite signals, computedFilter response

Only noise is visible here. The satellites sit under the floor until despreading pulls them out in stage 3.

2

Acquisition

A 2-D search over Doppler and code phase for each PRN. Every Doppler bin is mixed to baseband, correlated against the PRN's C/A code by FFT (circular correlation over 1 ms), and summed non-coherently. A peak that clears the next-highest peak by the threshold ratio hands its Doppler and code phase to a tracking channel.

Search across all 32 PRNs

Peak-to-second-peak ratio from the latest search of each PRN. Select a bar to inspect its correlation surface.

Correlation surface, PRN – drag to rotate

Doppler bins run front to back, 1023 chips of code phase left to right.

3

Tracking channels

Each channel runs a carrier NCO and a code NCO. An FLL pulls the carrier in, then a Costas PLL locks phase. A carrier-aided early-minus-late DLL keeps the local C/A replica aligned. Select a channel to open it up.

ChPRNStateDoppler (Hz)Truth (Hz)C/N₀ estTruthPhase lockBitsSubframesPseudorange (km)

Channel –

Downconversion and despreading, sample by sample Windowsamples

Receiver signal path (noisy, what the software sees)This satellite alone, noiseless, scaled up (truth, pre-filter)

One millisecond block, starting at the code epoch. The last row integrates the despread samples over the whole block: noise averages out and the coherent sum grows, which is the prompt I correlator value.

Code correlation 31 taps, ±1.5 chips

Early, prompt and late sit on the triangle. A narrow front end rounds its peak.

Prompt I/Q last 400 ms

A spinning ring means frequency error. Two clusters on I mean phase lock, split by the nav data bits.

Despreading

After carrier wipe-offAfter code wipe-off

Carrier NCO Doppler Hz

NCOTruth, including TCXO offset

Carrier discriminators

Costas phase error (cycles)FLL error (Hz ÷ 100)

DLL discriminator chips

Normalized early − late

Prompt correlator per ms

I (nav bits appear at lock)Q

C/N₀ estimate dB-Hz

Moment estimatorTruth

Phase lock indicator

cos 2Δφ, filteredLock threshold
4

Bit and frame synchronization

Nav data runs at 50 bit/s, so each bit spans 20 code periods. Sign changes in prompt I pile up at one of the 20 millisecond positions, which marks the bit edge. Frame sync then looks for the 8-bit TLM preamble in either polarity (the Costas loop has a 180° ambiguity) and confirms it with parity on the first two words, then again with the next preamble 300 bits later carrying the next TOW. Parity alone would accept any data word that happens to start with the preamble pattern.

Bit-edge histogram

Recovered bit stream

Last 120 bits as received, before polarity correction. Highlighted bits are a preamble; a bar marks each subframe start.

5

Navigation message (LNAV)

Each subframe is ten 30-bit words: 24 data bits plus 6 Hamming parity bits chained through the last two bits of the previous word. Subframe 1 carries clock corrections, subframes 2 and 3 the broadcast ephemeris. Decoded values are checked against the values the simulated satellite transmitted.

Latest subframe

Data bitsParity bitsPreamble

Decoded fields

6

Position fix

With ephemeris from four or more channels, the receiver turns code phase and TOW into transmit times, forms pseudoranges, corrects satellite clocks and Earth rotation, and solves for position and receiver clock bias by iterated least squares.

Sky

Used in fixTrackingIn view, not tracked

Select a satellite to block or unblock it.

Solution

Pseudorange residuals per satellite (m).

Horizontal error

Receiver log