Project

General

Profile

Osmo-tetra » History » Revision 17

Revision 16 (laforge, 02/21/2016 08:01 AM) → Revision 17/21 (laforge, 02/21/2016 09:59 AM)

{{>toc}} 

 h1. Osmocom TETRA MAC/PHY layer experimentation code 


 This code aims to implement the sending and receiving part of the 
 TETRA MAC/PHY layer. 

 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. 


 h2. Big picture 


 {{graphviz_link() 
 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="tetra-demod.py" ]; 
 } 
 }} 

 h2. Source Code 

 The source code is available via read-only git access at 
 <pre> 
 git clone git://git.osmocom.org/osmo-tetra.git 
 </code></pre> 

 You can also browse the source code at http://cgit.osmocom.org/ 

 You will need "libosmocore":http://bb.osmocom.org/trac/wiki/libosmocore to link. 


 h2. Mailing List 

 There is a public mailing list regarding development of this project, you can 
 visit the subscription page at https://lists.osmocom.org/mailman/listinfo/tetra 

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


 h2. FAQ 

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


 h2. Demodulator 


 <pre> 
 ******** contains a gnuradio based pi4/DQPSK demodulator, courtesy of KA1RBI 
 <pre> 
 ******** call demodulator on a 'cfile' containing complex baseband samples 
 <pre> 
 ******** use demodulator in realtime with a USRP1 SDR 
 <pre> 
 ******** use demodulator in realtime with a USRP2 SDR 
 <pre> 
 <pre> 
 ******** use demodulator in realtime with a [[Funcube_Dongle]]. Please use the "qthid":https://github.com/csete/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 



 h2. PHY/MAC layer 



 h3. library code 


 Specifically, it implements: 

 <pre> 
 ******** CRC16-CCITT (currently defunct/broken as we need it for 
           non-octet-aligned bitfields) 
 <pre> 
 ******** 16-state Rate-Compatible Punctured Convolutional (RCPC) coder 
 <pre> 
 ******** Block interleaving (over a single block only) 
 <pre> 
 ******** (30, 14) Reed-Muller code for the ACCH (broadcast block of 
           each downlink burst) 
 <pre> 
 ******** Scrambling 
 <pre> 
 ******** Convolutional decoder for signalling and voice channels 
 <pre> 
 ******** Routines to encode continuous normal and sync bursts 
 <pre> 



 h3. Receiver Program 


 <pre> 
 stream of unpacked bits, i.e. 1-bit-per-byte. 



 h3. Transmitter Program 


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



 h2. Quick example 


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

 <pre> 
 ./src/demod/python/tetra-demod.py -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 
 </code></pre> 

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

 <pre> 
 mkfifo /tmp/out.float 
 mkfifo /tmp/out.bits 
 ./src/demod/python/fcdp-tetra_demod.py -D hw:1,0 -o /tmp/out.float 
 ... 
 </code></pre> 




 The most user friendly way is the script osmosdr-tetra_demod_fft.py which is based on "gr-osmosdr":http://sdr.osmocom.org/trac/wiki/GrOsmoSDR and supports various radio hardware (OsmoSDR, RTLSDR, FCD, UHD) as well as IQ file input. 

 * Adjust the center frequency (-f) and gain (-g) according to your needs. 
 * Use left click in Wideband Spectrum window to roughly select a TETRA carrier. 
 * In Wideband Spectrum you may also tune by 1/4 of the bandwidth at once by clicking on the rightmost/leftmost spectrum side. 
 * Use left click in Channel Spectrum window to fine tune the carrier by clicking on the left or right side of the spectrum. 

 !osmo-tetra-demod.png! [[Image(osmo-tetra-demod.png,25%)]] 

 For live capture call: 

 <pre> 
 src$ ./demod/python/osmosdr-tetra_demod_fft.py -o /dev/stdout | ./float_to_bits /dev/stdin /dev/stdout | ./tetra-rx /dev/stdin 
 </code></pre> 

 You may specify gr-osmosdr device arguments by using the --args commandline option. 

 To use a gnuradio .cfile as input: 

 <pre> 
 src$ ./demod/python/osmosdr-tetra_demod_fft.py -a "file=/path/to/tetra_sps1024e3.cfile,rate=1024e3,repeat=true,throttle=true" -o /dev/stdout | ./float_to_bits /dev/stdin /dev/stdout | ./tetra-rx /dev/stdin 
 </code></pre> 

 Note the mandatory rate argument and optional repeat & throttle arguments. 
Add picture from clipboard (Maximum size: 48.8 MB)