Pre-Lab2

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

First you will need the spectrum visualization software. For mac users, you will use gqrx. For windows users, you will use SDR# (“SDR sharp”).

Mac/Ubuntu user:

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.

The Gqrx download web page is

http://gqrx.dk/download

1. Look for Gqrx binary package for Mac OS X 10.11. The latest stable version is 2.11.5.

2. Once the file has downloaded, run the installer and move Gqrx into application folder.

Windows user:

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.

1. To install, please download this zip file: link

2. After that, extract the zip file and 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

3. Plug in your RTL-SDR USB dongle

4. Find zadig.exe file under the same folder (If you cannot find it or it cannot be executed, download zadig here)

5. In zadig.exe, go to "Options -> List all devices" and make sure this item is selected. If you are using Windows 10, in some cases you may need to also uncheck "Ignore Hubs or Composite Parents"

6. Select "Bulk-In, Interface (Interface 0)" from the drop down list.

Note on some PCs you may see something like RTL2832UHIDIR or RTL2832U instead of the bulk in interface. This is also a valid selection. Do not select "USB Receiver (Interface 0) or Interface 1" or anything else or you will overwrite that driver! Double check that USB ID shows "0BDA 2838 00" as this indicates that the dongle is selected.

7. We need to install the WinUSB driver, so also ensure that WinUSB is selected in the box after the arrow next to where it says Driver (this is the default selection).

Note that there has been some confusion for a few people over this step. The goal is to install the WinUSB driver. So to be clear, the box to the left of the arrow shows the currently installed driver, whereas the box to the right of the arrow shows the driver that will be installed in the next step. The first time you open zadig the box on the left will show either 'None', or the default DVB-T drivers installed by Windows (RTL2832UUSB), depending on your Windows configuration and version.

8. Click "Replace Driver"

If your computer tries to automatically find the driver for the dongle, you will experience installation failure. Simply turn off that, you will be able to proceed.

9. Open "SDRSharp.exe" in the folder, set the source drop down box to "RTL-SDR (USB)", and remember to adjust RF gain settings by by pressing the Configure button (looks like a cog) up the top next to the Play button. By default the RF gain is set at zero. A gain of zero will probably receive nothing but very strong broadcast FM - increase the gain until you start seeing other signals.

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

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:

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:

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!

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:

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:

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:

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:

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 GradeScope 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).