Discussion:
Complex FIR and Stereo support for rtl_fm
Miroslav Slugeň
2013-09-13 13:22:40 UTC
Permalink
Hi again,

I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
unoficial patch to add:

Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data

Some other improvments in FM radio code.

All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts, of
course SSE is the fastest one and it should works on Intel Atoms, but
not on ARM.

Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.

Speed of SSE code is much better than anything you can get around here,
on Core i7 it consume only 5% of one CPU, so i could demodulate at least
80 channels at the same time in stereo quality of course.

I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
--
Miroslav Slugeň
+420 724 825 885

Teramos Multimedia s.r.o.
Tom Rondeau
2013-09-15 14:27:25 UTC
Permalink
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i would
like to also improve quality for rtl_fm application, i made unoficial patch
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts, of
course SSE is the fastest one and it should works on Intel Atoms, but not on
ARM.
Nice work, Miroslav. I wanted to point out our VOLK project that's
part of GNU Radio. It's designed to abstract SIMD instructions. We
don't have that much support for NEON right now, but VOLK is designed
in such a way that if you're using VOLK kernels, it'll fall back to a
generic implementation until such time as the kernel is written for
the particular architecture. You can get more info on the project
here:

http://www.trondeau.com/blog/2013/6/12/nearly-50-minutes-of-volk.html
http://www.trondeau.com/blog/2012/2/13/volk-integration-to-gnu-radio.html
--
Tom
Visit us at GRCon13 Oct. 1 - 4
http://www.trondeau.com/grcon13
Post by Miroslav Slugeň
--
Miroslav Slugeň
+420 724 825 885
Teramos Multimedia s.r.o.
Michał Morański
2013-09-16 09:36:12 UTC
Permalink
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.

Which version of rtl-sdr was used as base version? I'm getting errors
after applying the patch to last version:

patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej

P.S. Are you planning to add support for RDS in the future?

Regards, Michał.
Michał Morański
2013-09-16 12:09:31 UTC
Permalink
Hi, i used git from 14.9.2013, if you get errors from actual git it
could be because some functions might go into upstream, i also add as
attachment just rtl_fm.c so just replace it your version with this
version and it should work.
Thanks for rapid answer. I just compiled your code.
First, i got this message when compiling:
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/emmintrin.h:32:3: error:
#error "SSE2 instruction set not enabled"
Then i've added line to CMakeLists.txt:
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
After that i was able to compile the code, but with some warnings:

/usr/src/rtl-sdr/src/rtl_fm.c: In function ‘low_pass_complex’:
/usr/src/rtl-sdr/src/rtl_fm.c:451: warning: dereferencing pointer ‘v_r’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:452: warning: dereferencing pointer ‘v_i’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c: In function ‘low_pass_real’:
/usr/src/rtl-sdr/src/rtl_fm.c:769: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:755: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:850: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:872: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:851: warning: dereferencing pointer ‘v_p’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:852: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:873: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules

Now i got segfaults when i try to run rtl_fm -X -f 90.4e6 :
***@dabplus:/usr/src/rtl-sdr# rtl_fm -X -f 90.4e6 -
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Lifeview LV5TDeluxe
Found Fitipower FC0013 tuner
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 7.11ms
Tuned to 90704000 Hz.
Sampling at 1152000 Hz.
Output at 48000 Hz.
LP Complex: FIR hamming (SSE2), size: 32
LP Real: FIR hamming stereo (SSE2), size: 64
Tuner gain set to automatic.
Tuner AGC ON.
De-epmhasis IIR: 50.0 us
Segmentation fault

My processor:
***@dabplus:/usr/src/rtl-sdr# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU D525 @ 1.80GHz
.....
***@dabplus:/usr/src/rtl-sdr# cat /etc/issue
Ubuntu 10.04.4 LTS \n \l

