bug and parameters for rtl_fm

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Alain Prignet alain.prignet at univ-mlv.fr
Wed Oct 17 14:13:32 UTC 2012


Hello,

I have found what I think is a bug in rtl_fm.c : on line 171 there is
if (fm->prev_index < (fm->downsample)) {
but fm->prev_index start at -1 so to get an undersampling of factor
fm->downsample, one should have
if (fm->prev_index < (fm->downsample-1)) {

Without this correction, I get underruns, with this one, there is no
underrun.

Moreover, I have tried the idea of
http://www.embedded.com/design/embedded/4212086/DSP-Tricks--Frequency-demodulation-algorithms-
to avoid atan :
+int polar_discriminant2(int ar, int aj, int br, int bj)
+{
+       int cr, cj;
+       double angle;
+       angle = (double)(ar * (aj - bj) - aj * (ar - br)) / (double)(ar*ar + aj*aj);
+       return (int)(angle*(1<<12));
+}

Finally, to get good results, I use these parameters :
DEFAULT_BUF_LENGTH             (32 * 16384)
capture_rate = 2304000
fm->downsample = 12
fm->post_downsample=8
sample_rate = 24000

Best regards,

Alain Prignet




More information about the osmocom-sdr mailing list