DSPRelated.com
Forums

FM demod using PLL

Started by lightmetal November 10, 2003
Hello Tom et. al.,

The modulation index equals the deviation frequency divided by the
modulation frequency. The suppressed carrier requirement is for this index
to equal a zero of the Bessel function J0(x). The 1st several occur at
2.405, 5.520, 8.654, 11.792, etc.

So if your modulation frequency is 400 Hz, then if the deviation frequency
is one of 962, 2208, 3462,  4717 Hz, then there with be no residual carrier.
Since you stated the bandwidth looks like it is only plus or minus 3kHz and
you have a suppressed carrier, I suspect that your deviation frequency is
around 2kHz. And a perfect nulling occurs at 2208 Hz. If you are relying on
a pilot tone, then make sure its modulation index is away from a zero of
J0(x).

Clay





"Tom" <somebody@nOpam.com> wrote in message
news:3FB2CD5A.ADCB94E5@nOpam.com...
> > > lightmetal wrote: > > > Tom, > > > > I am using an FM signal generator and downconverting the signal to > > 12k. I don't know what the modulation index is but the signal looks > > like it occupies +/- 3k or so. > > > > I am sure that if I run the carrier only (I tested this but not with > > your pll) and sweep it as you suggest, the pll will track it. > > > > The problem as I see it is when I use the 400hz tone modulation from > > the signal generator the 12khz nulls due to the modulation. I > > recorded some FM two-way voice signals and they follow the same rule, > > though since the PL tone is present, they also null with no voice > > input. > > > > So I would think I need to recover the carrier as an average of the > > +/- excursions from 12k unless I am reading this wrong. > > > > If I understand it correctly, when you generate data with matlab, you > > are adding or subtracting the phase of the modulation (times the > > index) to the 12k signal and then taking the cos of the result. This > > makes sense but doesn't look the same as real data on an fft plot. It > > might be that the real signal has a multiplicity of sidebands out to > > the IF filter? > > > > I am missing something since I know PLL's lock to FM voice signals. > > When you say the 12kHz nulls does it sweep up and down from a centre > frequency od 12kHz? > ie set the modulating frequency to something really small - say 2HZ - if > possible. If there is no sign of the carrier then that woudl explain why > the PLL cannot lock. When you down-convert maybe the IF filter is set at > the wrong centre frequency. In any case you can do a test by FMing a > carrier at 12kHz and skip the down convertor - do it direct as a test. > > Maybe I can ask you a few questions. I have read a little bit about > sofware radio. Just how much of it is software? Is the front end still > hardware ie the RF amp, down convertor etc? How do you do the tuned > circuit if you want an AM radio for instance (well I suppose I can guess). > > Tom > > >

"Clay S. Turner" wrote:

