Important Note

This guide is a work in progress. Information may be updated or corrected over time for accuracy and clarity. Screenshots referencing WAV files are outdated (RF64 format is now preferred where supported) and will be updated subsequently.

Consider also exploring the NRSC5 Resample Tool, which offers a potentially simpler, self-contained command-line alternative for I/Q file preparation.

Introduction

This document outlines a procedure for decoding FM HD Radio signals from recorded I/Q data files, typically generated by software like SDR# or SDR Console. The core challenge involves converting the I/Q recording, which often uses incompatible sample rates and formats into the specific format required by the nrsc5 HD Radio decoder (8-bit signed samples at 1,488,375 samples per second).

The process utilizes GNU Radio for the necessary resampling and format conversion steps.

Prerequisites

Before proceeding, ensure you have the following software installed and operational:

Important: Compiling nrsc5 Required

Due to potential patent and copyright issues, pre-compiled binaries for nrsc5 are not provided. You must compile nrsc5 from source yourself by following the instructions in the official GitHub repository.

Step 1: Preparing the I/Q File using SDR Console Data File Editor

This method uses the SDR Console Data File Editor to trim the I/Q recording and center the frequency of interest. This is generally the most straightforward approach if starting with SDR Console recordings.

  1. Launch the SDR Console Data File Editor application.
  2. Specify the input I/Q file using the folder icon next to the input path field.
  3. Optionally, designate a different output folder for the processed file.
  4. Set the Center Frequency precisely to the target station's carrier frequency (the center of the analog FM or AM signal).
  5. Set the Bandwidth to 500 kHz. This bandwidth is used for both FM and AM HD processing within this specific workflow.
  6. Choose the File Size option "One file (RF64)". Important: If using a GNU Radio version older than 3.9, RF64 format is not supported. In this case, select a fixed file size (e.g., 1 GB). Be aware that this may split larger recordings and limit processing duration per file segment.
  7. Adjust the Start and Stop times to encompass the segment of the recording where the HD Radio sidebands are active and stable. Refer to the Data File Editor documentation for detailed usage. Note that times are typically in UTC by default.
  8. Click the Add button to queue the processing task.
  9. Click the Start button to begin processing.
SDR Console Data File Editor settings interface

Upon completion, a new I/Q file will be created in the specified output directory. Its filename usually reflects the selected center frequency and bandwidth (e.g., `..._500kHz.wav`).

Step 2: Resampling and Formatting with GNU Radio

The I/Q file generated by the Data File Editor needs further processing in GNU Radio to match the input requirements of the nrsc5 decoder.

Download the following GNU Radio Companion flowgraph file: fm_hd_convert_iq_500KSPS_baseband.grc.

Open GNU Radio Companion. Navigate to File > Open, and select the downloaded `.grc` file. The flowgraph workspace will populate with several interconnected blocks.

GNU Radio Companion flowgraph for HD Radio I/Q conversion

You will primarily need to configure three blocks (ignore the grayed-out blocks, which relate to older workarounds):

After configuring these blocks, execute the flowgraph by clicking the 'Run' button (or pressing F6). A window displaying the input and output spectrum/waterfall will appear. The process may take some time depending on the input file size and system performance.

GNU Radio FFT Sink and Waterfall Sink displaying signal spectrum during processing

Processing is complete when the waterfall and spectrum displays stop updating. The output file (e.g., fm-hd-output.cu8) will be available at the location specified in the File Sink block.

Step 3: Decoding the Processed File with nrsc5

The final step involves using the command-line nrsc5 application to decode the prepared .cu8 file.

Open your terminal or command prompt. To decode the primary HD Radio channel (HD1) from an FM HD signal, use the following command structure:

nrsc5 -r path/to/your_output_file.cu8 0

Replace path/to/your_output_file.cu8 with the actual path and filename of the file generated by GNU Radio in Step 2. The final number (0) specifies the HD program channel to decode (0 for HD1, 1 for HD2, 2 for HD3, 3 for HD4). Adjust this number if the desired station broadcasts multiple HD channels.

Decoding success depends significantly on factors like signal strength, the presence and quality of both digital sidebands, and the absence of interference. Refer to the nrsc5 documentation on its GitHub repository for more advanced usage options.

Example: nrsc5 decoding output from its sample file.

Terminal showing nrsc5 application decoding audio and displaying metadata

Alternative: Direct Spectrum Shifting in GNU Radio

An alternative approach involves performing the frequency centering (spectrum shift) directly within the GNU Radio flowgraph, eliminating the need for the SDR Console Data File Editor step. This method is typically more complex to configure.

Detailed instructions for this method may be added in a future update. For now, users interested in a more integrated command-line solution are encouraged to investigate the NRSC5 Resample Tool mentioned previously.

AM HD Radio Decoding

The nrsc5 application includes support for AM HD Radio decoding, although its maturity and feature set for AM may differ from FM HD. The workflow described above can be adapted for AM HD.

Use the same initial steps as for FM HD:

  1. Utilize the SDR Console Data File Editor (Step 1). Ensure the Center Frequency is set to the exact carrier frequency of the analog AM station. Critically, maintain the Bandwidth setting at 500 kHz for compatibility with the provided flowgraph.
  2. Process the resulting 500 kHz bandwidth I/Q file using the same GNU Radio flowgraph (fm_hd_convert_iq_500KSPS_baseband.grc) as described in Step 2 to generate the .cu8 file.
  3. To decode the generated .cu8 file for AM HD using nrsc5, execute the following command in your terminal, adding the essential --am flag:
nrsc5 --am -r path/to/your_output_file.cu8 0

Replace path/to/your_output_file.cu8 accordingly. The 0 usually selects the primary audio program (HD1).

As with FM, successful AM HD decoding depends heavily on the quality and presence of the digital sidebands adjacent to the AM carrier, as well as the current capabilities of the nrsc5 software for AM processing.