Saturday, January 19, 2008

Calculating positions using the C/A code

To start off, the receiver picks which C/A codes to listen for by PRN number, based on the almanac information it has previously acquired. As it detects each satellite's signal, it identifies it by its distinct C/A code pattern, then measures the received time for each satellite. To do this, the receiver produces an identical C/A sequence using the same seed number, referenced to its local clock, starting at the same time the satellite sent it. It then computes the offset to the local clock that generates the maximum correlation. This offset is the time delay from the satellite to the receiver, as told by the receiver's clock. Since the PRN repeats every millisecond, this offset is precise but ambiguous, and the ambiguity is resolved by looking at the data bits, which are sent at 50 Hz (20 ms) and aligned with the PRN code.

This data is used to solve for x,y,z and t. Many mathematical techniques can be used. The following description shows a straightforward iterative way, but receivers use more sophisticated methods. (see below)

Conceptually, the receiver calculates the distance to the satellite, called the pseudorange.

Overlapping pseudoranges, represented as curves, are modified to yield the probable position

Next, the orbital position data, or ephemeris, from the Navigation Message is then downloaded to calculate the satellite's precise position. A more-sensitive receiver will potentially acquire the ephemeris data more quickly than a less-sensitive receiver, especially in a noisy environment. Knowing the position and the distance of a satellite indicates that the receiver is located somewhere on the surface of an imaginary sphere centered on that satellite and whose radius is the distance to it. Receivers can substitute altitude for one satellite, which the GPS receiver translates to a pseudorange measured from the center of the Earth.

When pseudoranges have been determined for four satellites, a guess of the receiver's location is calculated. Dividing the speed of light by the distance adjustment required to make the pseudoranges come as close as possible to intersecting results in a guess of the difference between UTC and the time indicated by the receiver's on-board clock. With each combination of four satellites, a geometric dilution of precision (GDOP) vector is calculated, based on the relative sky positions of the satellites used. As more satellites are picked up, pseudoranges from more combinations of four satellites can be processed to add more guesses to the location and clock offset. The receiver then determines which combinations to use and how to calculate the estimated position by determining the weighted average of these positions and clock offsets. After the final location and time are calculated, the location is expressed in a specific coordinate system, e.g. latitude/longitude, using the WGS 84 geodetic datum or a local system specific to a country.

There are many other alternatives and improvements to this process. If at least 4 satellites are visible, for example, the receiver can eliminate time from the equations by computing only time differences, then solving for position as the intersection of hyperboloids. Also, with a full constellation and modern receivers, more than 4 satellites can be seen and received at once. Then all satellite data can be weighted by GDOP, signal to noise, path length through the ionosphere, and other accuracy concerns, and then used in a least squares fit to find a solution. In this case the residuals also give an estimate of the errors. Finally, results from other positioning systems such as GLONASS or the upcoming Galileo can be used in the fit, or used to double-check the result. (By design, these systems use the same bands, so much of the receiver circuitry can be shared, though the decoding is different).

No comments: