Skip to content

jheidel/rf64-convert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RIFF to RF64 WAV Converter

Build Status

A command-line utility for converting RIFF WAV files containing IQ data produced by gnuradio into RF64 WAV files (spec) for use with SDR-Radio Console.

A pre-built binary is available for both Windows and Linux, or you can easily compile your own with instructions below.

--

The standard RIFF WAV format has a file size limitation of 2 GiB because the size of the data chunk is stored within the file as a 32-bit integer. SDR IQ recordings can easily exceed this restriction due to high sample rates.

The gnuradio WAV Sink will generate RIFF WAV files with a standard header, followed by an unrestricted data payload. However, the size information in the final file may not be correct due to integer overflow, and some tools will fail to load the file due to the incorrect length information. From my experiments, SDR-Radio Console will end up showing an arbitrary length for these recordings and will not play the entire file.

Fortunately, SDR-Radio Console supports the RF64 WAV format which handles WAV files up to 16 EiB. This tool implements conversion to the RF64 WAV file format by rewriting the WAV file header with a RF64 header and corrected size information.

--

First you'll need a WAV file containing IQ data, for instance from a gnuradio flow graph like this:

gnuradio iq source

In my case, the IQ data comes from a headless Raspberry Pi 3 + AirSpy data logger running gnuradio.

Then run the conversion (note that the commands below assume Ubuntu 18.04):

# Install golang and git
sudo apt update && sudo apt install golang git

# Fetch repo
git clone https://github.com/jheidel/rf64-convert.git ~/go/src/github.com/jheidel/rf64-convert
cd ~/go/src/github.com/jheidel/rf64-convert

# Build
go build

# Convert
./rf64-convert --input=[path to gnuradio input WAV] --output=[path to output WAV]

Alternatively, download a pre-built binary from GitHub releases. A Docker image is also available from Docker Hub which has the binary installed as /bin/rf64-convert.

The input is assumed to be a RIFF WAV file which contains a standard header, followed by a data chunk which continues to the end of the file. The converter will rewrite the file with a RF64 header containing the correct file-size values.

The converter supports using a unix pipe as an input for use as part of a streaming conversion. The output must support seeking so the ds64 header can be updated at the end of the conversion.

In order to get SDR-Radio to display the correct timestamp and center frequency, I've found the easiest way is to replicate the filenames used by SDR#, which SDR-Radio will recognize.

Example:

--output=SDRSharp_20200119_110726Z_162550000Hz-IQ.wav

sdr radio recordings pane

SDR-Radio Console's own WAV output uses a special auxi chunk within the WAV file which contains XML metadata as a UTF16-encoded string. auxi.go shows the digging I've done into it so far and some sample data, but the SDR# path workaround above is simpler.

73 de KI7QIV!