Listening to a TETRA Cell with an RTL-SDR and (Mostly) Stock GNU Radio Blocks
One carrier, four timeslots, and a base station that never stops announcing who it is. This is the build log of my TETRA receiver: stock GNU Radio blocks from the RTL-SDR all the way to the cell's broadcast messages, a little Python where nothing stock exists, and finally clear speech from a live call coming out of my laptop speaker. Plus the eight bugs that stood in the way.
Code repo here

Why I did this
Somewhere around 390–393 MHz near me there are TETRA base stations transmitting nonstop. On a waterfall they look like solid 25 kHz-wide bars: no gaps, no breathing, nothing to see. They never switch off, and they never tell you anything by just looking at them.
Inside those bars, though, there's a whole little world. Every cell keeps announcing who it is (country, network, colour code), which carrier is its main one, how mobiles should behave when they access it, and what services it offers. And four times every 57 milliseconds, the carrier is chopped into timeslots, some of which may carry speech.
There are ready-made decoders for this (osmo-tetra's tetra-rx is the classic). I didn't want a black box. I wanted to build the receiver myself, on my Windows laptop, out of stock GNU Radio blocks wherever possible, so I could put a display on any stage and see what it does.
That's this flowgraph, tetra_rx_stock.grc. Part 1 explains what a TETRA downlink actually is. Parts 2 to 5 walk through the receiver, antenna to console. Part 6 is the voice path, and Part 7 is the story of everything that was wrong with my first version of it. And yes, in the end it works: on a live cell it decodes the broadcast channels at better than 99 % and plays clear calls from whichever timeslot is busy.
A word before I start. TETRA carries other people's traffic, often public-safety traffic. Everything in Parts 1–5 is what the network broadcasts to everyone: identity, system information, access rules. Part 6 plays actual calls, and listening to someone else's calls may be illegal where you live, so check before you point it at a real cell. Many networks encrypt their calls; an encrypted call comes out as noise, which is how it's supposed to be. (Careful, though: the "AIR ENCRYPTION" line my receiver prints doesn't mean every call is encrypted. More on that in Part 7.)
As usual I use a handful of DSP words (correlator, soft bit, Viterbi, scrambler…). I explain each one the first time it shows up.
What I used
- RTL-SDR dongle. My calibration comment says "35 ppm", which tells you how good its crystal is.
- A 70 cm antenna. Nothing special.
- Windows laptop with radioconda (GNU Radio 3.10). No out-of-tree modules: the RTL-SDR goes through the in-tree Soapy RTLSDR Source.
- Gqrx, for recordings I can replay at my desk (
gqrx_..._390600000_1200000_fc.raw: 1.2 MS/s centred on 390.600 MHz).
- tetra_dec.dll, my own build of the ETSI TETRA speech codec reference code (EN 300 395-2). Only the voice path needs it.
The files:
- tetra_rx_stock.grc: the flowgraph. It's self-contained: both Python blocks and the tables module live inside it, and GRC writes them out when you generate.
- tetra_testgen.py: makes a synthetic TETRA downlink for testing (numpy only).
- tetra_pe_*.svg: the eleven diagrams in this document. Keep them in the same folder.
The rule I followed
Same rule as all my GNU Radio projects:
Put each operation in a stock block if one exists. Use an Embedded Python Block (EPB) only for what GNU Radio cannot do natively.
For TETRA this turned out to go much further than I expected. Frame sync, burst cutting, descrambling, de-interleaving, de-puncturing and Viterbi decoding are all stock blocks. Python only does:
- the CRC check and message parsing (TETRA's CRC covers 76 or 140 bits; the stock CRC blocks only handle whole bytes), and
- the voice path: working out which timeslot a burst belongs to, and calling the ETSI speech decoder.
Here's the whole receiver on one page:

Plain boxes are stock blocks, double-bordered ones are my two Python blocks, and boxes with a little screen icon are displays. Solid arrows carry samples, dashed arrows carry messages (one per burst or per event), and dotted arrows are GRC variable updates. A dashed frame groups the symbols that live inside one GRC block. The rest of this story walks through it top to bottom.
Part 1: what a TETRA downlink is
The signal
A TETRA base station transmits on a 25 kHz channel using π/4-DQPSK:
- 18,000 symbols per second, two bits per symbol, so 36,000 bits per second per carrier;
- each symbol turns the phase by one of four amounts: +45°, +135°, −45° or −135°. Which one encodes the two bits (00, 01, 10, 11). The information is in the change of phase, not the phase itself;
- the pulses are shaped with a root-raised-cosine filter (roll-off 0.35), so the signal really occupies ±12.15 kHz.
The base station's main carrier never stops transmitting. That's handy: there's always something to lock onto.
Chopping time into boxes

TETRA is TDMA: one carrier, shared in time. It nests four boxes:
| Box |
Made of |
Lasts |
| Timeslot |
510 bits (255 symbols) |
14.17 ms |
| Frame |
4 timeslots (TN 1–4) |
56.67 ms |
| Multiframe |
18 frames (FN 1–18) |
1.02 s |
| Hyperframe |
60 multiframes |
61.2 s |
Two facts matter later:
- Frame 18 is the control frame. It never carries speech. Among other things, it carries the sync bursts.
- A voice call gets one timeslot in every frame 1–17. Each of those slots carries 60 ms of speech, and 17 × 60 ms = 1.02 s: exactly one multiframe. Clever.
Three kinds of burst

Every timeslot carries one burst. On the downlink there are three kinds I care about:
| Burst |
Training sequence |
What it carries |
| Sync burst |
y, 38 bits |
The BSCH (the SYNC message: who this cell is, and the time) plus a 216-bit block (often SYSINFO) |
| Normal burst, NTS2 |
22 bits |
Two separate half-slot blocks of 216 bits: signalling |
| Normal burst, NTS1 |
22 bits |
One full slot of 432 bits: speech (TCH) or full-slot signalling (SCH/F) |
A training sequence is a fixed bit pattern in the middle of each burst. The receiver knows it in advance, so it can search for it and find out exactly where the burst is. The two normal bursts put their training sequence in exactly the same place; only the 22-bit pattern tells them apart. That detail cost me a whole bug, as you'll see in Part 7.
Part 2: the front end, from samples to soft bits

Tuning in
- The dongle sits 150 kHz below the cell, at 1.152 MS/s. Every RTL-SDR has a spike of junk at its own tuning frequency, so I keep the channel well away from it. Why 1.152 MS/s? Because 1.152 MHz ÷ 16 = 72 kHz, which is exactly 4 samples per 18 kBd symbol. One integer decimation, no fractional resampler anywhere.
- Frequency Xlating FIR: slides the channel from +150 kHz down to 0 Hz, low-pass filters it, and keeps one sample in 16. Out come 72,000 samples per second.
- A tighter channel filter (−6 dB at 13.5 kHz). I added this after I measured a neighbour 25 kHz away, 9 dB stronger than my cell, dragging the frequency loop about 2 kHz off.
- AGC, so the loops after it see a steady level.
Pulling out the tuning error
Neither the base station's oscillator nor my dongle's is perfect, so the signal arrives slightly off frequency. The FLL Band-Edge block fixes most of it: it compares the energy at the upper and lower edges of the signal's spectrum and nudges the frequency until they balance. Its estimate drives a number display with two readouts: "carrier offset" in Hz, and "ppm to add" for the dongle's correction slider.
Finding the symbols
- Polyphase Clock Sync: the matched root-raised-cosine filter and symbol timing in one block. It goes from 4 samples per symbol to 1, choosing the best moment within each symbol.
- CMA Equaliser (16 taps): cleans up echoes and filter ripple. CMA works here because π/4-DQPSK symbols all have the same amplitude, so "make every symbol the same size" is a good target.
- Diff Phasor: multiplies each symbol by the conjugate of the previous one. What comes out is the phase step, which is where the data lives.
The 4th-power trick

After the FLL, a little tuning error is always left over, so every phase step comes out turned by the same small extra angle θ. My favourite part of the front end removes it with six stock blocks and no feedback loop:
- Raise each step to the 4th power. The four legal steps are ±45° and ±135°; times four, they all land on 180°. The data vanishes, and what's left is 180° + 4θ, the same for every symbol.
- Average over 128 symbols (7 ms), take the angle, and divide by −4 to get the correction, −θ.
- Turn every step back by that amount.
Why not a Costas loop? A loop can lock a quarter-turn wrong and stay there. This one has no memory and no lock state: it simply measures and corrects. Its limit is that the leftover has to stay under ±45° per symbol, about ±2.25 kHz, and keeping it there is the FLL's job.
The constellation display shows three things:
- blue: the symbols after clock sync. A thin ring means timing is locked.
- red: the corrected phase steps. Four tight clusters on the diagonals means healthy.
- green: the steps before correction. Their rotation is the leftover tuning error.
Soft bits
The Constellation Soft Decoder turns each phase step into two soft bits. A soft bit isn't just 0 or 1: it's a number whose sign says which bit is likelier and whose size says how sure. Later, the Viterbi decoder uses that confidence to fix errors much better than plain 0/1 decisions would.
The "Soft-bit polarity" chooser on the GUI flips the sign convention. "Normal" is the one verified with tetra_testgen.py; flip it only if "no sync seen" persists while the red clusters look clean.
Part 3: finding the bursts
Correlators
A correlator slides along the bit stream looking for a known pattern. GNU Radio's Correlate Access Code – Tag does exactly that, and when it finds a match it attaches a tag to the stream: a little label riding on one sample.
I run three of them on the same soft-bit stream:
| Correlator |
Pattern |
Errors allowed |
Finds |
| y |
38 bits |
4 |
sync bursts |
| NTS2 |
22 bits |
1 |
normal bursts with two half slots |
| NTS1 |
22 bits |
1 |
normal bursts with a full slot (voice) |
Random data matches a 22-bit pattern with one error allowed about 0.2 times a second. Those false hits are harmless: the CRC and the rules in Parts 5 and 6 throw them out.
Moving a tag with stock blocks

Here's the problem: the correlator tags the bit right after the training sequence (bit 266 of a normal burst), but the block I want starts at bit 14. The stock Tags To PDU block cuts a fixed number of bits starting at a tag. So I need the tag on bit 14.
The trick, all stock:
- Multiply the correlator output by 0. The data becomes zeros; the tag survives.
- Delay the real data by 252 bits with a Delay block.
- Add the two. Data + 0 = data, and Add keeps the tags from both inputs.
Now the tag sits on bit 14 of the (delayed) burst. For block 2, I do the opposite: leave the data alone and delay the tag by 16 bits, so it lands on bit 282. Every offset lives in the tetra_fec module as the difference of two burst positions, so none of them is a magic number.
What gets cut:
| Burst |
Cut |
Goes to |
| Sync |
BSCH (120 bits) + block 2 (216 bits) |
BSCH chain, SCH/HD chain |
| NTS2 |
block 1 and block 2 (216 bits each) |
SCH/HD chain |
| NTS1 |
the whole full slot, bits 14–497 (484 bits) |
voice decoder (Part 6) |
Part 4: undoing the armour