> Hello Tom et. al., > > The modulation index equals the deviation frequency divided by the > modulation frequency. The suppressed carrier requirement is for this index > to equal a zero of the Bessel function J0(x). The 1st several occur at > 2.405, 5.520, 8.654, 11.792, etc. > > So if your modulation frequency is 400 Hz, then if the deviation frequency > is one of 962, 2208, 3462, 4717 Hz, then there with be no residual carrier. > Since you stated the bandwidth looks like it is only plus or minus 3kHz and > you have a suppressed carrier, I suspect that your deviation frequency is > around 2kHz. And a perfect nulling occurs at 2208 Hz. If you are relying on > a pilot tone, then make sure its modulation index is away from a zero of > J0(x). > > Clay > > "Tom" <somebody@nOpam.com> wrote in message > news:3FB2CD5A.ADCB94E5@nOpam.com... > > > > > > lightmetal wrote: > > > > > Tom, > > > > > > I am using an FM signal generator and downconverting the signal to > > > 12k. I don't know what the modulation index is but the signal looks > > > like it occupies +/- 3k or so. > > > > > > I am sure that if I run the carrier only (I tested this but not with > > > your pll) and sweep it as you suggest, the pll will track it. > > > > > > The problem as I see it is when I use the 400hz tone modulation from > > > the signal generator the 12khz nulls due to the modulation. I > > > recorded some FM two-way voice signals and they follow the same rule, > > > though since the PL tone is present, they also null with no voice > > > input. > > > > > > So I would think I need to recover the carrier as an average of the > > > +/- excursions from 12k unless I am reading this wrong. > > > > > > If I understand it correctly, when you generate data with matlab, you > > > are adding or subtracting the phase of the modulation (times the > > > index) to the 12k signal and then taking the cos of the result. This > > > makes sense but doesn't look the same as real data on an fft plot. It > > > might be that the real signal has a multiplicity of sidebands out to > > > the IF filter? > > > > > > I am missing something since I know PLL's lock to FM voice signals. > > > > When you say the 12kHz nulls does it sweep up and down from a centre > > frequency od 12kHz? > > ie set the modulating frequency to something really small - say 2HZ - if > > possible. If there is no sign of the carrier then that woudl explain why > > the PLL cannot lock. When you down-convert maybe the IF filter is set at > > the wrong centre frequency. In any case you can do a test by FMing a > > carrier at 12kHz and skip the down convertor - do it direct as a test. > > > > Maybe I can ask you a few questions. I have read a little bit about > > sofware radio. Just how much of it is software? Is the front end still > > hardware ie the RF amp, down convertor etc? How do you do the tuned > > circuit if you want an AM radio for instance (well I suppose I can guess). > > > > Tom > > > > > >
If you have no power at the carrier and you have a pilot tone then of course you must lock onto the pilot and divide down to the carrier - you cannot lock onto a carrier that is not there. Tom
Tom, I haven't looked that closely at real data to say that it sweeps
up and down, though, I think would be almost correct depending on
modulation frequency.  I will try it later tomorrow with a few hz
which I think will give the results you are suggesting.  From what
I've read and seen, it isn't the fundamental that causes all the
problems but all the associated harmonics that you don't see in
matlab.  When observing with a spectrum analyzer, the 400hz modulating
12khz looks like a carrier but as you raise the index, it becomes a
wide flat carrier (aka square wave is fundamental plus harmonics)
until it hits the filters either in the receiver IF or transmitter.

As far as the hardware, it could be as simple as a pair of mixers with
a local osc. feeding a twisted wire quadrature splitter.  My hardware
is more complex in that I am using RF preamps, mixers, quadrature DDS
(sin/cos from one AD9854) along with preamps prior to the ADC and
ultimately the SHARC DSP.

Once I/Q are in the DSP, AM, FM, SSB, ISB and everything else is
demod'ed by software.  True software radio would skip the hardware and
go right to a mega sampling codec as long as you could live with 12bit
or maybe now 14bit conversion.  Using the SHARC and other Analog
Devices hardware gives me 24bit at up to 96khz coming from the mixers.

See the following post from Clay re: the carrier null.  I need to do
more research on PLL's.  I have Best's book from about 10yrs ago and
ordered a few more.  I am also going to look at the PL tones used in
two-way and try to find how others are doing PLL in linear (or DPPL)
to lock to FM.  It might be just a case of the correct loop filter.

I'll know more in a day or two after I get some meetings out of the
way.

Thanks again for hanging in there with me.


Tom <somebody@nOpam.com> wrote in message news:<3FB2CD5A.ADCB94E5@nOpam.com>...
> When you say the 12kHz nulls does it sweep up and down from a centre > frequency od 12kHz? > ie set the modulating frequency to something really small - say 2HZ - if > possible. If there is no sign of the carrier then that woudl explain why > the PLL cannot lock. When you down-convert maybe the IF filter is set at > the wrong centre frequency. In any case you can do a test by FMing a > carrier at 12kHz and skip the down convertor - do it direct as a test. > > Maybe I can ask you a few questions. I have read a little bit about > sofware radio. Just how much of it is software? Is the front end still > hardware ie the RF amp, down convertor etc? How do you do the tuned > circuit if you want an AM radio for instance (well I suppose I can guess). > > Tom
Tom,

I was finally able to get the simulink FM passband demodulator to work
on my data.  I had to set the VCO gain to greater than 8000.  It
tracks and demods the signal very well, about 15db s/n improvement
over some of my other methods.

How would this apply to your code?

lightmetal wrote:

