Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Change the I/Q sample format for the rawfile output to a more standard one #427

Closed
LZ2DMV opened this issue Oct 16, 2023 · 2 comments

Comments

@LZ2DMV
Copy link

LZ2DMV commented Oct 16, 2023

The current complex float 32-bit, little endian format that rtl_airband uses when configured to save raw I/Q data files differs from what appears to be the established standard in the RTL-SDR community for I/Q sample format - 48k/1 wav files, like the ones generated from GQRX and SDR++.

The wiki contains a few examples of using csdr to convert the raw samples to audio. However, the DSP processing (especially things like the de-emphasis) of csdr is sometimes flawed and i think we could say it is complicated to arrange the right pipeline without sufficient knowledge in the DSP domain, so getting an useful audio is not always trivial with it, say, when we need high precision (digital modes).

Therefore, i think it will be best if rtl_airband exports I/Q data in a more standard format, like the ones exported from SDR++, GQRX or SDRSharp - many tools support this I/Q format as an input source, so it will certainly be easier to work with it instead of the current format.

It could be added as an additional rawfile option or replacing the current one.

@charlie-foxtrot
Copy link
Owner

The rawfile output is a dump of the internal data structure with no additional processing.

I'm not familiar with 48k/1 wav files, but if the 48k is referring to the sample rate, that will require upsampling, and I dont think it makes sense to do that in rtl_airband.

Instead you can use sox to convert the output .cf32 files to any format you want. Looking at the man pages, this command may be what you're looking for (and if so please let me know and I'll add to the wiki):

sox −r 16k −e float −b 32 -L −c 2 input.raw output.wav

@LZ2DMV
Copy link
Author

LZ2DMV commented Oct 17, 2023

Hm, interesting. soxi reports the expected format for the samples - 32-bit Floating Point PCM, however, when i loaded the output wav file in GQRX and other software that accepts it, it fails to work with it.

During conversion, sox reports:

sox WARN sox: `input.raw' input clipped 2906524 samples
sox WARN sox: `output.wav' output clipped 1454773 samples; decrease volume?

@LZ2DMV LZ2DMV closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants