FM HD Radio decode from I/Q files

NOTE: This guide is a work in progress so things may change over time to correct errors and make it easier to understand. Screenshots are currently outdated due to suggesting RF64 instead of old wav files. They will be updated at a later time.

It is possible to decode FM HD radio from I/Q files from for example SDR-Console or SDR#.

This guide assumes you already have SDR Console installed. You will need this for Datafile Editor. See here for a guide on how to use it.

You will need GNURadio and the NRSC5 application. Most linux distributions have GNURadio packages. For use of GNURadio on Windows see here

Due to copyright and patent issues I am unable to provide a binary download of NRSC5. You will need to build it yourself. The github repo has insturctions on how to do this.

You can download Geof Nieboer's of GNUradio 3.8.2 here but this is not recommended due to being a very old and unsupported build of GNUradio. It will likely be removed soon as I no longer will test it. Please use the GNUradio wiki on installing radioconda instead for Windows. Newer builds of GNUradio include performance improvements and RF64 support that this build lacks.

The NRSC5 application uses 8-bit signed samples at 1488375 SPS However, SDR-Console and SDR# create I/Q files using 16-bit or 32-bit samples at completely different sample rates. You will need to trim, scale, and resample it into a format that the NRSC5 application can use.

Using the SDR-Console Data File editor

The first and easiest method is to use the SDR Console Data File editor. You will use this to trim and I/Q file and center the frequency you wish to decode. This assumes you are using I/Q files recorded with SDR Console. YMMV with files from other programs.

  1. Open the Data File editor
  2. Select your input I/Q file by selecting the folder to the right of the input box
  3. Change your output folder if you wish
  4. Change the center frequency to the exact frequency of the station. This should be the middle of the analog FM carrier.
  5. Change the Bandwidth to 500 kHz
  6. Change the File size to One file (RF64). If you are running a GNUradio version older then 3.9 you will need to set the file size 1 GB. RF64 is not supported before GNUradio 3.9. Keep in mind this will split files if they are large and limit playback time.
  7. Use the Start and Stop options as appropriate. These should be adjusted to when the HD sidebands are present in your I/Q recording. See above for a guide. NOTE: By default UTC time will be used.
  8. Click Add
  9. Click Start
Datafile Editor Screenshot

After doing this you should have a new I/Q file in the output folder with a filename indicating the center frequency and bandwidth.

Using GNURadio to resample and create a new file

After using the Data File editor you will need to use this I/Q file in GNUradio.

Download this flowgraph. You will need to open it in GNUradio.

Open GNURadio companion and you should be presented with an empty flow graph showing a Options and Variable block.

With GNURadion companion open on the top left hand corner Select File and then Open. Locate the fm_hd_convert_iq_500KSPS_baseband.grc file and choose open. You should see a populated flowgraph with several blocks.

GNUradio flowgraph

The blocks we need to focus on is the Wav File Source, Multiply Const, and File Sink. You can safely ignore the grayed out File Source and iShort to Complex blocks. These are for a workaround to use RF64 files in GNUradio older then 3.9. This will be removed at a later time.

You will need to edit the following blocks. You can edit the block values by double clicking on them. Another window will popup.

Once you have ediited your values click on Run -> Execute. You will then see another window popup that shows the Input and Output spectrum. This may take some time to complete.

GNUradio spectrum

The waterfall and spectrum FFT will stop moving when it is complete.

After that is done you will end up with a another file in the directory you specified. If you leave the default file name it will be fm-hd-convert.cu8. You will need to open this file with the NRSC5 application.

NRSC5 Application

In the last step you will need to use the NRSC5 application to read the resampled file you created with GNURadio. NRSC5 is a command line based application and will require use of the command prompt or terminal.

To load the file you created into NRSC5 use the command "nrsc5 -r inputfile.cu8 0" to decode the audio of HD Channel 1. If you have kept the defaults use fm-hd-convert.cu8 as the input file. "0,1,2,3" Are valid options in order from channels 1-4. You can change the HD channel if multiple channels exist for the station. YYMV of decodability based on signal strength and fading. See the NRSC5 user guide on github.

Decodability will vary greatly and will based on a number of factors. It is best if you have both sidebands present as both make the complete channel. If one is missing or there is interference decoding will be much harder.

Example of NRSC5 playing the included sample file in the github repo.

NRSC5 Sample File

Decoding by shifting the spectrum in GNURadio

This method is a little more complicated and does not require the use of the datafile editor. It will be added at a later date.

AM HD Radio decoding

AM HD Decoding support in the NRSC5 application is not well supported and missing many features. I will possibly add this later but it's much the same process.