> Tom, > > I was finally able to get the simulink FM passband demodulator to work > on my data. I had to set the VCO gain to greater than 8000. It > tracks and demods the signal very well, about 15db s/n improvement > over some of my other methods. > > How would this apply to your code?
I have not used the simulink PLL. The VCO gain can be varied? Normally the VCO gain will change as you change the free-running frequency (in a real PLL). I expect what is happening is that you are not set up for teh right frequency. My PLL is set up for a carrier frequency of 1kHz if I remember right- sampling at 10kHz. If you define the carrier frequency to be 12kHz then the PLL bandwidth will be set up to be 2.4kHz - this is the unity gain frequency of the PLL.It should re-calculate everything so it is still stable. You could try tweeking the overall gain and see what difference that makes, This is the only factor that could change. You need to change gainp in the Matlab code.Another thing you can do is to alter the amplitude of the FM - this will do the same thing. Move it up and down until it locks. Cheers Tom
Tom,

I have it working.  It looks like your code needs to have an average
FM input of ~1.  I multiplied my data and it works great.

S/N ration as a summary:

FM arctan approximation methods                ~54 to 55  (2nd and 3rd
high)
FM arctan approx using 3 point differentiator        ~57
FM arctan method with constant input amplitude       ~58

matlab demod command                                 ~68

simulink fm demod                                    ~70  (low
harmonics )

Your code                                            ~74  <----- 

The input data came from a down converted 1.6mhz carrier modulated
with 400hz.  The IF was 12k.  I used an AD1836 24bit codec on the
output of the downconverted with a sample rate of 48khz.  I truncated
the 24bit data to 16bits using an ADI ADSP-21161 floating point DSP
and digitally transfered it to the PC for analysis.  I used both
matlabs sptool and soundforge for the spectrum analysis.


Thanks again for all your help and code.  Contact me offline if you
would like to discuss software based radio down conversion.

lightmetal wrote:

> Tom, > > I have it working. It looks like your code needs to have an average > FM input of ~1. I multiplied my data and it works great. > > S/N ration as a summary: > > FM arctan approximation methods ~54 to 55 (2nd and 3rd > high) > FM arctan approx using 3 point differentiator ~57 > FM arctan method with constant input amplitude ~58 > > matlab demod command ~68 > > simulink fm demod ~70 (low > harmonics ) > > Your code ~74 <----- > > The input data came from a down converted 1.6mhz carrier modulated > with 400hz. The IF was 12k. I used an AD1836 24bit codec on the > output of the downconverted with a sample rate of 48khz. I truncated > the 24bit data to 16bits using an ADI ADSP-21161 floating point DSP > and digitally transfered it to the PC for analysis. I used both > matlabs sptool and soundforge for the spectrum analysis. > > Thanks again for all your help and code. Contact me offline if you > would like to discuss software based radio down conversion.
Hi there, glad to hear it is working. You can experiment a bit now. To get better traking (but worse transient performance) you can change the span ratio from 10:1 to something a little lower. The phase margin is given by pmargin = arcsin[(span-1)/(span+1)] and from phase margin you can deduce overshoot. For instance for 10:1 span we have arcsin (9/11) as a phase margin (convert to degrees). If you reduce this to 5:1 then the phase margin goes down but the gain at low frequencies goes up. You can also play with the bandwidth by increasing it. Make it too big of course and too much 2fc will get through which we don't want. You might get better SNR with a lower bandwidth but the tracking will not be as good and as you get really low it will be difficult to achieve lock.The hwole thing is one big trade off.Aslo make sure you have no hard limiters as at low SNRs it can make things worse. One thing you can try is to put AGC in front of the PLL (instead of a hard limiter) I have code for that somewhere on Google (pseodo code but it is really easy to follow). I learnt all about analogue PLLs from my mentor Archie Pettigrew - he is the one to thank! regards Tom
Tom, After playing with the results in your code and the matlab
simulink PLL demod, I noticed that there is a roll-off in the high
frequencies so that by 3khz the signal is donw about 30db.  How do you
usually correct this?  I can modify the band pass filter that follows
the pll but was wondering if there is something else to tweak.

Thanks

lightmetal wrote:

