The GPS pseudo-random code
The invention of the pseudo-random code as part of the operation of the GPS was a major factor in making
the GPS an affordable and usable system. It allows small GPS receivers with small aerials to make sense of
the very faint signal being sent from the satellite. To explain this, lets look at the way the GPS determines the
distance between a satellite and a receiver:
Both the satellite and the receiver contain highly accurate clocks. At precisely the same time, both the satellite
and the receiver generate a signal. Both signals are made up of the same, ‘randomly’ spaced set of pulses for
one millionth of a second. The random pulses are not really random. They are a well thought out pattern,
which is repeated over and over. This is why they are called pseudo random.
As they are both generated at the same time, if you were positioned at the receiver, the signal travelling from
the satellite would get to you after a short time delay. The distance to the satellite causes this delay. We know
the speed that the signal travels (the speed of propagation), so if we can measure the time it took to get to the
receiver, the distance / time / speed formula can be used to determine the distance to the satellite. The time
delay is determined by ‘electronically’ sliding the satellite signal back in time until it matches up with the
receiver generated signal. The amount of slide represents the time delay.
This sounds easy until you take the general background noise into account. Noise in this case is made up of
all the other transmissions, manmade or natural which are occurring in the background at any time. The noise
is so loud that the GPS signals become lost within it. The following graphic shows the pseudo random code
(PRN) at the top and the background noise at the bottom.
It can be seen that the PRN has a formal pattern of peaks and valleys and the Background noise has an
informal pattern. If we do a comparison between the pseudo random code and the background noise, by
checking where they match in regard to signal peaks and valleys over even time slots, we get an interesting
yet maybe expected pattern seen below.
In the diagram, a 0 represents no match (one has a peak while the other has a valley) and a 1 representing
a mach (either matching peaks or matching valleys), the quantity of 0’s and 1’s are even. If we give the
0’s the value of –1 and do an addition, the result will be 0. Now if we add the incoming satellite code to
the background noise, watch what happens in the two diagrams below.
In this first diagram the Satellite signal is still one slot from lining up and the number of matches is down to 3
The last diagram shows the result when the two pseudo codes line up. There are sudenly eleven 1’s
(representing matches) and only four 0’s (-1’s). When these are added the result is 7.
As the incoming signal is caused to slide in time, the addition of matches and miss-matches will remain at a
low level until the two pseudo random codes line up, and then there will be a sudden increase in the sum.
The increase indicates the match.