All the codes mentioned come to a GPS receiver on a modulated carrier; therefore, it is important to understand how a modulated carrier is generated. The signal created by an electronic distance meter (EDM) in a total station is a good example of a modulated carrier.
Distance measurement in modern surveying is done electronically. Distance is measured as a function of the speed of light, an electromagnetic signal of stable frequency and elapsed time. Frequencies generated within an electronic distance measuring device (EDM) can be used to determine the elapsed travel time of its signal, because the signal bounces off a reflector and returns to where it started. An EDM only needs one oscillator at the point of origin, because its electromagnetic wave travels to a retroprism and is reflected back to its origination. The EDM is both the transmitter and the receiver of the signal. Therefore, in general terms, the instrument can take half the time elapsed between the moment of transmission and the moment of reception, multiply by the speed of light, and find the distance between itself and the retroprism (Distance = Elapsed Time x Rate).
The fundamental elements of the calculation of the distance measured by an EDM, ρ, are the time elapsed between transmission and reception of the signal, Δt, and the speed of light, c.
Distance = ρ
Elapsed Time = Δt
Rate = c
This is a good time to explain how ranging with electromagnetic signals works. It's convenient to talk about it in terms of electronic distance measuring device. It's a good place to start in the explanation. In a two-way system, the EDM on the left sends out a signal of very constant frequency to a retroprism or a reflector, corner cube. The signal goes out, reflects off of the retroprism, and returns to the EDM. On the signal's return, the EDM can analyze it and determine the distance.