Understanding GPS
Introduction
The Global Positioning System (GPS) is a constellation of 31 satellites that transmit radio signals from medium earth orbit which is developed and operated by the United States of America. Its basic service provides users with approximately 7 meters accuracy, 95 percent of the time, anywhere on or near the surface of the earth. To accomplish this, a user employs trilateration on the signals of at least four satellites. To trilaterate, the receiver needs to measure the reception time of a satellite signal, and it needs to determine the time at which that signal was transmitted, as well as the location of the satellite at that time of transmission. A GPS satellite carries an atomic clock that provides extremely accurate time, and this information is placed in the code broadcast by the satellite, enabling the receiver to continuously determine the time that the signal was broadcast. The code also contains data that a receiver uses, along with the transmission time, to continuously compute the location of the broadcasting satellite.
Many articles explain how to trilaterate, given that the locations at the transmission times of the satellites used in the trilateration are known. This article focuses on filling that gap, and explains how a GPS receiver can determine the satellite locations and transmission times required for the trilateration.
Legacy GPS
The interface between the GPS Space Segment and the GPS User Segment includes two RF links:
- L1 at frequency 1575.42 MHz
- L2 at frequency 1227.60 MHz
Both signals are generated from a base frequency of 10.23 MHz.
Legacy Navigation (LNAV) data is spread with the Coarse Acquisition code (C/A-code) and with the Precision code (P-code). When the anti-spoofing (AS) mode of operation is activated, the P-code is encrypted and called the Y-code. P(Y) is used to denote the code which may or may not be encrypted. The chipping rates and lengths of these codes are:
The chips BPSK modulate the quadrature components of the carriers according to:
- L1 I-component carries the LNAV data spread by the P(Y) code
- L1 Q-component carries the LNAV data spread by the C/A code
- L2 I-component is configured to carry either the LNAV data spread by the P(Y) code, or the P(Y) code without data, or the LNAV data spread by the C/A code
- L2 Q-component is empty
For Block IIR-M, IIF, and subsequent blocks of satellites, two additional ranging codes are transmitted. They are the L2 Civil-Moderate (L2 CM) code and the L2 Civil-Long (L2 CL) code; which are transmitted on the Q-component of the L2 link, and are used to spread the Civil Navigation (CNAV) data.
The LNAV data is transmitted at 50 bps in 1500 bit-length frames of duration 30 seconds. Each frame consists of five subframes each of 6 seconds duration consisting of 300 bits. Each subframe is made up of 10 words with 30 bits per word. A word consists of 24 bits followed by 6 parity bits.
GPS time is expressed as a week number and a Time-Of-Week (TOW) count. The zero time-point is defined to be the same zero time-point as for Coordinated Universal Time (UTC), which is midnight January 5, 1980. GPS time differs from UTC because GPS is a continuous time scale, while UTC is corrected periodically with an integer number of leap seconds.
The P-code for SV ID number i is the sum of two codes denoted X1 and X2i. The X1 code is 15345000 chips in length which corresponds to exactly 1.5 seconds. The X1 code epoch defines the start of the 1.5 second intervals, and the TOW count increments by 1 at each X1 code epoch. The TOW is a modulo 403200 count and its rollover points define the start of a week.
In each subframe, word 1 is the Telemetry (TLM) word and word 2 is the Handover Word (HOW). The TLM format is:
And the HOW format is:
The truncated TOW count indicates the 17 most significant bits of the full 19-bit TOW count, and this truncated count increments at 6 second intervals, which correspond to the subframe intervals. The HOW TOW gives the GPS time of when the first bit of the next subframe will be transmitted.
Words 3 to 10 of the subframes carry three types of information:
- subframe 1 carries time-related and satellite status information
- subframes 2 and 3 carry orbital information of the transmitting satellite which enables one to determine the position of the satellite. This orbital information is called the ephemeris.
- subframes 4 and 5 contain 1 page of a 25 page series. Because transmitting each frame takes 30 seconds, transmitting the entire series spanned over 25 frames takes 12.5 minutes. These pages contain the almanac, which consists of low-resolution ephemeris data for all the satellites in the GPS constellation, as well as the Navigation Message Correction Table, Ionospheric and UTC data, SV health data, and the almanac reference time and reference week number.
The subframe 1 parameters are summarised in the following table:
The subframe 2,3 parameters are summarized in the following table:
A summary of the various data contained in each page of subframes 4,5 is:
The almanac parameters for a single SV are given by:
The almanac parameters are a subset of the ephemeris parameters, and are of lower resolution. Hence the equations for calculating the satellite position are moderately simpler, but the same conceptually. So we provide the computational algorithm here, and refer the reader to the GPS specification for the more complex and accurate calculation based on the ephemeris.
GPS Reception
The first step of a GPS receiver is to synchronise to the C/A ranging code. This will presumably be done by cross-correlating the received signal with a local version of the C/A code. The receiver must have a local notion of time which is not required to be synchronised to any particular system. The cross-correlation will be done at multiple time offsets until an offset is found that results in a sufficiently strong correlation peak. At this point a tracking loop can be started that maintains synchronization with the GPS signal.
The signal is phase equalised, the Q quadrature is BPSK demodulated, and the preamble of the TLM is searched for to achieve alignment with the subframe boundaries. Upon subframe alignment, the HOW is read and the TOW field provides t_sv, which is the SV PRN code phase time at message transmission time. This time is precisely the time of the start of the first chip of the subframe immediately following the subframe that contained the HOW. The receiver shall also record the local message reception time, t_rx, of reception of the first chip of the subframe. The user requires the message transmission time, message reception time, and the satellite position at the message transmission time for at least 4 satellites to determine the user position at message reception time.
Corrections to t_sv are made to account for satellite clock bias, drift and ageing to obtain the GPS time at message transmission, t, by application of the first order polynomial:
t = t_sv – dt_sv. (1)
with correction term
dt_sv = a_f0 + a_f1*t_k. (2)
where t_k is the time difference from the reference time
t_k = t – t_oa. (3)
In this last equation t can be approximated by t_sv. The GPS control segment shall update the almanac often enough to ensure that GPS time, t, shall differ from the almanac reference time, t_oa, by less than 3.5 days. To account for TOW roll-overs, if t_k is greater than 302,400 seconds, subtract 604,800 seconds from t; if t_k is less than -302,400 seconds, add 604,800 seconds to t_k.
With the transmission time t computed, the earth-fixed cartesian coordinates of a satellite are obtained by the series of equations:
Equation (9) can be solved by an iterative technique.
The more accurate calculation based on the ephemeris data also accounts for propagation delays or decreases in the signal's speed caused by the ionosphere by utilising the time delay differential between L1 and L2. Systems that have only the L1 or the L2 link must instead perform an additional computation based on the broadcasted ionospheric data.
Conclusion
The receiver uses the time difference between the time of signal reception and the broadcast time to compute the range from the receiver to a satellite used in the trilateration. With the ranges to the satellites and the cartesian coordinates of the satellites when the signal was sent, the receiver can compute its own three-dimensional position.
About the Author
Principal Research Scientist for the Wireless Security Group at Bluvec Technologies Inc. He obtained his PhD at the University of British Columbia in the Department of Physics. He works on signal processing algorithms for wireless communication systems, with recent emphasis on detection and tracking system design and implementation.
Original Sources: