B200-B205mini FM Receiver: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
(adding commas)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
B200B/B205mini 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 Ettus Research B200/B205 mini 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 Ettus Research B200/B205 mini receiver.
 
The previous tutorial, [[RTL-SDR_FM_Receiver|RTL-SDR FM Receiver]], describes how to build a broadcast FM receiver using an RTL-SDR receiver.
 
The following hardware is needed for this tutorial:
* B200/B205mini Receiver
* B200/B205mini Receiver
* VHF Antenna
* VHF Antenna
Line 11: Line 17:
==Configure the USRP==
==Configure the USRP==


Start by dragging in the UHD: USRP Source block into the flowgraph. UHD is a library for communicating with the family of USRP radio receivers and the USRP Source simplifies and abstracts communication with all of the USRP radio receivers using a single block.
Start by dragging in the '''UHD: USRP Source''' block into the flowgraph. UHD is a library for communicating with the family of USRP radio receivers and the USRP Source simplifies and abstracts communication with all of the USRP radio receivers using a single block.


[[File:B200mini_FM_Receiver_add_usrp_block.png]]
[[File:B200mini_FM_Receiver_add_usrp_block.png]]


First change the samp_rate to 2 MHz, which will be the sampling rate for the USRP.
 
First change the ''samp_rate'' to 2 MHz, which will be the sampling rate for the USRP.


[[File:B200mini_FM_Receiver_change_samp_rate.png]]
[[File:B200mini_FM_Receiver_change_samp_rate.png]]


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. A QT GUI Range block will be used to define different radio station frequencies for the USRP. Drag in a QT GUI Range block, 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:
 
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. A '''QT GUI Range''' block will be used to define different radio station frequencies for the USRP. Drag in a '''QT GUI Range''' block, 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:B200mini_FM_Receiver_qt_gui_range_freq.png]]
[[File:B200mini_FM_Receiver_qt_gui_range_freq.png]]


Open the UHD: USRP Source block properties. Navigate to RF Options and then enter freq as the Center Frequency. Enable AGC.
 
Open the '''UHD: USRP Source''' block properties. Navigate to ''RF Options'' and then enter ''freq'' as the Center Frequency. Enable AGC.


[[File:B200mini_FM_Receiver_usrp_freq.png]]
[[File:B200mini_FM_Receiver_usrp_freq.png]]


The flowgraph should now look like the following. Note that the USRP block displays an updated sampling rate of 2 MHz, a center frequency of 87.9 MHz ,and an enabled AGC:
The flowgraph should now look like the following. Note that the USRP block displays an updated sampling rate of 2 MHz, a center frequency of 87.9 MHz, and an enabled AGC:


[[File:B200mini_FM_Receiver_updated_freq_samp_rate.png]]
[[File:B200mini_FM_Receiver_updated_freq_samp_rate.png]]
Line 33: Line 42:
==Add Time & Frequency Plots==
==Add Time & Frequency Plots==


Drag and drop a QT Time Sink and QT GUI Sink block into the flowgraph. Open the properties of the QT GUI Time Sink and enable autoscaling:
Drag and drop a '''QT GUI Time Sink''' and '''QT GUI Frequency Sink''' block into the flowgraph. Open the properties of the '''QT GUI Time Sink''' and enable autoscaling:


[[File:B200mini_FM_Receiver_time_sink_autoscale.png]]
[[File:B200mini_FM_Receiver_time_sink_autoscale.png]]


Open the properties of the QT GUI Freq Sink and enter freq as the Center Frequency:
 
Open the properties of the '''QT GUI Freq Sink''' and enter ''freq'' as the Center Frequency:


[[File:B200mini_FM_Receiver_freq_sink_freq.png]]
[[File:B200mini_FM_Receiver_freq_sink_freq.png]]


The flowgraph should now look like the following:
The flowgraph should now look like the following:


[[File:B200mini_FM_Receiver_basic_scanner_flowgraph.png]]
[[File:B200mini_FM_Receiver_basic_scanner_flowgraph.png]]


Run the flowgraph. A display window will show the time domain and frequency domain plots. The spectrum can be scanned by sliding the bar at the top of the screen or by entering a frequency manually.
Run the flowgraph. A display window will show the time domain and frequency domain plots. The spectrum can be scanned by sliding the bar at the top of the screen or by entering a frequency manually.


[[File:B200mini_FM_Receiver_basic_scanner_output.png|500px]]
[[File:B200mini_FM_Receiver_basic_scanner_output.png|500px]]


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


Drag in an Audio Source block. Open the properties. Note there are only a couple of options to select for the audio sampling rate. Select 48 kHz.
Drag in an '''Audio Sink''' block. Open the properties. Note there are only a couple of options to select for the audio sampling rate. Select 48 kHz.


[[File:B200mini_FM_Receiver_audio_sink_samp_rate.png]]
[[File:B200mini_FM_Receiver_audio_sink_samp_rate.png]]


The flowgraph should now look like the following:
The flowgraph should now look like the following:
Line 59: Line 73:
[[File:B200mini_FM_Receiver_flowgraph_audio_sink.png]]
[[File:B200mini_FM_Receiver_flowgraph_audio_sink.png]]


The question is how to get from the output of the USRP which is complex IQ sampled at 2 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 USRP.


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 question is how to get from the output of the USRP which is complex IQ sampled at 2 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 USRP.
 
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:B200mini_FM_Receiver_flowgraph_wbfm_receive.png]]
[[File:B200mini_FM_Receiver_flowgraph_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.


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


[[File:B200mini_FM_Receiver_wbfm_receive_properties.png]]
[[File:B200mini_FM_Receiver_wbfm_receive_properties.png]]


The flowgraph should now look like the following:
The flowgraph should now look like the following:
Line 75: Line 92:
[[File:B200mini_FM_Receiver_flowgraph_wbfm_set_properties.png]]
[[File:B200mini_FM_Receiver_flowgraph_wbfm_set_properties.png]]


A sample rate change is needed to convert from the USRP output of 2 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2000000 = 192/2000 = 12/125, 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 12 for the interpolation and 125 for the decimation:
A sample rate change is needed to convert from the USRP output of 2 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2000000 = 192/2000 = 12/125, 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 12 for the interpolation and 125 for the decimation:


[[File:B200mini_FM_Receiver_rational_resampler_properties.png]]
[[File:B200mini_FM_Receiver_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:B200mini_FM_Receiver_flowgraph_rational_resampler.png]]
[[File:B200mini_FM_Receiver_flowgraph_rational_resampler.png]]


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.
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:B200mini_FM_Receiver_final_output.png]]
[[File:B200mini_FM_Receiver_final_output.png|500px]]
 


==Diagnosing Overrun Problems==
==Diagnosing Overrun Problems==
When you run your flowgraph if you get a string of “OOOOOOOO” or messages about overflows 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:B200mini_FM_Receiver_sample_rate_overflows.png]]
The previous tutorial, [[RTL-SDR_FM_Receiver|RTL-SDR FM Receiver]], describes how to build a broadcast FM receiver using an RTL-SDR receiver.

Latest revision as of 22:36, 12 June 2024

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

This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the Ettus Research B200/B205 mini receiver.

The previous tutorial, RTL-SDR FM Receiver, describes how to build a broadcast FM receiver using an RTL-SDR receiver.

The following hardware is needed for this tutorial:

  • B200/B205mini Receiver
  • VHF Antenna

It is likely (but not guaranteed) that the Ettus Research B210/B200 will also work for this tutorial with no other modifications.

Please connect the antenna to the B200/B205mini, and plug the B200/B205 mini into the USB port on your computer.

Configure the USRP

Start by dragging in the UHD: USRP Source block into the flowgraph. UHD is a library for communicating with the family of USRP radio receivers and the USRP Source simplifies and abstracts communication with all of the USRP radio receivers using a single block.

B200mini FM Receiver add usrp block.png


First change the samp_rate to 2 MHz, which will be the sampling rate for the USRP.

B200mini FM Receiver change samp rate.png


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 [1], and each channel is separated by 200 kHz. A QT GUI Range block will be used to define different radio station frequencies for the USRP. Drag in a QT GUI Range block, 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:

B200mini FM Receiver qt gui range freq.png


Open the UHD: USRP Source block properties. Navigate to RF Options and then enter freq as the Center Frequency. Enable AGC.

B200mini FM Receiver usrp freq.png

The flowgraph should now look like the following. Note that the USRP block displays an updated sampling rate of 2 MHz, a center frequency of 87.9 MHz, and an enabled AGC:

B200mini FM Receiver updated freq samp rate.png

Add Time & Frequency Plots

Drag and drop a QT GUI Time Sink and QT GUI Frequency Sink block into the flowgraph. Open the properties of the QT GUI Time Sink and enable autoscaling:

B200mini FM Receiver time sink autoscale.png


Open the properties of the QT GUI Freq Sink and enter freq as the Center Frequency:

B200mini FM Receiver freq sink freq.png


The flowgraph should now look like the following:

B200mini FM Receiver basic scanner flowgraph.png


Run the flowgraph. A display window will show the time domain and frequency domain plots. The spectrum can be scanned by sliding the bar at the top of the screen or by entering a frequency manually.

B200mini FM Receiver basic scanner output.png


FM Demodulator

Drag in an Audio Sink block. Open the properties. Note there are only a couple of options to select for the audio sampling rate. Select 48 kHz.

B200mini FM Receiver audio sink samp rate.png


The flowgraph should now look like the following:

B200mini FM Receiver flowgraph audio sink.png


The question is how to get from the output of the USRP which is complex IQ sampled at 2 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 USRP.

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.

B200mini FM Receiver flowgraph 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.

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.

B200mini FM Receiver wbfm receive properties.png


The flowgraph should now look like the following:

B200mini FM Receiver flowgraph wbfm set properties.png


A sample rate change is needed to convert from the USRP output of 2 MHz to the WBFM input of 192 kHz. The required sampling rate change can be simplified as 192000/2000000 = 192/2000 = 12/125, 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 12 for the interpolation and 125 for the decimation:

B200mini FM Receiver rational resampler properties.png


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

B200mini FM Receiver flowgraph rational resampler.png


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.

B200mini FM Receiver final output.png


Diagnosing Overrun Problems

When you run your flowgraph if you get a string of “OOOOOOOO” or messages about overflows 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.

B200mini FM Receiver sample rate overflows.png

The previous tutorial, RTL-SDR FM Receiver, describes how to build a broadcast FM receiver using an RTL-SDR receiver.