Reply by robert bristow-johnson October 17, 20072007-10-17
On Sep 23, 12:26 pm, wi...@yahoo.com wrote:
> Assume there is a real function f and its spectrum F. If f is discrete > sampled, we have samples at some t = st * k, where st is sampling > period and k = 0, 1, 2, ..., N - 1. Also assume every frequency in f > is within [-fc..fc] range, fc = Nyqist frequency. If f is a simple > sine function whose minimums, zeros and maximums are at the sampling > points, F will be very "good", without leakage and just by looking at > some point of F we can see what is the frequency m of f = > sin(2*pi*m). > > However, if this is not the case, i.e. extremal points of f do not lay > on the sampled points (k = 0, 1, 2, ..., N - 1), this will not be the > case - there will be leakage. Assume that I calculated F from the > known f and I have N/2 bins of F at my hand. Bin n - 1 is for > frequency m - j, bin n is for frequency m and bin n + 1 for frequency > m + j. How can I calculate the power for frequency e.g. m - j / 2 or m > + j / 3 or such? That is, calculate the power at some frequency for > which I don't have F defined, which I presume would allow me to see > which frequency is the "main" one (let away special cases).
dunno if you're interested, but i did a paper in 2001 (Mohonk, geez, i wonder if it's going on now?) where, in the case of using a Gaussian window on the data, i had an reasonably elegant solution for estimating the instantaneous frequency (at the midddle of the window), the sweep-rate, and ramp-rate in log amplitude (and amplitude). it requires FFT, discrete-derivative, complex log, least-squares fit to a linear function, and a closed form expression for extracting the parameters we want out of the complex slope and offset parameters from the linear function. it *does* assume it's not interfered with significantly by ohter swept sinusoids. that's a deficiency in the algorithm. r b-j
Reply by wx October 17, 20072007-10-17
All of you,

