GRC Examples

On this page you will find a few software defined radio (SDR) examples implemented in the GNU Radio Companion aka GRC. They are very simple yet functional examples I created while I was learning GNU Radio and SDR. I hope other who are learning GNU Radio and SDR might also find them useful.

Note that these GRC scripts are not compatible with current GNU Radio. If you have GNU Radio 3.7 or later, use the grc_to_37.sh script to convert my GRC files to be compatible.

At the time of creation the only available hardware option was the USRP series from Ettus Research. Therefore, the examples use UHD sources and sinks, but there is nothing wrong with changing these to e.g. gr-osmosdr blocks. You will, however, need to also update the sample rates throughout the flow graphs according to the device you are using.

You will find that in many of the examples tuning is done using a frequency translating FIR filter rather than changing the USRP frequency. This is because on some daughterboards (e.g. WBX) tuning is not fast enough for the user moving a GUI slider. If you are only using a daughterboard that is fast enough you can conveniently change the flow graph to tune the USRP directly and remove the frequency translating filter.

If you are looking for theoretical material for learning digital signal processing and software defined radios see Suggested Reading on the GNU Radio website. If you are an absolute newbie to SDR (like I was when I started) and haven’t even got a clue of what quadrature signals are, I suggest you start with Quadrature Signals: Complex, But Not Complicated and the excellent tutorials at Complex2Real.com.

Most recently (2014), Michael Ossmann has started his educational series called Software Defined Radio with HackRF which can be used for learning DSP and SDR.

The examples are hosted on Github, see csete/gnuradio-grc-examples or create a local clone using

  git clone https://github.com/csete/gnuradio-grc-examples.git

Table of Contents

  1. Narrow Band FM receiver
  2. AM Receiver
  3. SSB/CW Receiver
  4. SSB Transmitter
  5. Recording IQ data using dynamic file names
  6. NOAA APT decoder

Narrow Band FM Receiver

This is a simple narrow band FM receiver with two NBFM demodulators to allow switching between 5 kHz and 2.5 kHz deviation.

  • Enter USRP frequency in a text field
  • Tune within the passband using frequency translating filter (fast tuning)
  • Variable filter width and shape
  • Squelch
  • Supports 5 kHz and 2.5 kHz deviation
  • Download the GRC file

The video below shows the narrow band FM receiver in action receiving the AO-51 amateur radio satellite using the USRP, WBX and an Arrow antenna.

AM Receiver

This is a simple AM receiver featuring a variable low pass filter and automatic gain control with fixed rate and levels.

  • Enter USRP frequency in a text field
  • Tune within the passband using frequency translating filter (fast tuning)
  • Variable filter width and shape
  • Automatic gain control
  • Download the GRC file

SSB/CW Receiver

This is a simple SSB/CW receiver featuring a complex band pass filter for side selection and automatic gain control with fast/medium/slow rate.

  • Enter USRP frequency in a text field
  • Tune within the passband using frequency translating filter (fast tuning)
  • Variable filter width, offset and shape
  • Sideband is selected using the filter
  • Automatic gain control (fast/medium/slow)
  • Download the GRC file

SSB Transmitter

This SSB transmitter is based on the simple principle of AM modulation. The audio input modulates the “carrier”, a complex sine wave with frequency 0 Hz. The result is an AM signal, which is the filtered using a  complex band pass filter to select the side band.

  • Enter USRP frequency in a text field
  • Tune within +/- 25 kHz of the USRP frequency
  • Variable filter width
  • Level controls for audio, carrier, signal and USRP gain
  • Download the GRC file for LSB and USB.

Recording IQ data using dynamic file names

Recording IQ data in GNU Radio companion is very easy, we simply add a filesink to the flow graph and connect it to the data we want to record. We can use the current date and time to generate a unique filename every time the GNU Radio flow graphs is started. This prevents previously recorded files to be deleted when we restart the flow graph . The usage of the Python datetime module for this purpose is explained in Dynamic File Names in GNU Radio Companion.

The flow graph shown below implements a simple WFM receiver for NOAA APT downlink and a simple IQ data recorder using this datetime trick.

To play back the recorded IQ data we simply replace the USRP source in the receiver with a file source and a throttle block, see more in Playback of the Recorded IQ Data.

Example GRC files for recording and playback are also included in the GIT repository – they are called xyz_rec.grc and xyz_play.grc.

NOAA APT decoder

A simple prototype for decoding Automatic Picture Transmission (APT) from the NOAA polar orbiting weather satellites is presented in this post. Instead of WAV file input you can connect it directly to the output of a WFM receiver like the one presented in the previous section. Be sure to use the correct sample rates in the band pass filter and the first resampler. The sample rate for the decoder must be 9.6 ksps.

Simple APT decoder

Sorry there is no GRC file, but it should be very easy to reproduce from the screenshot.

4 thoughts on “GRC Examples”

  1. Clicking on screenshots to (hopefully) view a larger, actually readable size results in a 404.

    Thanks

Comments are closed.