Skip to content

8.2 — GPS: How It Works Without Internet

Turn off mobile data and aeroplane mode, walk outside, and your phone still knows where it is to within a few metres. No connection is involved. The satellites transmit and never listen; they have no idea you exist.

This chapter is how that is possible, and it is one of the most elegant pieces of engineering ever deployed.

GPS is Chapter 7.3's digital modulation plus arithmetic with time, and it is the one consumer system that fails without general relativity — Volume IV Chapter 6.9 computes the 38 microseconds a day that would otherwise put every position 11 km out.

1. The idea in one paragraph

Each satellite continuously broadcasts two things: the exact time, and its own exact position. Your receiver notes when each message arrives. The difference between the transmission time and the arrival time is the travel time, and multiplying by the speed of light gives the distance.

Knowing your distance from several satellites whose positions you know, you can compute your own position. That is trilateration, and it is the whole principle.

The complication that dominates the engineering: the receiver's clock is nothing like good enough.

2. Trilateration

One satellite at a known position, and a known distance from it, places you somewhere on a sphere.

Two satellites place you on the circle where two spheres intersect.

Three satellites narrow it to two points, one of which is usually absurd — deep inside the earth or far out in space — so it is discarded.

So three satellites should suffice. They do not, and here is why.

d=c\times\Delta t

The speed of light is 300 million metres per second, so one microsecond of timing error is 300 metres of position error.

Each satellite carries atomic clocks, accurate to about a nanosecond, which corresponds to 30 cm. Fine.

Your receiver has a quartz crystal, drifting by microseconds within seconds. Utterly inadequate, and putting an atomic clock in every phone is not an option.

The fourth satellite

The trick: treat the receiver's clock error as a fourth unknown and solve for it.

Four unknowns — x, y, z and the clock bias b — need four equations, so four satellites:

\sqrt{(x-x_i)^2+(y-y_i)^2+(z-z_i)^2}+cb=\rho_i, \qquad i=1,2,3,4

where \rho_i is the measured range, called the pseudorange because it is contaminated by the clock error.

Four equations, four unknowns. Solve, and you get position and an exact time.

This is the piece of the design that deserves admiration. Instead of demanding an accurate clock, the system computes what the clock error is. And the by-product is that any GPS receiver is also a free atomic-clock-quality time reference, which is why GPS timing synchronises mobile networks, power grids and financial trading systems worldwide.

SV1SV2SV3youtrue rangesmeasured, all too longby the same clock errorBecause the clock error is common to all measurements, a fourth satellite pins it down exactly.
Trilateration with a bad clock. A receiver clock error makes every measured range too long by the same amount, so the three circles fail to meet at a point. Adding a fourth measurement lets the receiver solve for the error that makes them all agree.

Notice why the fourth satellite works. The clock error affects every pseudorange identically. So there is exactly one value of b that makes all four spheres intersect at a single point, and finding it is the same as finding the position.

3. The constellation

31 operational satellites in six orbital planes, inclined 55° to the equator.

Altitude 20,200 km, giving an orbital period of 11 hours 58 minutes — exactly half a sidereal day, so each satellite passes over the same point twice daily.

Why that altitude? It was chosen so that four to twelve satellites are visible from anywhere on earth at any time, while keeping the number of satellites manageable. Lower would need many more; higher would weaken the signal and worsen the geometry.

Each satellite carries several atomic clocks — caesium and rubidium — with several as backups. They are monitored from the ground and corrections are uploaded, since even atomic clocks drift by nanoseconds a day.

Six monitoring stations track every satellite continuously and compute precise orbits, which are uploaded to the satellites for retransmission as the ephemeris.

The other systems. GLONASS (Russia, 24 satellites), Galileo (Europe, 28), BeiDou (China, 35+). Modern receivers use all of them — a phone typically tracks 20 to 30 satellites across four constellations, which improves accuracy and, crucially, availability in cities where buildings block much of the sky.

