User:Duggabe: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
(add ADALM-PLUTO)
Line 1: Line 1:
<!-- Guided_Tutorial_Hardware_Considerations -->
<!-- Guided_Tutorial_Hardware_Considerations -->
<!-- "Using GNU Radio with Hardware" -->
<!-- "Using GNU Radio with Hardware" -->
<!-- 04 May 2020 -->
= DRAFT REVISION Guided_Tutorial_Hardware_Considerations =
= DRAFT REVISION Guided_Tutorial_Hardware_Considerations =
== Introduction ==
== Introduction ==
Line 16: Line 17:
== What Will I Need? ==
== What Will I Need? ==


Even if you don't have an actual radio to work with, this tutorial is still useful. Perform the following steps:
Even if you don't have an actual radio to work with, this tutorial is still useful. The "Signal Processing" portion produces an FM radio with input from a pre-recorded file. To load that file, do the following steps:


* Go to https://github.com/gnuradio/gr-tutorial/blob/master/examples/tutorial6/fm_101.8MHz_1Msps.cfile in your browser and click Download.
* Go to https://github.com/gnuradio/gr-tutorial/blob/master/examples/tutorial6/fm_101.8MHz_1Msps.cfile in your browser and click Download.
Line 26: Line 27:


This tutorial is divided into two sections: "Signal Processing" and "Hardware". Various popular hardware devices are shown so that you can build with your available device.
This tutorial is divided into two sections: "Signal Processing" and "Hardware". Various popular hardware devices are shown so that you can build with your available device.
In the "Signal Processing" section we will build the Software Defined Radio (SDR) portion of the flowgraph and test it. Then, using that as a base, we will "plug in" a hardware device of your choice. So, <b>building the "Signal Processing" portion is required in any case</b>. After that, substituting a hardware device will follow easily.


=== GNU Radio Signal Processing ===
=== GNU Radio Signal Processing ===
Line 38: Line 41:
** id: FM_receive
** id: FM_receive
** Title: Broadcast FM receiver
** Title: Broadcast FM receiver
** enter other fields as desired
** click Apply
** click Apply
** click OK
** click OK
** click on File -> Save As&nbsp;&nbsp;Use the file name 'FM_receive'. the extension '.grc' is added automatically
** click on File -> Save As&nbsp;&nbsp;Use the file name 'FM_receive'. the extension '.grc' is added automatically


* Variable block
* Variable block - defines the sample rate for the flowgraph
** id: samp_rate
** id: samp_rate
** value: 384000
** value: 384000


* Variable block
* Variable block - defines the decimation factor for the rational resampler
** id: rf_decim
** id: rf_decim
** value: 1000
** value: 1000


* Variable block
* Variable block - defines the interpolation factor for the rational resampler
** id: interp
** id: interp
** value: 384
** value: 384


* Variable block
* Variable block - defines the FM modulation deviation in Hertz
** id: deviation
** id: deviation
** value: 75000
** value: 75000


* Variable block
* Variable block - defines the audio decimation factor for the FM demodulator
** id: audio_decim
** id: audio_decim
** value: 8
** value: 8


* The QT GUI Range block defines an Audio gain (volume) control
* The QT GUI Range block creates an Audio gain (volume) control
** id: volume
** id: volume
** default value: 0.3
** default value: 0.3
Line 70: Line 74:
** Widget: slider (or you can choose whichever you like)
** Widget: slider (or you can choose whichever you like)


* File Source
* File Source - reads the pre-recorded FM station data file
** File: /home/barry/Downloads/fm_101.8MHz_1Msps.cfile    (use your file path)
** File: /home/barry/Downloads/fm_101.8MHz_1Msps.cfile    (use your file path; you also can browse to find the file by clicking the three dots next to the filename)
** Output Type: Complex
** Output Type: Complex
** Repeat: Yes
** Repeat: Yes
** leave the other parameters as default values


The Rational Resampler interpolates (multiplies) the sample rate by the Interpolation factor and decimates (divides) the sample rate by the Decimation factor to produce the output sample rate. In the initial case, the 1MB input is divided by 1000 and multiplied by 384 to produce an output rate of 384000 samples per second.
* Rational Resampler
* Rational Resampler
** Type: Complex -> Complex (Complex Taps)
** Type: Complex -> Complex (Complex Taps)
** Interpolation: interp
** Interpolation: interp
** Decimation: rf_decim
** Decimation: rf_decim
** Taps: leave blank
** Fractional BW: 0


