Project

General

Profile

DecoderPage » History » Version 4

matt, 10/26/2017 12:49 AM

1 4 matt
h1. Decoder
2 1 zecke
3
The OP25 decoder program demodulates and decodes P25 signals and produces an audio stream and a queue of error-corrected APCO Project 25 frames. A block diagram of the major decoder functions is shown below:
4
5 2 matt
!receiver.png!
6 1 zecke
7
The steps involved in this process are:
8
9
 1. Sample the radio spectrum (the USRP can sample 6MHz or so at once or 480 APCO Project 25 channels!).
10
 1. Filter the original signal with an appropriate channel filter.
11
 1. Demodulate the symbol stream.
12
 1. Decode the P25 frames.
13
  1. Correlate the bit stream using the Frame Synchronization (FS) field.
14
  1. Aggregate of bit stream into octets and frames (partitioned by an FS).
15
  1. Apply error detection and correction.
16
  1. Decode IMBE audio frames and produce a mono audio output stream.
17
  1. Encapsulate assembled frames in IP and send them for further processing.
18
19 4 matt
h2. Sampling
20
21 1 zecke
The [HardwarePage USRP] allows us to receive a wideband spectrum consisting of many channels at once. Using the analysis_filterbank block these channels can be divided into equal-width channels and processed in parallel. Whatever the source of the samples it will be necessary to filter the incoming signal and correct for any frequency offset.
22
For example, the [source:trunk/samples/sample-complex-250KSS.dat example signal] has the peak hold spectrum is shown below.
23
24 2 matt
!original-sample-fft-peak.png!
25 1 zecke
26
Notice that in this example there is a peak at approximately +27.5KHz which is the center frequency of a P25 signal. A 12.5KHz low-pass filter is used extract the channel of interest and has extremely good selectivity. Once the original signal has been filtered results in a [source:trunk/samples/baseband-complex-250KSS.dat baseband signal] with the following peak-hold spectrum:
27
28 2 matt
!baseband-fft-peak.png!
29 1 zecke
30
When displayed as a float signal on an oscilloscope the baseband signal shows a nice clean APCO Project 25 signal:
31
32
!baseband-oscope-snapshot.png!
33 2 matt
34 4 matt
h2. Demodulator block
35
36 1 zecke
The demodulator block is responsible for transforming the baseband signal into a symbol stream. The phase I and phase II signals have been defined such that a single C4FM or π/4 DQPSK receiver can demodulate both signals. π/4 DQPSK means that there is a shift in the constellation by 45 degrees every symbol - what would otherwise be a 0 degree phase shift (00) becomes a +45 degree phase shift. This minimizes the phase transition between successive symbols so the maximum is +135 degrees instead of +180. This minor change in the modulator that lowers the bandwidth of the signal and permits the transmitter power amplifier more leeway in terms of linearity and spectral regrowth.
37
38
The [http://radiorausch.googlepages.com/GnuradioFourLevelFSK.html Radio Rausch FSK4 demodulator] is a GNURadio demodulator block that demodulates P25 signal and recovers one of four frequencies that are trivially mapped back into symbols. Each symbol comprises a pair of bits and the signal maps between the dibit symbol and audio frequency/phase shifts according to the following specification:
39
40
  ||Dibits||Symbol||CQPSK Phase Change (degrees)||C4FM Deviation (KHz)||
41
  ||01    ||+3    ||+135                        ||+1.8                ||
42
  ||00    ||+1    ||+45                         ||+0.6                ||
43
  ||10    ||-1    ||-45                         ||-0.6                ||
44
  ||11    ||-3    ||-135                        ||-1.8                ||
45
46
The output from the demodulator block is fed to the decoder block which combines the tasks of correlation, frame assembly, error correction and decoding.
47
48 4 matt
h3. Decoder block
49
50 1 zecke
The bit stream on its own provides no clues as to where the beginning of an octet or frame should be. We need to spot the FS, a fixed 48 bit pattern, to determine where the beginning occurs. Once a frame has begun the decoder is responsible for aggregating symbols into frames, applying the many different error detection and correction schemes.
51
APCO Project 25 uses Golay, Reed-Solomon and Hamming error correcting codes to guarantee that data survives errors in reception. For LDU1 and LDU2 frames the IMBE voice content is decoded into an audio stream and for all frames the error-corrected contents are written to a message queue for processing by Python (in our case writing to file or using scapy to write to the loopback device).
52
53 4 matt
h3. Write packets to socket for further processing
54
55 1 zecke
At this point the GNURadio framework has served its purpose and we feed the output to its final destination. The diagram above uses the loopback device to allow for using packet sniffers and tunneling P25 to another site. A modified version of the !WireShark program will, for example, allow for packet sniffing of the P25 traffic (for more details see the WireSharkPage) including the use of capture and display filters. Later versions have used TUN/TAP and we are now encapsulating the P25 traffic in UDP and multicasting it to all stations that want to process such traffic (this would include !WireShark, traffic logging and so on).
56
57 2 matt
!wireshark.png!
58 1 zecke
59
Other programs can be written to further process the voice and data streams using the output of the decoder block.
60
61 3 matt
h3. Further Pointers
62
63 1 zecke
 * [source:/trunk/audio/encrypted-p25-as-nbfm.mp3 MP3 audio recording of an encrypted P25 signal when received as NBFM.]
64
 * [http://www.p25.com/resources/P25TrainingGuide.pdf P25 Systems Training Guide from Daniels Electronics Ltd.]
65
 * [http://radiorausch.googlepages.com/GnuradioFourLevelFSK.html Radio Rausch FSK4 demodulator] The 4-level FSK demodulator used to demodulate the signal.
Add picture from clipboard (Maximum size: 48.8 MB)