4. The signal

Frequencies: L1 at 1575.42 MHz and L2 at 1227.60 MHz, with L5 at 1176.45 MHz on newer satellites.

Transmit power: about 27 W. Received power on the ground: around -160 dBm, which is 10^{-19} watts.

And the thermal noise floor in the signal's 2 MHz bandwidth (Chapter 7.1):

-174+10\log_{10}(2\times10^6)=-111\ \text{dBm}

The signal is 49 dB below the noise. It is not merely weak; it is completely buried, and no ordinary receiver could detect its presence at all.

How it is recovered

Direct sequence spread spectrum, from Chapter 7.4.

Each satellite transmits a unique C/A code — a 1023-chip pseudorandom sequence repeating every millisecond, at 1.023 Mchip/s. The navigation data runs at only 50 bit/s, so each data bit is spread across 20 repetitions of the code.

Processing gain:

G_p=10\log_{10}\frac{1.023\times10^6}{50}=43\ \text{dB}

After despreading, the effective SNR becomes -49+43 = -6 dB in the data bandwidth — and with the additional integration over multiple code periods, a workable margin appears.

The codes are Gold codes, chosen so that any two have very low cross-correlation. That is what lets 30 satellites share one frequency, and it is exactly the CDMA principle.

The acquisition problem, and why the first fix is slow. The receiver must search a two-dimensional space: which code phase (1023 possibilities) and what Doppler shift (±5 kHz, in perhaps 40 steps). Around 40,000 combinations per satellite, and the receiver must find at least four.

This is why a cold start takes 30 seconds or more. Modern receivers use massively parallel correlators — thousands of them in hardware — and search all code phases simultaneously using the FFT (Chapter 5.1), because correlation is convolution and convolution is fast in the frequency domain.

Assisted GPS short-circuits the search: the mobile network tells the phone roughly where it is, what time it is, and which satellites are overhead with what Doppler. The search space collapses and the fix takes a second or two — which is why GPS on a phone with a data connection is so much faster than a standalone receiver.

The navigation message

50 bit/s, in a 12.5 minute cycle of 25 frames, each frame 30 seconds long and divided into five subframes.

Contents:

  • Satellite clock corrections — the difference between the satellite's clock and GPS system time.
  • Ephemeris — this satellite's precise orbit, valid for about four hours.
  • Almanac — coarse orbits of all satellites, so the receiver knows where to look. Valid for months.
  • Ionospheric model and health flags.

The timing consequence that explains cold-start behaviour: the ephemeris takes 30 seconds to receive, so a receiver with no stored data cannot produce a fix in less than 30 seconds no matter how good it is. With a valid stored almanac it knows where to look and starts faster; with a valid stored ephemeris it can fix in a few seconds.

5. The error budget

SourceTypical error
Satellite clock2 m
Ephemeris2.5 m
Ionosphere5 m
Troposphere0.5 m
Multipath1 m
Receiver noise0.3 m
Total (RMS)~6 m

The ionosphere dominates, and it does so because free electrons slow the signal by an amount that depends on frequency:

\Delta t\propto\frac{TEC}{f^2}

where TEC is the total electron content along the path.

The fix is beautiful and it is why L2 exists. Measure the delay at two frequencies. Because the delay scales as 1/f^2, the difference between the two measurements reveals the electron content, which can then be subtracted from both.

\text{corrected} = \frac{f_1^2\rho_1-f_2^2\rho_2}{f_1^2-f_2^2}

Dual-frequency receivers therefore eliminate the largest error source entirely, reaching 2 to 3 m. Single-frequency receivers use a broadcast model that removes about half of it.

Phones have had dual-frequency GNSS since about 2018, which is why phone GPS accuracy improved noticeably around then.

Geometry: the dilution of precision

Accuracy depends not only on measurement quality but on where the satellites are.

\sigma_{position}=\text{DOP}\times\sigma_{measurement}

