Raw IQ files - options for converting?

It would be very helpful to allow the end user to select the format of the IQ file. I have read in posts here that satnogs stores the raw WAV (when enabled in the advanced setup) as short, and that it needs to be converted to complex. Someone posted how to do that using GNUradio.

Is there any other tool that can do that easily from command line ?
my end goal is to take a raw IQ file from my satnogs station and use it with SDR Sharp.

It is extremely frustrating to not have the file stored in a format that is usable.

-Kevin

Hi Kevin,
I am not an expert, but there are various ways. You can manually import it into audacity and export as .wav which I replay in HDSDR. Or you can find .bat file using SOX for conversion.
It has just single line used in win:
FOR %%A IN (%*) DO sox -t raw -b 16 -e signed-integer -r 48000 -c 2 %%A “SATNOGS data/%%~nxA.wav”

I got it from gents here in forum year ago.
Hope it helps you
Tomas OK2PNQ

1 Like

CSDR is a nice tool for this: https://github.com/ha7ilm/csdr

It would simply be:

cat inputfile.bin | csdr convert_s16_f > outputfile.bin

And the reason the files are stored in s16 format is to try and save disk space and avoid thrashing flash memory too much. The new qzip format should be even smaller, though yes - you will need to convert it to something else to run it through GQRX or whatever.

2 Likes

If they would modify satnogs user interface to allow a flag for the owner to save that particular pass to raw, it wouldn’t matter the size so much. The issue is that they force an all-or-nothing approach. I only need / want to save linear transponder sat to IQ, since there is no built in way to do anything with them in the built in decoders.
I love the hard word the team is giving, and appreciate the progress. I am in no way implying differently.
It just seems that if things were a bit more user friendly, we would have more satnog stations.

@vk5qi Mark, I tried the suggestion you had above, but it file threw an Invalid file format error in SDRSharp.
Any ideas what could have gone wrong? The original was the raw wav file produced by satnogs and was 41479368 in size. The result was a file 82960384 in size.

thanks

I have configured satnogs to store the iq file on the ramdisk, so flash wear is no problem.

@kk4yel I am not familiar with linear transponder, but maybe you could check the value of SCRIPT_NAME and/or BAUD and only process (convert, upload) iq files for observations you are interested in?

Edit: you can echo the values of the variables to a file to see what the values are for the observations you are interested in.

1 Like

I don’t know what format SDR# is expecting. The command I gave just does a direct conversion of all samples to floating point, but it will remove all the WAV metadata, which perhaps SDR# is looking for.

Yep… it looks like SDR# is wanting wav metadata. It looks like using SOX is probably the best option, as that will re-create the WAV headers.

1 Like

OK, I get the intent of the command line options. I tested it out manually, and it works. so not just have to add it to the bash script for post observation. For anyone referencing this later on.

-t raw // file type is raw.

-b 16 // encoded sample size 16 bits

-e signed-integer // set encoding to signed-integer

-r 48000 // samples per second (sample rate of audio)

-c 2 //two channels i.e. stereo

1 Like