DSPRelated.com
Forums

SDR IQ samples of FM stereo to stereo audio help?

Started by Hannu Vuolasaho July 11, 2013
Hello everyone!

I have been reading C algorithm for real-time DSP book for a while and 
the signal processing stuff feels so unrelated to real world problems.

I invested DVB-T dongle and started playing with it. With all 
applications available the understanding how the system works is still 
little bit mystified to me.

I even played with the gnuradio and got it to output audio. However yhe 
level of abstraction for understanding was too high for my intentions.

So I looked the source of rtl_fm and was first time enlightened how this 
stuff works and made real world problem for myself. I want to decode 
stereo from FM radio.

So. Has anyone seen course matrerial where this has been taken as an 
example or is there simple and straight forward code available to learn? 
Or Am I stuck with SDR#, gqrx and cutesdr source codes which already 
implement this?

I think this is quite good example as there has to be done 
fm-demodulation, signal detection, de-empahsis, handle the subcarrier 
also and separate the channels. Or did I miss some important thing?

TLDR; I want example of IQ samples of FM radio to stereo audio.

Best regards,
Hannu Vuolasaho
On Thu, 11 Jul 2013 13:59:39 +0000, Hannu Vuolasaho wrote:

> Hello everyone! > > I have been reading C algorithm for real-time DSP book for a while and > the signal processing stuff feels so unrelated to real world problems. > > I invested DVB-T dongle and started playing with it. With all > applications available the understanding how the system works is still > little bit mystified to me. > > I even played with the gnuradio and got it to output audio. However yhe > level of abstraction for understanding was too high for my intentions. > > So I looked the source of rtl_fm and was first time enlightened how this > stuff works and made real world problem for myself. I want to decode > stereo from FM radio. > > So. Has anyone seen course matrerial where this has been taken as an > example or is there simple and straight forward code available to learn? > Or Am I stuck with SDR#, gqrx and cutesdr source codes which already > implement this? > > I think this is quite good example as there has to be done > fm-demodulation, signal detection, de-empahsis, handle the subcarrier > also and separate the channels. Or did I miss some important thing? > > TLDR; I want example of IQ samples of FM radio to stereo audio.
Trying to deduce how DSP algorithms work by studying code is going to be like trying to deduce how a tomato tastes from looking at its DNA: it'll be theoretically possible, but a top-down approach will be a lot easier. I'm just not sure that you're going to get this stuff without having the underlying theory. Some studying is in order. I'd recommend one of three. Rick Lyon's book is good if you have some electrical engineering under your belt ("Understanding Digital Signal Processing", Prentice- Hall. I think it's at the 3rd edition now). The standard college text is one of the editions of Oppenheim & Wilsky "Signal Processing", but I don't know if it's possible to get through on a self-study program. Finally, the latest edition of the "Handbook", published by the Amateur Radio Relay League is always a good resource. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On 2013-07-11, Tim Wescott <tim@seemywebsite.really> wrote:
> > Trying to deduce how DSP algorithms work by studying code is going to be > like trying to deduce how a tomato tastes from looking at its DNA: it'll > be theoretically possible, but a top-down approach will be a lot easier.
I have the tomatoes. I've tasted them and now I want to breed them to get the flavor right :) My interest in DSP started when I saw the Understanding DSP book in trash and it answered to my question what I don't understand now. I played with with the mathematics on paper and matlab but it stayed little bit too far from reality all the time. Unrelated to everything. Mostly I could relate to low-pass filter when I thought I'll put DAC, amplifier and subwoofer after it. Input I could take from ADC but coding the filter for MCU was the hardest part. So as I see it, it is the theory to practice conversion which I'm missing right now. And I know I need to study more theory.
> > I'm just not sure that you're going to get this stuff without having the > underlying theory. Some studying is in order. I'd recommend one of > three. Rick Lyon's book is good if you have some electrical engineering > under your belt ("Understanding Digital Signal Processing", Prentice- > Hall. I think it's at the 3rd edition now). The standard college text > is one of the editions of Oppenheim & Wilsky "Signal Processing", but I > don't know if it's possible to get through on a self-study program. > Finally, the latest edition of the "Handbook", published by the Amateur > Radio Relay League is always a good resource. >
Thanks. Good books. I'm waiting for August to get next year's Handbook. I like big books specially when they have large Handbook, reference or manual on their back. Best regards, Hannu Vuolasaho
here is a good place to start
http://transmitters.tripod.com/stereo.htm
Mark
Hannu Vuolasaho <hannu.vuolasaho@nospam.tut.fi.invalid> writes:

> Hello everyone! > > I have been reading C algorithm for real-time DSP book for a while and > the signal processing stuff feels so unrelated to real world problems. > > I invested DVB-T dongle and started playing with it. With all > applications available the understanding how the system works is still > little bit mystified to me. > > I even played with the gnuradio and got it to output audio. However yhe > level of abstraction for understanding was too high for my intentions. > > So I looked the source of rtl_fm and was first time enlightened how this > stuff works and made real world problem for myself. I want to decode > stereo from FM radio. > > So. Has anyone seen course matrerial where this has been taken as an > example or is there simple and straight forward code available to learn? > Or Am I stuck with SDR#, gqrx and cutesdr source codes which already > implement this? > > I think this is quite good example as there has to be done > fm-demodulation, signal detection, de-empahsis, handle the subcarrier > also and separate the channels. Or did I miss some important thing? > > TLDR; I want example of IQ samples of FM radio to stereo audio. > > Best regards, > Hannu Vuolasaho
See "FM Demodulation Using a Digital Radio and Digital Signal Processing" here: http://www.dspdude.com/ -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On Thu, 11 Jul 2013 13:59:39 +0000, Hannu Vuolasaho wrote:

[snip] 
> I think this is quite good example as there has to be done > fm-demodulation, signal detection, de-empahsis, handle the subcarrier > also and separate the channels.
I think the order of those operations should be changed to perform de- emphasis *after* handling the subcarrier and separating the channels.
> Or did I miss some important thing?
I assume you are doing this for self-education. If making a commercial product, a chip like this might be useful: http://www.silabs.com/products/audiovideo/amfmreceivers/Pages/si468x.aspx Regards, Allan
>On Thu, 11 Jul 2013 13:59:39 +0000, Hannu Vuolasaho wrote: > >[snip] >> I think this is quite good example as there has to be done >> fm-demodulation, signal detection, de-empahsis, handle the subcarrier >> also and separate the channels. > >I think the order of those operations should be changed to perform de- >emphasis *after* handling the subcarrier and separating the channels.
Or else it would make for pretty wild filter design problem. _____________________________ Posted through www.DSPRelated.com
I assume you are starting with a signal which comes from an analog IF stage, and using an A/D on that signal to get into the digital world?

The reason I ask is that doing an IF stage in digital form has many subtle complications (apart from the high sampling rates involved). Analog IF stages saturate in a specific way after a specific amount of bandpass filtering to achieve a good capture ratio and rejection of AM-to-FM effects. To do the same in a dsp implementation may require a very high over-sampling rate to emulate analog saturation. Not to mention that an analog FM IF stage probably costs about 20 cents to make; hard to compete with a digital implementation. 

Disclaimer; I'm not an rf guy.


Bob
On Sun, 14 Jul 2013 05:13:24 -0700, radams2000 wrote:

> I assume you are starting with a signal which comes from an analog IF > stage, and using an A/D on that signal to get into the digital world?
The OP stated that he had a "DVB-T dongle". The analog downconversion, quadrature ADC, digital downconversion and decimation has already been done by a pair of $1 ICs before the signal gets to the OP's DSP (via USB). The digital IC is probably something like a Realtek RTL2832U DVB-T demodulator. It has a COFDM demodulator for DVB-T reception, however it also has a passthrough mode that allows the I&Q samples to be accessed directly over the USB interface. This is typically used to allow DAB or FM demodulation in software. I could not guess at a part number for the analog downconverter IC without knowing the part number of the USB dongle. Some examples are listed here: http://sdr.osmocom.org/trac/wiki/rtl-sdr Allan
Thanks for the clarification. 


Bob