Satellites spread widely across the sky give a good intersection angle and a low DOP. Satellites clustered in one part of the sky give shallow intersection angles and a large DOP.

DOPQuality
under 2excellent
2–5good
5–10moderate
over 20unusable

This is why GPS is poor in an urban canyon. Buildings block most of the sky, leaving only satellites nearly overhead, and the vertical geometry becomes terrible. Horizontal accuracy degrades and vertical accuracy degrades far more — which is why a phone knows which street you are on but not which floor.

Vertical accuracy is always about twice as bad as horizontal, for the same reason: all the satellites are above you, so there is no geometric leverage from below.

6. Relativity, which is not a footnote

GPS is the most-cited practical application of relativity, and the corrections are large enough to make the system useless within minutes if omitted.

Special relativity — the satellite's speed. Moving at 3.87 km/s, its clock runs slow relative to the ground:

\frac{\Delta t}{t}=-\frac{v^2}{2c^2}=-\frac{(3874)^2}{2(3\times10^8)^2}=-8.3\times10^{-11}

That is -7.2 microseconds per day.

General relativity — weaker gravity at altitude. Higher in the gravitational well, the satellite's clock runs fast:

\frac{\Delta t}{t}=\frac{GM}{c^2}\left(\frac{1}{r_{earth}}-\frac{1}{r_{sat}}\right)=+5.3\times10^{-10}

That is +45.9 microseconds per day.

Net effect:

-7.2+45.9=+38.6\ \mu\text{s per day fast}

Convert to distance:

38.6\times10^{-6}\times3\times10^8=11{,}580\ \text{metres per day}

Eleven and a half kilometres of position error per day, accumulating. After two minutes the error already exceeds the system's specification.

The correction. The satellites' clock oscillators are deliberately manufactured to run at 10.22999999543 MHz instead of 10.23 MHz, so that once in orbit they tick at exactly the right rate as seen from the ground.

There is a smaller residual correction for orbital eccentricity, applied in the receiver, worth up to 45 ns.

The historical note worth telling. When GPS was being designed in the 1970s, some engineers were genuinely unconvinced the relativistic correction was necessary, and the first satellite was launched with the frequency offset implemented but switchable, so it could be tested. It was needed exactly as predicted, and the switch was never used again.

7. Getting to centimetres

Differential GPS. A reference receiver at a precisely surveyed position computes the error in each satellite's pseudorange and broadcasts the corrections. Nearby receivers apply them.

Because most errors — ionosphere, satellite clock, ephemeris — are common to receivers within tens of kilometres, they cancel almost entirely. Accuracy improves to about 1 m.

Real-time kinematic (RTK). Instead of measuring the code, measure the phase of the carrier wave itself.

\lambda_{L1}=\frac{3\times10^8}{1.57542\times10^9}=19.0\ \text{cm}

Measuring the carrier phase to 1% gives 2 mm of precision.

The difficulty is the integer ambiguity: you can measure the phase within one cycle, but not how many whole cycles have elapsed. Resolving that integer is the whole problem, and it is solved by combining measurements from many satellites over time until only one integer combination is consistent.

RTK achieves 1 to 2 cm and is what precision agriculture, surveying and construction machine control use. It needs a base station within about 20 km, or a network of them delivering corrections over the internet.

PPP — precise point positioning — uses precise satellite orbit and clock products instead of a local base station, reaching a few centimetres after a convergence period of tens of minutes.

8. What breaks GPS

Jamming. The received signal is 10^{-19} W. A one-watt transmitter overwhelms it for kilometres, and such devices are cheap and illegal in most countries. They are used by drivers avoiding tracking, and they disrupt everything nearby — including, in documented cases, airport landing systems.

Spoofing. Transmitting false signals that appear genuine. Harder than jamming and much more dangerous, since the receiver reports a confident wrong position. Demonstrated against a yacht in 2013 and observed operationally near contested waters.

