SignalScopePage » History » Version 16
max, 04/22/2017 04:04 PM
trunking updates part II
1 | 1 | max | = Signal Scope = |
---|---|---|---|
2 | |||
3 | == Installation == |
||
4 | |||
5 | 6 | max | Before running the scope app, check that the following standard pre-requisite packages are also installed: |
6 | 1 | max | * GNU Radio |
7 | * The op25 blocks |
||
8 | * The op25 repeater block |
||
9 | |||
10 | 14 | max | The osmosdr http://sdr.osmocom.org/trac/wiki/GrOsmoSDR package is required when using USRP or HackRF (or other hardware supported by osmosdr) |
11 | |||
12 | Additionally, hamlib http://sourceforge.net/apps/mediawiki/hamlib/index.php?title=Main_Page is (optionally) needed if using a frequency-agile receiver that is to be tuned using hamlib (see below) |
||
13 | |||
14 | The Python Numeric package is also needed when using autocorrelation. If you're running Debian or Ubuntu: |
||
15 | 6 | max | {{{ |
16 | apt-get install python-numeric |
||
17 | 1 | max | }}} |
18 | 6 | max | |
19 | 1 | max | Other than these pre-reqs, no special setup or installation is needed. |
20 | 11 | max | |
21 | 1 | max | == Targets == |
22 | 14 | max | * Choice of osmosdr(uhd / hackrf, etc), discriminator-tap, or "audio-IF" hardware modes |
23 | 1 | max | * Supports either GL or non-GL display mode |
24 | * Both FSK4 and CQPSK demodulation modes supported |
||
25 | 14 | max | * Lower and middle range PC hardware, not just the latest (optional features require more CPU) |
26 | 11 | max | |
27 | == Running the Program == |
||
28 | |||
29 | 14 | max | There are four overall options or modes depending on your hardware; these are |
30 | * Osmosdr |
||
31 | * Hamlib |
||
32 | 1 | max | * External receiver with discriminator tap connected to sound card |
33 | 11 | max | * External receiver with IF in the audio sound card range (e.g., 24 KHz), referred to as "audio IF" |
34 | 3 | max | |
35 | 1 | max | === Running with the disc-tap option === |
36 | |||
37 | 9 | max | The signal scope does not require the USRP. If you have a discriminator-tapped receiver, use the "-a" option: |
38 | 3 | max | {{{ |
39 | 1 | max | ./scope.py -a -v 10 -g 50 |
40 | }}} |
||
41 | |||
42 | 14 | max | === UHD example === |
43 | 1 | max | |
44 | {{{ |
||
45 | 16 | max | ./scope.py --args 'uhd,nchan=1,subdev=B:0' -g 65 -f 412.34e6 -o 50e3 -V -v 0 -T trunk.tsv -N 'ADC-pga:10,PGA0:29' -c 7500 |
46 | 1 | max | }}} |
47 | |||
48 | 14 | max | === HackRF example === |
49 | {{{ |
||
50 | 16 | max | ./scope.py --args 'hackrf' -g 65 -f 412.34e6 -N 'RF:14,IF:32,BB:26' -o 50e3 -c 2500 -T trunk.tsv -V -v 0 |
51 | 14 | max | }}} |
52 | |||
53 | === Hamlib example === |
||
54 | Two receivers in cascade (USRP with LFRX connected to the 455 KHz IF output terminal of hamlib-controlled receiver) |
||
55 | {{{ |
||
56 | 16 | max | ./scope.py --args 'uhd,nchan=1,subdev=A:A' -g 65 -f 455e3 -o 50e3 -V -v 0 -H 1234 -T trunk.tsv |
57 | 14 | max | }}} |
58 | |||
59 | 11 | max | === Running in the Audio IF mode === |
60 | 1 | max | |
61 | 5 | max | Receivers equipped with an IF output in the sound card range can be used. This is known as "audio IF" mode. |
62 | A soundcard sampling rate of 96K is used and the IF frequency (typically 24 KHz) is given using the {{{--calibration}}} parameter: |
||
63 | |||
64 | {{{ |
||
65 | 9 | max | ./scope.py -A -c 24e3 -g 50 -v 10 |
66 | 5 | max | }}} |
67 | |||
68 | 4 | max | == Feature overview == |
69 | |||
70 | * Spectrum plot |
||
71 | * Baseband oscilloscope |
||
72 | 1 | max | * Eye Pattern Diagram (Datascope) display supporting several standard symbol rates |
73 | 4 | max | * Constellation Diagrams |
74 | * Demodulated Symbol Output |
||
75 | 1 | max | * Correlation (including Fast Auto-Correlation) |
76 | 6 | max | * Direct-frequency entry, signal gain and fine-tuning controls |
77 | 1 | max | * User-selectable demodulator (FSK4 or QPSK) |
78 | 16 | max | * Multi-system trunked receiver with IMBE voice support using the {{{-V}}} command line option (requires frequency-agile SDR receiver) |
79 | 5 | max | |
80 | 12 | max | In the baseband AF (disc. tap) mode, several program functions are disabled (spectrum FFT, constellation diagram, PSK demod, FAC and iDEN correlation) |
81 | because these functions require direct access to the signal with no demodulation. |
||
82 | 5 | max | |
83 | In all modes, the {{{--wireshark}}} option is used to write received P25 packet data to Wireshark. |
||
84 | 1 | max | |
85 | == Program Options == |
||
86 | 10 | max | |
87 | Here is a full list of program options: |
||
88 | {{{ |
||
89 | Usage: scope.py [options] |
||
90 | |||
91 | Options: |
||
92 | -h, --help show this help message and exit |
||
93 | 14 | max | --args=ARGS device args |
94 | --antenna=ANTENNA select antenna |
||
95 | 10 | max | -a, --audio use direct audio input |
96 | -A, --audio-if soundcard IF mode (use --calibration to set IF freq) |
||
97 | -I AUDIO_INPUT, --audio-input=AUDIO_INPUT |
||
98 | 1 | max | pcm input device name. E.g., hw:0,0 or /dev/dsp |
99 | -i INPUT, --input=INPUT |
||
100 | input file name |
||
101 | -b Hz, --excess-bw=Hz |
||
102 | for RRC filter |
||
103 | -c Hz, --calibration=Hz |
||
104 | USRP offset or audio IF frequency |
||
105 | -C Hz, --costas-alpha=Hz |
||
106 | value of alpha for Costas loop |
||
107 | -f Hz, --frequency=Hz |
||
108 | 10 | max | USRP center frequency |
109 | 14 | max | -F IFILE, --ifile=IFILE |
110 | read input from complex capture file |
||
111 | -H HAMLIB_MODEL, --hamlib-model=HAMLIB_MODEL |
||
112 | specify model for hamlib |
||
113 | -s SEEK, --seek=SEEK ifile seek in K |
||
114 | -S SAMPLE_RATE, --sample-rate=SAMPLE_RATE |
||
115 | source samp rate |
||
116 | -t, --tone-detect use experimental tone detect algorithm |
||
117 | 15 | max | -T TRUNK_CONF_FILE, --trunk-conf-file=TRUNK_CONF_FILE |
118 | trunking config file name |
||
119 | 10 | max | -v VERBOSITY, --verbosity=VERBOSITY |
120 | message debug level |
||
121 | 14 | max | -V, --vocoder voice codec |
122 | -o Hz, --offset=Hz tuning offset frequency [to circumvent DC offset] |
||
123 | 10 | max | -p, --pause block on startup |
124 | 1 | max | -w, --wireshark output data to Wireshark |
125 | -W WIRESHARK_HOST, --wireshark-host=WIRESHARK_HOST |
||
126 | Wireshark host |
||
127 | 14 | max | -r RAW_SYMBOLS, --raw-symbols=RAW_SYMBOLS |
128 | dump decoded symbols to file |
||
129 | 10 | max | -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC |
130 | select USRP Rx side A or B (default=A) |
||
131 | -g GAIN, --gain=GAIN set USRP gain in dB (default is midpoint) or set audio |
||
132 | gain |
||
133 | -G GAIN_MU, --gain-mu=GAIN_MU |
||
134 | gardner gain |
||
135 | 14 | max | -N GAINS, --gains=GAINS |
136 | gain settings |
||
137 | -O AUDIO_OUTPUT, --audio-output=AUDIO_OUTPUT |
||
138 | audio output device name |
||
139 | 10 | max | }}} |
140 | |||
141 | 4 | max | == Spectrum Display == |
142 | |||
143 | [[Image(a.png)]] |
||
144 | |||
145 | The controls arranged along the bottom of the page are: |
||
146 | * Frequency: to retune, type the new frequency here and press ENTER |
||
147 | * Signal Gain: adjusts the baseband (demodulated) signal level |
||
148 | * Fine Tune: adjusts tuning frequency over +/- 3000 Hz range |
||
149 | * Demod: Selects demodulator (currently used in Demodulated Symbols only) |
||
150 | Except for the signal gain control, these controls are only available in USRP RX mode. |
||
151 | |||
152 | == Eye Pattern Diagrams == |
||
153 | |||
154 | The scope input source can be connected either before or after the symbol filter using the Viewpoint toggle. |
||
155 | |||
156 | Also the proper speed must be selected from the available options. |
||
157 | |||
158 | [[Image(b.png)]] |
||
159 | |||
160 | == Constellation Diagram == |
||
161 | |||
162 | 7 | max | [[Image(f.png)]] |
163 | |||
164 | The signal scope also features an angular population graph (shown above) in addition to the traditional constellation display. |
||
165 | In this mode the symbol magnitude (distance from center) is discarded. Instead the circle is sliced into segments and a count |
||
166 | of symbols found in each segment is plotted. This is similar to a histogram except that a straight line is drawn between each |
||
167 | result, and that the results are arranged in polar form instead of rectangular form. |
||
168 | |||
169 | 8 | max | With this display, the zone at the exact center of the plot can be used precisely to measure the degree of separation or margin |
170 | 13 | max | between the demodulated symbols. The plots below illustrate the difference, with poor separation showing on the left image as |
171 | revealed by the failure to converge at the center and by the clear territorial violations: |
||
172 | 1 | max | |
173 | 8 | max | [[Image(mhp7a.png)]][[Image(c.png)]] |
174 | |||
175 | The two-color mode is used in these images, providing natural relief to highlight the distinctive feature of π/4 DQPSK in which |
||
176 | successive symbols are chosen from two distinct constellations (each containing four possible symbol values) separated by 45° |
||
177 | |||
178 | 4 | max | == Demodulated Symbols == |
179 | |||
180 | [[Image(d.png)]] |
||
181 | |||
182 | 1 | max | == Correlation == |
183 | |||
184 | [[Image(e.png)]] |
||
185 | |||
186 | 9 | max | Cross correlation allows rapid identification of signals with known characteristics. Frame Sync (FS) signatures of several commonly |
187 | used radio systems are included. |
||
188 | |||
189 | By convention correlation results are usually displayed using positive correlation peaks only. In this system |
||
190 | however it is possible (and legal) for negative correlation products to be produced. This can occur for two wholly separate reasons: |
||
191 | * If the hardware polarity is inverted |
||
192 | * When the FS symbols are purposely inverted as an integral part of protocol processing (commonly used in certain protocols but not used in P25) |
||
193 | |||
194 | The first case commonly happens when using the disc-tap method of hardware connection, because the actual polarity of the signal seems to vary |
||
195 | randomly among different sound cards and receivers. In one actual case, two PC's of the same PC brand bought from the same store had opposite polarity. |
||
196 | |||
197 | The P25 software framer automatically detects the proper polarity and issues a message if negative polarity data is received: |
||
198 | {{{ |
||
199 | Reversed FS polarity detected - autocorrecting |
||
200 | }}} |
||
201 | |||
202 | The automatic correction applies only to software framing and doesn't help with correlation. For correct results for both software framing and |
||
203 | correlation, you should correct the polarity reversal problem at its source; this is done using negative values for the {{{--gain}}} parameter at |
||
204 | program start time: |
||
205 | |||
206 | {{{ |
||
207 | ./scope.py -a -v 10 -g -50 |
||
208 | }}} |
||
209 | |||
210 | The second cause of negative correlation peaks is that some protocols (although not P25) make use of both normal- and inverted-polarity FS |
||
211 | sequences as a standard part of their processing. Instead of clogging the GUI menu with several choices that are merely inverses of others, |
||
212 | 1 | max | just for the sake of always having positive-peaked correlations, we allow the correlation graph to reflect the natural polarity of the data. |
213 | 9 | max | Thus both + and - peaks are shown, allowing quick diagnosis of incorrect hardware polarity (see above), and allowing identification of the |
214 | 12 | max | particular family and sub-protocol in use. |
215 | 9 | max | |
216 | == Auto Correlation == |
||
217 | |||
218 | 1 | max | Also included is Frank's Fast Auto Correlation (fac): |
219 | |||
220 | 8 | max | [[Image(g.png)]] |
221 | 9 | max | |
222 | For further details about Fast Auto Correlation refer to Frank's page at http://sites.google.com/site/radiorausch/ |
||
223 | 8 | max | |
224 | == BUGS == |
||
225 | |||
226 | Possibly bugs exist, here are a few of the known ones as of this writing |
||
227 | 1 | max | * Symbol filters totally brain damaged (need separate filters for each speed) |
228 | * When switching modes using the notebook tabs, leftover data from before may appear momentarily |
||
229 | * Highest and lowest speeds are not well tuned resulting either in sluggish updates or CPU exhaustion |
||
230 | 11 | max | |
231 | == CREDITS == |
||
232 | |||
233 | I ripped off the "tabbed notebook" theme (and code) from Stevie; it already had the spectrum, baseband, and decoded symbol displays. I added the data scope, constellation scope, and cross correlation features. |
||
234 | |||
235 | The Fast Auto Correlation (fac) code came from Radiorausch. |
||
236 | |||
237 | Special thanks to Mossmann for leaving one commented-out "print" statement in c4fm-decode.py. Of course it was tempting to wonder "what would happen" if that statement were un-commented. The final result? The cross-correlation feature. |
||
238 | |||
239 | Special thanks also to GPL(v3), for encouraging these mashups. |