Osmo-tetra » History » Version 3

« Previous - Version 3/19 (diff) - Next » - Current version
horiz0n, 02/19/2016 10:52 PM
added more information about FCDP usage

PageOutline = Osmocom TETRA MAC/PHY layer experimentation code =

This code aims to implement the sending and receiving part of the

If you read the ETSI EN 300 392-2 (TETRA V+D Air Interface), you will
find this code implementing the parts between the MAC-blocks (called
type-1 bits) and the bits that go to the DQPSK-modulator (type-5 bits).

It is most useful to look at Figure 8.5, 8.6, 9.3 and 19.12 of the
abovementioned specification in conjunction with this program.

Big picture

digraph G {
graph [ rankdir = LR ];

bits_file2 -> tetra_rx [ label = "read" ];
tetra_rx -> console [ label = "stdout" ];
tetra_rx -> wireshark [ label = "GSMTAP" ];
float_file2 -> float_to_bits [ label = "read" ];
float_to_bits -> bits_file1 [ label = "write" ];
USRP -> tetra_demod [ label = "USB" ];
tetra_demod -> float_file1 [ label = "write" ];
bits_file1 [ shape=box label="file.bits" ];
bits_file2 [ shape=box label="file.bits" ];
float_file1 [ shape=box label="file.float" ];
float_file2 [ shape=box label="file.float" ];
tetra_rx [ label="tetra-rx" ];
tetra_demod [ label="" ];
Source Code
The source code is available via read-only git access at {{{
git clone git://

You can also browse the source code at

You will need [ libosmocore] to link.

Mailing List
There is a public mailing list regarding development of this project, you can
visit the subscription page at

This list is '''for discussion between software developers''' who intend to improve the
Osmocom TETRA software. It is not a forum for individuals asking how they can tap
into police radio (which is encrypted anyway).

We now have a [wiki:FAQ] (Frequently asked Questions) page! Demodulator

{{{src/demod/python/}}} * contains a gnuradio based pi4/DQPSK demodulator, courtesy of KA1RBI {{{src/demod/python/}}} * call demodulator on a 'cfile' containing complex baseband samples {{{src/demod/python/}}} * use demodulator in realtime with a USRP1 SDR {{{src/demod/python/}}} * use demodulator in realtime with a USRP2 SDR {{{src/demod/python/}}} {{{src/demod/python/}}} * use demodulator in realtime with a [wiki:Funcube_Dongle]. Please use the [ qthid] application to tune the dongle and adjust its gain/filter parameters for best reception result. This demodulator may also be used with other Softrock-type receivers by downconverting the intermediate frequency of a radio scanner to the complex baseband.

The output of the demodulator is a file containing one float value for each symbol,
containing the phase shift (in units of pi/4) relative to the previous symbol.

You can use the "float_to_bits" program to convert the float values to unpacked
bits, i.e. 1-bit-per-byte

PHY/MAC layer

=== library code ===

Specifically, it implements:

{{{lower_mac/crc_simple.[ch]}}} * CRC16-CCITT (currently defunct/broken as we need it for
non-octet-aligned bitfields) {{{lower_mac/tetra_conv_enc.[ch]}}} * 16-state Rate-Compatible Punctured Convolutional (RCPC) coder {{{lower_mac/tetra_interleave.[ch]}}} * Block interleaving (over a single block only) {{{lower_mac/tetra_rm3014.[ch]}}} * (30, 14) Reed-Muller code for the ACCH (broadcast block of
each downlink burst) {{{lower_mac/tetra_scramb.[ch]}}} * Scrambling {{{lower_mac/viterbi*.[ch]}}} * Convolutional decoder for signalling and voice channels {{{phy/tetra_burst.[ch]}}} * Routines to encode continuous normal and sync bursts {{{phy/tetra_burst_sync.[ch]}}}

=== Receiver Program ===

The main receiver program {{{tetra-rx}}} expects an input file containing a
stream of unpacked bits, i.e. 1-bit-per-byte.

=== Transmitter Program ===

The main program {{{conv_enc_test.c}}} generates a single continuous downlink sync
burst (SB), contining: * a SYNC-PDU as block 1 * a ACCESS-ASSIGN PDU as broadcast block * a SYSINFO-PDU as block 2

Scrambling is set to 0 (no scrambling) for all elements of the burst.

It does not actually modulate and/or transmit yet.

Quick example

assuming you have generated a file samples.cfile at a sample rate of 195.312kHz (100MHz/512 == USRP2 at decimation 512)

./src/demod/python/ -i /tmp/samples.cfile -o /tmp/out.float -s 195312 -c 0
./src/float_to_bits /tmp/out.float /tmp/out.bits
./src/tetra-rx /tmp/out.bits

Also, you may use pipes to glue the three programs running in different terminals together to achieve real time operation.

mkfifo /tmp/out.float
mkfifo /tmp/out.bits
./src/demod/python/ -D hw:1,0 -o /tmp/out.float

Add picture from clipboard (Maximum size: 48.8 MB)