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

demuxing from hackrf #274

Open
parity-error opened this issue Mar 1, 2022 · 4 comments
Open

demuxing from hackrf #274

parity-error opened this issue Mar 1, 2022 · 4 comments

Comments

@parity-error
Copy link

parity-error commented Mar 1, 2022

I have a (20MHZ ) bit stream of raw IQ data (form HackRf) coming in to my pipeline (its currently demodulating and recording all of the fm channels) and I want to take that same stream and individually shift it (like I do currently for the analog) then decimate and send it to nrsc5 for each digital channel that is present.

I have been playing around with trying this using CSDR (https://github.com/ha7ilm/csdr) something like this:

(in this example the sample is taken with the center at the frequency that I want to test so I don't need to 'slide' (shift_addition_cc) it.
cat 20Mhz.sample.fom.hackrf.iq | csdr convert_u8_f | csdr fir_decimate_cc 92 0.01 HAMMING | csdr convert_f_u8 | ./nrsc5/src/nrsc5 -r - 0

But I don't get any output from nrsc5. This seems theoretically possible but I am not sure if the problem is a slightly different format of the IQ data or if I am not getting it to the exact sampling rate that nrsc5 is expecting. Please advise. Any help on this would be greatly appreciated.

@icb-
Copy link
Contributor

icb- commented Mar 2, 2022

You want a 1488375 sample per second interleaved uint8 stream.

This GNU Radio flow graph generates a playable IQ file from my Pluto SDR.
nrsc5_pluto_cu8

@argilo
Copy link
Collaborator

argilo commented Mar 3, 2022

Correct, the input sample rate needs to be exactly 1488375. A decimation factor of 92 will give you 217391 instead, which is way off. Also, I believe the HackRF produces signed 8-bit samples, whereas RTL-SDR tools (including nrsc5) use unsigned 8-bit.

@argilo
Copy link
Collaborator

argilo commented Mar 3, 2022

In case it's any more convenient for your use case, nrsc5's API (accessible from C or Python) has an nrsc5_pipe_samples_cs16 function that accepts signed 16-bit complex samples at 1488375/2 samples per second (i.e. half the rate that the command line tool uses).

@argilo
Copy link
Collaborator

argilo commented Mar 3, 2022

Also, the Python command-line tool (cli.py) has an --iq-input-format option which allows you to choose between cu8 and cs16 formats. The sample rates are as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants