RTL-SDR FM Receiver: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Cleaned up the entries for the various range properties. Corrected the information on the RTL-SDR.com v4 driver.)
 
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
RTL-SDR Based FM Receiver
<div style="float:right">
{{Template:BeginnerTutorials}}
</div>


This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the RTL-SDR receiver. The following hardware is needed for this tutorial:
This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the RTL-SDR receiver.
* RTL-SDR Receiver
* VHF Antenna


Please connect the antenna to the RTL-SDR, and plug the RTL-SDR into the USB port on your computer.
The previous tutorial, [[Reading_and_Writing_Binary_Files|Reading and Writing Binary Files]], demonstrates how to read and write radio waveform captures as binary files. The next tutorial, [[B200-B205mini_FM Receiver|B200-B205mini FM Receiver]], describes how to build a broadcast FM receiver using the Ettus Research B200/B205mini receiver.
 
The following hardware is needed for this tutorial:
* RTL-based SDR (aka "RTL-SDR"); this flowgraph has been tested on the Nooelec NESDR SMArt, the Nooelec Nano Three, the RTL-SDR.com v3, and a generic RTL-SDR with a R820T RF front end. The RTL-SDR.com v4 only works  if you've [https://www.rtl-sdr.com/V4/ loaded the v4 drivers].
* An antenna. As this is tutorial is designed to receive and demodulate FM broadcast signals, which operate in the range of 88 - 108 MHz, a VHF antenna designed to operate in this range is ideal. The number and quality of FM broadcast signals you will be able to receive is related to the how well the antenna operates within that range, as well as the distance between your receive antenna and the FM broadcast towers.
 
Connect the antenna to the RTL-SDR, and plug the RTL-SDR into the USB port on your computer.


==Configure the RTL-SDR==
==Configure the RTL-SDR==


