There are a number of alternatives for hardware to capture a P25 baseband signal. These include:
- USRP (using TVRX daughterboard and appropriate antenna). * SSRP with an appropriate radio front-end and antenna. * Custom interface to existing scanner using soundcard for quadrature sampling. * Custom PSK to serial interface hardware (a "slicer").
For those without any hardware it is possible to investigate using signal samples which are available in the [source:trunk/samples repository] and described in the [source:trunk/samples/manifest.txt manifest].
Initial work is proceeding using the USRP which is available from [[http://ettus.com Ettus Research LLC]]. This is a relatively low-cost software radio (< 1000USD) that works with the GNURadio framework. The example USRP shown below shows a fully populated USRP with TX and RX capabilities as well as identifying the major components:
The USRP is capable of wideband reception and requires no special-purpose hardware as everything is done in software. A USRP with the TVRX daughterboard (not illustrated) and an appropriate antenna can be used out-of-the-box or the BasicRX card combined with an appropriate RF interface.
Sound Card Transmission¶
The audio_p25_tx.py script enables P25 transmission using PC soundcards and ordinary VHF/UHF radio transmitters.
Most existing FM radios require modification ("tapping") to bypass the audio filtering, both in receive and transmit. There's an existing online corpus of hints, tips, and information to assist in modifying these radios for "high speed" or "9600 packet" TX usage; for example, see
The author successfully utilized an old Kenwood TM-621A by applying a TX tap. The sound card audio output (headphone jack) was connected as follows: the ground line from the soundcard was connected to the radio chassis, through a short shield cable. The shielded signal lead was connected, through a series RC circuit consisting of a nonpolarized electrolytic capacitor in series with a 1K-ohm resistor, to the TX tap point in the transmitter. [A nonpolar electrolytic can be constructed from two equal (ordinary polarized) electrolytics by connecting the two of them together in series, with the "minus" leads connecting to each other, and the two "plus" leads forming the two conductors of our newly-created non-polar cap]. I used a pair of 1uF caps.
Not all radios appear to be equal. The 621 has two transmitters in one; the 144 MHz band appeared to have a high error rate, while the 220 MHz side was better, but not 100 per cent clean. The audio_p25_rx.py script should be used (along with a separate receiver) to scope the signal and make sure it's as clean as possible.
For soundcard use, generally the signal must be attenuated (volume lowered) before transmission, accomplished using the -f flag. Some transmitters also require a polarity reversal (-v). For test purposes, the input signal can be replayed over and over (-r).
./audio_p25_tx.py -v -r -i base.packed.dat -f 0.04
The sound card's transmit level (volume control setting) also affects this, and is usually controlled by a slider in your mixer app. The mixer volume setting and the -f flag (above) combine to set the overall the signal transmit level, which must be set within tight limits to insure proper reception, and carefully checked to insure standards compliance and proper (and legal) RF signal emission. The error rate is somewhat improved when the -f value and the mixer volume setting are properly set; these two adjustments interact, and are inversely proportional.
A newer TX program is also available.
./op25_audio_tx.py -n 1 -G 0.8
It takes audio in at 8000, encodes it and outputs an audio signal at 48000. YMMV, but it requires either a full duplex-capable sound card without any bleedthrough, or two separate sound cards with input to one and output from the second. This example shows one channel with mono operation at the sound card. To use two independent audio channels, specify the
-n 2 option.
C4FM audio levels must be carefully set. Here's one method:
* Start the audio_p25_rx. py program and tune to a known-good P25 station. Select the "Datascope" tab.
* Calibrate the audio level as shown on the Hardware page (-3/-1/+1/+3)
* With the proper audio gain setting now known and calibrated, tune the receiver to the test TX station.
* Without adjusting the RX gain, now adjust
* a) TX gain [-G option]
* b) the "speaker volume" gain slider(s) in your audio mixer app which governs the output soundcard channel(s)
* c) the "FM deviation pot" in the radio transmitter (if applicable).
You should adjust these gains to obtain precisely the same C4FM deviation as shown in the RX datascope for the known-good station.
The output gain (-G) option should probably not be set much higher than 1.0, but could be set lower. The -G interacts with the speaker volume slider in the mixer and they're inversely proportional. There is probably one or a range of "best" settings.
Also remember- * A professional [C4]FM deviation meter may be used to set the proper deviation value. * The transmitter output should be verified for proper spectral purity using a spectrum analyzer.
Sound Card Sampling¶
The ADC built into the soundcard of many home computers is capable of sampling at rates of up to 200KHz. Using the soundcard to quadrature sample the discriminator output of a receiver is a cheap and cheerful solution. Not all scanners provide a discriminator output but there are scanner modifications that that can be made when this is not provided as standard. This approach may require some custom interface circuitry and the filtering within the receiver will probably limit reception to a single channel.
Another approach for interfacing to existing scanners is to feed the discriminator output to a custom hardware circuit. Some are available built and tested from a variety of sources such as [[http://www.discriminator.nl/index-en.html discriminator.nl]]. This approach is low cost and pretty straightforward although limited to reception of a single-channel at a time.
Discriminator Tap with Sound Card¶
The scanner's discriminator tap output is fed directly into the sound card's line input, instead of into a custom external hardware circuit. It should be possible to run two radios simultaneously (one each on the left and right audio channels), although this configuration has not been tested. On my radio I found that adding a 10K-ohm resistor in series with the audio signal line was desirable. It has been rumored that adding a series capacitor in place of or in addition to the resistor is a bad idea. Some writers also suggest adding a small audio buffer amplifier stage, although I have found that unnecessary. A simple audio cable with standard stereo phone plugs on each end was used to complete the connection.
The author's system uses a standard sound card with the sampling rate set to 48K. Most sound cards should support at least this rate.
In terms of GNU Radio software blocks used to demodulate and decode P25 signals, input discriminator tap (baseband) audio is sampled and digitized and read using gnuradio audio.source(). The FM signal has already been demodulated (by hardware inside the radio), so the quadrature_demod_cf() (and its predecessor) signal processing blocks aren't needed; the input audio signal is fed directly to the symbol filter preceding the P25 FSK4 demodulator.
The "voltage level" of baseband audio signals input to the symbol filter block is critical. Amplification or attenuation (i.e., multiplication by a constant value greater than or less than unity, respectively) must be applied to bring the signal into the proper "voltage" range such that the symbol decision points appear at the standard (-3, -1, +1, +3) levels.
Unfortunately, the proper multiplication factor may vary. One method to get correct reception is to use your audio mixer application to set the proper signal level while viewing the symbol scope output. Tune the radio to a strong P25 signal. Starting with the volume control all the way down, the scope should display a single horizontal line. The scope should be set to use the plus "+" format. Slowly raise the audio level until the display breaks up into a band, which may weave up and down. Continue to increase the audio level until four distinct bands begin to appear, and the weaving should cease. The signal will overload eventually if you increase it too far. Adjust for best reception.
Another potential problem occurs due to inaccuracies in sound card sampling rates, and less severely due to variations in the symbol rates among different transmitter stations. This slop should be fully handled by the decoder used in this project, which applies phase and frequency correction; but some other decoders require a manual adjustment to ensure exact timing.
The audio_p25_rx.py application has a built-in gain control. To tune and decode a P25 station, select the "Datascope" tab, then adjust the gain control slider so that the signal points are at the standard -3, -1, +1, +3 levels:
Figure: P25 Receiver