Lab 2 Pre-lab (based on John Pauly's EE 179 Lab 1)

Overview

The USB dongles we passed out in class can directly digitize a 2.4 MHz segment of the RF spectrum, from 27 MHz up to 1.7 GHz. This can capture a large part of the RF spectrum, which we can then process in matlab, and extract the signals we want.

In this pre-lab we will install the USB software for your computer, and then use a real time spectral display to look at some of the different signals that are all around you.

Aim of the Pre-Lab

This pre-lab is mostly about getting your software working, and starting to look around at all of the signals that you are constantly being bombarded with.

Software Installation

There are two parts to the software you need.

The first is the device driver to control the SDR. Please follow the instructions on rtl-sdr install page first: https://inst.eecs.berkeley.edu/~ee123/sp16/rtl_sdr_install.html.

The second is the spectrum visualization software. For mac users, you will use gqrx. For windows users, you will use SDR#.

For MacOS and Ubuntu, we will use the gqrx program. This is a graphical interface that is built on top of gnu radio, an open source software defined radio project. When you download gqrx, you will also get the gnu radio libraries, as well as the command line programs we will use in the next labs.

The gqrx download web page is

http://gqrx.dk/download

The latest stable version is 2.5 It has, it has been recently updated, so should work for all OSX versions. Click the download tab at the top of the page, and then the MacOS icon. If you are ambitious you can use macports to get version 2.5, which works better and has some enhancements. However, it is a non-trivial process.

Once the file has downloaded, run the installer. The program will appear in the Applications folder.

Windows

For Windows we will use SDR#. This is the same sort of program as gqrx, but written in C# for Windows. The following install instructions are taken from http://www.rtl-sdr.com/rtl-sdr-quick-start-guide.

To install, please download this zip file: lab/lab2/sdrsharp-x86.zip

After that, double click on install-rtlsdr.bat from within the extracted folder. This will start a command prompt that will download all the drivers required to make SDRSharp work with RTL-SDR

SDR Sharp Install

sdrsharp_install

That should be enough to get you going. Double click on SDRSharp.exe to start. This worked right out of the box on a Windows laptop.

Commercial FM Radio

First, plug the antenna into your sdr, and the sdr into a USB socket on your computer. Then, start your program. We'll look at gqrx here, but SDR# is very similar, and has the same settings to adjust.

When you start gqrx, it will pop up a window for the device configuration

gqrx_config 

Set the sample rate to 2400000 (i.e. 2.4 MHz). Your computer and the sdr should keep up with this easily (if it does not, set it to 1000000). After clicking OK, gqrx will pop up:

gqrx_init 

Set the frequency offset in the upper right to 0.000 kHz, and then set the receiver frequency in the upper left to 88.500 000 MHz. This is KQED, which is a nice clean signal. Change the “Mode” pulldown on the right side of the screen to “Wide FM (Stereo)”. The display should look like this:

gqrx_kqed_init 

Now click the big button in the upper left corner. It looks like an on/off power button. With any luck, you should be listening to KQED!

gqrx_885 

The plot in the upper panel is the live spectrum that is being received, and has a range +/- 1.2 MHz, since you set the sampling rate to 2.4 MHz.

The lower panel is a waterfall plot. Each line in the image is the spectrum from the top panel, displayed with color encoding amplitude. It slowly scrolls down as you acquire longer. This plot is a great way to recognize different types of signals.

One useful setting is the receiver gain. To change this click on “Input Controls”, which will bring up a panel for controlling the SDR. The slider at the top adjusts the gain. If it is too low (to the left), the signal will be all noise. If it is too high (to the right) the receiver saturates, and the signal is distorted. The “A” button sets the gain automatically, which you generally don't want to do when you are looking for signals, since it will constantly be changing.

Go back to the “Receiver Options”. The top “Filter” pulldown sets how wide a bandwidth we are listening to. This is the shaded region on the live spectrum plot. On “Normal” it chooses something reasonable for whatever modulation we are receiving, so generally leave it there. The middle “Mode” pulldown selects how the receiver decodes the signal. Common choice are “AM”, used for aircraft and air traffic control, “Narrow FM” used for police and fire radio, and “Wide FM” used for commercial FM radio. We will talk about the other options later. The bottom “AGC” pulldown sets how rapidly the receiver adjusts for amplitude variations in the signal.

Try setting the center frequency to other stations that you know (such as 88.5). Often you will see several stations in the plot, as shown below:

gqrx_997 

Select any of them by clicking on them in the top panel. That will set the receiver offset.

The SDR# version looks like this, when tuned to KQED:

sdrsharp_885 

Choose “RTLSDR/USB” as the input, next to the stop/play button in the upper left. Aside from the color scale, one difference from gqrx is that the SDR gain and sampling rate is set by the “configure” button. Otherwise the controls are pretty much the same.

Police, Fire, Airport and Amateur Radio

There are several frequency bands that are used for public services, such as local police and fire. Unfortunately, for Berkeley-Oakland, the police, and some utilities have moved to a digital trunking system called Project 25, which is difficult to listen to without specialized software. Here's a list of some interesting frequencies you can look for:

airfield 

These frequencies are taken from http://radioreference.com

Note that you may need to find the right environment to be able to see lots of signals. Lots of devices spew RF. Campus buildings, like Cory, have a tremendous amount of interference. Also, buildings can screen signals. You may need to put your antenna in a window, or take your receiver outside, in order to improve your reception.

First, set your receive “Mode” pulldown to “Narrow FM”. This uses much less spectrum than commercial FM, and is commonly used for handheld communications such as police and fire. Click on any of the peaks in the upper plot. That will shift your receiver offset to that frequency. About half of the signals are digital, and will sound like dial-up modems. We'll talk about how these signals are encoded later in the class. The other half will be narrowband FM, and should be easy for you to decode. An example of narrow FM is the NOAA weather service. It's located at 162.40MHz. Tuning there, Your screen should look something like this:

NOAA 

Note, that there are probably more signals in the spectrum in the above figure, since its captured at my home in Moraga using a nice antenna. Here the receiver frequency is 162 MHz, and the receiver offset is +399.2 KHz, so that we are monitoring the frequency 162.3992 MHz. The frequencies won't be exactly those shown in the table, because the crystal in your SDR drifts with frequency. In fact, the frequency for NOAA weather off San Francisco should be 162.4. So this receiver has an offset of 800Hz, which is almost 5ppm. Yours might have a larger offset. I made a video a while back showing how to manually calibrate the frequency using GSM base station signal:

Another useful control is the squelch slider, labeled “SQL” on the “Receiver Controls”. Tune to a frequency that is only noise, and adjust the slider so that it just blanks the noise, and the speaker goes quiet. Then when you tune to an active frequency the signal will come through, but will blank again when the signal stops. This will annoy your roommates less!

There are lots of other frequencies where you can find narrow band FM signals. One is the police and fire band at about 154 MHz. Another are the amateur radio bands from 144-148 MHz, 220-225 MHz, and 420-450 MHz. There are many commercial users, like PG&E, right above 450 MHz. These are fun to listen to after a power failure. Another is the weather radio around 162.400 MHz, where different weather stations are separated by 25 kHz spacings.

Assignment

To show you have completed this lab, Upload a screen shot to bcourses of some frequency band where you have found narrow band FM signals. There are lots of other interesting frequency bands out there, that use other forms of modulation. Check out 463 MHz (lots of digital radio), 930 MHz (Paging), and 856 MHz (ATT cell phones).