adsb_decoder) is the third and final block in the gr-adsb pipeline. It receives raw demodulated bit PDUs from the Demod block, runs a CRC-24 parity check, optionally applies error correction, parses the Mode S downlink format, and publishes decoded aircraft state data as PMT PDUs.
Block info
| Property | Value |
|---|---|
| GRC block ID | adsb_decoder |
| GRC label | ADS-B Decoder |
| GRC category | [ADS-B] |
| Python class | adsb.decoder |
| Constructor | adsb.decoder(msg_filter, error_corr, print_level) |
| Block type | sync block (message-driven, no stream ports) |
Parameters
Controls which downlink formats the decoder processes. See Message Filter for a full comparison.
"Extended Squitter Only"— only processes DF 17, 18, and 19 (ADS-B messages)."All Messages"— processes all supported downlink formats including DF 0, 4, 5, 11, 16, 17, 18, 19, 20, and 21.
Selects the error correction strategy applied to messages that fail the initial CRC-24 check. See Error Correction for details.
"None"— no correction; only CRC-passing messages are decoded."Conservative"— syndrome-based correction of 1- or 2-bit contiguous burst errors."Brute Force"— not yet implemented; logs a critical error if selected.
Sets the console output verbosity. See Print Levels for examples.
"None"— no console output."Brief"— live curses table with one row per tracked aircraft."Verbose"— PythonloggingDEBUG output for every decoded field.
Ports
Message ports
| Label | Direction | Description |
|---|---|---|
demodulated | input | PDU from the Demod block — raw bits + timestamp/snr meta |
decoded | output | PDU for every successfully decoded and CRC-verified message |
unknown | output | PDU for messages with unsupported or unimplemented type codes |
Decoded PDU structure
A PDU is published on thedecoded port for each message that passes the CRC-24 check and is successfully parsed. The PDU is a PMT cons cell: (metadata_dict . data_vector).
The data vector is the original 112-element uint8 bit array from the Demod block.
Metadata fields
UTC Unix timestamp in seconds, propagated from the Demod PDU.
Human-readable UTC datetime string, formatted as
"%Y-%m-%d %H:%M:%S.%f UTC".6-character lowercase hexadecimal ICAO 24-bit aircraft address (e.g.,
"ac53a4").Mode S Downlink Format number (0–31).
Signal-to-noise ratio in dB, propagated from the Demod PDU.
Aircraft callsign decoded from a Type Code 1–4 identification message.
None until an identification message has been received for this ICAO address.Altitude in feet.
NaN until a position or altitude message has been received.Groundspeed in knots, decoded from a TC 19 airborne velocity message.
NaN until received.Heading in degrees (0° = East, 90° = North), decoded from a TC 19 message.
NaN until received.Vertical rate in ft/min. Positive values indicate climb; negative values indicate descent.
NaN until received.Latitude in decimal degrees.
NaN until a valid CPR position pair has been decoded.Longitude in decimal degrees.
NaN until a valid CPR position pair has been decoded.Latitude and longitude require two consecutive CPR-encoded position messages — one even frame and one odd frame — both received within 30 seconds of each other (
CPR_TIMEOUT_S = 30). A single position message is not sufficient to compute an absolute position.Unknown PDU structure
Messages that pass CRC but have unsupported or unimplemented type codes are published on theunknown port. The metadata contains timestamp, datetime, df, and snr. The data vector is the raw bit array.
Decode flow
Parse header
The Downlink Format (DF) is extracted from bits 0–4. If the DF is not in the set allowed by
msg_filter, processing stops.Check parity
A CRC-24 check is run against the payload. For DF 17/18/19, the 24-bit PI field must equal the computed CRC. For DF 0/4/5/16/20/21, the Address/Parity field is XORed with the CRC to recover the ICAO address, which is then looked up in the known-aircraft dictionary.
Error correction (optional)
If the CRC fails and
error_corr is not "None", the correct_errors method is called. On success, the header is re-parsed with the corrected bits.Decode message
The message payload is parsed according to the DF and, for Extended Squitter messages, the Type Code (TC). Decoded fields are stored in the per-aircraft
plane_dict.Instantiation example
demodulated message port to the Decoder’s demodulated message port in GNU Radio Companion.