***@dabplus:/usr/src/rtl-sdr# uname -r
2.6.32-38-generic-pae
I have RDS decoder also, but it is very ugly and not all issues are
solved.
Wow :) If you searching for help with that you can count on me.
Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.
Which version of rtl-sdr was used as base version? I'm getting errors
patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
P.S. Are you planning to add support for RDS in the future?
Regards, Michał.
Michał Morański
2013-09-16 15:33:35 UTC
Permalink
Thanks for testing, is it 32bit arch?
Right.
All memory buffers used in SSE should be 16bit aligned, please try no
rtl_fm -X -F 2 -J 5 -f yourfreq
Also you can try modified rtl_fm version i send as attachment which
use memalign to allocate buffers instead of malloc, but it is only for
gcc.
Yeah! The code attached works perfectly! Thank you so much! :)
On X86_64 platform all malloc are 16bit aligned so i missed this.
Those errors when compiling are not important, but also in SSE part.
Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Hi, i used git from 14.9.2013, if you get errors from actual git it
could be because some functions might go into upstream, i also add as
attachment just rtl_fm.c so just replace it your version with this
version and it should work.
Thanks for rapid answer. I just compiled your code.
#error "SSE2 instruction set not enabled"
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
/usr/src/rtl-sdr/src/rtl_fm.c:451: warning: dereferencing pointer ‘v_r’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:452: warning: dereferencing pointer ‘v_i’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:769: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:755: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:850: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:872: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:851: warning: dereferencing pointer ‘v_p’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:852: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:873: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Lifeview LV5TDeluxe
Found Fitipower FC0013 tuner
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 7.11ms
Tuned to 90704000 Hz.
Sampling at 1152000 Hz.
Output at 48000 Hz.
LP Complex: FIR hamming (SSE2), size: 32
LP Real: FIR hamming stereo (SSE2), size: 64
Tuner gain set to automatic.
Tuner AGC ON.
De-epmhasis IIR: 50.0 us
Segmentation fault
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
.....
Ubuntu 10.04.4 LTS \n \l
2.6.32-38-generic-pae
I have RDS decoder also, but it is very ugly and not all issues are
solved.
Wow :) If you searching for help with that you can count on me.
Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.
Which version of rtl-sdr was used as base version? I'm getting errors
patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
P.S. Are you planning to add support for RDS in the future?
Regards, Michał.
Miroslav Slugeň
2013-09-16 13:05:13 UTC
Permalink
Thanks for testing, is it 32bit arch?

All memory buffers used in SSE should be 16bit aligned, please try no
SSE version:

rtl_fm -X -F 2 -J 5 -f yourfreq

Also you can try modified rtl_fm version i send as attachment which use
memalign to allocate buffers instead of malloc, but it is only for gcc.

On X86_64 platform all malloc are 16bit aligned so i missed this.

Those errors when compiling are not important, but also in SSE part.

Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Hi, i used git from 14.9.2013, if you get errors from actual git it
could be because some functions might go into upstream, i also add as
attachment just rtl_fm.c so just replace it your version with this
version and it should work.
Thanks for rapid answer. I just compiled your code.
#error "SSE2 instruction set not enabled"
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
/usr/src/rtl-sdr/src/rtl_fm.c:451: warning: dereferencing pointer ‘v_r’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:452: warning: dereferencing pointer ‘v_i’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:436: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:769: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:755: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:850: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:872: warning: dereferencing pointer ‘v_m’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:851: warning: dereferencing pointer ‘v_p’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:834: note: initialized from here
/usr/src/rtl-sdr/src/rtl_fm.c:852: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules
/usr/src/rtl-sdr/src/rtl_fm.c:873: warning: dereferencing pointer ‘v_s’
does break strict-aliasing rules
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Lifeview LV5TDeluxe
Found Fitipower FC0013 tuner
Oversampling input by: 6x.
Oversampling output by: 1x.
Buffer size: 7.11ms
Tuned to 90704000 Hz.
Sampling at 1152000 Hz.
Output at 48000 Hz.
LP Complex: FIR hamming (SSE2), size: 32
LP Real: FIR hamming stereo (SSE2), size: 64
Tuner gain set to automatic.
Tuner AGC ON.
De-epmhasis IIR: 50.0 us
Segmentation fault
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
.....
Ubuntu 10.04.4 LTS \n \l
2.6.32-38-generic-pae
I have RDS decoder also, but it is very ugly and not all issues are solved.
Wow :) If you searching for help with that you can count on me.
Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.
Which version of rtl-sdr was used as base version? I'm getting errors
patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
P.S. Are you planning to add support for RDS in the future?
Regards, Michał.
Miroslav Slugeň
2013-09-16 09:38:18 UTC
Permalink
Hi, i used git from 14.9.2013, if you get errors from actual git it
could be because some functions might go into upstream, i also add as
attachment just rtl_fm.c so just replace it your version with this
version and it should work.