The defences: Galileo's authenticated signals with cryptographic signatures, multi-constellation cross-checking, and inertial sensors that detect an implausible jump.

Urban canyons and indoors. Signals reflect off buildings, and a reflected path is longer, so the range is overestimated. Multipath is why a phone sometimes places you on the wrong side of a street. Indoors, the signal is attenuated by 20 to 30 dB and usually unusable, which is why indoor positioning uses Wi-Fi and Bluetooth instead.

Solar activity. A geomagnetic storm increases and destabilises the ionospheric delay. Severe storms have degraded accuracy to tens of metres and occasionally caused complete loss of lock at high latitudes.

The dependency worth stating. GPS timing synchronises mobile networks, electricity grid protection relays, financial trade timestamping and broadcast networks. It is critical infrastructure that depends on a signal weaker than the noise, arriving from 20,000 km away, with no backup of comparable coverage. Several countries are building terrestrial timing alternatives for exactly this reason.


Chapter 8.3 covers the two radios that work over metres rather than thousands of kilometres, and the very different design compromises that short range permits.

Every formula above, built from scratch

None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.

GPS

Pseudorange, with the receiver clock bias as a fourth unknown:

\sqrt{(x-x_i)^2+(y-y_i)^2+(z-z_i)^2}+cb=\rho_i, \qquad i=1\ldots4

Four unknowns — three coordinates and the clock bias — need four satellites. The clock error is common to all measurements, so exactly one value of b makes all four spheres meet at a point.

d=c\,\Delta t, \qquad 1\ \mu\text{s}=300\ \text{m}

Orbit:

T=2\pi\sqrt{\frac{r^3}{GM}}=43{,}082\ \text{s (half a sidereal day)} \;\Rightarrow\; r=26{,}560\ \text{km}

giving an altitude of 20,200 km.

Processing gain:

G_p=10\log_{10}\frac{R_{chip}}{R_{bit}}=10\log_{10}\frac{1.023\times10^6}{50}=43\ \text{dB}

Received power about -160 dBm; noise floor in 2 MHz about -111 dBm; the signal is 49 dB below the noise and only despreading recovers it.

Ionospheric delay:

\Delta t\propto\frac{TEC}{f^2}

Dual-frequency correction, exploiting that 1/f^2 dependence:

\rho_{corrected}=\frac{f_1^2\rho_1-f_2^2\rho_2}{f_1^2-f_2^2}

Position error:

\sigma_{position}=\text{DOP}\times\sigma_{measurement}

DOP under 2 is excellent; over 20 is unusable. Vertical accuracy is about twice as poor as horizontal, because all satellites are above the receiver.

Relativity

Special relativity (satellite moving, clock runs slow):

\frac{\Delta t}{t}=-\frac{v^2}{2c^2}=-\frac{(3874)^2}{2(3\times10^8)^2}=-8.3\times10^{-11}=-7.2\ \mu\text{s/day}

General relativity (weaker gravity, clock runs fast):

\frac{\Delta t}{t}=\frac{GM}{c^2}\left(\frac{1}{r_e}-\frac{1}{r_s}\right)=+5.3\times10^{-10}=+45.9\ \mu\text{s/day}

Net: +38.6 µs/day, which is

38.6\times10^{-6}\times3\times10^8=11.6\ \text{km/day of position error}

The satellites' oscillators are built to run at 10.22999999543 MHz so that in orbit they tick at exactly 10.23 MHz as observed from the ground.

Carrier phase precision:

\lambda_{L1}=\frac{3\times10^8}{1.57542\times10^9}=19.0\ \text{cm}

Measuring phase to 1% gives 2 mm, which is why RTK reaches centimetres once the integer ambiguity is resolved.

What the next chapter fixes

Cellular and GPS are national infrastructure. Chapter 8.3 covers the two radios you own outright, which share one crowded unlicensed band and were designed with opposite goals: one to replace a network cable, the other to run for a year on a coin cell.