Project · ENSEIRB-MATMECA
Decoding ADS-B messages from radio recordings
Recovering, from raw recordings of a software-defined radio, the messages that aircraft broadcast in the clear on 1,090 MHz: 26 aircraft heard, 23 placed on a map, and the 93 messages of the reference decoder supplied by the teacher found one by one. No live reception.
- Period
- September to October 2025, taken up again in 2026
- Role
- Pair project, left unfinished, then taken up and finished afterwards outside the pair, and ported to Python
- Skills
- End-to-end signal processing chain
- Digital communications
- Verified MATLAB to Python port
- Tools
- MATLAB · Python · NumPy · Signal processing · CRC · CPR decoding
- 26 aircraft
- heard in 9 recordings of 0.5 s; 23 have a position on the map
- 171 messages
- decoded and checked by the CRC, 163 of them distinct frames
- 93 of 93
- of the teacher’s chain’s messages found again, in the same recordings, to within one sample and with the same bits
- 1.31 dB
- more signal than the ideal-case theory needs for 1 wrong bit in 1,000 (simulation)
Context
Every airliner broadcasts its identity, position, altitude and speed in the clear, on 1,090 MHz. This is ADS-B, and any receiver can listen to it. A software-defined radio digitises the raw signal; everything else is computation.
I do not start from an antenna but from recordings: 9 of 0.5 s each, at 4 million samples per second, so 4.5 s of signal. They were recorded by the software-defined radio used by the course and are supplied with the assignment, in its public repository.
The school project was done in a pair. It stayed unfinished: no message had yet been drawn from the recordings, and we had not managed to connect to the school’s radio for the real-time part. I took it up and finished it afterwards, working from the recordings only, then ported it to Python and checked it block by block.
Method
The chain starts from the signal and ends on a map.
- Find the frames. Each 112-bit message begins with a preamble. At every instant I measure how much it resembles the signal. Where it exceeds the threshold of 0.75 and forms a peak, a frame may start; the CRC decides. The threshold is supplied with the assignment; the theory shows it is well placed.
- Read the bits. With PPM, it is enough to compare the first and the second half of each slot.
- Check. The last 24 bits are a CRC. A message whose remainder is not zero is thrown away rather than misread.
- Read the fields. Identity, altitude, position (CPR) and speed.
- Place. Each position becomes a point on the map, tied to its aircraft.
The tool takes a real frame and follows these steps. Its slider adds simulated noise to the same frame: you see at which noise level the CRC starts rejecting it. Eb/N0, on the slider, is the energy of one bit divided by the noise density.
Decode a frame, step by step
A real frame, taken from the school radio’s recordings. Follow the steps: from a burst of radio pulses to an aircraft’s identity, position or velocity. Demodulation, the integrity check and field decoding run again in your browser.
Eb/N0 compares the energy of one bit with that of the noise: the lower it is, the stronger the noise. Moving the slider switches to the simulation.
The signal shown is the real recording. Move the slider to replay the same frame with simulated noise.
1. Received signal
Position frame from RYR968E (4CA706), recording 5, 334.6 ms after its start.
- recorded signal (magnitude of I and Q)
- preamble
This is recording 5 from the school radio, 334.6 ms after its start: 140 µs of signal, at 4 million samples per second. The frame stands out clearly: its amplitude rises to 408, while the background noise before it stays around 16.
The radio gives two numbers per sample (I and Q channels, 4 million samples per second); the curve is their magnitude, sqrt(I² + Q²), which does not depend on the phase of the received wave.
position frame, step 1 of 6: Received signal. No wrong bit, frame intact.
Results
The 9 recordings give 171 valid messages, 163 of them distinct frames (8 are repeats received in another recording). I hear 26 aircraft in them. 75 messages carry a position; 5 of them, all from aircraft 3444C3, are of type 18: an airborne position whose accuracy is not guaranteed. The map draws them dashed, among the 70 others. 23 aircraft have at least one position.
The aircraft around Bordeaux
The positions decoded in the 9 recordings, aircraft by aircraft. The slider replays the recordings one by one.
The recordings carry no timestamp: the seconds are an estimate, derived from the speeds the aircraft announce.
- successive positions; the arrow shows the announced heading
- aircraft seen in a single frame
- positions of unguaranteed quality (type 18)
- school antenna (ENSEIRB-MATMECA)
- town
- airport (“Around Bordeaux” view)
Drag, or use the arrow keys once the map is selected, to move around; + and − to zoom. Tap or click an aircraft to open its details. The aircraft table, further down, gives the same information.
Up to recording 9, about 106 s after the first, 23 aircraft have given at least one position, out of 26 heard. Between the first and the last recording, an airliner at cruise covers 23 to 27 km.
3 aircraft heard have no position: AIB03KD (38011A), its identification and one status message; 398446, one velocity frame with no content; 405636, one velocity frame.
Positions decoded from the recordings; no live reception. Basemap: OpenStreetMap data. The 9 recordings last 0.5 s each, 4.5 s of signal in all, but they are not consecutive: from the announced speeds, about 1 min 38 s to 1 min 54 s elapse between the first and the last (106 s by least squares). This is an estimate: the file contains no timestamp.
The 26 aircraft as a table
| Aircraft | Frames | Positions | Altitude | Speed, heading | Recordings | Teacher’s chain |
|---|---|---|---|---|---|---|
| 0200AE | 2 | 1 | 37,975 ft | 419 kt, 23° | 8 | yes |
| 3420CA | 3 | 2 | 34,975 – 35,000 ft | 486 kt, 213° | 8, 9 | yes |
| 343543 | 6 | 1 | 34,000 ft | 407 kt, 25° | 2, 3, 4, 5, 7 | yes |
| 3444C3 | 11 | 5 (type 18) | 41,000 ft | 437 kt, 172° | 1, 2, 3, 4, 5, 6, 7 | no |
| VLG80PL 345042 | 18 | 5 | 34,000 – 34,025 ft | 457 kt, 352° | 1, 2, 3, 4, 5, 6, 7, 9 | yes |
| 34538E | 12 | 6 | 30,000 ft | 434 kt, 26° | 1, 3, 4, 5, 6, 7, 8 | yes |
| 346083 | 17 | 6 | 36,000 ft | 432 kt, 20° | 1, 2, 3, 4, 5, 6, 7, 8, 9 | yes |
| AIB03KD 38011A | 2 | 0 | — | — | 1, 2 | yes |
| AFR35YC 3944E8 | 4 | 1 | 5,225 ft | 252 kt, 352° | 1, 2, 4 | yes |
| 394C0F | 6 | 4 | 475 – 2,050 ft | 153 kt, 226° | 1, 3, 8, 9 | yes |
| 394C14 | 6 | 3 | 32,975 ft | 484 kt, 213° | 3, 6 | yes |
| 398446 (single frame)a single frame (velocity, FTC 19) whose velocity fields are all 0 (information not available); no other frame from this address, even with the threshold lowered to 0.5 | 1 | 0 | — | — | 9 | no |
| 39CEA5 | 6 | 2 | 37,975 – 38,000 ft | 435 kt, 353° | 2, 3, 5, 7 | yes |
| 39D702 (single frame) | 1 | 1 | 29,750 ft | — | 4 | yes |
| 3CC158 | 2 | 1 | 37,000 ft | 414 kt, 181° | 1, 2 | yes |
| 405635 | 4 | 4 | 34,000 – 34,025 ft | — | 1, 5, 6, 9 | yes |
| 405636 (single frame)a single frame above the threshold (velocity, FTC 19: 351 kt, heading 168°, descending at 1,536 ft/min), backed by a position read just below the threshold (buffer 5, correlation 0.623, CRC good) at 22,825 ft, consistent with the announced descent | 1 | 0 | — | 351 kt, 168° | 7 | no |
| BAW374 406AE3 | 17 | 7 | 32,025 – 32,900 ft | 430 kt, 168° | 1, 2, 3, 4, 5, 6, 7, 8, 9 | yes |
| GOACJ 407079 | 5 | 2 | 35,000 – 35,025 ft | 476 kt, 211° | 3, 4, 5, 6, 7 | yes |
| 4074B3 | 3 | 1 | 22,500 ft | 374 kt, 167° | 2, 4, 6 | yes |
| 471F7D (single frame) | 1 | 1 | 36,975 ft | — | 5 | yes |
| 4CA2AD | 16 | 7 | 36,000 ft | 477 kt, 337° | 1, 2, 3, 4, 5, 6, 7, 8, 9 | yes |
| 4CA358 | 5 | 3 | 35,975 – 36,000 ft | 424 kt, 23° | 4, 7, 9 | yes |
| 4CA532 | 4 | 3 | 35,975 – 36,000 ft | 421 kt, 22° | 1, 2, 5 | yes |
| RYR968E 4CA706 | 14 | 6 | 36,000 ft | 462 kt, 336° | 1, 2, 3, 4, 5, 6, 7, 8, 9 | yes |
| 4CA9DF | 4 | 3 | 36,000 ft | 523 kt, 276° | 1, 2, 5, 6 | yes |
Up to recording 9, about 106 s after the first, 23 aircraft have given at least one position, out of 26 heard. Between the first and the last recording, an airliner at cruise covers 23 to 27 km.
I then compare with the teacher’s chain, supplied in protected form. Its 93 valid messages are all found again. On these recordings, it returns only three message types (identification and two position types); my chain keeps every ADS-B message whose CRC is good, velocities and type 18 included, and so finds 3 more aircraft.
Comparison with the teacher’s chain
The assignment provides a reference chain, in protected form (the teacher’s .p files). Both chains decoded the same 9 recordings.
| Quantity | Teacher’s chain | Our chain |
|---|---|---|
| Valid messages returned | 93, including 17 duplicates | 171 receptions |
| Distinct frames | 76 | 163 (8 frames received again in another recording) |
| Positions | 87, 70 of them distinct | 75, 70 of them plotted |
| Aircraft | 23 | 26 (extra: 3444C3, 398446 and 405636) |
| Teacher’s messages found | — | 93/93 |
| Quantity | Teacher’s chain | Our chain |
|---|---|---|
| Identification (type 4) | 6 | 6 |
| Airborne position (type 11) | 83, including 17 duplicates | 66 |
| Airborne position (type 12) | 4 | 4 |
| Position, quality not guaranteed (type 18) | not decoded | 5 |
| Velocity (type 19) | not decoded | 76 |
| Aircraft status (types 28, 29, 31) | not decoded | 14 |
| Total | 93 | 171 |
The teacher’s chain returns 93 valid messages, including 17 duplicates (the same frame counted twice, one sample apart): 76 distinct frames, 23 aircraft. Ours returns 171 receptions, 163 distinct frames, 26 aircraft. All 93 of the teacher’s messages are found (93/93), in the same recording, to within one sample and with the same 112 bits; the 95 extra receptions are of types the teacher’s chain does not decode.
The 8 frames received again are genuine transmissions at different times (status messages and velocities unchanged from one recording to the next): they are kept, as the radio received them.
Four aircraft are seen on a single message only. I keep them, but I do not rely on them.
What was taken up afterwards
The blocks of the school project were written, but several had defects.
- Fixed. Some blocks crashed on certain inputs, the CRC and a position-decoding (CPR) function among them. The decision rule compared energies and made about twice as many errors as it should in simulation; on the recordings, it gave the same bits. A power spectral density (how the signal’s power is spread over frequency) had the wrong scale.
- Finished. The processing of the recordings, from frame detection to the list of aircraft, without the teacher’s protected files.
- Checked. Each block was compared with the teacher’s version on fixed inputs, then with the theory in simulation.
- Ported. The Python chain gives the same 171 messages again, at the same positions, with the same bits.
The chain against noise, in simulation
Before the recordings, three points were checked in simulation against theory: error rate, effect of an unknown delay, shape of the spectrum.
Error rate, synchronised signal (task 1)
- theory, 0.5·erfc(√(Eb/2N0))
- measured, MATLAB
- measured, Python port
- old rule (comparing energies), MATLAB
At 10 dB, the measured error rate is 7.7·10⁻⁴ (MATLAB) and 7.9·10⁻⁴ (Python), against 7.8·10⁻⁴ in theory. The old rule, which compared the energies of the two halves instead of their amplitudes, made 1.5·10⁻³, 2.0 times more.
At least 200 errors counted per point. Simulated real-valued noise added to every sample; 20 samples per bit.
Unknown delay, frequency and phase (task 4)
- theory, synchronised receiver (task 1)
- theory, phase-insensitive decision, 0.5·exp(−Eb/2N0)
- measured, delay estimated from the preamble
- measured, true delay given
- hollow: fewer than 100 errors counted
An error rate of 10⁻³ is reached at 11.11 dB instead of 9.80 dB in theory for the synchronised receiver of task 1: a 1.31 dB loss. Most of it, 1.18 dB (1.14 dB in theory), comes from the phase-insensitive decision the assignment requires; synchronising on the preamble only costs 0.13 dB. The Python port, with other random draws, finds 1.30 dB.
MATLAB measurements: at least 3,000 frames and 300 errors per point, at most 30,000 frames. Delay drawn between 0 and 100 samples, frequency offset within ±1 kHz, any phase.
Spectrum of the transmitted signal (task 2)
- estimated (Welch, 2,000 FFTs of 256 points)
- theoretical, sampled
- theoretical, continuous formula
- ¼·δ(f) line
The estimate (2,000 FFTs of 256 points) differs on average by 0.19 dB from the sampled theory, and by 0.48 dB from the continuous formula up to 5 MHz; higher up, the continuous formula falls below the estimate, an aliasing effect. The line at 0 equals ¼·δ(f) to a ratio of 1.001, and the measured power is 0.50.
Simulated signal (Fs = 20 MHz, 20 samples per bit), not the recordings. The zeros of the PSD (−∞ dB) are cut at the bottom of the plot.
Limits
- No live reception. I have never received an aircraft with a radio. Everything comes from the recordings supplied with the assignment: 4.5 s of signal.
- Estimated duration. The recordings carry no date and are not consecutive. I count between 1 min 38 s and 1 min 54 s from the first to the last, estimated from the announced speeds. It is an estimate, not a measurement.
- No external check. I did not compare the positions with a tracking site.
- Simulated noise. The noise curves come from a model, not from the radio’s real noise.
What I take from it
An integrity check changes the nature of the result: a damaged frame is rejected, not placed wrongly on the map. Comparing two chains message by message, to within one sample, teaches more than a vague “it roughly works”. Taking up an unfinished project also forced me to write down plainly what works and what does not exist.
Data and references
Recordings: the assignment’s public repository, github.com/rtajan/TS229, recorded by the software-defined radio used by the course. ADS-B messages are broadcast in the clear. Basemap: OpenStreetMap data (© OpenStreetMap contributors), shown with Leaflet; without JavaScript, a diagram in kilometres around the school stands in for it.