# How does a GPS device determine bearing?

Following a discussion on Math and this particular comment, I am wondering how a GPS receiver determines its bearing. As I understand it:

• GPS is not a directional system, thus bearing can only be inferred from receiver movement. If a receiver has obtained a fix and a valid bearing, then turns while stationary, the bearing will not reflect that until the receiver actually starts moving in that direction.
• So far I have therefore assumed that the receiver simply takes the current and previous location, assumes it has traveled in a straight line from one to the other and returns the appropriate bearing.
• Bearing will therefore suffer from errors which are linked to the positional accuracy of these two positions, as well as the distance between them.
• The error increases whenever the receiver is not traveling along a straight line – rather than the current bearing, the receiver would return the average bearing as it moved from the previous to the current position.

But the comment I got seems to indicate otherwise.

Are my assumptions correct? Or do GPS receivers have another way of determining bearing from satellite signals alone?

• Some GPS devices are equipped with an electronical three axis compass and thus are able to determine the bearing irrespective of the GPS measurements. – TobsenB Mar 8 '16 at 9:01
• Thanks for your answer, but it doesn't apply in my case (the compass and other sensors are separate from the GPS, and it is my job to make sense of all their readings). I've edited the question to reflect that I'm only asking for methods that rely entirely on sat signals. – user149408 Mar 8 '16 at 10:17
• I never really thought about it before, but, in theory, the device could use the azimuth positions of the satellites (compared to the direction it's "pointing" in) to determine bearing. Sort of like using Polaris to find north, since GPS satellites broadcast their position. – barrycarter Mar 8 '16 at 15:12
• AFAIK you are right. The bearing, if not aided by other instruments, is taken by using the current and last position. The same goes to velocity (that also uses time). Normally bearing goes wild when the device is stopped because any small change in the position will reflect on it. While velocity is affected by bigger positional error, making it look like you are traveling really fast. – Alexandre Neto Mar 9 '16 at 9:39

Your understanding is correct; however, by introducing velocity and/or angular velocity and even acceleration into a model you could setup an extended Kalman filter such that at each time interval it would provide a more accurate estimate of the bearing.

There are two stages to estimation in a Kalman filter. The first is the "predict" step where a state transition model is used to predict what "state" the system will be in at the next time interval. The prediction is accompanied by uncertainty expressed in terms of a covariance matrix. The second stage is the measurement update, where measurements, in this case from the GPS, are used to update the prediction and produce a final state estimate.

Now the choice of the "state" depends on what you are looking to get out of the filter, in your case it would be the bearing. I would suggest you start with a position-velocity state transition model which assumes constant acceleration between steps and use the velocity vector at each time interval to estimate the heading.

With a quick google search I was able to find a couple of references that are freely available and may be of use to you. This one gives a good example of a position-velocity state transition model in an extended Kalman filter and this is a PhD thesis where the author uses bearing only for SLAM (Simultaneous Localization and Mapping). At page 74 it discusses using Kalman filters.

• Thank you – my plan is indeed to feed the bearing information (and others) into a Kálmán filter. But before I can do that, I need to know the factors which influence the accuracy of GPS bearing, and then determine accuracy (the latter being the subject of my Math.SE question). – user149408 Mar 10 '16 at 8:27

When surveyors use GPS technology to get accurate bearings (or sometimes back bearings) they will set up a GPS device at each end of a the-longer-the-better sight line, gather several minutes (hours even?) of data and do real-time kinematic (RTK) or post-processing to get the best positions and hence good reference bearing.

At the other end of the measurement spectrum, what you appear to describe, are the very crude bearing estimates devices provide based upon, I believe, successive positions of a vehicle or vessel. Certainly not survey grade but adequate for real-time navigation.

• Real-Time Kinematic (RTK) GPS is used to create the baseline – Mapperz Mar 8 '16 at 22:23
• I guess i should have read your other question before answering. I may not be correct about just how crude the navigational bearing estimate is. – Martin F Mar 8 '16 at 22:34

It is not unusual for the heading to fluctuate all over the map when a vehicle is sitting stationary. The GPS device is searching for movement to see what the heading is. Placing a 3 access compass or other device in a GPS system adds cost and weight, and takes up space. Many applications place objects on a map such as buildings, fire hydrants, businesses, etc. Location is the main focus on these apps. Code may be written to show "0" when no heading is available, but if the device searches for heading, it may not help.