How does GPS work?

Ever wondered how the GPS on your phone knows exactly where you are? Here's how GPS keeps your blue dot on the right street...

St Andrews 20267 min read · 0 reads

1 Introduction

Each day, nearly 75% of the global population relies on GPS for essential navigation and communication. The Global Positioning System (GPS) is a network of more than 24 operational satellites at any given time (currently 32 total) used to determine a receiver's precise 3D location on Earth. The project, initially called NAVSTAR GPS, was started by the US Department of Defence in 1973 to provide a reliable global navigation and timing system for the military. In 1983, first public access was given to GPS, though with deliberately degraded signals, and the high-accuracy version was fully released in 2000. Each satellite follows one of six orbital paths and broadcasts radio signals from onboard atomic clocks, so that a receiver can determine its longitude, latitude and altitude based on time-delay signals from a minimum of four satellites, using an algorithm called trilateration. Radio waves travel at the speed of light ( 3×108~3 \times 10^8 m/s), so even a microsecond error could throw your location off by 300m, making GPS a stunning triumph of physics and algorithmic engineering.


2 The Space Segment

GPS is based upon its Space Segment, a constellation of 32 Medium Earth Orbit (MEO) satellites in six equally spaced orbital planes. Each operates at an altitude of approximately 20,200 km above the Earth's surface, inclined at 55∘55^\circ to the equator. These satellites orbit the planet twice each day, meaning that the configuration ensures that any receiver always has access to a direct line of at least four satellites at all times. To ensure accurate synchronisation across all satellites, each is equipped with highly precise rubidium and caesium atomic clocks, with a relative frequency uncertainty of around 10−1610^{-16} to 10−1510^{-15} (caesium is the current international standard for a second). Atomic clocks use quantum transitions in atoms to determine periods of time with extreme accuracy.

The satellites broadcast ephemeris data (parameters outlining their precise location at a specific time) and the almanac data (rough data for all other satellites in the system) via L-band radio waves. The radio transmission encodes a pseudorandom noise (PRN) code, which is a detailed digital signature for each satellite with an exact timestamp of transmission. A receiver intercepts these signals and correlates the PRN codes with locally formed codes of its own to establish the data necessary for location computation.

3 Core Algorithm: Trilateration

Once a receiver obtains data from four satellites, it uses an algorithm called trilateration to determine its location. Since radio waves travel at the known speed of light (cc), distance (dd) is calculated using:

d=c×(treceive−ttransmit)d = c \times (t_{\text{receive}} - t_{\text{transmit}})

Given the exact position of a satellite and your distance from it, you must be located at some point on the surface of a sphere centred at the satellite, with radius equivalent to the distance. Measuring your distance from a second satellite, the two spheres intersect in a circular ring of points. A third satellite further narrows your possible position down to two distinct points. However, one of these is typically deep in space or underground, so the algorithm discards this invalid point, thus determining your 3D location (x,y,z)(x, y, z).

Intersecting SpheresDiagram of 3 Intersecting Spheres

Despite this, there is the issue of receiver clock bias, as the satellites carry expensive atomic clocks which can precisely determine time, while a standard phone or GPS chip only uses a relatively cheap quartz crystal oscillator. The local clock is prone to small inaccuracies, and since the utmost precision is necessary for accurate location determination, algorithms introduce a fourth variable: clock error (dtdt) to resolve this issue. To find four unknowns (x,y,zx, y, z, and dtdt), the receiver must form a system of four simultaneous equations, each corresponding to signals from at least four satellites:

