Radio Receiver

An application to listen to radio transmissions from your browser using a cheap RTL-SDR stick.

What is Radio Receiver

Radio Receiver is an HTML5 webpage that uses an RTL-SDR USB stick to receive and digitize radio signals. Then, it demodulates those signals on your computer and plays the resulting audio through your computer's speakers or headphones.

Most RTL-SDR sticks let you receive signals in any frequency between 30 and 1700 MHz. This includes interesting radio bands like FM radio, marine radio, air band (airplanes and airports), weather radio, amateur radio, police and other emergency services, etc.

You may also be able to listen to frequencies below 30 MHz using an upconverter or some sticks' “direct sampling mode”. These frequencies include AM radio, shortwave radio, HF amateur radio, and numbers stations, among others.

Radio Receiver can demodulate stereo FM, AM, narrowband FM, USB, and LSB. It has adjustable bandwidth filters so you can also listen to Morse code transmissions or challenging, distant stations.

Radio Receiver was written by Jacobo Tarrío, and its source is available on GitHub.

Compatible hardware and software

Radio Receiver needs to run in a browser that supports the HTML5 USB API. Generally, this means a Chromium based-browser (Chrome, Edge, Opera) on a computer or on an Android device.

Radio Receiver was written to work with an RTL-2832U-based receiver with a R820 or R828 tuner chip (or compatible). In particular, the RTL-SDR Blog V3 and V4 sticks are supported, but old R820 or R860-based sticks should work too.

You may need to configure your computer to use an RTL-SDR stick if you use Windows or Linux (MacOS, Android, and Chrome OS usually work out of the box.)

Some things you need to know

How SDR works

Traditionally, radios were built entirely out of hardware components such as oscillators, inductors, capacitors, transistors, etc., that were selected and combined to receive and demodulate a particular type of signal. Therefore, each type of signal required its own hardware, and modifying a radio to receive a different signal could be hard or even impossible.

The modern approach to radio is “Software-Defined Radio” (SDR), in which the hardware only receives and digitizes the signals, and then a computer processes them with special software. SDR systems are flexible (changing the signals they can receive can be as simple as changing their software) and cheap, because the same hardware designs can be used for many different types of radio signals.

Your RTL-SDR stick was designed as a European Digital TV receiver. It contains a microprocessor that demodulates radio signals, extracts a video stream, and sends it to your computer. However, it can be made to send the signals to your computer instead of decoding them. Radio Receiver will then receive those signals and demodulate them in your browser.

Frequency, bandwidth, and sample rate

Your RTL-SDR stick works by tuning into a radio frequency, receiving radio signals around that frequency, digitizing them, and sending them to your computer.

Radio waves are electromagnetic fields that oscillate. The rate at which they oscillate is called the “frequency”, which is measured in Hertz (cycles per second.) Radio frequencies usually are in the thousands or millions of Hertz, so we often use kilohertz (kHz) for thousands of Hertz, or megahertz (MHz) for millions.

When you tune a receiver, you adjust it to receive a frequency. RTL-SDR sticks don't only receive signals in the exact frequency they are tuned into; instead they receive a “band” of frequencies. The difference between the lowest and highest frequencies in that band is the “bandwidth”.

“Digitizing” the signals in that frequency band means turning them into a stream of numbers (digital “samples”) that can be processed by a program running on a computer. The number of samples sent per second is the “sample rate”.

The bandwidth and the sample rate are tied together: 1 sample per second corresponds to 1 hertz of bandwidth. Therefore, more bandwidth lets you “see” more signals at once but requires more computing power to deal with a higher sample rate. Conversely, if you reduce the sample rate to use less computing power, you will receive a smaller bandwidth.

Modulation

Signals need to be “modulated” to be transmitted through the radio. This modulation is a scheme to modify the radio waves according to the content of the signal. The receiver can then “demodulate” the received radio waves to extract the original signal.

There are many modulation schemes. You have probably heard of FM and AM, which stand for “frequency modulation” and “amplitude modulation”, but there are many others. Radio Receiver can demodulate commercial FM and AM, and also narrowband FM (used in 2-way radios and weather radio), USB, and LSB (used in amateur radio.)

Decibels

The power of a radio signal is indicated in decibels (dB). Decibels are not units of measure like meters, pounds, liters, or acres: there is no “how big is a decibel.” Instead, they are units of comparison.