* FM Demod
* FM Demod - the 384kHz input signal is demodulated and then decimated by 8 to produce a 48kHz signal for the Audio Output.
** Channel Rate: samp_rate
** Channel Rate: samp_rate
** Audio Decimation: audio_decim
** Audio Decimation: audio_decim
Line 88: Line 96:


* The value of the volume control is used as a multiplier in the Multiply Const block.
* The value of the volume control is used as a multiplier in the Multiply Const block.
** IO Type: float
** Constant: volume
** Constant: volume


Line 96: Line 105:
==== Testing ====
==== Testing ====


Using GRC, click the Run icon or click Run -> Execute from the menu. After a few seconds, a GUI window will open with the Volume control and you should hear the radio station.
Using GRC, click the Run icon or click Run -> Execute from the menu. After a few seconds, a GUI window will open with the Volume control and you should hear the radio station. If it doesn't appear, look at your terminal screen for error messages.


To terminate the process cleanly, click on the 'X' in the upper corner of the GUI rather than using Control-C.
To terminate the process cleanly, click on the 'X' in the upper corner of the GUI rather than using Control-C.
Line 102: Line 111:
=== Hardware Front End ===
=== Hardware Front End ===


==== UHD / USRP ====
Now that you have gotten this far, you need to save a copy of your flowgraph before proceeding. On a terminal screen, enter
 
    cp -v FM_receive.grc FM_receive.sav
 
==== Preparation for hardware ====
 
For each of the hardware blocks presented below, we will be replacing the File Source block with a hardware block. In addition, four of the five Variable blocks may need to have new values. Each also will need a tuning function. For this, we will add a QT GUI Range block.
 
* The QT GUI Range block
** id: tuning
** default value: 99.1e6
** start: 87.9e6
** stop: 108.1e6
** step: 1e5
** Widget: Counter + Slider (or you can choose whichever you like)
 


==== ADALM-PLUTO ====
==== ADALM-PLUTO ====
The ADALM-PLUTO (PlutoSDR) is a portable, self-contained RF learning module which is supported by GNU Radio source and sink blocks. It can operate from 70MHz to 3.8GHz.
The actual source and sink blocks are created by an 'Industrial I/O' module. See https://wiki.analog.com/resources/tools-software/linux-software/gnuradio for details.
* Set the following Variables:
** id: samp_rate
** value: 1920000
** id: rf_decim
** value: 10
** id: interp
** value: 1
** id: audio_decim
** value: 4
* Delete the File Source block and replace it with a PlutoSDR Source block. Set the parameters as follows:
** TBD


==== RTL-SDR dongle ====
==== RTL-SDR dongle ====


==== FunCube Pro+ ====
==== FunCube Pro+ ====
==== UHD / USRP ====

Revision as of 21:28, 4 May 2020

DRAFT REVISION Guided_Tutorial_Hardware_Considerations

Introduction

One of the great strengths of GNU Radio is how easy it is to move from simulation to real-world operation. In this tutorial, we will build on what you have learned so far and create a complete FM radio receiver which you can use to listen to your local FM radio stations. Also we will discuss considerations that come into play when working with real-world radio hardware.

Prerequisites

What Will I Need?

Even if you don't have an actual radio to work with, this tutorial is still useful. The "Signal Processing" portion produces an FM radio with input from a pre-recorded file. To load that file, do the following steps:

This tutorial will be most useful, however, if you have a piece of radio hardware that you can use with GNU Radio. There are a large number of vendors who provide hardware with GNU Radio drivers. They span from very cheap $20 receivers to very high-performance tens-of-thousands-of-dollars systems. See Hardware for additional information.

Building an FM Radio Receiver

This tutorial is divided into two sections: "Signal Processing" and "Hardware". Various popular hardware devices are shown so that you can build with your available device.

In the "Signal Processing" section we will build the Software Defined Radio (SDR) portion of the flowgraph and test it. Then, using that as a base, we will "plug in" a hardware device of your choice. So, building the "Signal Processing" portion is required in any case. After that, substituting a hardware device will follow easily.

GNU Radio Signal Processing