> Tom, After playing with the results in your code and the matlab > simulink PLL demod, I noticed that there is a roll-off in the high > frequencies so that by 3khz the signal is donw about 30db. How do you > usually correct this? I can modify the band pass filter that follows > the pll but was wondering if there is something else to tweak. > > Thanks
The PLL is designed to be a type II ie it has two integrators within it. One of these is due to the inherent VCO characteristics and the other is due to a pure integrator (in many real PLLs a phase lag network is used rather than a pure integrator - some people call these lag-lead). In any case the open-loop Bode plot has the form -12dB/octave then -6dB/octove through unity gain (the bandwidth) and then a further roll off at -12dB/octave at higher frequencies. The reason for the steep roll-off is to attenuate 2fc feedthrough (ie to act as a filter) and any noise. It woudl be possible to reduce the effect of this filter by increasing the span ratio . You would still have a -12dB/octave roll off at high frequencies but the cut-off (break point frequency) would be higher. The span raio is defined as the ratio of the upper cut off to the lower most break point frequencies. The upper one is the final roll-down whilst the lower one is a change from -12 to -6dB/octave through unity gain. There are many possibilities, each which have effects on otehr parameters.You could have a loop which did -12 then -6dB/octave and no -12dB/octave at high frequencies but there would be more noise and 2fc carrier feedthrough. Alternatively you can increase the span ratio.For a given fixed unity gain frequency this would make the tracking ability of the loop worse but would reduce the effect of the roll-off. I would need lots of Bode diagrasm to explain it all but for the time being just try increasing the span raio from 10 to say 30 and see the effect. You do not have the freedom to increase the bandwith (unity gain crossover freq) by too much more due to the 2fc feedthrough term.The PLL is just a servo like any other and there are strict limits on what you can do. Alter one thing and it effects another. The main limiting factor is bandwidth (unity gain). Tom
Tom,
I think I understand all the PLL issues.  I was just wondering how you
normally account for the rolloff since I am using the output of the
PLL for the demodulated FM.  I could use a multirate output bandpass
filter but they are harder to calculate on the fly as I do today.

Thanks again.



Tom <somebody@nOpam.com> wrote in message news:<3FBA97CD.53931E66@nOpam.com>...
> lightmetal wrote: > > > Tom, After playing with the results in your code and the matlab > > simulink PLL demod, I noticed that there is a roll-off in the high > > frequencies so that by 3khz the signal is donw about 30db. How do you > > usually correct this? I can modify the band pass filter that follows > > the pll but was wondering if there is something else to tweak. > > > > Thanks > > The PLL is designed to be a type II ie it has two integrators within it. > One of these is due to the inherent VCO characteristics and the other is > due to a pure integrator (in many real PLLs a phase lag network is used > rather than a pure integrator - some people call these lag-lead). In any > case the open-loop Bode plot has the form -12dB/octave then -6dB/octove > through unity gain (the bandwidth) and then a further roll off at > -12dB/octave at higher frequencies. The reason for the steep roll-off is > to attenuate 2fc feedthrough (ie to act as a filter) and any noise. It > woudl be possible to reduce the effect of this filter by increasing the > span ratio . You would still have a -12dB/octave roll off at high > frequencies but the cut-off (break point frequency) would be higher. The > span raio is defined as the ratio of the upper cut off to the lower most > break point frequencies. The upper one is the final roll-down whilst the > lower one is a change from -12 to -6dB/octave through unity gain. There > are many possibilities, each which have effects on otehr parameters.You > could have a loop which did -12 then -6dB/octave and no -12dB/octave at > high frequencies but there would be more noise and 2fc carrier > feedthrough. Alternatively you can increase the span ratio.For a given > fixed unity gain frequency this would make the tracking ability of the > loop worse but would reduce the effect of the roll-off. I would need lots > of Bode diagrasm to explain it all but for the time being just try > increasing the span raio from 10 to say 30 and see the effect. You do not > have the freedom to increase the bandwith (unity gain crossover freq) by > too much more due to the 2fc feedthrough term.The PLL is just a servo like > any other and there are strict limits on what you can do. Alter one thing > and it effects another. The main limiting factor is bandwidth (unity > gain). > > > Tom