When engineers compare the power of two signals, they don't care if one is a little bit stronger than the other. They want to know if it's twice as strong, 10 times as strong, five million times as strong, one billionth the strength, and so on.

Decibels let us avoid having to use such big numbers by letting us know how many times we would have to multiply (or divide) our reference signal to be as strong as the signal we're measuring.

There is an exact formula, but normal people cannot do logarithms in their heads, so there is also a rule of thumb: you start with 0 dB; every time you double the power, you add 3 dB, and every time you multiply it by 10, you add 10 dB. Conversely, if you divide by 2 or 10, you subtract 3 or 10 dB.

So a signal twice as strong as the reference is 3 dB; 10 times as strong, 10 dB; one thousand times as strong, 30 dB (multiply by 10 three times); 5 million times as strong, 67 dB (multiply by 10 seven times then divide by 2), and one billionth is -90 dB (divide by 10 nine times.)

Upconverters and direct sampling

RTL-SDR sticks are designed to receive signals between 30 and 1700 MHz. However, there are many interesting signals below 30 MHz (AM radio, shortwave radio, lots of amateur radio, etc.) so people have come up with several ways to receive those frequencies with RTL-SDR.

One way to do it is by using an “upconverter”: a device that raises the frequency of signals to put them in the range that RTL-SDR sticks can receive. Some sticks have an integrated upconverter, while other upconverters are external devices.

Another way is to use “direct sampling mode”: a modification to the sticks by which the tuner chip is bypassed so the sampler chip receives the radio signals directly.

Radio Receiver supports sticks that have direct sampling mode and the RTL-SDR Blog V4 with its internal upconverter. It doesn't have explicit support for external upconverters, but you can use one by tuning into the modified frequency; so if your upconverter raises frequencies by 100 MHz and you want to receive an AM station on 830 kHz, you would tune into 100830 kHz.

How to use Radio Receiver

The main display

The main Radio Receiver display appears below, showing a few simulated radio signals to better illustrate how it works.

The main parts of this display are, from top to bottom: the spectrum scope, the waterfall, and the bottom bar.

The spectrum scope

The spectrum scope represents the frequency band that Radio Receiver is tuned into. The lowest frequency is in the left and the highest frequency is in the right, and the scale at the top shows which frequency corresponds to each part of the scope.

The yellow line “dancing” in the scope shows how much signal power is present on each frequency: the higher it goes, the more power there is. On the left, a decibel scale lets you gauge the amount of power. 0 dB is the maximum power that Radio Receiver can process, so all the numbers in the scale are negative.

In the figure above, you can see some strong signals on 93.5, 93.9, and 94.3 MHz, and a weak one on 94.1.

The waterfall

The spectrum scope shows you the signals that are being received right now, but the waterfall lets you see what signals were received in the past.

The waterfall scrolls down slowly, showing more recent signals at the top and less recent ones on the bottom. On each line, each pixel corresponds to a frequency and takes a brighter color if there is a strong signal in it.

With the waterfall, you can see if there are regular transmissions on neighboring frequencies, how wide they are, how often they repeat, and more important information. With enough practice, you can even tell what type of transmission it is!

The bottom bar

The bottom bar lets you adjust the decibel range for the spectrum scope and waterfall, and also lets you zoom in and out of a particular frequency range.

The contains the decibel range adjustment controls, which consists of two numbers separated by a “rainbow”. You can change the numbers directly, or you can drag the two sliders that appear on either side of the rainbow. As you do so, you will see changes in the decibel scale in the spectrum scope, and the new lines in the waterfall will change their colors.

The contains the zoom controls, which contain two “magnifier glass” buttons with a number in between. The “zoom in“ button increases the magnification level, while the “zoom out” button decreases it. The current magnification level is shown between the buttons; you can edit it directly if you prefer.

The contains a scrollbar that you can use to move around the spectrum when you are zoomed in. This works like a classic Windows scrollbar: click on the arrow buttons to scroll a little, click between the slider and the button to scroll one page, and drag the slider from side to side to scroll freely.

The main controls

The main Radio Receiver controls are shown below. They let you tune into a different frequency, change the signal demodulation parameters, and adjust the gain for your receiver.

Play/stop/settings

Press the “play“ button to start listening to the radio. When the radio is playing, the “play” button becomes the “stop” button , which you can press to stop listening.

Press the “settings” button to open the settings window.

Tuning

You have two frequencies to play with in Radio Receiver: the “center frequency” and the “tuning frequency”.

