bistromath / gr-air-modes

Gnuradio Mode-S/ADS-B radio
This project implements a Mode S receiver for the Gnuradio software-defined radio project. It is designed to receive Mode S transmissions from aircraft and decode them to a human-readable format, including ADS-B information messages such as position and a
GNU General Public License v3.0
438 stars 126 forks source link

Adjust bitmask for 13-bit altitude codes with q bit. #86

Closed e5150 closed 7 years ago

e5150 commented 8 years ago

Replaced the 14-bit 0x3F80 with 13-bit 0x1F80. (The 14-bit mask would have produced correct results as long as the input is 13 bit. But for the sake of correctness…)

bistromath commented 8 years ago

The mask is actually correct; while there are only thirteen bits in the final representation, the so-called "M" bit (indicating metric altitude but so far unused in practice) is present in Mode S-style transmissions, adding a fourteenth bit to the representation and requiring the mask to be fourteen bits wide.

Try running "altitude.py" as a standalone Python program to see the effect of changing this mask.