Project

General

Profile

SignalScopePage » History » Version 1

zecke, 04/22/2017 04:19 PM

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