Storing undemodulated baseband possible?

Short update:
Looking good. Stitched all subroutines together and getting a clean signal. There´s some DC-offset left, which should be straightforward to eliminate.

I´d like to test it under SatNogs conditions on the Pi with RTLSDR
.
Could you tell me what´s the command line parameter to make a test recording in standard settings for a given frequency?
How far is the desired RX frequency and the RTLSDR set frequency shifted - or is it just set to center?

Well from what I know satnogs uses just the flowchart with the RTLSDR source in the flowchar.

1 Like

It is shifted by 100kHz (the parameter is called shift_offset iirc).

1 Like

Thanx. Will try this on weekend and give some feedback about compression ratios for various signals.

Just had a glimpse into one of the flowgraphs: the parameter is called ‘lo_offset’ and has a default value of 100e3 (100 kHz).

1 Like

It works :smile:
A selectable 40 kHz band within a high bandwidth I/Q-WAV-file compresses losslessly to 25.5 kbyte/sec, that´s around 2.5 times the amount of the actual audio storage. It can be decoded to a standard I/Q-WAV.
Tested with recorded MFSK signal, FM will take more for sure - I´ll need to make some tests.
The decoded WAV can be loaded for example into SDR# or HDSDR and demodulated freely.
I´m sure that DX signals within noise can also be recovered - as it´s lossless.
The DC offset is removed, so the whole band is clean, and you don´t need to work only on one sideband.
There is still some (trivial) work to do like taking command line arguments, making a proper WAV-header and stuff, and compiling on the Pi.
It´s plain C, but I never compiled on the Pi, shouldn´t be that big obstacle, though.
Compression of a 40kHz band from a 135 sec IQ-file with 250 kHz sample rate takes 13sec, and decompression takes only 1sec on an i5-intel processor.
BTW: It´s funny that ZIP still squeezes out 65 kbyte more of the 3.4 Mbyte compressed file :smiley:
I know the reason for it, but the hell I won´t optimize for that. My brain is already slimey and spongy.
Will have a beer now, bros!
Cheers, 73s DL1UAC

3 Likes

Got a link to a repo or something for that? :stuck_out_tongue:

1 Like

No repo yet - still in development of the prototype.
There´s also a little issue. I´ll just be able to give away an uglyfied source code, because some of the software is part of a commercial product I am working on. And I don´t want shoot my own leg.
I will give the compileable source for free to the SatNogs community, so it can be compiled for many platforms, but unfortunately I can´t make it fully open for now.
I´ll see what I can do in the future. Will try to publish it fully open-source as soon as possible.
Maybe GPL V3 license or something similar.

Ok, it will be GPLV3 license :slight_smile:
I´ll prepare a repo when the code is complete.

2 Likes

Repo is online: https://github.com/DL1UAC/RFLpacker

It should compile on any platform. If not, maybe some minor changes have to be done.
There´s no help included yet, so here´s an example how to use:

Compressing an 8bit I/Q file:
(The file can be also raw data. A WAV is also only raw data with a header, so it will be read correcly, but you must specify the samplingrate as parameter)
Note that at this time, only 8bit I/Q files convert correctly. 16bit IQ files need to be reduced to 8bit.
RTLSDR samples to 8bit, works flawlessly on my system.

RFLpacker -p -i (input file name) -o (output file name) -sr (sample rate of input file in Hz) -fs (frequency shift of desired subband in Hz) -sb (skip x bytes of file, can be used to skip WAV header or change byte offset) -bw (bandwidth of desired subband)

Decompressing to a WAV-I/Q file:

RFLpacker -u -i (input file name) -o (output file name.wav)

The output file is a valid I/Q-WAV which can be read into SDR# or HDSDR

4 Likes

where would I find clx.h?

1 Like

I´m not sure, but I think it´s only used for compatibilty reasons with my compiler (BCB). It might compile without it on other platform.
Try to compile without it. If it doesn´t work, send me the error message, I´ll dig deeper then.

I uploaded a testfile for everyone interested in testing it out:
https://www.dropbox.com/s/9us4yz3ca6g0qps/testf_20180429_054357Z_000000000Hz_IQ.wav?dl=0

samplerate is 250000 Hz
There is an MFSK signal coming up at -50 kHz, so you can use the packer with 50000 Hz shift and around 30000 Hz bandwidth to compress this MFSK signal.
After decompression, you can load the IQ-Wav into sdr# or hdsdr or whatever SDR software is capable of showing and demodulating IQ files

I was able to download this IQ file and load it into SDR# and listen to the MFSK signal. This ability to download an IQ file would be a nice feature!

1 Like

Thanx. I´ll upload the compressed example for comparison and testing tomorrow.
Hope this packer gets integrated into the system.
40kHz compresses to 25kB/sec, not much higher than demodulated audio, but more powerful.
Compared to the original sampled I/Q file (at 1 MHz rate) it´s a compression of 1/78,
so the final file has only 1.3% the size of the sampled one :smiley:
If only CW is expected, the bandwidth lowered to 10kHz, then it would be only 6 kB/sec,
even leaving some headroom :slight_smile:
When the saellite´s frequency is off a bit, which is almost always the case (even a few kHz), it wouldn´t matter. The observation wouldn´t be lost.

Plus some people smarter then me could figure out how to do the decompression in browser and use the SDR stuff that openwebrx does to allow demodulation.

1 Like

Cool! I knew websdr, the openwerx is new for me, will check it out. Looks very promising.

Here the promised files for testing purposes:

The original I/Q file with 250kHz sample rate:
https://www.dropbox.com/s/9us4yz3ca6g0qps/testf_20180429_054357Z_000000000Hz_IQ.wav?dl=1

The above file compressed:
https://www.dropbox.com/s/gmxot30rpmllmgt/compressed.rfl?dl=1

The above file uncompressed to subband I/Q-WAV:
https://www.dropbox.com/s/kvtwnvukrwmvzht/uncompressedIQ.wav?dl=1

I processed the files with the following command line parameters:

Packing example:
RFLpacker -p -sr 250000 -fs 60000 -sb 128 -bw 40000 -o compressed.rfl -i testf_20180429_054357Z_000000000Hz_IQ.wav

Unpacking example:
RFLpacker -u -i compressed.rfl -o uncompressedIQ.wav