{(x−x1)2+(y−y1)2+(z−z1)2=c2(tr1−dt)2(x−x2)2+(y−y2)2+(z−z2)2=c2(tr2−dt)2(x−x3)2+(y−y3)2+(z−z3)2=c2(tr3−dt)2(x−x4)2+(y−y4)2+(z−z4)2=c2(tr4−dt)2\begin{cases} (x - x_1)^2 + (y - y_1)^2 + (z - z_1)^2 = c^2(t_{r1} - dt)^2 \\ (x - x_2)^2 + (y - y_2)^2 + (z - z_2)^2 = c^2(t_{r2} - dt)^2 \\ (x - x_3)^2 + (y - y_3)^2 + (z - z_3)^2 = c^2(t_{r3} - dt)^2 \\ (x - x_4)^2 + (y - y_4)^2 + (z - z_4)^2 = c^2(t_{r4} - dt)^2 \end{cases}

Typically, iterative numerical methods such as the Gauss-Newton method or Extended Kalman Filter (EKF) are used by the receiver to solve this system of non-linear equations, thus allowing it to find its precise 3D coordinates while also calibrating the local device's clock error at the same time. This loop executes repetitively in the background of each device using GPS, constantly updating your position as you move.


4 Computational Challenges

Simply solving the equations using trilateration does not result in finding a receiver's accurate location, as engineers must account for physical anomalies that may affect the accuracy of data. Einstein's theories of relativity affect GPS, as it is fundamentally a time measurement system that is rewritten as a location system; however, gravity and speed change how time itself flows. According to his theory of Special Relativity, clocks moving rapidly relative to an observer tick slower, losing about 7.2 microseconds/day. Conversely, General Relativity states that clocks in weaker gravitational fields tick faster, gaining about 45.8 microseconds/day, so that the net daily discrepancy is +38.6 microseconds. This is certainly not negligible, as light travels 11.58 km in that time and the accumulation of positioning errors would be very large.

Moreover, atmospheric interference may affect correct time measurement. As radio signals come down from MEO, they must pass through the ionosphere, extending from 50 to 1000 km high, which is charged with free electrons. Being a dispersive plasma medium, charged particles slow down and refract the radio waves, where propagation delay varies inversely with the square of frequency (f2f^2). These time delays trick the receiver into thinking that the satellite is farther away than it actually is, so dual-frequency receivers and atmospheric modelling algorithms must analyse dual signals to subtract these errors. The lowest atmospheric layer, from 0 to 50 km, is non-dispersive at frequencies below 15 GHz. Around 90% of tropospheric delay is hydrostatic (dry), caused by ambient atmospheric pressure, while 10% is wet, caused by atmospheric water vapour content. Finally, when satellite signals bounce off buildings or mountains before reaching a receiver's antenna, there are certain ghost delays, which must be smoothed out by advanced filtering algorithms such as Kalman filters.

5 Modern Receiver Optimisations

Whilst pure trilateration can be quite effective, directly downloading almanac data from satellites can take up to one minute, with a downloading speed of 50 bits per second. As a consequence, modern consumer products get around this issue by using Assisted GPS (A-GPS). If your smartphone opens mapping software in an urban area, it will use your local cellular tower or Wi-Fi to connect to an Internet server, which will in turn immediately download the current satellite almanac and ephemeris data, giving a rough estimate of your position while reducing the time for connection. Modern devices also employ hardware sensor fusion. Your smartphone will have a variety of micro-electro-mechanical systems (MEMS) sensors such as accelerometers, gyroscopes and digital compasses, which allow your device to detect movement between consecutive satellite pings. For instance, if you enter a long tunnel and lose signal from the satellites, your device can use dead reckoning, employing its internal inertial sensors to estimate your speed and direction until a direct signal returns.

6 Conclusion

The Global Positioning System is a remarkable combination of aerospace engineering, physics and high-speed computer science. Beginning as a Cold War military project, GPS has evolved into one of humanity's greatest technological achievements, from being the smartphone map to the time synchronisation of stock exchanges and digital monetary transactions. GPS continuously resolves complex relativistic equations and in conjunction with real-time data, it transforms radio wave signals into exact three-dimensional coordinates. Today, the US system is part of the Global Navigation Satellite Systems (GNSS), with other satellite systems being Europe's Galileo, Russia's GLONASS and China's BeiDou. Modern navigation pushes far beyond mere smartphone maps, as it has relevance in fully autonomous vehicles, smart infrastructure and sub-centimetre global precision.


Bibliography

  • 1. Spilker Jr, James J., et al., eds. Global positioning system: theory and applications, volume I. American Institute of Aeronautics and Astronautics, 1996.
  • 2. Hofmann-Wellenhof, Bernhard, Herbert Lichtenegger, and James Collins. Global positioning system: theory and practice. Vol. 5. Wien: Springer, 2001.
  • 3. Kaplan, Elliott D., and Christopher Hegarty, eds. Understanding GPS/GNSS: principles and applications. Artech House, 2017.
  • 4. Ashby, Neil. "Relativity in the global positioning system." Living Reviews in Relativity 6.1 (2003): 1.

Reader discussion

Join the conversation.

0 contributions

No comments yet. Start the discussion.

Deep Dive

Written by students at Eton.
Read by anyone curious.

Your cookie preferences

We use essential cookies to run this website. With your permission, we also use analytics cookies to understand how visitors use the site.