How a software GPS and Galileo receiver turns raw radio hiss at 1575.42 MHz into satellite orbits, your position, and a measurement of relativity — with no GPS chip anywhere in the loop.
A GPS chip is a sealed black box: signal in, coordinates out. gpsTuna opens the box. You point any software-defined radio at 1575.42 MHz (the GPS/Galileo L1 frequency), record a few seconds of what sounds like pure static, and the software does everything a receiver chip does — and then some things a chip never bothers to show you: the satellites' orbits, the navigation messages they broadcast, and even the relativistic behaviour of their atomic clocks.
The catch that makes it interesting: the signal is about 20 dB below the noise floor. You genuinely cannot see it in the recording. It has to be dug out.
A single antenna and SDR capture raw IQ samples at the L1 frequency. Every visible satellite in the sky is in there at once, all transmitting on the same frequency, all buried under the noise. Nothing looks like a signal yet — which is exactly the point.
Every satellite transmits a unique, publicly known pseudo-random code, and all of them share the frequency by using codes that don't correlate with each other (CDMA). The receiver generates a copy of each satellite's code and slides it against the recording looking for a match. When it lines up, the signal that was 20 dB under the noise suddenly stacks up into a sharp peak — that's acquisition. From there the receiver tracks the satellite, following its carrier frequency (Doppler-shifted by orbital motion) and its code timing continuously. A deep acquisition mode extends the integration to pull signals 6 dB fainter still.
Riding on top of that code, each satellite sends a slow 50 bits-per-second navigation message: its own precise orbit (the ephemeris), clock corrections, health, and a model of the ionosphere — all broadcast straight off the satellite. The receiver finds the frame boundaries, checks parity, and takes a majority vote across the message's 30-second repeats to drive noisy bit errors down toward zero. Galileo's E1-B message decodes here too — 1161 of 1161 pages CRC-clean across three satellites, with Galileo System Time read directly off the air and verified against the recording's own timestamp.
With each satellite's ephemeris, the receiver computes where that satellite was at the instant it transmitted (Kepler's orbit plus a stack of fine corrections, following the IS-GPS-200 standard). It measures how long each signal took to arrive — the pseudorange — and corrects for the satellite's own clock, for relativity, and for the Earth rotating underneath the signal during flight. Four satellites give four equations in four unknowns (your x, y, z, and the receiver clock error); more satellites are solved by least-squares. Galileo folds in as a second constellation, with the small offset between GPS time and Galileo time carried as one extra unknown.
Here's where opening the black box pays off. A GPS satellite's atomic clock does not tick at the same rate as a clock on the ground — and the reason is relativity. Special relativity slows the fast-moving satellite clock; general relativity speeds it up because it sits higher in Earth's gravity well. The two don't cancel: the net is about +38 microseconds per day, and GPS satellites ship with their clocks deliberately detuned by a factor of −4.4647×10⁻¹⁰ to compensate.
gpsTuna turns the decoded orbit into that relativistic clock budget and reproduces the factory detune to 99.9% — plus the small ±39-nanosecond wobble that comes from each orbit being slightly elliptical. Time dilation, measured from a wire in the yard.
One tracked bird turned out to be E14 — one of the two Galileo satellites launched into the wrong, eccentric orbit in 2014 and later used for landmark tests of gravitational redshift. gpsTuna read its unusually elliptical ephemeris (eccentricity 0.168) and its "do-not-use" health flag straight off the air. Including it in the solution actually improves the fix.
This is a snapshot receiver working from short captures on a cheap active patch antenna — not a survey instrument.