Thank you very much for the information. Sorry for the delay on this,
I didn't have time to do this in the past month, so I decided I will
wait until I can do it well. I tried some of the things mentioned
above (like quadratic interpolation found in the links mnentwig gave)
and I applied Hann window (which I didn't before), so it worked pretty
well. I am still not completely satisfied with the result and I will
look into this a little more.

Thanks again and good day to you all!

Reply by mnentwig September 25, 20072007-09-25
Ah, we are talking about different things.
Those discussions are usually the best. Well, the most entertaining for
the audience at least, not necessarily the most productive. 
I am actually not arguing with you.

My statement was and is that the original poster might need a standard
"Proakis-chapter-six" carrier recovery instead of a wild FFT scheme, as is
the subject of the thread. Yes, the original post says nothing about
carrier recovery. But that's still what might be the most useful.

I hope that clarifies.

-mn
Reply by stan September 25, 20072007-09-25
On Sep 25, 2:57 pm, "mnentwig" <mnent...@elisanet.fi> wrote:
> >>Bad in what way? Maximum likelihood is hard to beat. > > Huh? What does FFT have to do with maximum likelyhood? > > From a practical point of view, I doubt think that a majority of carrier > recovery schemes relies on FFT, and that may be what the OP really needs. > > >Why FM demod? Once the PLL is locked up, read it's frequency. If the > >frequency is variable, the PLL *is* the FM demod. > > That's right and that's my point. But search for PLL alone, and I doubt > something relevant will come up at the top. Search for FM demodulation > -and- PLL... well, you said it already. > > -mn
The original post says nothing about carrier recovery. As far as Maxlikelihood, read the article I cited.
Reply by mnentwig September 25, 20072007-09-25
>>Bad in what way? Maximum likelihood is hard to beat.
Huh? What does FFT have to do with maximum likelyhood? From a practical point of view, I doubt think that a majority of carrier recovery schemes relies on FFT, and that may be what the OP really needs.
>Why FM demod? Once the PLL is locked up, read it's frequency. If the >frequency is variable, the PLL *is* the FM demod.
That's right and that's my point. But search for PLL alone, and I doubt something relevant will come up at the top. Search for FM demodulation -and- PLL... well, you said it already. -mn
Reply by Jerry Avins September 25, 20072007-09-25
mnentwig wrote:
> Just wondering... > If I go back to square one, it may turn out that FFT itself is a bad > approach. > Simple carrier recovery / PLL / FM demodulator / ... might be what is > really needed.
Why FM demod? Once the PLL is locked up, read it's frequency. If the frequency is variable, the PLL *is* the FM demod. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Reply by stan September 25, 20072007-09-25
On Sep 25, 12:10 pm, "mnentwig" <mnent...@elisanet.fi> wrote:
> Just wondering... > If I go back to square one, it may turn out that FFT itself is a bad > approach. > Simple carrier recovery / PLL / FM demodulator / ... might be what is > really needed. > > -mn
Bad in what way? Maximum likelihood is hard to beat.
Reply by mnentwig September 25, 20072007-09-25
Just wondering...
If I go back to square one, it may turn out that FFT itself is a bad
approach. 
Simple carrier recovery / PLL / FM demodulator / ... might be what is
really needed.

-mn
Reply by stan September 25, 20072007-09-25
On Sep 25, 11:29 am, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> On Sun, 23 Sep 2007 16:26:40 -0000, wi...@yahoo.com wrote: > >Assume there is a real function f and its spectrum F. If f is discrete > >sampled, we have samples at some t = st * k, where st is sampling > >period and k = 0, 1, 2, ..., N - 1. Also assume every frequency in f > >is within [-fc..fc] range, fc = Nyqist frequency. If f is a simple > >sine function whose minimums, zeros and maximums are at the sampling > >points, F will be very "good", without leakage and just by looking at > >some point of F we can see what is the frequency m of f = > >sin(2*pi*m). > > >However, if this is not the case, i.e. extremal points of f do not lay > >on the sampled points (k = 0, 1, 2, ..., N - 1), this will not be the > >case - there will be leakage. Assume that I calculated F from the > >known f and I have N/2 bins of F at my hand. Bin n - 1 is for > >frequency m - j, bin n is for frequency m and bin n + 1 for frequency > >m + j. How can I calculate the power for frequency e.g. m - j / 2 or m > >+ j / 3 or such? That is, calculate the power at some frequency for > >which I don't have F defined, which I presume would allow me to see > >which frequency is the "main" one (let away special cases). > > As has been mentioned, regardless of the phase of the sine wave, if > the there are an integer number of cycles in the DFT aperture you'll > get the nice peak behavior. > > You seem to imply that you may be doing only real-valued processing, > though, which changes a few things but not the generalities. > > If you're really trying to better estimate the frequency of a tone > between bins, there are some good resources from folks here on > comp.dsp. Matt Donadio's treatment on dspguru has already been > linked. Here's Peter Kootsookos' page: > > http://home.comcast.net/~kootsoop/freqalgs.htm > > and mine: > > http://www.ericjacobsen.org/fe.htm > > Eric Jacobsen > Minister of Algorithms > Abineau Communicationshttp://www.ericjacobsen.org
This one in particular is good, although he doesn't handle windows. [1] Macleod, M.D., "Fast Nearly ML Estimation of the Parameters of Real or Complex Single Tones or Resolved Multiple Tones," IEEE Trans. Sig. Proc. Vol 46 No 1, January 1998, pp141-148
Reply by Eric Jacobsen September 25, 20072007-09-25
On Sun, 23 Sep 2007 16:26:40 -0000, wimxa@yahoo.com wrote:

>Assume there is a real function f and its spectrum F. If f is discrete >sampled, we have samples at some t = st * k, where st is sampling >period and k = 0, 1, 2, ..., N - 1. Also assume every frequency in f >is within [-fc..fc] range, fc = Nyqist frequency. If f is a simple >sine function whose minimums, zeros and maximums are at the sampling >points, F will be very "good", without leakage and just by looking at >some point of F we can see what is the frequency m of f = >sin(2*pi*m). > >However, if this is not the case, i.e. extremal points of f do not lay >on the sampled points (k = 0, 1, 2, ..., N - 1), this will not be the >case - there will be leakage. Assume that I calculated F from the >known f and I have N/2 bins of F at my hand. Bin n - 1 is for >frequency m - j, bin n is for frequency m and bin n + 1 for frequency >m + j. How can I calculate the power for frequency e.g. m - j / 2 or m >+ j / 3 or such? That is, calculate the power at some frequency for >which I don't have F defined, which I presume would allow me to see >which frequency is the "main" one (let away special cases).
As has been mentioned, regardless of the phase of the sine wave, if the there are an integer number of cycles in the DFT aperture you'll get the nice peak behavior. You seem to imply that you may be doing only real-valued processing, though, which changes a few things but not the generalities. If you're really trying to better estimate the frequency of a tone between bins, there are some good resources from folks here on comp.dsp. Matt Donadio's treatment on dspguru has already been linked. Here's Peter Kootsookos' page: http://home.comcast.net/~kootsoop/freqalgs.htm and mine: http://www.ericjacobsen.org/fe.htm Eric Jacobsen Minister of Algorithms Abineau Communications http://www.ericjacobsen.org