Software
The following software examples are
written in Python and work with the USRP and GNU radio library to demodulate
and send the signal to the system's audio device (typically speakers).
USRP hardware is not required to listen to the samples.
There are a wide variety of signals located on the OTA
Capture page.
Capture To File
Capture to file is a simple utility
that records USRP samples to a file for post processing. The I/Q data
pairs are stored as 32-bit IEEE float point values in little endian format.
This is version 1.0 of the utility. The next version will
automatically generate the output file and verify the input parameters.
For now, this should get you started.
capture_to_file.py
The utility requires the following command
line parameters:
file_name - Where file_name is the output filename and path.
(Like you couldn't figure that out).
IF_freq_MHz - USRP tuning frequency in MHz where a negative frequency
number inverts the input spectrum.
decim_rate - Decimation rate down from 64MHz sampling clock rate.
duration_seconds - Length of recording in seconds where seconds is a
valid floating pointer number
In the first example, we capture a narrow band,
±128KHz
signal bandwidth. In the second, we capture a wider
±2MHz
bandwidth suitable for GPS signals. In the third example, we capture a
standard broadcast FM station with a bandwidth of
±256KHz.
In the final example, we capture a
±4MHz
bandwidth suitable for NTSC video.
[mgray@socata ~/py]$
capture_to_file.py narrowband_256k_complex.dat 10.7 250 30
[mgray@socata ~/py]$ capture_to_file.py gps_4msps_complex.dat
10.7 16 0.5
[mgray@socata ~/py]$ capture_to_file.py wbfm_512k_complex.dat 10.7
125 15
[mgray@socata ~/py]$ capture_to_file.py
ntsc_colorbars_8msps_complex.dat 10.7 8 0.5 |
AM
Demodulate good old fashioned AM
(Amplitude Modulation) that can be received with a 3 cent diode and ear
phone. But you're using $2500 worth of computer hardware and lots of
software. Oh well, its all good.
am_rcv.py
From the command line, run the program and
specify the input file name and tuning frequency in KHz. This application will run with only the GNU radio core and audio driver for
your system. No hardware is required.
In this example, the first two commands were used to listen to a recorded RF
file. The first example tunes to 10.000MHz and is radio station WWV.
The second tunes to 9.975MHz and is a SW broadcast station. In the
last example, the USRP hardware was used instead of a file and we listened
to 10.000MHz live.
[mgray@socata ~/py]$ am_rcv.py
hf_10000khz_256_complex.dat 0
[mgray@socata ~/py]$ am_rcv.py hf_10000khz_256_complex.dat -25
[mgray@socata ~/py]$ am_rcv.py usrp 0 |
Upper/Lower SSB
Demodulate upper and lower single
side band signals. Code based on
excellent set of samples from
http://webpages.charter.net/cswiger
ssb_rcv_file.py
From the command line, run the program and
specify the tuning frequency, BFO (tune to get best audio quality), and side
band selection. This application will run with only the GNU radio core and audio driver for
your system. No hardware is required.
For the OTA capture, the USRP IF was centered at 50.250MHz and the
suppressed carrier signal was transmitted on 50.350MHz. This 50Khz
offset is the second parameter specified in the command line. The BFO
is used to tune for best or most natural sound. SSB is very frequency
sensitive and less than 50Hz offset between the transmitter and receiver
will produce a "Donald Duck" sound. I've not yet calibrated the
sampling clock on the USRP hardware. One note, the USB signal demod is
not very clean. More investigation is required.
[mgray@socata ~/py]$
ssb_rcv_file.py ssb_lsb_256k_complex.dat 50000 1500 l
[mgray@socata ~/py]$ ssb_rcv_file.py ssb_usb_256k_complex.dat 50000
1500 u |
Narrow Band FM
The following code is useful
for tuning and listening to the NBFM sample set above. I've started to
comment the code, but it will require more to make it useful.
nfm_rcv_file.py
From the command line run the program and
specify the sample file and desired tuning channel. If you select a
frequency without a signal, you'll hear the classic FM background hiss.
This application will run with only the GNU radio core and audio driver for
your system. No hardware is required.
[mgray@socata py]$
nfm_rcv_file.py nws_nbfm_4_stations_256k_complex.dat -50 |
The following table shows the
tuning offset, its associated OTA frequency, and the transmitter location.
Because of terrain and the distance to the stations, signal strength varies.
Offset |
OTA Frequency |
Transmitter
Location |
Signal Level |
-75KHz |
162.400 MHz |
Flagstaff |
-97 dBm |
-50KHz |
162.425 MHz |
Payson (Mt. Ord) |
-85 dBm |
+25KHz |
162.500 MHz |
Globe (Signal Peak) |
-107 dBm |
+75KHz |
162.550 MHz |
Phoenix |
-111 dBm |
|