DSPRelated.com
Forums

FM Demod question

Started by Paul Solomon August 2, 2005
Hi All,

Thanks for your assistance so far. I have finally got a working FM demod 
module that allows me to stick an antenna (with a LNA) on the input of my 
dev board and listen to the radio on the output of a DAC.

I however have hit an unexpected issue in the design relating to the minimum 
sample rate of the signals throughout the system which I would like to get a 
second opinion on.

I am under-sampling a clean (filtered) spectrum of 88-108 MHZ with an ADC 
running at 80MSPS. this gives me the spectrum in the digital domain at 8 - 
28MHz with an image at 52 - 72MHz .

From this I do I/Q mixing to downsample the desired channel to 0MHz and then 
filter and decimate.
The first filter / decimate stage is a 1MHz pass 9MHz stop filter and I 
decimate by 8, taking my sample rate down to 10MSPS.

After this I apply tighter filter 200kHz pass 400kHz stop on the I and Q so 
that I only have my desired station left.

This is where the problem comes, if I run this straight into an arctan 
(cordic) and then phase unwrap / differentiate the system works fine, 
however I have 10MSPS to represent a signal with a bandwidth of ~400kHz 
which seems to be a major overkill.

If I decimate after this final filter stage (as I was planning to) by a 
factor of 8, this gets my sample rate down to 1.25MSPS which is more 
reasonable, however my audio becomes badly distorted.

A fair amount of experimentation has let me to believe that the distortion 
is comming from the phase unwrap process, as when I decimate further, the 
phase jumps will get larger, when the phase jumps get greater then pi, the 
unwrap will assume a wrap occured and try to correct for it.

The way I came to this conclusion is with an FM test generator, When I dont 
decimate in this last stage, I can demodulate a normal FM carrier (with a 
deviation of 75kHz) with out a problem. If I decimate by 2 here, then i get 
distortion, but if I bring the carrier deviation down to ~50kHz, then the 
distortion goes. when I decimate by 8 I can clear the distortion by reducing 
the carrier deviation to ~20kHz. The carrier has no effect on this 
distortion, and the spectrum of the signal after decimation and before the 
cordic looks correct in all instances.

So...... This has left me scratching my head, as I thought that I should 
only require the BW * 2 + a little but as the sampling frequency, however 
this does not seem to be the case here. If anyone has any input that would 
be appreciated. Are my results here to be expected or would you have assumed 
otherwise?


Regards,

Paul Solomon 


"Paul Solomon" <psolomon@tpg.com.au> wrote in message 
news:42f01ac4@dnews.tpgi.com.au...
> Hi All, > > > A fair amount of experimentation has let me to believe that the distortion > is comming from the phase unwrap process, as when I decimate further, the > phase jumps will get larger, when the phase jumps get greater then pi, the > unwrap will assume a wrap occured and try to correct for it. > >
Hello Paul, You may have missed my post, but I gave a method that completely avoids both the cordic atan and phase unwrapping processes. your phase theta = atan(Q/I) and freq omega = (d/dt) atan(Q/I) just carry out the calculus omega = (I*(d/dt)Q - Q*(d/dt)I) / (I^2 + Q^2) So all you need is two differentiators and two delays to directly go from I,Q to FM demod. No cordic or unwrapping needed! This is had with a pair of FIR differentiators and an extra pair of pointers to pull the delayed data from the filters' buffers. It just doesn't get simpler except if your AGC is real good, then the denominator in the above expression may become a simple constant. Clay
Paul Solomon wrote:
> Hi All, > > Thanks for your assistance so far. I have finally got a working FM demod > module that allows me to stick an antenna (with a LNA) on the input of my > dev board and listen to the radio on the output of a DAC. > > I however have hit an unexpected issue in the design relating to the minimum > sample rate of the signals throughout the system which I would like to get a > second opinion on. > > I am under-sampling a clean (filtered) spectrum of 88-108 MHZ with an ADC > running at 80MSPS. this gives me the spectrum in the digital domain at 8 - > 28MHz with an image at 52 - 72MHz . > > From this I do I/Q mixing to downsample the desired channel to 0MHz and then > filter and decimate. > The first filter / decimate stage is a 1MHz pass 9MHz stop filter and I > decimate by 8, taking my sample rate down to 10MSPS. > > After this I apply tighter filter 200kHz pass 400kHz stop on the I and Q so > that I only have my desired station left. > > This is where the problem comes, if I run this straight into an arctan > (cordic) and then phase unwrap / differentiate the system works fine, > however I have 10MSPS to represent a signal with a bandwidth of ~400kHz > which seems to be a major overkill. > > If I decimate after this final filter stage (as I was planning to) by a > factor of 8, this gets my sample rate down to 1.25MSPS which is more > reasonable, however my audio becomes badly distorted. > > A fair amount of experimentation has let me to believe that the distortion > is comming from the phase unwrap process, as when I decimate further, the > phase jumps will get larger, when the phase jumps get greater then pi, the > unwrap will assume a wrap occured and try to correct for it. > > The way I came to this conclusion is with an FM test generator, When I dont > decimate in this last stage, I can demodulate a normal FM carrier (with a > deviation of 75kHz) with out a problem. If I decimate by 2 here, then i get > distortion, but if I bring the carrier deviation down to ~50kHz, then the > distortion goes. when I decimate by 8 I can clear the distortion by reducing > the carrier deviation to ~20kHz. The carrier has no effect on this > distortion, and the spectrum of the signal after decimation and before the > cordic looks correct in all instances. > > So...... This has left me scratching my head, as I thought that I should > only require the BW * 2 + a little but as the sampling frequency, however > this does not seem to be the case here. If anyone has any input that would > be appreciated. Are my results here to be expected or would you have assumed > otherwise? > > > Regards, > > Paul Solomon > >
Run the numbers. With a carrier deviation of 75kHz and a sampling rate of 1.25MSPS then you should see no more than (2 pi rad/cycle) * (75kHz) / (1.25MSPS) = 0.377 radians, which is hardly a half-circle! While there must be something going on to cause your distortion it isn't from excessive wrap. It may be in your wrap detector (are you perhaps overdetecting wrap?) or your cordic implementation may have some nonlinearities. You could take Clay's suggestion, although you'll need to keep the sampling rate up: if I'm right that method uses the small-angle approximation and will distort for large phase jumps. This is a cool saga to watch -- I've been wanting to implement something like this for narrow band FM; it's nice to know you're out there hacking the brush down for the rest of us. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
"Clay S. Turner" <Physics@Bellsouth.net> wrote in message 
news:zkVHe.2499$jq.2292@bignews3.bellsouth.net...
> > "Paul Solomon" <psolomon@tpg.com.au> wrote in message > news:42f01ac4@dnews.tpgi.com.au... >> Hi All, >> >> >> A fair amount of experimentation has let me to believe that the >> distortion is comming from the phase unwrap process, as when I decimate >> further, the phase jumps will get larger, when the phase jumps get >> greater then pi, the unwrap will assume a wrap occured and try to correct >> for it. >> >> > > Hello Paul, > > You may have missed my post, but I gave a method that completely avoids > both the cordic atan and phase unwrapping processes. > > your phase > > theta = atan(Q/I) > > and freq > > omega = (d/dt) atan(Q/I) > > just carry out the calculus > > omega = (I*(d/dt)Q - Q*(d/dt)I) / (I^2 + Q^2) > > So all you need is two differentiators and two delays to directly go from > I,Q to FM demod. No cordic or unwrapping needed! This is had with a pair > of FIR differentiators and an extra pair of pointers to pull the delayed > data from the filters' buffers. It just doesn't get simpler except if your > AGC is real good, then the denominator in the above expression may become > a simple constant. > > Clay > > > >
Hi Clay, I saw this post last time, however I had already gone down the track of the cordic implementation so I wanted to see if I could get it to work that way. I am implementing this on an FPGA so the cordic should work out to be a fairly efficient implementation, however I am interested in finding out more about this other method which you have suggested. I have seen a few other posts relating to this demod style, and I heard that it is only an approximation. I am fairly concerned in maintaing the quality of the signal comming in as it is going to be used for retransmission. So I guess there are 2 things that I am unsure about, and maybe you could point me to some good references. 1. What is the FIR differentiator, i.e. how do you calculate the number of taps necessary for a given quality, and work out the coeffecients? 2. What is this form of demodulation called? (This would help me with google) Regards, Paul Solomon
"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:11f09ir8lbvg23a@corp.supernews.com...
> Paul Solomon wrote: >> Hi All, >> >> Thanks for your assistance so far. I have finally got a working FM demod >> module that allows me to stick an antenna (with a LNA) on the input of my >> dev board and listen to the radio on the output of a DAC. >> >> I however have hit an unexpected issue in the design relating to the >> minimum sample rate of the signals throughout the system which I would >> like to get a second opinion on. >> >> I am under-sampling a clean (filtered) spectrum of 88-108 MHZ with an ADC >> running at 80MSPS. this gives me the spectrum in the digital domain at >> 8 - 28MHz with an image at 52 - 72MHz . >> >> From this I do I/Q mixing to downsample the desired channel to 0MHz and >> then filter and decimate. >> The first filter / decimate stage is a 1MHz pass 9MHz stop filter and I >> decimate by 8, taking my sample rate down to 10MSPS. >> >> After this I apply tighter filter 200kHz pass 400kHz stop on the I and Q >> so that I only have my desired station left. >> >> This is where the problem comes, if I run this straight into an arctan >> (cordic) and then phase unwrap / differentiate the system works fine, >> however I have 10MSPS to represent a signal with a bandwidth of ~400kHz >> which seems to be a major overkill. >> >> If I decimate after this final filter stage (as I was planning to) by a >> factor of 8, this gets my sample rate down to 1.25MSPS which is more >> reasonable, however my audio becomes badly distorted. >> >> A fair amount of experimentation has let me to believe that the >> distortion is comming from the phase unwrap process, as when I decimate >> further, the phase jumps will get larger, when the phase jumps get >> greater then pi, the unwrap will assume a wrap occured and try to correct >> for it. >> >> The way I came to this conclusion is with an FM test generator, When I >> dont decimate in this last stage, I can demodulate a normal FM carrier >> (with a deviation of 75kHz) with out a problem. If I decimate by 2 here, >> then i get distortion, but if I bring the carrier deviation down to >> ~50kHz, then the distortion goes. when I decimate by 8 I can clear the >> distortion by reducing the carrier deviation to ~20kHz. The carrier has >> no effect on this distortion, and the spectrum of the signal after >> decimation and before the cordic looks correct in all instances. >> >> So...... This has left me scratching my head, as I thought that I should >> only require the BW * 2 + a little but as the sampling frequency, however >> this does not seem to be the case here. If anyone has any input that >> would be appreciated. Are my results here to be expected or would you >> have assumed otherwise? >> >> >> Regards, >> >> Paul Solomon > Run the numbers. With a carrier deviation of 75kHz and a sampling rate of > 1.25MSPS then you should see no more than > (2 pi rad/cycle) * (75kHz) / (1.25MSPS) = 0.377 radians, which is hardly a > half-circle! While there must be something going on to cause your > distortion it isn't from excessive wrap. It may be in your wrap detector > (are you perhaps overdetecting wrap?) or your cordic implementation may > have some nonlinearities. > > You could take Clay's suggestion, although you'll need to keep the > sampling rate up: if I'm right that method uses the small-angle > approximation and will distort for large phase jumps. > > This is a cool saga to watch -- I've been wanting to implement something > like this for narrow band FM; it's nice to know you're out there hacking > the brush down for the rest of us. > > -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com
Hi Tim, Thanks for this reply, I had the same conclusion as you, except then I cannot explain why it is working at 10MSPS and not at 5MSPS (or 1.25). I guess it is time to go back to matlab and do some more modelling. I will let you know what I find when I finally crack this one! Regards, Paul Solomon
when you look at the distortion with the signal generator....

