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

Poor WFM decoding performance with homepage example #35

Open
felixzero opened this issue May 8, 2018 · 9 comments
Open

Poor WFM decoding performance with homepage example #35

felixzero opened this issue May 8, 2018 · 9 comments
Labels

Comments

@felixzero
Copy link

Hello,
I am playing around with SDR with my newly bought RTL-SDR and I tried some of the examples given on the homepage (https://github.com/simonyiszk/csdr).

However, I could not manage to make any good quality demodulation of a standard WFM commercial broadcast using csdr. I applied the "Demodulate WFM: Advanced" command line almost as-it:
rtl_sdr -s 2400000 -f 97700000 -g 20 - | ./csdr convert_u8_f | ./csdr shift_addition_cc -0.085 | ./csdr fir_decimate_cc 10 0.05 HAMMING | ./csdr fmdemod_quadri_cf | ./csdr fractional_decimator_ff 5 | ./csdr deemphasis_wfm_ff 48000 50e-6 | ./csdr convert_f_s16 > csdr_decode.raw

but all I could get was a very noisy decoded sound. Here is a short audio clip after converting the raw to wav: Link to WAV file

This is surprising since I can get a much better output in GNU Radio using the very same sequence as csdr:
untitled2 grc

And then, on the same channel, only a few seconds apart, the output is really good: Link to WAV file

Am I missing something? Are these two doing something different?

--
felixzero

@ha7ilm
Copy link
Owner

ha7ilm commented May 8, 2018

Thanks for the feedback.
Possibly the transition BW for the fir_decimate_cc is low. 0.05*2400000 = 120 kHz
What if you change it to ./csdr fir_decimate_cc 10 0.005 HAMMING (12 kHz)?

(The bandwidth of the signal fed to the FM demodulator is also quite high, 240 kHz in this configuration. This could possibly be decreased to 96 kHz by playing around with the decimation rates, although on the other side that might be too low:

rtl_sdr -s 2400000 -f 97700000 -g 20 - | ./csdr convert_u8_f | ./csdr shift_addition_cc -0.085 | ./csdr fir_decimate_cc 25 0.005 HAMMING | ./csdr fmdemod_quadri_cf | ./csdr fractional_decimator_ff 2 | ./csdr deemphasis_wfm_ff 48000 50e-6 | ./csdr convert_f_s16 > csdr_decode.raw

Possibly you have distorted sound because there are multiple channels next to each other at your receiver. At my place, WFM channels are quite strong and are quite far away from each other, so it's not a problem that this simple receiver does not provide much selectivity with the original command.

@felixzero
Copy link
Author

Thanks for your answer,

I just tried the command you propose. I don't upload the audio clip, but it is very similar to the previous one (i.e. as noisy and distorted).

I don't think this is an issue with nearby channels, as I didn't plug a good antenna on my RTL-SDR (just a piece of random wire) and it is picking up only a few stations and noise sources. As seen on GQRX:
capture du 2018-05-08 22-09-29

Plus, the GNU Radio script/sketch seems to work so I guess it is probably a filtering/demodulation issue.

@ha7ilm
Copy link
Owner

ha7ilm commented May 8, 2018

Thanks for trying the new command.
Unfortunately, I can't find out anything else without trying myself.
Maybe there's someting with the fractional_decimator_ff which I had to fix about a year ago. You could possibly try the old_fractional_decimator_ff which is actually worse in some scenarios, but I used that algorithm originally when I tried the WFM demod last time.

@felixzero
Copy link
Author

Yes! This is it. I simply changed the fractional_decimator_ff to old_fractional_decimator_ff and it works really well: Link to WAV.

I guess I will stick to the old function. Thanks.

@ha7ilm
Copy link
Owner

ha7ilm commented May 8, 2018

Thanks for finding that.
Maybe the default parameters for the fractional_decimator_ff are not good enough.

@ha7ilm
Copy link
Owner

ha7ilm commented May 8, 2018

What about csdr fractional_decimator_ff 5 16 --prefilter? Could you test that, too?

@felixzero
Copy link
Author

It is also working well: WAV file

@ha7ilm ha7ilm added the bug label May 8, 2018
@ha7ilm
Copy link
Owner

ha7ilm commented May 8, 2018

OK, thanks!

@TunaLobster
Copy link

I can confirm that old_fractional_decimator_ff 5 is better in some cases. I was getting very similar results with fractional_decimator_ff 5 with and without 16 --prefilter. Thanks for keeping that code included!

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

No branches or pull requests

3 participants