Skip to main content
The ADS-B Decoder (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

PropertyValue
GRC block IDadsb_decoder
GRC labelADS-B Decoder
GRC category[ADS-B]
Python classadsb.decoder
Constructoradsb.decoder(msg_filter, error_corr, print_level)
Block typesync block (message-driven, no stream ports)

Parameters

msg_filter
enum
default:"\"Extended Squitter Only\""
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.
error_corr
enum
default:"\"None\""
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.
print_level
enum
default:"\"Brief\""
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" — Python logging DEBUG output for every decoded field.

Ports

Message ports

LabelDirectionDescription
demodulatedinputPDU from the Demod block — raw bits + timestamp/snr meta
decodedoutputPDU for every successfully decoded and CRC-verified message
unknownoutputPDU for messages with unsupported or unimplemented type codes
The Decoder has no stream input or output ports.

Decoded PDU structure

A PDU is published on the decoded 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

timestamp
float
UTC Unix timestamp in seconds, propagated from the Demod PDU.
datetime
string
Human-readable UTC datetime string, formatted as "%Y-%m-%d %H:%M:%S.%f UTC".
icao
string
6-character lowercase hexadecimal ICAO 24-bit aircraft address (e.g., "ac53a4").
df
integer
Mode S Downlink Format number (0–31).
snr
float
Signal-to-noise ratio in dB, propagated from the Demod PDU.
callsign
string or None
Aircraft callsign decoded from a Type Code 1–4 identification message. None until an identification message has been received for this ICAO address.
altitude
float
Altitude in feet. NaN until a position or altitude message has been received.
speed
float
Groundspeed in knots, decoded from a TC 19 airborne velocity message. NaN until received.
heading
float
Heading in degrees (0° = East, 90° = North), decoded from a TC 19 message. NaN until received.
vertical_rate
float
Vertical rate in ft/min. Positive values indicate climb; negative values indicate descent. NaN until received.
latitude
float
Latitude in decimal degrees. NaN until a valid CPR position pair has been decoded.
longitude
float
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 the unknown port. The metadata contains timestamp, datetime, df, and snr. The data vector is the raw bit array.

Decode flow

1

Receive PDU

The decode_packet handler is invoked when a PDU arrives on the demodulated input port.
2

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.
3

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.
4

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.
5

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.
6

Publish PDU

A decoded PDU is published on the decoded port containing the accumulated aircraft state.

Instantiation example

import gnuradio.adsb as adsb

decoder = adsb.decoder(
    msg_filter="Extended Squitter Only",
    error_corr="None",
    print_level="Brief",
)
Connect the Demod block’s demodulated message port to the Decoder’s demodulated message port in GNU Radio Companion.

Build docs developers (and LLMs) love