Tagged: IQ

iq_tool: A Command Line Tool for Resampling, Filtering, Shifting and Correcting IQ Data Streams

Thank you to Eric Inloes for submitting to the blog his new tool called "iq_tool". This is a tool designed to "provide an easy, fast, and lightweight command-line utility for converting I/Q data from files or SDRs to a specific sample rate and format, and then either piping it to other programs or writing it to a file". Or in other words have a "neutral ffmpeg like converter tool but for IQ data".

Many SDR software tools are written for specific SDR hardware, such as RTL-SDRs, and may only accept a specific sample rate, type, or bit depth, meaning other SDRs cannot use these tools. The goal of iq_tool is to easily allow the IQ data stream from any SDR to be converted into a compatible format. 

Eric gives some examples. For example, if you wanted to use rtl_433 with an Airspy you could run the command:

iq_tool --input airspy  --airspy-gain-mode linearity --airspy-gain-value 15 --output stdout  --sdr-rf-freq 433.92e6 --output-sample-rate 250e3 --output-sample-format cu8 --output-agc | rtl_433 -r -

Similarly, for an SDRplay, you could run:

iq_tool --input sdrplay   --sdrplay-lna-state 15 --sdrplay-antenna b --sdrplay-if-gain -50 --output stdout  --sdr-rf-freq 433.92e6 --output-sample-rate 250e3 --output-sample-format cu8 --output-agc | rtl_433 -r -

We note that Eric released this tool with the caveat that it is experimental and was written with heavy AI assistance.

iq_tool example converting from a networked Airspy and piping into rtl_433
iq_tool example converting from a networked Airspy and piping into rtl_433

Compressing and Filtering I/Q Data

One great feature of SDR software like SDR# is the ability to make I/Q recordings of the entire received bandwidth for later analysis. The problem is that these recordings can take up massive amounts of hard disk space. Jay Moore, the author of the RTL-SDR DX blog has recently been experimenting with methods for compressing I/Q files (2021 UPDATE: Jay's site has been abandoned, please use this archive.org link).

Jay tried compressing a test I/Q file with 7-Zip LZMA, Zip Deflate and FLAC. His results showed that FLAC compression was by far the fastest and also compressed the most in a test I/Q file with low amounts of redundant information.

Jay also discovered that it is possible to record "filtered" I/Q recordings using the RAW setting in SDR#. The RAW setting allows you to record an I/Q file from the tuned bandwidth selected within SDR# which allows for a much smaller file size.

I/Q Data interpreted by an audio editor
I/Q Data interpreted by an audio editor