I have RDS decoder also, but it is very ugly and not all issues are solved.

Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.
Which version of rtl-sdr was used as base version? I'm getting errors
patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
P.S. Are you planning to add support for RDS in the future?
Regards, Michał.
Miroslav Slugeň
2013-09-16 09:50:49 UTC
Permalink
I also forget to add that you can now use:

-W for FM radio in USA (deemphasis 75us)
-X for FM radio in other countries (deemphasis 50us)

This mode is designed for 48kHz reception, i know it is not necessary
(fm radio has only 16kHz, so 32kHz shouhld be enough), but it is because
of good multiplications, othervise we have to use complicated resampler.

Usage for FM reception will be now:
rtl_fm -X -f 97400000 - | aplay -r 48k -f S16_LE -t raw -c 2

Mirek
Hi, i used git from 14.9.2013, if you get errors from actual git it
could be because some functions might go into upstream, i also add as
attachment just rtl_fm.c so just replace it your version with this
version and it should work.
I have RDS decoder also, but it is very ugly and not all issues are solved.
Miroslav Slugeň
+420 724 825 885
Post by Michał Morański
Post by Miroslav Slugeň
Hi again,
I am working on my own SDR project for Stereo FM radio support, but i
would like to also improve quality for rtl_fm application, i made
Complex FIR - to filter strong signals close to wanted signal
Real FIR - to filter pilot from FM
Stereo FIR
Stereo Deemphasis
AGC support - it can give better resolution of IQ data
Some other improvments in FM radio code.
All FIR filters has 3 possible variants, simple, LUT, SSE2 instricts,
of course SSE is the fastest one and it should works on Intel Atoms,
but not on ARM.
Feel free to use any part of code in any of you programs, I know that
this code is little to much to add it into rtl_fm, but maybe it could
somebody help to recieve HW stereo FM radio.
Speed of SSE code is much better than anything you can get around
here, on Core i7 it consume only 5% of one CPU, so i could demodulate
at least 80 channels at the same time in stereo quality of course.
I tried this code only on AMD64 and GCC Linux, so i am not sure if it
can be compiled under windows.
Hi! Very nice to hear, that someone working on Stereo FM reception. I'm
building a small remote devices with rtl-dongles as fm stereo receivers.
Now i'm using gnu-radio to decode fm-stereo, but as you all know,
gnu-radio is a large and heavy project and it's wasting its
capatibilities in that role.
It would be very nice if native rtl-sdr software can decode fm-stereo.
Which version of rtl-sdr was used as base version? I'm getting errors
patching file rtl_fm.c
Hunk #2 succeeded at 47 (offset 5 lines).
Hunk #3 succeeded at 87 (offset 9 lines).
Hunk #4 succeeded at 144 (offset 9 lines).
Hunk #5 succeeded at 169 (offset 9 lines).
Hunk #6 succeeded at 190 (offset 9 lines).
Hunk #7 FAILED at 239.
Hunk #8 FAILED at 258.
Hunk #9 succeeded at 314 (offset 13 lines).
Hunk #10 succeeded at 420 (offset 13 lines).
Hunk #11 succeeded at 994 (offset 13 lines).
Hunk #12 FAILED at 1106.
Hunk #13 succeeded at 1148 (offset 15 lines).
Hunk #14 succeeded at 1259 (offset 35 lines).
Hunk #15 succeeded at 1268 (offset 35 lines).
Hunk #16 succeeded at 1290 (offset 35 lines).
Hunk #17 succeeded at 1301 with fuzz 2 (offset 36 lines).
Hunk #18 succeeded at 1351 (offset 38 lines).
Hunk #19 succeeded at 1378 (offset 38 lines).
Hunk #20 succeeded at 1389 (offset 38 lines).
Hunk #21 succeeded at 1508 (offset 50 lines).
Hunk #22 succeeded at 1527 (offset 50 lines).
3 out of 22 hunks FAILED -- saving rejects to file rtl_fm.c.rej
P.S. Are you planning to add support for RDS in the future?
Regards, Michał.
Loading...