Using gnuradio-companion (GRC) and the following Block descriptions, build this flowgraph:

FM receiver fg.png

Block descriptions

  • The Options block identifies the filename for the flowgraph, a title, author, etc.
    • id: FM_receive
    • Title: Broadcast FM receiver
    • enter other fields as desired
    • click Apply
    • click OK
    • click on File -> Save As  Use the file name 'FM_receive'. the extension '.grc' is added automatically
  • Variable block - defines the sample rate for the flowgraph
    • id: samp_rate
    • value: 384000
  • Variable block - defines the decimation factor for the rational resampler
    • id: rf_decim
    • value: 1000
  • Variable block - defines the interpolation factor for the rational resampler
    • id: interp
    • value: 384
  • Variable block - defines the FM modulation deviation in Hertz
    • id: deviation
    • value: 75000
  • Variable block - defines the audio decimation factor for the FM demodulator
    • id: audio_decim
    • value: 8
  • The QT GUI Range block creates an Audio gain (volume) control
    • id: volume
    • default value: 0.3
    • start: 0.0
    • stop: 1.0
    • step: 0.1
    • Widget: slider (or you can choose whichever you like)
  • File Source - reads the pre-recorded FM station data file
    • File: /home/barry/Downloads/fm_101.8MHz_1Msps.cfile (use your file path; you also can browse to find the file by clicking the three dots next to the filename)
    • Output Type: Complex
    • Repeat: Yes
    • leave the other parameters as default values

The Rational Resampler interpolates (multiplies) the sample rate by the Interpolation factor and decimates (divides) the sample rate by the Decimation factor to produce the output sample rate. In the initial case, the 1MB input is divided by 1000 and multiplied by 384 to produce an output rate of 384000 samples per second.

  • Rational Resampler
    • Type: Complex -> Complex (Complex Taps)
    • Interpolation: interp
    • Decimation: rf_decim
    • Taps: leave blank
    • Fractional BW: 0
  • FM Demod - the 384kHz input signal is demodulated and then decimated by 8 to produce a 48kHz signal for the Audio Output.
    • Channel Rate: samp_rate
    • Audio Decimation: audio_decim
    • Deviation: deviation
    • Audio Pass: 16000
    • Audio Stop: 20000
  • The value of the volume control is used as a multiplier in the Multiply Const block.
    • IO Type: float
    • Constant: volume
  • The speaker output is created by an Audio Sink block. The parameters are:
    • Sample rate: set to 48khz (use the pull-down)
    • Device name: for most speakers (or headphone jacks) built into the computer, the Device name can be left blank; for other cases, see Audio_Sink#Device_Name

Testing

Using GRC, click the Run icon or click Run -> Execute from the menu. After a few seconds, a GUI window will open with the Volume control and you should hear the radio station. If it doesn't appear, look at your terminal screen for error messages.

To terminate the process cleanly, click on the 'X' in the upper corner of the GUI rather than using Control-C.

Hardware Front End

Now that you have gotten this far, you need to save a copy of your flowgraph before proceeding. On a terminal screen, enter

   cp -v FM_receive.grc FM_receive.sav

Preparation for hardware

For each of the hardware blocks presented below, we will be replacing the File Source block with a hardware block. In addition, four of the five Variable blocks may need to have new values. Each also will need a tuning function. For this, we will add a QT GUI Range block.

  • The QT GUI Range block
    • id: tuning
    • default value: 99.1e6
    • start: 87.9e6
    • stop: 108.1e6
    • step: 1e5
    • Widget: Counter + Slider (or you can choose whichever you like)


ADALM-PLUTO

The ADALM-PLUTO (PlutoSDR) is a portable, self-contained RF learning module which is supported by GNU Radio source and sink blocks. It can operate from 70MHz to 3.8GHz.

The actual source and sink blocks are created by an 'Industrial I/O' module. See https://wiki.analog.com/resources/tools-software/linux-software/gnuradio for details.

  • Set the following Variables:
    • id: samp_rate
    • value: 1920000
    • id: rf_decim
    • value: 10
    • id: interp
    • value: 1
    • id: audio_decim
    • value: 4
  • Delete the File Source block and replace it with a PlutoSDR Source block. Set the parameters as follows:
    • TBD

RTL-SDR dongle

FunCube Pro+

UHD / USRP