GEOG 862
GPS and GNSS for Geospatial Professionals

The P and C/A Codes


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.

Diagram showing P Code @ 10.23 MBPS is F0=10.23 MHz
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 of 1994. It is done to prevent spoofing from working. 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. Dual-frequency GPS receivers must also overcome AS.

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. The P code is the Precise code, The C/A code is the the Civilian Access code. They're carried on the carrier waves. The way these codes are modulated onto the carrier is important. 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. If you could hear it, it would be a constant buzz. 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 1 and a 0 and a 1 and a 1 and a 0 and a 0. These indicate code chips, a binary code.

Please notice the way these code chips transition from 1 to 0 and back to 1. When there is a transition from a 1 to a 0 or a 0 to a 1, the blue line does not go all the way up to the top and it does not go all the way down to the bottom. When there is a transition, the blue line stops in the middle and reverses direction. When that happens, there's a transition from the 1 to the 0 or from the 0 to the 1.

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.

The P-Code is generated at 10.23 million bits per second. It turns out that this is known as the fundamental clock rate in GPS. It's a very long code, 37-weeks long. The satellites are assigned one week pieces of the P-Code. For example, Space Vehicle 14 or SV14 is named that because it broadcasts the 14th week of the P-Code, and when a receiver can determine that it's looking at that particular segment of the P-Code, it must be coming from SV14.