GEOG 862
GPS and GNSS for Geospatial Professionals

The P and C/A Codes

PrintPrint

The P and C/A codes are complicated, so complicated that they appear to be noise at first. In fact, they are known as pseudorandom noise, or PRN, codes. Actually, they are carefully designed. They have to be. They must be capable of repetition and replication. However, unlike the Navigation Message, the P and C/A codes are not vehicles for broadcasting information that has been uploaded by the Control Segment. They carry the raw data from which GPS receivers derive their time and distance measurements.

P Code @ 10.23 MBPS is Fsub0=10.23 MHz, see text surrounding image
Figure1.12: The P Code
Source: GPS for Land Surveyors

P Code

The P code is called the Precise code. It is a particular series of ones and zeroes generated at a rate of 10.23 million bits per second. It is carried on both L1 and L2, and it is very long, 37 weeks (2x1014 bits in code). Each GPS satellite is assigned a part of the P code all its own, and then repeats its portion every 7 days. This assignment of one particular week of the 37-week-long P code to each satellite helps a GPS receiver distinguish one satellite’s transmission from another. For example, if a satellite is broadcasting the fourteenth week of the P code, it must be Space Vehicle 14 (SV 14). The encrypted P code is called the P(Y) code.

There is a flag in subframe 4 of the NAV message that tells a receiver when the P code is encrypted into the P(Y) code. This security system has been activated by the Control Segment since January 1994. It is done to prevent spoofing. Spoofing is generation of false transmissions masquerading as the Precise Code. This countermeasure called Antispoofing (AS) is accomplished by the modulation of a W-Code to generate the more secure Y-Code that replaces the P code. Commercial GPS receiver manufacturers are not authorized to use the P(Y) code directly. Therefore, most have developed proprietary techniques both for carrier wave and pseudorange measurements on L2 indirectly. There is now a civilian code on L2 (L2C).  There is also now a military code known as the M code. We will discuss both of these later.

The Navigation Message can be thought of as the NAV Code, but there are others. Positioning, one of the primary objectives of GPS, is really the office of the P-Code, the C/A Code and some others that are newer than these legacy codes. The P code is the Precise code, The C/A code is the Civilian Access code. They're modulated onto carrier waves. For example, when you listen to a radio in your car and the announcer says you're listening to, let's say, 760 megahertz... well, of course, you're not listening to 760 megahertz. You can't hear that. Human hearing tops out at about 0.02 megahertz. What you hear is the modulation of speech and music onto the 760 megahertz carrier. The same idea is used in GPS. But with a radio, of course, the modulation is typically a frequency modulation or an amplitude modulation for FM and AM, respectively. In GPS, the modulation is done differently. Phase modulation is used. The image here is intending to show that. The P code in the image is a sine wave. It has particularly sharp peaks, but it is still a sine wave. Please note that up at the top of the blue line, there's a sequence of 1's and 0's. These indicate code chips of a binary code.

Please notice the way these code chips transition from 1 to 0 and back to 1. At those instances the sine wave, the blue line, does not go all the way to the top or bottom. When there is a transition from a 1 to a 0 or from a 0 to a 1, the blue line stops in the middle and reverses direction.  However, when the code chip just goes from a 1 to a 1, or from a 0 to a 0, there is no interruption of the normal sine wave path. In those cases, the blue line does go all the way up to the top, and it goes all the way down to the bottom.

This technique is called phase modulation.