# How can I correctly decode CPR positions from ADS-B frames?

I am decoding Compact Position Reporting (CPR) positions from ADS-B frames (the airborne position and surface position frames).

Most of my results give realistic longitude/latitude values, but some return things like 0,781518968485169 177,220642089844; or 1,76377118644068 -0,664306640625; or 2,12129237288136 -2,838134765625.

I have a feeling like I must be missing some kind of validation or some kind of frame type identification. Where can I find more information about the decoding process?

• I think some people are unfamiliar with ADS-B and didn't realize that your question had to do with transponder signal coding. – J Walters Jan 21 '16 at 12:25
• Welcome to Aviation.Se! – DeltaLima Jan 22 '16 at 11:39
• Do you use global decoding or local decoding? – DeltaLima Jan 22 '16 at 11:40
• Can you explain how you do the decoding, it is impossible to see from result what is wrong. – DeltaLima Jan 23 '16 at 9:04
• Are you using a specific library like Dump1090 - we are having similar issues lately – Jeef Nov 3 '17 at 10:40

We were decoding Airborne Position frames having TypeCode 0, 9-18 and 20-22. Apparently, frames with TypeCode 20-22 and possibly 0 have to be decode a different way.

(For now I think that I get enough information out of TypeCode 9-18 frames so I'll just skip the other ones.)

• Type codes 20-22 have the same coding as 9-18, all are Airborne Position messages. 19 is Velocity, there is no CPR in there. 0 is a "no position message", there is basically only altitude in there. 1-4 is identity & emitter type. 5-8 is surface position & velocity. 5-8 have a slightly different position coding than 9-18,20-22. – DeltaLima Jan 22 '16 at 11:38
• In addition, if you see type 20-22 I'd expect there is something wrong with your receiver or decoder as these messages are really, really rare. – DeltaLima Jan 22 '16 at 11:38
• Sorry I mistyped '8-19' for '9-18'. We don't receive 20-22 now, but why would that mean there is something wrong. – TTT Jan 22 '16 at 14:09
• 20-22 has very high position integrity which is not achieved with current day avionics. – DeltaLima Jan 22 '16 at 15:55