OsmocomTETRA » History » Version 7
laforge, 02/19/2016 10:52 PM
add graphviz
1 | 6 | laforge | [[PageOutline]] |
---|---|---|---|
2 | 2 | laforge | = Osmocom TETRA MAC/PHY layer experimentation code = |
3 | 1 | ||
4 | 2 | laforge | This code aims to implement the sending and receiving part of the |
5 | 2 | laforge | TETRA MAC/PHY layer. |
6 | 1 | ||
7 | 2 | laforge | If you read the ETSI EN 300 392-2 (TETRA V+D Air Interface), you will |
8 | 2 | laforge | find this code implementing the parts between the MAC-blocks (called |
9 | 2 | laforge | type-1 bits) and the bits that go to the DQPSK-modulator (type-5 bits). |
10 | 1 | ||
11 | 3 | laforge | It is most useful to look at Figure 8.5, 8.6, 9.3 and 19.12 of the |
12 | 3 | laforge | abovementioned specification in conjunction with this program. |
13 | 1 | ||
14 | 7 | laforge | == Big picture == |
15 | 7 | laforge | |
16 | 7 | laforge | {{{ |
17 | 7 | laforge | #!graphviz |
18 | 7 | laforge | digraph G { |
19 | 7 | laforge | graph [ rankdir = LR ]; |
20 | 7 | laforge | |
21 | 7 | laforge | bits_file2 -> tetra_rx [ label = "read" ]; |
22 | 7 | laforge | tetra_rx -> console [ label = "stdout" ]; |
23 | 7 | laforge | tetra_rx -> wireshark [ label = "GSMTAP" ]; |
24 | 7 | laforge | |
25 | 7 | laforge | float_file2 -> float_to_bits [ label = "read" ]; |
26 | 7 | laforge | float_to_bits -> bits_file1 [ label = "write" ]; |
27 | 7 | laforge | |
28 | 7 | laforge | USRP -> tetra_demod [ label = "USB" ]; |
29 | 7 | laforge | tetra_demod -> float_file1 [ label = "write" ]; |
30 | 7 | laforge | |
31 | 7 | laforge | bits_file1 [ shape=box label="file.bits" ]; |
32 | 7 | laforge | bits_file2 [ shape=box label="file.bits" ]; |
33 | 7 | laforge | float_file1 [ shape=box label="file.float" ]; |
34 | 7 | laforge | float_file2 [ shape=box label="file.float" ]; |
35 | 7 | laforge | tetra_rx [ label="tetra-rx" ]; |
36 | 7 | laforge | tetra_demod [ label="tetra-demod.py" ]; |
37 | 7 | laforge | } |
38 | 7 | laforge | }}} |
39 | 3 | laforge | |
40 | 3 | laforge | == Source Code == |
41 | 3 | laforge | The source code is available via read-only git access at |
42 | 3 | laforge | {{{ |
43 | 3 | laforge | git clone git://git.osmocom.org/osmo-tetra.git |
44 | 3 | laforge | }}} |
45 | 3 | laforge | |
46 | 5 | laforge | You can also browse the source code at http://cgit.osmocom.org/ |
47 | 3 | laforge | |
48 | 1 | You will need [http://bb.osmocom.org/trac/wiki/libosmocore libosmocore] to link. |
|
49 | 3 | laforge | |
50 | 3 | laforge | == Mailing List == |
51 | 3 | laforge | There is a public mailing list regarding development of this project, you can |
52 | 3 | laforge | visit the subscription page at https://lists.osmocom.org/mailman/listinfo/tetra |
53 | 3 | laforge | |
54 | 3 | laforge | This list is '''for discussion between software developers''' who intend to improve the |
55 | 3 | laforge | Osmocom TETRA software. It is not a forum for individuals asking how they can tap |
56 | 3 | laforge | into police radio (which is encrypted anyway). |
57 | 6 | laforge | |
58 | 6 | laforge | == FAQ == |
59 | 6 | laforge | We now have a [wiki:FAQ] (Frequently asked Questions) page! |
60 | 1 | ||
61 | 2 | laforge | == Demodulator == |
62 | 1 | ||
63 | 2 | laforge | src/demod/python/cpsk.py |
64 | 2 | laforge | * contains a gnuradio based pi4/DQPSK demodulator, courtesy of KA1RBI |
65 | 2 | laforge | src/demod/python/tetra-demod.py |
66 | 2 | laforge | * call demodulator on a 'cfile' containing complex baseband samples |
67 | 2 | laforge | src/demod/python/usrp1-tetra_demod.py |
68 | 2 | laforge | * use demodulator in realtime with a USRP1 SDR |
69 | 2 | laforge | src/demod/python/usrp2-tetra_demod.py |
70 | 2 | laforge | * use demodulator in realtime with a USRP2 SDR |
71 | 1 | ||
72 | 2 | laforge | The output of the demodulator is a file containing one float value for each symbol, |
73 | 2 | laforge | containing the phase shift (in units of pi/4) relative to the previous symbol. |
74 | 1 | ||
75 | 2 | laforge | You can use the "float_to_bits" program to convert the float values to unpacked |
76 | 2 | laforge | bits, i.e. 1-bit-per-byte |
77 | 1 | ||
78 | 1 | ||
79 | 2 | laforge | == PHY/MAC layer == |
80 | 2 | laforge | |
81 | 2 | laforge | === library code === |
82 | 2 | laforge | |
83 | 2 | laforge | Specifically, it implements: |
84 | 2 | laforge | lower_mac/crc_simple.[ch] |
85 | 2 | laforge | * CRC16-CCITT (currently defunct/broken as we need it for |
86 | 2 | laforge | non-octet-aligned bitfields) |
87 | 2 | laforge | lower_mac/tetra_conv_enc.[ch] |
88 | 2 | laforge | * 16-state Rate-Compatible Punctured Convolutional (RCPC) coder |
89 | 2 | laforge | lower_mac/tetra_interleave.[ch] |
90 | 2 | laforge | * Block interleaving (over a single block only) |
91 | 2 | laforge | lower_mac/tetra_rm3014.[ch] |
92 | 2 | laforge | * (30, 14) Reed-Muller code for the ACCH (broadcast block of |
93 | 2 | laforge | each downlink burst) |
94 | 2 | laforge | lower_mac/tetra_scramb.[ch] |
95 | 2 | laforge | * Scrambling |
96 | 2 | laforge | lower_mac/viterbi*.[ch] |
97 | 2 | laforge | * Convolutional decoder for signalling and voice channels |
98 | 2 | laforge | phy/tetra_burst.[ch] |
99 | 2 | laforge | * Routines to encode continuous normal and sync bursts |
100 | 2 | laforge | phy/tetra_burst_sync.[ch] |
101 | 2 | laforge | |
102 | 2 | laforge | |
103 | 2 | laforge | === Receiver Program === |
104 | 2 | laforge | |
105 | 2 | laforge | The main receiver program 'tetra-rx' expects an input file containing a |
106 | 2 | laforge | stream of unpacked bits, i.e. 1-bit-per-byte. |
107 | 2 | laforge | |
108 | 2 | laforge | |
109 | 2 | laforge | === Transmitter Program === |
110 | 2 | laforge | |
111 | 2 | laforge | The main program conv_enc_test.c generates a single continuous downlinc sync |
112 | 2 | laforge | burst (SB), contining: |
113 | 2 | laforge | * a SYNC-PDU as block 1 |
114 | 2 | laforge | * a ACCESS-ASSIGN PDU as broadcast block |
115 | 2 | laforge | * a SYSINFO-PDU as block 2 |
116 | 2 | laforge | |
117 | 2 | laforge | Scrambling is set to 0 (no scrambling) for all elements of the burst. |
118 | 2 | laforge | |
119 | 2 | laforge | It does not actually modulate and/or transmit yet. |
120 | 2 | laforge | |
121 | 2 | laforge | |
122 | 2 | laforge | == Quick example == |
123 | 2 | laforge | |
124 | 2 | laforge | assuming you have generated a file samples.cfile at a sample rate of 195.312kHz (100MHz/512 == USRP2 at decimation 512) |
125 | 2 | laforge | |
126 | 2 | laforge | {{{ |
127 | 2 | laforge | ./src/demod/python/tetra-demod.py -i /tmp/samples.cfile -o /tmp/out.float -s 195312 -c 0 |
128 | 2 | laforge | ./src/float_to_bits /tmp/out.float /tmp/out.bits |
129 | 2 | laforge | ./src/tetra-rx /tmp/out.bits |
130 | 2 | laforge | }}} |
131 | 1 | ||
132 | 1 | For a complete list of local wiki pages, see TitleIndex. |