GPS Technical Architecture and Mechanics
Trilateration and Timing
From Geometry to Timing
The basic principle of GPS is finding your position by measuring your distance from several satellites orbiting the Earth. But how does your phone measure that distance? It doesn't use a cosmic measuring tape. Instead, it uses time.
Every GPS satellite constantly broadcasts a radio signal. Your receiver picks up this signal and notes the time it arrived. Since radio waves travel at the speed of light, a known constant, your device can calculate the distance to the satellite with a simple formula.
This calculation hinges on knowing exactly when the signal left the satellite and when it arrived at your receiver. To make this possible, each satellite transmits a unique, complex digital pattern called a Pseudo-Random Noise (PRN) code which acts like a digital timestamp.
The Heartbeat of a Satellite
Think of a PRN code as a satellite's unique and incredibly long heartbeat. It sounds random, but it's actually a precisely defined sequence of ones and zeros. Your GPS receiver knows the exact pattern for every satellite.
When your receiver wants to find its distance from a satellite, it generates its own copy of that satellite's PRN code. It then listens for the same code arriving from space. Because the satellite's signal took time to travel, the sequence it receives is delayed compared to the one it generated internally. By measuring this time shift, the receiver calculates the travel time, .
This sounds straightforward, but there’s a critical complication. The entire system relies on perfect timing. While the satellites are equipped with incredibly stable and synchronized atomic clocks, the clock in your phone is a simple, inexpensive quartz crystal. It’s good enough for everyday life but hopelessly inaccurate for the nanosecond precision GPS requires. This unavoidable timing difference is known as receiver clock bias.
The Need for a Fourth Satellite
Because your receiver's clock is off, the distance it calculates isn't the true distance. It's a pseudorange, a term that reflects this timing error. This introduces a fourth unknown variable into our positioning problem. In addition to your three spatial coordinates (latitude, longitude, and altitude, or x, y, z), we now also need to solve for your receiver's clock bias ().
In algebra, to solve for a certain number of unknown variables, you need at least that same number of independent equations.
- With 3 satellites, you get 3 pseudorange measurements. This gives you 3 equations, but you have 4 unknowns (x, y, z, and ). You can't find a unique solution.
- With 4 satellites, you get 4 pseudorange measurements. Now you have 4 equations for your 4 unknowns. The system can be solved.
The receiver's computer takes the four pseudorange equations and, through some clever algebra, solves them simultaneously. It finds the one and only combination of x, y, z, and clock bias that satisfies the distance measurements from all four satellites. As a byproduct of calculating your location, your GPS device also calculates its own clock error and corrects its time to be in sync with the global standard. This is why many networked systems use GPS as a source of highly accurate time.
So, while you only need three measurements to pinpoint a location in three-dimensional space, the imperfect nature of timekeeping on Earth makes a fourth satellite essential for the GPS system to work.