is the distortion a function only of the deviation or is the distortion
also a function of the modulating tone frequency?

In other words is the maximum deviation that you can demodulate without
distortion a function of the modulating frequency or not?

There was an article in RF design (many years ago) about a DSP based FM
stereo exciter and there was something about the sampling rate having
to be higher then you would think.  I'll see if I can locate the
article.

Mark
 

Mark

"Clay S. Turner" <Physics@Bellsouth.net> wrote in message
news:zkVHe.2499$jq.2292@bignews3.bellsouth.net...
> > "Paul Solomon" <psolomon@tpg.com.au> wrote in message > news:42f01ac4@dnews.tpgi.com.au... > > Hi All, > > > > > > A fair amount of experimentation has let me to believe that the
distortion
> > is comming from the phase unwrap process, as when I decimate further,
the
> > phase jumps will get larger, when the phase jumps get greater then pi,
the
> > unwrap will assume a wrap occured and try to correct for it. > > > > > > Hello Paul, > > You may have missed my post, but I gave a method that completely avoids
both
> the cordic atan and phase unwrapping processes. > > your phase > > theta = atan(Q/I) > > and freq > > omega = (d/dt) atan(Q/I) > > just carry out the calculus > > omega = (I*(d/dt)Q - Q*(d/dt)I) / (I^2 + Q^2) > > So all you need is two differentiators and two delays to directly go from > I,Q to FM demod. No cordic or unwrapping needed! This is had with a pair
of
> FIR differentiators and an extra pair of pointers to pull the delayed data > from the filters' buffers. It just doesn't get simpler except if your AGC
is
> real good, then the denominator in the above expression may become a
simple
> constant. > > Clay > > > >
You took the very words from my mouth. However, can I ask what hardware (DSP or FPGA) the original poster is using? The AGC would have to be such a high bandwidth that the envelope is flattened for the denominator to be ignored however.An AGC is nornally slow and preserves the amplitude variations. Thus the denominator acts like a limiter of sorts. Shytot
"Paul Solomon" <psolomon@tpg.com.au> wrote in message
news:42f029e7@dnews.tpgi.com.au...
> > "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:11f09ir8lbvg23a@corp.supernews.com... > > Paul Solomon wrote: > >> Hi All, > >> > >> Thanks for your assistance so far. I have finally got a working FM
demod
> >> module that allows me to stick an antenna (with a LNA) on the input of
my
> >> dev board and listen to the radio on the output of a DAC. > >> > >> I however have hit an unexpected issue in the design relating to the > >> minimum sample rate of the signals throughout the system which I would > >> like to get a second opinion on. > >> > >> I am under-sampling a clean (filtered) spectrum of 88-108 MHZ with an
ADC
> >> running at 80MSPS. this gives me the spectrum in the digital domain at > >> 8 - 28MHz with an image at 52 - 72MHz . > >> > >> From this I do I/Q mixing to downsample the desired channel to 0MHz and > >> then filter and decimate. > >> The first filter / decimate stage is a 1MHz pass 9MHz stop filter and I > >> decimate by 8, taking my sample rate down to 10MSPS. > >> > >> After this I apply tighter filter 200kHz pass 400kHz stop on the I and
Q
> >> so that I only have my desired station left. > >> > >> This is where the problem comes, if I run this straight into an arctan > >> (cordic) and then phase unwrap / differentiate the system works fine, > >> however I have 10MSPS to represent a signal with a bandwidth of ~400kHz > >> which seems to be a major overkill. > >> > >> If I decimate after this final filter stage (as I was planning to) by a > >> factor of 8, this gets my sample rate down to 1.25MSPS which is more > >> reasonable, however my audio becomes badly distorted. > >> > >> A fair amount of experimentation has let me to believe that the > >> distortion is comming from the phase unwrap process, as when I decimate > >> further, the phase jumps will get larger, when the phase jumps get > >> greater then pi, the unwrap will assume a wrap occured and try to
correct
> >> for it. > >> > >> The way I came to this conclusion is with an FM test generator, When I > >> dont decimate in this last stage, I can demodulate a normal FM carrier > >> (with a deviation of 75kHz) with out a problem. If I decimate by 2
here,
> >> then i get distortion, but if I bring the carrier deviation down to > >> ~50kHz, then the distortion goes. when I decimate by 8 I can clear the > >> distortion by reducing the carrier deviation to ~20kHz. The carrier has > >> no effect on this distortion, and the spectrum of the signal after > >> decimation and before the cordic looks correct in all instances. > >> > >> So...... This has left me scratching my head, as I thought that I
should
> >> only require the BW * 2 + a little but as the sampling frequency,
however
> >> this does not seem to be the case here. If anyone has any input that > >> would be appreciated. Are my results here to be expected or would you > >> have assumed otherwise? > >> > >> > >> Regards, > >> > >> Paul Solomon > > Run the numbers. With a carrier deviation of 75kHz and a sampling rate
of
> > 1.25MSPS then you should see no more than > > (2 pi rad/cycle) * (75kHz) / (1.25MSPS) = 0.377 radians, which is hardly
a
> > half-circle! While there must be something going on to cause your > > distortion it isn't from excessive wrap. It may be in your wrap
detector
> > (are you perhaps overdetecting wrap?) or your cordic implementation may > > have some nonlinearities. > > > > You could take Clay's suggestion, although you'll need to keep the > > sampling rate up: if I'm right that method uses the small-angle > > approximation and will distort for large phase jumps. > > > > This is a cool saga to watch -- I've been wanting to implement something > > like this for narrow band FM; it's nice to know you're out there hacking > > the brush down for the rest of us. > > > > -- > > > > Tim Wescott > > Wescott Design Services > > http://www.wescottdesign.com > > Hi Tim, > > Thanks for this reply, > > I had the same conclusion as you, except then I cannot explain why it is > working at 10MSPS and not at 5MSPS (or 1.25). I guess it is time to go
back
> to matlab and do some more modelling. > > I will let you know what I find when I finally crack this one! > > Regards, > > Paul Solomon > >
Another question...after you have sampeld the entire 20MHz FM broadcast spectrum are then tuning the radio by just selecting quadrature sin and cos at a given carrier freq? Also can you use quadrature square waves instead of sin and cos (since the higher harmonics get filtered).Also what are you using as a front end? I find such work fascinating but I cannot help thinking...why go to all the trouble of software radio when an analogue fornt end is needed and it costs 10-100 times as much. Shytot Shytot
"Mark" <makolber@yahoo.com> wrote in message
news:1123038479.124518.29680@z14g2000cwz.googlegroups.com...
> when you look at the distortion with the signal generator.... > > is the distortion a function only of the deviation or is the distortion > also a function of the modulating tone frequency? > > In other words is the maximum deviation that you can demodulate without > distortion a function of the modulating frequency or not? > > There was an article in RF design (many years ago) about a DSP based FM > stereo exciter and there was something about the sampling rate having > to be higher then you would think. I'll see if I can locate the > article. > > Mark > > > Mark >
From what I have read the sampling rate of 80MHz is quite normal...its the ADC you need to be careful of..jitter for instance and teh analogue bandwidth of the ADC. Shytot
"Shytot" <Shytot@yme.com> wrote in message 
news:9aXHe.5388$PL5.487667@news.xtra.co.nz...
> > "Clay S. Turner" <Physics@Bellsouth.net> wrote in message > news:zkVHe.2499$jq.2292@bignews3.bellsouth.net... >> >> "Paul Solomon" <psolomon@tpg.com.au> wrote in message >> news:42f01ac4@dnews.tpgi.com.au... >> > Hi All, >> > >> > >> > A fair amount of experimentation has let me to believe that the > distortion >> > is comming from the phase unwrap process, as when I decimate further, > the >> > phase jumps will get larger, when the phase jumps get greater then pi, > the >> > unwrap will assume a wrap occured and try to correct for it. >> > >> > >> >> Hello Paul, >> >> You may have missed my post, but I gave a method that completely avoids > both >> the cordic atan and phase unwrapping processes. >> >> your phase >> >> theta = atan(Q/I) >> >> and freq >> >> omega = (d/dt) atan(Q/I) >> >> just carry out the calculus >> >> omega = (I*(d/dt)Q - Q*(d/dt)I) / (I^2 + Q^2) >> >> So all you need is two differentiators and two delays to directly go from >> I,Q to FM demod. No cordic or unwrapping needed! This is had with a pair > of >> FIR differentiators and an extra pair of pointers to pull the delayed >> data >> from the filters' buffers. It just doesn't get simpler except if your AGC > is >> real good, then the denominator in the above expression may become a > simple >> constant. >> >> Clay >> >> >> >> > You took the very words from my mouth. However, can I ask what hardware > (DSP or FPGA) the original poster is using? The AGC would have to be such > a > high bandwidth that the envelope is flattened for the denominator to be > ignored however.An AGC is nornally slow and preserves the amplitude > variations. Thus the denominator acts like a limiter of sorts. > > Shytot > >
Hi, I am currently using a Altera Stratix, but will be moving the design to a Stratix II when my new dev board arrives.