Add the Soapy RTLSDR Source block to the flowgraph. Soapy [https://github.com/pothosware/SoapySDR] is a SDR support library which interfaces with different SDR hardware.
Add the '''Soapy RTLSDR Source''' block to the flowgraph. Soapy [https://github.com/pothosware/SoapySDR] is a SDR support library which interfaces with different SDR hardware.


[[File:RTL_SDR_FM_add_rtlsdr_block.png]]
[[File:RTL_SDR_FM_add_rtlsdr_block.png]]


The receiver needs to be configured with a proper sampling rate, center frequency and gain value. The RTL-SDR supports multiple sampling rates but in this tutorial the maximum sampling rate of 2.048 MHz is chosen. Update the ''samp_rate'' variable with the value 2048000:
[[File:RTL_SDR_FM_set_samp_rate.png]]


The receiver needs to be configured with a proper sampling rate, center frequency and gain value. The RTL-SDR supports multiple sampling rates but in this tutorial the maximum sampling rate of 2.048 MHz is chosen. Update the samp_rate variable with the value 2048000:
Notice that the sampling rate within the RTL-SDR block has been updated:


[[File:RTL_SDR_FM_set_samp_rate.png]]
[[File:RTL_SDR_FM_rtlsdr_updated_samp_rate.png]]
 
The RTL-SDR source block still has an undefined ''freq''. The ''freq'' variable needs to be given a frequency associated with a radio station. This tutorial uses the frequency allocations within the United State of America, therefore you will need to modify them according to the allocation for your country. Within the USA, the smallest frequency of a radio station is 87.9 MHz and the largest frequency is 107.9 MHz [https://en.wikipedia.org/wiki/FM_broadcasting_in_the_United_States], and each channel is separated by 200 kHz.


Add two (2) '''QT GUI Range''' blocks into the flowgraph. The properties need to be changed in order to incorporate the frequency allocations for broadcast FM as well as the adjustable gain of the RTL-SDR.


RTL-SDR source block still has an undefined freq. The freq variable needs to be given a frequency associated with a radio station. This tutorial uses the frequency allocations within the United State of America, therefore you will need to modify them according to the allocation for your country. Within the USA, the smallest frequency of a radio station is 87.9 MHz and the largest frequency is 107.9 MHz [https://en.wikipedia.org/wiki/FM_broadcasting_in_the_United_States], and each channel is separated by 200 kHz.  
Open the properties of the first '''QT GUI Range''' block and enter the following values:
* ID: freq
* Label: Center Frequency
* Default Value: the frequency of your favorite FM broadcast station. If you don't know, use the start frequency [https://mytuner-radio.com/radio/worldwide-frequencies/ for your country]. For example, [https://mytuner-radio.com/radio/country/rwanda-stations/frequency/fm Rwanda] runs from 87 - 108 MHz. You can use 87e6 for the default value. For this tutorial, we're using 88.5e6.
* Start: Use the start frequency of your country. This tutorial assumes the USA, which starts at 88 MHz. We're going to drop it down a little bit to 87.7e6.
* Stop: 107.9e6
* Step: Use the step size of your country. We're using 200 kHz (200e3), which is the USA separation.
* GUI Hint: 0,0,1,10


Add the QT GUI Range block into the flowgraph. The properties need to be changed in order to incorporate the frequency allocations for broadcast FM.
NOTE: We're going to use the ''GUI Hint'' properties for each of the '''QT GUI Range''' blocks so that they're at the top of the window created when you run the flowgraph.


Open the properties and give it the name freq and the start frequency of 87.9 MHz, the stop frequency of 107.9 MHz and a step of 200 kHz:
[[File:QT-GUI-Range-general-properties-freq-annotated.png]]


[[File:RTL_SDR_FM_qt_gui_range_properties.png]]
Open the properties of the second '''QT GUI Range''' block and enter the following values:
* ID: rfGain
* Label: RF Gain (dB)
* Default Value: 10
* Start: 0
* Stop: 50
* Step: 1
* GUI Hint: 1,0,1,10


Many RTL-SDRs operate from the Rafael Micro R820T, R820T2 or R828D (RTL-SDR.com v4) RF chip. They use an amplifier that allow for a set of 29 values ranging from 0 - 49.6. The start, stop and step size listed here will get you pretty close to those values without having to enter each of the 29 values as a separate vector. Trust us. This is easier.


The freq variable within the Soapy RTLSDR Source block is now defined. The flowgraph should look like the following:
[[File:QT-GUI-Range-general-properties-rfGain-annotated.png]]


[[File:RTL_SDR_FM_flowgraph_with_qt_gui_range.png]]
The ''freq'' variable within the '''Soapy RTLSDR Source''' block is now defined. The flowgraph should look like the following:


[[File:RtlsdrFmReceiverSourceOnly.jpg]]


Open the Soapy RTLSDR Source block properties. Navigate to the RF Options and enter True for AGC.
Open the '''Soapy RTLSDR''' Source block properties. Navigate to the ''RF Options'' and enter ''rfGain'' within the ''RF Gain'' window:


[[File:RTL_SDR_FM_set_AGC.png]]
[[File:Soapy-RTLSDR-Source-RF-Options-properties-annotated.png]]


==Add Time & Frequency Plots==
==Add Time & Frequency Plots==


Drag in a QT GUI Time Sink and QT GUI Frequency Sink. Enable the auto-scaling in the QT GUI Time Sink block:
Drag in a '''QT GUI Time Sink''' and '''QT GUI Frequency Sink''':


[[File:RTL_SDR_FM_time_sink_autoscale.png]]
Open the '''QT GUI Frequency Sink''' and enter ''freq'' as the Center Frequency (Hz):


[[File:RTL_SDR_FM_freq_sink_center_freq.png]]


Open the QT GUI Frequency Sink and enter freq as the Center Frequency (Hz):
Connect the '''QT GUI Time Sink''' and '''QT GUI Frequency Sink''' blocks:


[[File:RTL_SDR_FM_freq_sink_center_freq.png]]
[[File:RtlsdrFmReceiverNoDemod.jpg]]


Run the flowgraph. A time plot and frequency plot will be displayed. This simple flowgraph represents a basic tuner application, such that dragging the slider bar or entering a frequency manually will retune the RTL-SDR and start producing sampled data.


Connect the QT GUI Time Sink and QT GUI Freq Sink blocks:
[[File:RTL-SDR-FM-Receiver-10-gain.png|500px]]


[[File:RTL_SDR_FM_basic_scanner_flowgraph.png]]
Due to the nature of the RTL-SDR and how it presents data to Gnu Radio, a '''QT GUI Time Sink''' at the output of the RTL-SDR source block gives an indication of signal strength and potential overload. The image above, with the ''RF Gain'' set to 10, shows the data in the time sink as relatively low amplitude. Depending on the antenna connected to your specific RTL-SDR, your time domain may be higher or lower amplitude. Further, your spectral display (the '''QT GUI Frequency Sink''') will also appear differently.  


Adjusting the ''RF Gain'' value higher adds gain to the RF front end of the RTL-SDR. This will boost the signal strength and increase the signal-to-noise ratio (SNR). For example, increasing the gain to 31 dB will increase the amplitude within the time sink, as shown below:


Run the flowgraph. A time plot and frequency plot will be displayed. This simple flowgraph represents a basic tuner application, such that dragging the slider bar or entering a frequency manually will retune the RTL-SDR and start producing sampled data.
[[File:RTL-SDR-FM-Receiver-31-gain.png|500px]]


[[File:RTL_SDR_FM_basic_scanner_plots.png|500px]]
Increasing the gain to where the amplitudes within the time sink are close to, but not surpassing, the top and bottom of the display (with limits set to +/-1, which is the default) is optimal for proper reception.


==FM Demodulator==
==FM Demodulator==


An Audio Sink block is needed to play the sound of a demodulated FM radio station. Drag in an Audio Sink block and open the properties. Notice there are a couple choices for sampling rates to choose from. Select 48 kHz:
An '''Audio Sink''' block is needed to play the sound of a demodulated FM radio station. Drag in an '''Audio Sink''' block and open the properties. Notice there are a couple choices for sampling rates to choose from. Select '''48 kHz''':


[[File:RTL_SDR_FM_audio_sink_properties.png]]
[[File:RTL_SDR_FM_audio_sink_properties.png]]


The flowgraph should now look like the following:


The question is how to get from the output of the RTL-SDR which is complex IQ sampled at 2.048 MHz to the input of the Audio Sink block which requires real samples at a sampling rate of 48 kHz? The rest of this tutorial will work backwards from the Audio Sink and establishing blocks and connections towards the output of the RTL-SDR.
[[File:RTL_SDR_FM_flowgraph_with_audio_sink.png]]


[[File:RTL_SDR_FM_audio_sink_properties.png]]
The question is how to get from the output of the RTL-SDR which is complex IQ sampled at 2.048 MHz to the input of the '''Audio Sink''' block which requires real samples at a sampling rate of 48 kHz? The rest of this tutorial will work backwards from the '''Audio Sink''' and establishing blocks and connections towards the output of the RTL-SDR.


The next block that is needed is the an FM demodulator. Drag in the WBFM Receive block, which takes complex IQ as an input, demodulates the FM thereby producing real output samples and also performs a decimation.
The next block that is needed is the an FM demodulator. Drag in the '''WBFM Receive''' block, which takes complex IQ as an input, demodulates the FM thereby producing real output samples and also performs a decimation.


[[File:RTL_SDR_FM_add_wbfm_receive.png]]
[[File:RTL_SDR_FM_add_wbfm_receive.png]]




Recall from earlier in the tutorial that FM broadcast channels allocated 200 kHz, therefore we want to process as much of that bandwidth as possible with the FM demodulator. The WBFM Receive block can perform a decimation from a larger input sampling rate to the required Audio Sink input of 48 kHz. The decimation factor must be an integer, and 4*48 kHz = 192 kHz which is close to the total bandwidth of the frequency allocation.
Recall from earlier in the tutorial that FM broadcast channels allocated 200 kHz, therefore we want to process as much of that bandwidth as possible with the FM demodulator. The '''WBFM Receive''' block can perform a decimation from a larger input sampling rate to the required '''Audio Sink''' input of 48 kHz. The decimation factor must be an integer, and 4*48 kHz = 192 kHz which is close to the total bandwidth of the frequency allocation.


Open the WBFM Receive properties and enter in the quadrature rate of 192 kHz and an audio decimation of 4. Note that the quadrature rate must be evenly divisible by the audio decimation factor, and that the audio decimation must be an integer.
Add a '''WBFM Receive''' block, open the properties and enter in the quadrature rate of 192 kHz and an audio decimation of 4. Note that the quadrature rate must be evenly divisible by the audio decimation factor, and that the audio decimation must be an integer.


[[File:RTL_SDR_FM_wbfm_receive_properties.png]]
[[File:RTL_SDR_FM_wbfm_receive_properties.png]]
Line 86: Line 118:




A sample rate change is needed to convert from the RTL-SDR output of 2.048 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2048000 = 192/2048 = 3/32, a rational ratio. Therefore the Rational Resampler block can be used to implement the sample rate change.
A sample rate change is needed to convert from the RTL-SDR output of 2.048 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2048000 = 192/2048 = 3/32, a rational ratio. Therefore the '''Rational Resampler''' block can be used to implement the sample rate change.


Drag in the Rational Resampler block and open the properties. Enter 3 for the interpolation and 32 for the decimation:
Drag in the '''Rational Resampler''' block and open the properties. Enter 3 for the interpolation and 32 for the decimation:


[[File:RTL_SDR_FM_rational_resampler_properties.png]]
[[File:RTL_SDR_FM_rational_resampler_properties.png]]


The flowgraph is now complete and should look like the following.
The flowgraph is now complete and should look like the following.
[[File:RTL-SDR-FM-Receiver-original.jpg|800px]]
Run the flowgraph. The same GUI window that was displayed previously will appear but now audio should be playing through your computer. You can drag the bar at the top of the screen to tune to different channels.
[[File:RTL-SDR-FM-Receiver-90M9CF.png|500px]]
==Diagnosing Overrun Problems==
When you run your flowgraph if you get a string of “aUaUaU” and the audio comes in and out periodically then you have probably entered a sample rate wrong somewhere along the way. Double check all of the sample rate values and interpolation and decimation rate changes.
[[File:RTL_SDR_FM_sample_rate_overflows.png]]
== Additional Feature - Volume Control ==
An additional you can add to this flowgraph is a volume control. Volume is controlled by the amplitude of the signal going into the [[Audio Sink]]. We'll add another [[QT GUI Range]] block as well as a [[Multiply Const]] block to adjust the volume. Place the '''Multiply Const''' block between the '''WBFM Receive''' and '''Audio Sink''' blocks. Your flowgraph should be similar to this:
[[File:RTL-SDR-FM-Receiver-with-volume-control.jpg|800px]]
Open the properties for the just-added '''QT GUI Range''' block and enter the following values:
* ID: volume
* Label: Volume (dB)
* Default Value: -6
* Start: -100
* Stop: 10
* Step: 0.1
* GUI Hint: 3,0,1,10
[[File:RTL-SDR-FM-Receiver-volume-range-properties-annotated.png|600px]]
Open the properties of the '''Multiply Const''' block and enter the following values:
* IO Type: float
* Constant: 10**(volume/20)
[[File:RTL-SDR-FM-Receiver-Multiply-Const-properties-annotated.png]]
Run the flowgraph. Now the display will have a slider for the audio volume, as shown below. Using decibel (dB, a logarithmic scale) values as opposed to linear values (e.g. 0 - 100, for example) means that the audio adjustments will more closely follow human hearing, which is also logarithmic. Values less than 0 will lower the volume, while values greater than 0 will raise the volume. A value of 0 will be no change in the amplitude. NOTE: Amplitudes greater than 1 or less than -1 going into an '''Audio Sink''' block will typically cause audio distortion.
[[File:RTL-SDR-FM-Receiver-display-with-volume-control.png]]
== Next Tutorial - Ettus Research B200/B205mini Receiver ==
The next tutorial, [[B200-B205mini_FM Receiver|B200-B205mini FM Receiver]], describes how to build a broadcast FM receiver using the Ettus Research B200/B205mini receiver.

Latest revision as of 17:39, 19 July 2025

Beginner Tutorials

Introducing GNU Radio

  1. What is GNU Radio?
  2. Installing GNU Radio
  3. Your First Flowgraph

Flowgraph Fundamentals

  1. Python Variables in GRC
  2. Variables in Flowgraphs
  3. Runtime Updating Variables
  4. Signal Data Types
  5. Converting Data Types
  6. Packing Bits
  7. Streams and Vectors
  8. Hier Blocks and Parameters

Creating and Modifying Python Blocks

  1. Creating Your First Block
  2. Python Block With Vectors
  3. Python Block Message Passing
  4. Python Block Tags

DSP Blocks

  1. Low Pass Filter Example
  2. Designing Filter Taps
  3. Sample Rate Change
  4. Frequency Shifting
  5. Reading and Writing Binary Files

SDR Hardware

  1. RTL-SDR FM Receiver
  2. B200-B205mini FM Receiver
  3. E310 FM Receiver

This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the RTL-SDR receiver.

The previous tutorial, Reading and Writing Binary Files, demonstrates how to read and write radio waveform captures as binary files. The next tutorial, B200-B205mini FM Receiver, describes how to build a broadcast FM receiver using the Ettus Research B200/B205mini receiver.

The following hardware is needed for this tutorial:

  • RTL-based SDR (aka "RTL-SDR"); this flowgraph has been tested on the Nooelec NESDR SMArt, the Nooelec Nano Three, the RTL-SDR.com v3, and a generic RTL-SDR with a R820T RF front end. The RTL-SDR.com v4 only works if you've loaded the v4 drivers.
  • An antenna. As this is tutorial is designed to receive and demodulate FM broadcast signals, which operate in the range of 88 - 108 MHz, a VHF antenna designed to operate in this range is ideal. The number and quality of FM broadcast signals you will be able to receive is related to the how well the antenna operates within that range, as well as the distance between your receive antenna and the FM broadcast towers.

Connect the antenna to the RTL-SDR, and plug the RTL-SDR into the USB port on your computer.

Configure the RTL-SDR

Add the Soapy RTLSDR Source block to the flowgraph. Soapy [1] is a SDR support library which interfaces with different SDR hardware.

RTL SDR FM add rtlsdr block.png

The receiver needs to be configured with a proper sampling rate, center frequency and gain value. The RTL-SDR supports multiple sampling rates but in this tutorial the maximum sampling rate of 2.048 MHz is chosen. Update the samp_rate variable with the value 2048000:

RTL SDR FM set samp rate.png

Notice that the sampling rate within the RTL-SDR block has been updated:

RTL SDR FM rtlsdr updated samp rate.png

The RTL-SDR source block still has an undefined freq. The freq variable needs to be given a frequency associated with a radio station. This tutorial uses the frequency allocations within the United State of America, therefore you will need to modify them according to the allocation for your country. Within the USA, the smallest frequency of a radio station is 87.9 MHz and the largest frequency is 107.9 MHz [2], and each channel is separated by 200 kHz.

Add two (2) QT GUI Range blocks into the flowgraph. The properties need to be changed in order to incorporate the frequency allocations for broadcast FM as well as the adjustable gain of the RTL-SDR.

Open the properties of the first QT GUI Range block and enter the following values:

  • ID: freq
  • Label: Center Frequency
  • Default Value: the frequency of your favorite FM broadcast station. If you don't know, use the start frequency for your country. For example, Rwanda runs from 87 - 108 MHz. You can use 87e6 for the default value. For this tutorial, we're using 88.5e6.
  • Start: Use the start frequency of your country. This tutorial assumes the USA, which starts at 88 MHz. We're going to drop it down a little bit to 87.7e6.
  • Stop: 107.9e6
  • Step: Use the step size of your country. We're using 200 kHz (200e3), which is the USA separation.
  • GUI Hint: 0,0,1,10

NOTE: We're going to use the GUI Hint properties for each of the QT GUI Range blocks so that they're at the top of the window created when you run the flowgraph.

QT-GUI-Range-general-properties-freq-annotated.png

Open the properties of the second QT GUI Range block and enter the following values:

  • ID: rfGain
  • Label: RF Gain (dB)
  • Default Value: 10
  • Start: 0
  • Stop: 50
  • Step: 1
  • GUI Hint: 1,0,1,10

Many RTL-SDRs operate from the Rafael Micro R820T, R820T2 or R828D (RTL-SDR.com v4) RF chip. They use an amplifier that allow for a set of 29 values ranging from 0 - 49.6. The start, stop and step size listed here will get you pretty close to those values without having to enter each of the 29 values as a separate vector. Trust us. This is easier.

QT-GUI-Range-general-properties-rfGain-annotated.png

The freq variable within the Soapy RTLSDR Source block is now defined. The flowgraph should look like the following:

RtlsdrFmReceiverSourceOnly.jpg

Open the Soapy RTLSDR Source block properties. Navigate to the RF Options and enter rfGain within the RF Gain window:

Soapy-RTLSDR-Source-RF-Options-properties-annotated.png

Add Time & Frequency Plots

Drag in a QT GUI Time Sink and QT GUI Frequency Sink:

Open the QT GUI Frequency Sink and enter freq as the Center Frequency (Hz):

RTL SDR FM freq sink center freq.png

Connect the QT GUI Time Sink and QT GUI Frequency Sink blocks:

RtlsdrFmReceiverNoDemod.jpg

Run the flowgraph. A time plot and frequency plot will be displayed. This simple flowgraph represents a basic tuner application, such that dragging the slider bar or entering a frequency manually will retune the RTL-SDR and start producing sampled data.

RTL-SDR-FM-Receiver-10-gain.png

Due to the nature of the RTL-SDR and how it presents data to Gnu Radio, a QT GUI Time Sink at the output of the RTL-SDR source block gives an indication of signal strength and potential overload. The image above, with the RF Gain set to 10, shows the data in the time sink as relatively low amplitude. Depending on the antenna connected to your specific RTL-SDR, your time domain may be higher or lower amplitude. Further, your spectral display (the QT GUI Frequency Sink) will also appear differently.

Adjusting the RF Gain value higher adds gain to the RF front end of the RTL-SDR. This will boost the signal strength and increase the signal-to-noise ratio (SNR). For example, increasing the gain to 31 dB will increase the amplitude within the time sink, as shown below:

RTL-SDR-FM-Receiver-31-gain.png

Increasing the gain to where the amplitudes within the time sink are close to, but not surpassing, the top and bottom of the display (with limits set to +/-1, which is the default) is optimal for proper reception.

FM Demodulator

An Audio Sink block is needed to play the sound of a demodulated FM radio station. Drag in an Audio Sink block and open the properties. Notice there are a couple choices for sampling rates to choose from. Select 48 kHz:

RTL SDR FM audio sink properties.png

The flowgraph should now look like the following:

RTL SDR FM flowgraph with audio sink.png

The question is how to get from the output of the RTL-SDR which is complex IQ sampled at 2.048 MHz to the input of the Audio Sink block which requires real samples at a sampling rate of 48 kHz? The rest of this tutorial will work backwards from the Audio Sink and establishing blocks and connections towards the output of the RTL-SDR.

The next block that is needed is the an FM demodulator. Drag in the WBFM Receive block, which takes complex IQ as an input, demodulates the FM thereby producing real output samples and also performs a decimation.

RTL SDR FM add wbfm receive.png


Recall from earlier in the tutorial that FM broadcast channels allocated 200 kHz, therefore we want to process as much of that bandwidth as possible with the FM demodulator. The WBFM Receive block can perform a decimation from a larger input sampling rate to the required Audio Sink input of 48 kHz. The decimation factor must be an integer, and 4*48 kHz = 192 kHz which is close to the total bandwidth of the frequency allocation.

Add a WBFM Receive block, open the properties and enter in the quadrature rate of 192 kHz and an audio decimation of 4. Note that the quadrature rate must be evenly divisible by the audio decimation factor, and that the audio decimation must be an integer.

RTL SDR FM wbfm receive properties.png


The flowgraph should now look like the following:

RTL SDR FM flowgraph with WBFM.png


A sample rate change is needed to convert from the RTL-SDR output of 2.048 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2048000 = 192/2048 = 3/32, a rational ratio. Therefore the Rational Resampler block can be used to implement the sample rate change.

Drag in the Rational Resampler block and open the properties. Enter 3 for the interpolation and 32 for the decimation:

RTL SDR FM rational resampler properties.png

The flowgraph is now complete and should look like the following.

RTL-SDR-FM-Receiver-original.jpg

Run the flowgraph. The same GUI window that was displayed previously will appear but now audio should be playing through your computer. You can drag the bar at the top of the screen to tune to different channels.

RTL-SDR-FM-Receiver-90M9CF.png

Diagnosing Overrun Problems

When you run your flowgraph if you get a string of “aUaUaU” and the audio comes in and out periodically then you have probably entered a sample rate wrong somewhere along the way. Double check all of the sample rate values and interpolation and decimation rate changes.

RTL SDR FM sample rate overflows.png

Additional Feature - Volume Control

An additional you can add to this flowgraph is a volume control. Volume is controlled by the amplitude of the signal going into the Audio Sink. We'll add another QT GUI Range block as well as a Multiply Const block to adjust the volume. Place the Multiply Const block between the WBFM Receive and Audio Sink blocks. Your flowgraph should be similar to this:

RTL-SDR-FM-Receiver-with-volume-control.jpg

Open the properties for the just-added QT GUI Range block and enter the following values:

  • ID: volume
  • Label: Volume (dB)
  • Default Value: -6
  • Start: -100
  • Stop: 10
  • Step: 0.1
  • GUI Hint: 3,0,1,10

RTL-SDR-FM-Receiver-volume-range-properties-annotated.png

Open the properties of the Multiply Const block and enter the following values:

  • IO Type: float
  • Constant: 10**(volume/20)

RTL-SDR-FM-Receiver-Multiply-Const-properties-annotated.png

Run the flowgraph. Now the display will have a slider for the audio volume, as shown below. Using decibel (dB, a logarithmic scale) values as opposed to linear values (e.g. 0 - 100, for example) means that the audio adjustments will more closely follow human hearing, which is also logarithmic. Values less than 0 will lower the volume, while values greater than 0 will raise the volume. A value of 0 will be no change in the amplitude. NOTE: Amplitudes greater than 1 or less than -1 going into an Audio Sink block will typically cause audio distortion.

RTL-SDR-FM-Receiver-display-with-volume-control.png

Next Tutorial - Ettus Research B200/B205mini Receiver

The next tutorial, B200-B205mini FM Receiver, describes how to build a broadcast FM receiver using the Ettus Research B200/B205mini receiver.