Project

General

Profile

SignalScopePage » History » Version 25

max, 04/22/2017 04:04 PM

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 17 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'
46 1 max
}}}
47
48 14 max
=== HackRF example ===
49
{{{
50 17 max
./scope.py --args 'hackrf'  -g 65 -f 412.34e6 -N  'RF:14,IF:32,BB:26' -o 50e3 -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 25 max
=== RTL-SDR Example ===
60
{{{
61
./scope.py --args 'rtl'  -g 65 -f 123.45e6 -N 'LNA:49' -V -v 0 -S 1000000 -q 39 -T trunk.tsv
62
}}}
63
64 11 max
=== Running in the Audio IF mode ===
65 1 max
66 5 max
Receivers equipped with an IF output in the sound card range can be used.  This is known as "audio IF" mode.
67
A soundcard sampling rate of 96K is used and the IF frequency (typically 24 KHz) is given using the {{{--calibration}}} parameter:
68
69
{{{
70 9 max
./scope.py -A -c 24e3 -g 50 -v 10
71 5 max
}}}
72
73 4 max
== Feature overview ==
74
75
 * Spectrum plot
76
 * Baseband oscilloscope
77 1 max
 * Eye Pattern Diagram (Datascope) display supporting several standard symbol rates
78 4 max
 * Constellation Diagrams
79
 * Demodulated Symbol Output
80 1 max
 * Correlation (including Fast Auto-Correlation)
81 6 max
 * Direct-frequency entry, signal gain and fine-tuning controls
82 1 max
 * User-selectable demodulator (FSK4 or QPSK)
83 16 max
 * Multi-system trunked receiver with IMBE voice support using the {{{-V}}} command line option (requires frequency-agile SDR receiver)
84 5 max
85 12 max
In the baseband AF (disc. tap) mode, several program functions are disabled (spectrum FFT, constellation diagram, PSK demod, FAC and iDEN correlation)
86
because these functions require direct access to the signal with no demodulation.
87 5 max
88
In all modes, the {{{--wireshark}}} option is used to write received P25 packet data to Wireshark.
89 1 max
90
== Program Options ==
91 10 max
92
Here is a full list of program options:
93
{{{
94
Usage: scope.py [options]
95
96
Options:
97
  -h, --help            show this help message and exit
98 14 max
  --args=ARGS           device args
99
  --antenna=ANTENNA     select antenna
100 10 max
  -a, --audio           use direct audio input
101
  -A, --audio-if        soundcard IF mode (use --calibration to set IF freq)
102
  -I AUDIO_INPUT, --audio-input=AUDIO_INPUT
103 1 max
                        pcm input device name.  E.g., hw:0,0 or /dev/dsp
104
  -i INPUT, --input=INPUT
105
                        input file name
106
  -b Hz, --excess-bw=Hz
107
                        for RRC filter
108
  -c Hz, --calibration=Hz
109
                        USRP offset or audio IF frequency
110
  -C Hz, --costas-alpha=Hz
111
                        value of alpha for Costas loop
112
  -f Hz, --frequency=Hz
113 10 max
                        USRP center frequency
114 14 max
  -F IFILE, --ifile=IFILE
115
                        read input from complex capture file
116
  -H HAMLIB_MODEL, --hamlib-model=HAMLIB_MODEL
117
                        specify model for hamlib
118
  -s SEEK, --seek=SEEK  ifile seek in K
119
  -S SAMPLE_RATE, --sample-rate=SAMPLE_RATE
120
                        source samp rate
121
  -t, --tone-detect     use experimental tone detect algorithm
122 15 max
  -T TRUNK_CONF_FILE, --trunk-conf-file=TRUNK_CONF_FILE
123
                        trunking config file name
124 10 max
  -v VERBOSITY, --verbosity=VERBOSITY
125
                        message debug level
126 14 max
  -V, --vocoder         voice codec
127
  -o Hz, --offset=Hz    tuning offset frequency [to circumvent DC offset]
128 10 max
  -p, --pause           block on startup
129 1 max
  -w, --wireshark       output data to Wireshark
130
  -W WIRESHARK_HOST, --wireshark-host=WIRESHARK_HOST
131
                        Wireshark host
132 14 max
  -r RAW_SYMBOLS, --raw-symbols=RAW_SYMBOLS
133
                        dump decoded symbols to file
134 10 max
  -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC
135
                        select USRP Rx side A or B (default=A)
136
  -g GAIN, --gain=GAIN  set USRP gain in dB (default is midpoint) or set audio
137
                        gain
138
  -G GAIN_MU, --gain-mu=GAIN_MU
139
                        gardner gain
140 14 max
  -N GAINS, --gains=GAINS
141
                        gain settings
142
  -O AUDIO_OUTPUT, --audio-output=AUDIO_OUTPUT
143
                        audio output device name
144 25 max
  -q FREQ_CORR, --freq-corr=FREQ_CORR
145
                        frequency correction
146 10 max
}}}
147
148 4 max
== Spectrum Display ==
149
150
[[Image(a.png)]]
151
152
The controls arranged along the bottom of the page are:
153
 * Frequency: to retune, type the new frequency here and press ENTER
154
 * Signal Gain: adjusts the baseband (demodulated) signal level
155
 * Fine Tune: adjusts tuning frequency over +/- 3000 Hz range
156
 * Demod: Selects demodulator (currently used in Demodulated Symbols only)
157
Except for the signal gain control, these controls are only available in USRP RX mode.
158
159
== Eye Pattern Diagrams ==
160
161
The scope input source can be connected either before or after the symbol filter using the Viewpoint toggle.
162
163
Also the proper speed must be selected from the available options.
164
165
[[Image(b.png)]]
166
167
== Constellation Diagram ==
168
169 7 max
[[Image(f.png)]]
170
171
The signal scope also features an angular population graph (shown above) in addition to the traditional constellation display.
172
In this mode the symbol magnitude (distance from center) is discarded.  Instead the circle is sliced into segments and a count
173
of symbols found in each segment is plotted.  This is similar to a histogram except that a straight line is drawn between each
174
result, and that the results are arranged in polar form instead of rectangular form.
175
176 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
177 13 max
between the demodulated symbols.  The plots below illustrate the difference, with poor separation showing on the left image as 
178
revealed by the failure to converge at the center and by the clear territorial violations:
179 1 max
180 8 max
[[Image(mhp7a.png)]][[Image(c.png)]]
181
182
The two-color mode is used in these images, providing natural relief to highlight the distinctive feature of π/4 DQPSK in which 
183
successive symbols are chosen from two distinct constellations (each containing four possible symbol values) separated by 45°
184
185 4 max
== Demodulated Symbols ==
186
187
[[Image(d.png)]]
188
189 1 max
== Correlation ==
190
191
[[Image(e.png)]]
192
193 9 max
Cross correlation allows rapid identification of signals with known characteristics.  Frame Sync (FS) signatures of several commonly
194
used radio systems are included.
195
196
By convention correlation results are usually displayed using positive correlation peaks only.  In this system
197
however it is possible (and legal) for negative correlation products to be produced.  This can occur for two wholly separate reasons:
198
 * If the hardware polarity is inverted 
199
 * When the FS symbols are purposely inverted as an integral part of protocol processing (commonly used in certain protocols but not used in P25)
200
201
The first case commonly happens when using the disc-tap method of hardware connection, because the actual polarity of the signal seems to vary 
202
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.
203
204
The P25 software framer automatically detects the proper polarity and issues a message if negative polarity data is received:
205
{{{
206
Reversed FS polarity detected - autocorrecting
207
}}}
208
209
The automatic correction applies only to software framing and doesn't help with correlation.  For correct results for both software framing and
210
correlation, you should correct the polarity reversal problem at its source; this is done using negative values for the {{{--gain}}} parameter at 
211
program start time:
212
213
{{{
214
./scope.py -a -v 10 -g -50
215
}}}
216
217
The second cause of negative correlation peaks is that some protocols (although not P25) make use of both normal- and inverted-polarity FS 
218
sequences as a standard part of their processing.   Instead of clogging the GUI menu with several choices that are merely inverses of others,
219 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.
220 9 max
Thus both + and - peaks are shown, allowing quick diagnosis of incorrect hardware polarity (see above), and allowing identification of the
221 12 max
particular family and sub-protocol in use.
222 9 max
223
== Auto Correlation ==
224
225 1 max
Also included is Frank's Fast Auto Correlation (fac):
226
227 8 max
[[Image(g.png)]]
228 9 max
229 1 max
For further details about Fast Auto Correlation refer to Frank's page at http://sites.google.com/site/radiorausch/
230
231 18 max
=== TRUNKING ===
232 17 max
233
New in late 2013, trunk following for multiple trunked P25 systems was added, supporting the following feature set:
234
  * Any number of separate trunked systems may be scanned
235
  * P25 Phase I (IMBE) voice channel decoding and audio output
236
  * Supports LSM/CQPSK systems that require CQPSK (not C4FM) demodulation in addition to C4FM systems
237
  * Since CQPSK demodulation is used, LSM simulcast distortion is suppressed (contrary to all current scanners)
238
  * In this release, systems and voice channels are scanned sequentially (like trunk tracking scanners)
239
  * Alpha tagging for talkgroup ID's
240
  * Per-system whitelist (closed group) support: only those talkgroups in the list are scanned
241
  * Per-system blacklist support: all talkgroups are scanned, except those listed
242
  * Configuration files are TSV (tab-separated); may be edited using spreadsheet software such as Libre office
243
  * Talkgroup ID hold: momentary delay after each voice transmission to allow following conversations
244
  * Manual talkgroup ID hold: click to pause, remains on current talkgroup until resumed
245
  * Manual lockout: click to lock out current talkgroup
246
  * All of the signal scope functions (see above) are live and may be selected in real time
247 21 max
  * Traffic history including list of active voice channels, key trunk control channel data, etc.
248 18 max
  * Hardware support provided by gr-osmosdr http://sdr.osmocom.org/trac/wiki/GrOsmoSDR including usrp/uhd, hackrf, and (in theory) RTL DVB-T based sticks etc.
249
The trunking code has not yet been merged into the master branch.  In the meantime after cloning the
250
repository you can issue this command to switch to the proper code branch:
251
252 1 max
{{{
253 25 max
git checkout max-trunking-update2
254 18 max
}}}
255
(you must first {{{cd}}} to the top level op25 project directory)
256
257
== Trunking Configuration ==
258
The primary configuration file {{{trunk.tsv}}} contains one line (or spreadsheet row) per trunked system
259 23 max
to be monitored. The file need not be named {{{trunk.tsv}}}; any name of your choice may be used, and is specified using the {{{-T}}} option.  The file contains the following information:
260 18 max
 * NAC: This is used as the "primary key" to tell different systems apart. 
261
 * Sysname: The name of the system (for display purposes)
262
 * Control Channel List: comma-separated list of trunk control channels.
263 19 max
 * Offset: if using a SDR with GPSDO, this value is not needed and should be set to zero.  Used for frequency drift correction.  The values shown are almost certainly incorrect for your system; the frequency error (drift) is different for every oscillator and is also almost always temperature dependent.  You can use the other functions of scope.py such as the eye diagram to determine the error (difference between nominal frequency and received frequency).
264 18 max
 * Modulation: C4FM or CQPSK
265
 * TGID Tags File: specifies the name of a TSV file for this system, containing alpha talkgroup ID tags
266
 * Whitelist: if set, the system is a "closed" system; only listed TGID's will be included
267 1 max
 * Blacklist: excludes listed TGID's
268 25 max
 * Center Frequency: set this to (Highest-Frequency-Channel - Lowest-Frequency-Channel) / 2 - and make sure it's at least (say) 50 KHz away from any active channel
269 1 max
270
Note: the first line of the file containing the field names must not be changed.
271 25 max
272
=== Software Tuning Mode ===
273
A new feature which helps to workaround a current problem with the RTL-SDR, the software Local Oscillator allows software tuning within the passband whose width is equal to the current sampling rate ({{{--sample-rate}}}) parameter.  Currently this seems to be limited to 2.56 MHz.
274
275
To use this mode
276
 * find the lowest (F1) and highest frequencies (F2) in the system
277
 * You will have to adjust F1 and F2 such that (F2-F1) is less than the selected sample rate
278
 * RTL SDR apparently supports rates higher than 2.56 MHz but there are reported problems
279
 * Find the center frequency = F1 plus one-half of (F2-F1)
280
 * Adjust the center frequency by a few tens of KHz if necessary to ensure it does not coincide with any of the system channel frequencies, to avoid DC offset
281
 * The higher the sample rate, the more CPU is used
282
 * If the system contains frequencies outside of the band from F1 to F2, tuning error messages will be issued but the remaining channels should still work
283 19 max
284
[[Image(t2.png)]]
285
286
== TSV Files ==
287
288
Use the following command to open a TSV file for editing:
289
290
{{{oocalc trunk.tsv}}}
291
292
Here are the options used when opening the file
293
294
[[Image(t1.png)]]
295 18 max
296 20 max
== Talkgroup ID Alpha Tags ==
297
298
There is usually a separate tags file for each system, although sometimes multiple systems can share a common set of tags.  The talkgroup ID (first column in each row) is in decimal (base 10).
299
300
[[Image(t3.png)]]
301
302 22 max
== Trunked Traffic ==
303
304
[[Image(t4.png)]]
305
306 8 max
== BUGS ==
307 1 max
308
Possibly bugs exist, here are a few of the known ones as of this writing
309
 * Symbol filters totally brain damaged (need separate filters for each speed)
310
 * When switching modes using the notebook tabs, leftover data from before may appear momentarily
311 11 max
 * Highest and lowest speeds are not well tuned resulting either in sluggish updates or CPU exhaustion
312 18 max
 * Currently ignores all except first frequency in list of trunk control frequencies
313 24 max
 * The selected tab may override the mode (C4FM vs. CQPSK); be sure to select "constellation" to enable CQPSK mode
314 11 max
== CREDITS ==
315
316 17 max
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, cross correlation, and trunk tracking features.
317 11 max
318
The Fast Auto Correlation (fac) code came from Radiorausch.
319
320
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.
321
322
Special thanks also to GPL(v3), for encouraging these mashups.
Add picture from clipboard (Maximum size: 48.8 MB)