The center frequency determines the frequency band that you'll receive with your RTL-SDR stick. It is always the frequency in the center of your spectrum scope and waterfall.

The tuning frequency is the frequency within the received band that contains the signal you want to listen to.

To change either frequency, type it in the corresponding box. On the right, you can select the unit you'd like to use (Hz, kHz, or MHz); this unit is also used in the spectrum display.

In general, you can change the center or tuning frequency without changing the other, as long as the tuning frequency is within the frequency band in the spectrum scope. If it would fall outside of the band, the frequency you didn't change will be modified so that you can use the frequency you selected.

For example: if your center frequency is 93.9 with a 1 MHz-wide band and you set the tuning frequency to 94.1, the center frequency will stay at 93.9. However, if you change the tuning frequency to 88.3, the center frequency will also be changed to 88.3 so that your selected tuning frequency works.

The “tuning step” is most useful with the display controls, so it will be described with them.

Modulation

The next line lets you select a modulation scheme for the signal. You can choose between wideband FM (WBFM, used in commercial radio), narrowband FM (NBFM), AM, upper sideband (USB), and lower sideband (LSB). You need to match the modulation scheme to the signal you are receiving; otherwise, you'll only hear noise or gibberish.

You can also select a bandwidth for all schemes except WBFM. You generally need to match the bandwidth to the received signal, but you may sometimes need to use a reduced bandwidth if there are interfering signals near the one you are interested in.

For WBFM, you can enable and disable stereo reception. When stereo reception is enabled, the stereo indicator will turn green whenever a stereo signal is detected, or grey otherwise.

Tuner gain

Your RTL-SDR stick has an amplification circuit to boost the power of received signals. Its amplification level (“gain”) can be controlled automatically (“auto gain”) or manually through the main controls.

(When the RTL-SDR stick is in “direct sampling mode”, only automatic gain control is available.)

It is very useful to control the gain manually, but it has to be done judiciously. There is such a thing as “too much gain”. The recommendation is to have enough gain that you can receive your signal well, but not enough to raise the noise floor. This is how you do it:

First, uncheck “auto gain” and move the gain slider all the way to the left to set it to the minimum value. Adjust the decibel range in the spectrum scope so that the yellow line appears at the bottom.

Now, increase the gain slowly while you watch the spectrum scope. You should see some signals rise while the rest of the line stays at the bottom. At some point, the whole yellow line will start to go up; that's when you stop increasing the gain.

At this point, you'll have the best signal-to-noise ratio with the minimum amount of noise. If you kept increasing the gain, the signal level would go up but the noise would also rise with it. At some point, the noise would be so loud that it would swamp the demodulation algorithms, making the demodulated audio sound worse.

The display controls

There is a second set of controls available on the spectrum display, which you can manipulate by clicking and dragging with the mouse or touch screen.

Changing the tuned frequency

You can see a yellow vertical line surrounded by a highlighted area on top of the current tuned frequency. The yellow line indicates the frequency, and the white area indicates the modulation bandwidth.

You can change the tuned frequency by dragging the yellow line to the left and right with your mouse, or with your finger on touch screens.

You can also modify the bandwidth by dragging the edge of the white area to the left or right with your mouse or finger. (This does not work with WBFM because it uses a fixed bandwidth.)

Another way to change the tuned frequency is by clicking or tapping on a point on the screen that corresponds to the frequency you wish to tune into.

When you change the frequency by clicking or dragging, the frequency is always changed in increments of the “tuning step”, which can be set in the main controls window. This makes it easier to change frequencies accurately.

Changing the center frequency

You can change the center frequency by clicking and dragging the waterfall from side to side. The center frequency will change in increments of the selected frequency unit (Hz, kHz, or MHz.)

The settings window

You can open the settings window by clicking the “settings” button in the main controls window.

The “sample rate” setting lets you change the RTL-SDR stick's sample rate; that is the number of samples it captures per second. Note that, as you change the sample rate, the bandwidth that is visible in the spectrum display also changes (see the “frequency, bandwidth, and sample rate” section for more information.)

The “PPM correction” setting lets you make adjustments if your RTL-SDR stick is not exactly on frequency. By changing the value (which represents the frequency drift, in parts per million), you can make the RTL-SDR stick tune a little bit higher or lower until it's just right.

The “FFT size” setting lets you change the resolution of the spectrum display. Higher values result in more detailed spectra, at the cost of more processing power.