On 8/30/11 9:29 PM, Ron N wrote:> > For frequency estimation from FFT results, I might try a parabolic > interpolation when far off, and a phase vocoder estimator when > getting close. >Ron, why would you be off more than one DFT bin? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
measuruement of peak amplitude of each cycle of sinusoid having varying frequency
Started by ●August 22, 2011
Reply by ●August 30, 20112011-08-30
Reply by ●August 30, 20112011-08-30
On Aug 30, 6:34�pm, robert bristow-johnson <r...@audioimagination.com> wrote:> On 8/30/11 9:29 PM, Ron N wrote: > > > > > For frequency estimation from FFT results, I might try a parabolic > > interpolation when far off, and a phase vocoder estimator when > > getting close. > > Ron, why would you be off more than one DFT bin?Less than half a bin. Parabolic estimators seem to work well when the frequency offset is near a half a bin in size. IMO, phase vocoder estimators seem to work better for frequency offsets of a tiny fraction of 1 bin (much less than 1/2), given a non-zero amount of noise in the data. rhn
Reply by ●August 31, 20112011-08-31
On Aug 31, 1:46�am, eric.jacob...@ieee.org (Eric Jacobsen) wrote:> On Tue, 30 Aug 2011 16:03:57 -0700 (PDT), Rune Allnor > > > > > > <all...@tele.ntnu.no> wrote: > >On Aug 26, 3:58=A0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: > >> On Tue, 23 Aug 2011 13:21:52 -0500, Vladimir Vassilevsky > > >> <nos...@nowhere.com> wrote: > > >> >Eric Jacobsen wrote: > > >> >> On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashau...@hotmail.com > >> >> wrote: > > >> >>>I am measuring the peak amplitude of each cycle of a sinusoid having > >> >>>frequency of 125Hz but the frequency varies in the range 100Hz to > >> >>>150Hz after around every 3 cycles. I sample the signal for 8ms to > >> >>>capture 1 complete cycle of the sinusoid and then apply 128 point FFT > >> >>>on it to get magnitude and phase information. The algorithm works > >> >>>pretty well if the frequency remains constant at 125Hz however as the > >> >>>frequency changes i get incorrect magnitude and phase due to spectral > >> >>>leakage problem. I tried using windowing but still the results deviate > > >> >>>from actual a lot. It has been more than a week I am trying to solve > > >> >>>this problem but in vain:( Can any body please help me to solve this > >> >>>issue. > > >> >> Look into windows that provide flat-topped frequency response. =A0 The= > >se > >> >> are used in spectrum analyzers for the purpose you mention. > > >> >Dear doctor Jacobsen, > > >> >A sinusoid with variable frequency is not a sinusoid. Hence any FFT > >> >based method will produce a wrong result for amplitude. > > >> One could argue that a sinusoid without infinite duration is also not > >> a sinusoid. =A0 Since such things do not exit one could then conclude > >> that any FFT based method will produce a wrong result for amplitude > >> for any signal given to it. > > >> Most of us can see beyond that. > > >> Eric Jacobsenhttp://www.ericjacobsen.orghttp://www.dsprelated.com/blogs-1= > >//Eric_Jacobsen.php > > >The only case when the DFT coefficients are related to > >time domain amplitude, is when the sinusoidal coincides > >with a DFT basis function. > > >Consider a sinusoidal of length N and frequency (K+1)/2, K being > >some integer < N/2. No noise, quantization or anything like that; > >a perfect sinusoidal. > > >Now compute its N-length DFT. > > >How can you use the coefficientd to deduce the time > >domain amplitude of the sinusoidal? > > >Rune > > If the DFT input is composed of a single sinusoid that is > monochromatic, or a single frequency, or whatever one wishes to call > it, and the three coefficients around the DFT maximizer are known, > then one can deduce both the amplitude and frequency, regardless of > the relationship of the input frequency to the basis function > frequencies. � This assumes that the window function is known.This is totally new to me. References? You are sure you don't confuse this with 3-pt parametric model fitting in time domain? Rune
Reply by ●August 31, 20112011-08-31
On Tue, 30 Aug 2011 23:16:24 -0700 (PDT), Rune Allnor <allnor@tele.ntnu.no> wrote:>On Aug 31, 1:46=A0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: >> On Tue, 30 Aug 2011 16:03:57 -0700 (PDT), Rune Allnor >> >> >> >> >> >> <all...@tele.ntnu.no> wrote: >> >On Aug 26, 3:58=3DA0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: >> >> On Tue, 23 Aug 2011 13:21:52 -0500, Vladimir Vassilevsky >> >> >> <nos...@nowhere.com> wrote: >> >> >> >Eric Jacobsen wrote: >> >> >> >> On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashau...@hotmail.com >> >> >> wrote: >> >> >> >>>I am measuring the peak amplitude of each cycle of a sinusoid havin= >g >> >> >>>frequency of 125Hz but the frequency varies in the range 100Hz to >> >> >>>150Hz after around every 3 cycles. I sample the signal for 8ms to >> >> >>>capture 1 complete cycle of the sinusoid and then apply 128 point F= >FT >> >> >>>on it to get magnitude and phase information. The algorithm works >> >> >>>pretty well if the frequency remains constant at 125Hz however as t= >he >> >> >>>frequency changes i get incorrect magnitude and phase due to spectr= >al >> >> >>>leakage problem. I tried using windowing but still the results devi= >ate >> >> >> >>>from actual a lot. It has been more than a week I am trying to solv= >e >> >> >> >>>this problem but in vain:( Can any body please help me to solve thi= >s >> >> >>>issue. >> >> >> >> Look into windows that provide flat-topped frequency response. =3DA= >0 The=3D >> >se >> >> >> are used in spectrum analyzers for the purpose you mention. >> >> >> >Dear doctor Jacobsen, >> >> >> >A sinusoid with variable frequency is not a sinusoid. Hence any FFT >> >> >based method will produce a wrong result for amplitude. >> >> >> One could argue that a sinusoid without infinite duration is also not >> >> a sinusoid. =3DA0 Since such things do not exit one could then conclud= >e >> >> that any FFT based method will produce a wrong result for amplitude >> >> for any signal given to it. >> >> >> Most of us can see beyond that. >> >> >> Eric Jacobsenhttp://www.ericjacobsen.orghttp://www.dsprelated.com/blog= >s-1=3D >> >//Eric_Jacobsen.php >> >> >The only case when the DFT coefficients are related to >> >time domain amplitude, is when the sinusoidal coincides >> >with a DFT basis function. >> >> >Consider a sinusoidal of length N and frequency (K+1)/2, K being >> >some integer < N/2. No noise, quantization or anything like that; >> >a perfect sinusoidal. >> >> >Now compute its N-length DFT. >> >> >How can you use the coefficientd to deduce the time >> >domain amplitude of the sinusoidal? >> >> >Rune >> >> If the DFT input is composed of a single sinusoid that is >> monochromatic, or a single frequency, or whatever one wishes to call >> it, and the three coefficients around the DFT maximizer are known, >> then one can deduce both the amplitude and frequency, regardless of >> the relationship of the input frequency to the basis function >> frequencies. =A0 This assumes that the window function is known. > >This is totally new to me. References? You are sure >you don't confuse this with 3-pt parametric model >fitting in time domain? > >RuneBecause the shape of the sinx/x frequency response of the transform bin is known it is possible to interpolate the peak location and amplitude even if the samples don't line up exactly at the peak. A simple example is that if the tone is exactly halfway between bins so that two bins are of equal amplitude, then, for a rectangular window, the peak estimate is 1/(sin(pi/2)/(pi/2)) higher than the two equal samples that straddle the peak. It's also clear when the two peak samples are equal that the tone is halfway between bins. There are lots of different techniques for using the three coefficients around the DFT peak to obtain fine frequency estimates (and magnitude estimates) for isolated tones. This is not the best treatise on the idea, but it touches on two different methods for estimating frequency, with rough amplitude estimates from the second. http://www.ericjacobsen.org/FTinterp.pdf I *think* there's a longer reference list in this one: Jacobsen, E., Kootsookos, P., "Fast, Accurate Frequency Estimators", IEEE Signal Processing Magazine, Vol. 24, Issue 3, pp. 123-125, May, 2007 The general idea is pretty straighforward, though. It should be stated that these techniques start to break down when the sinusoid being estimated isn't isolated. If there's a lot of spectral content then estimating the peak amplitude of the time domain signal from the FD information isn't very practical, IMHO, without just doing an inverse transform and measuring it. Eric Jacobsen http://www.ericjacobsen.org http://www.dsprelated.com/blogs-1//Eric_Jacobsen.php
Reply by ●August 31, 20112011-08-31
Rune Allnor wrote:> On Aug 31, 1:46 am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: >>>If the DFT input is composed of a single sinusoid that is >>monochromatic, or a single frequency, or whatever one wishes to call >>it, and the three coefficients around the DFT maximizer are known, >>then one can deduce both the amplitude and frequency, regardless of >>the relationship of the input frequency to the basis function >>frequencies. This assumes that the window function is known. > > > This is totally new to me. References? You are sure > you don't confuse this with 3-pt parametric model > fitting in time domain?Dear doctor Rune, Isn't it obvious that the 3-pt parametric model could be just as well defined in the frequency domain? BTW, not very long ago a madman was proposing exactly this idea here and was catcalled for that. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●August 31, 20112011-08-31
On Aug 31, 8:33�am, Vladimir Vassilevsky <nos...@nowhere.com> wrote:> ... > > Isn't it obvious that the 3-pt parametric model could be just as well > defined in the frequency domain? > > BTW, not very long ago a madman was proposing exactly this idea here and > was catcalled for that. > > Vladimir VassilevskyLast year: http://groups.google.com/group/comp.dsp/browse_thread/thread/aba68afada5c8a55/354a256e8f978bb0?hl=en&lnk=gst&q=parabolic+interpolation+Dalrymple#354a256e8f978bb0 This year: http://groups.google.com/group/comp.dsp/browse_thread/thread/cad149a34313333f/bfc5677d530382f8?hl=en&lnk=gst&q=parabolic+interpolation+Dalrymple#bfc5677d530382f8 including, from a post May 24: %%%% begin quote %%%%% ... Consider: Use of the Discrete Fourier Transform in the Measurement of Frequencies and Levels of Tones PDF Rife, D.C.; Vincent, G.A. Bell System Technical Journal Volume 49, Issue 2, February 1970 | 11095.4K http://www.alcatel-lucent.com/bstj/vol49-1970/articles/bstj49-2-197.pdf This is a classic (but far from the first) interpolation paper. Three types of windows are discussed: class I: maximum sidelobe rolloff windows class II: (two parameter) Taylor windows class III: an ad hoc set of windows The maximum sidelobe rolloff windows are a frequent "rediscovery" in the IEEE literature. The richest collection of fft interpolation windows in the IEEE literature seems to be in the Transactions on Instrumentation and Measurement For example: http://wwwir.vub.ac.be/elec/Papers%20on%20web/Papers/JohanSchoukens/I... For comparison to other methods: http://home.mit.bme.hu/~sarhegyi/pubs/msthesis.pdf The optical guys have a long history of fft interpolation, too: http://www.eng.tau.ac.il/~yaro/RecentPublications/ps&pdf/EfficientSin... ... %%%%% end quote %%%%% You can go to the original posts to get the full version of the longer urls. Also, in the "frequency reassignment" technique for linear FM sweeps (including stationary tones), the DFT coefficients from 3 windowed transforms of the same sample set can be used to calculate center frequency and sweep rate. See, for example: A Unified Theory of Time-Frequency Reassignment Kelly R. Fitz, Sean A. Fulop Download the paper from the site: http://arxiv.org/abs/0903.3080 Dale B. Dalrymple
Reply by ●August 31, 20112011-08-31
On Wed, 31 Aug 2011 10:02:32 -0700 (PDT), dbd <dbd@ieee.org> wrote:>On Aug 31, 8:33=A0am, Vladimir Vassilevsky <nos...@nowhere.com> wrote: >> ... >> >> Isn't it obvious that the 3-pt parametric model could be just as well >> defined in the frequency domain? >> >> BTW, not very long ago a madman was proposing exactly this idea here and >> was catcalled for that. >> >> Vladimir Vassilevsky > >Last year: >http://groups.google.com/group/comp.dsp/browse_thread/thread/aba68afada5c8a= >55/354a256e8f978bb0?hl=3Den&lnk=3Dgst&q=3Dparabolic+interpolation+Dalrymple= >#354a256e8f978bb0 >This year: >http://groups.google.com/group/comp.dsp/browse_thread/thread/cad149a3431333= >3f/bfc5677d530382f8?hl=3Den&lnk=3Dgst&q=3Dparabolic+interpolation+Dalrymple= >#bfc5677d530382f8Those links don't seem to work for me, even after logging into google groups.>including, from a post May 24: > >%%%% begin quote %%%%% >... >Consider: >Use of the Discrete Fourier Transform in the Measurement of >Frequencies and Levels of Tones PDF >Rife, D.C.; Vincent, G.A. >Bell System Technical Journal >Volume 49, Issue 2, February 1970 | 11095.4K >http://www.alcatel-lucent.com/bstj/vol49-1970/articles/bstj49-2-197.pdfThanks for the link to the Rife & Vincent pdf. I've been wanting a copy of that for a long time. Don't know how/why I missed it if you posted it before.>This is a classic (but far from the first) interpolation paper. Three >types of windows are discussed: >class I: maximum sidelobe rolloff windows >class II: (two parameter) Taylor windows >class III: an ad hoc set of windows > >The maximum sidelobe rolloff windows are a frequent "rediscovery" in >the IEEE literature. The richest collection of fft interpolation >windows in the IEEE literature seems to be in the Transactions on >Instrumentation and Measurement For example: >http://wwwir.vub.ac.be/elec/Papers%20on%20web/Papers/JohanSchoukens/I...Yes, a lot of this stuff happens in Instrumentation and Measurement (which I think I erroneously referred to as Test and Measurement a while back). That's been a source of annoyance for easy access to the papers since it's hard to justify another society membership that's outside my general practice area.>For comparison to other methods: >http://home.mit.bme.hu/~sarhegyi/pubs/msthesis.pdf > >The optical guys have a long history of fft interpolation, too: >http://www.eng.tau.ac.il/~yaro/RecentPublications/ps&pdf/EfficientSin... > >... >%%%%% end quote %%%%% > >You can go to the original posts to get the full version of the longer >urls. > >Also, in the "frequency reassignment" technique for linear FM sweeps >(including stationary tones), the DFT coefficients from 3 windowed >transforms of the same sample set can be used to calculate center >frequency and sweep rate. See, for example: >A Unified Theory of Time-Frequency Reassignment >Kelly R. Fitz, Sean A. Fulop >Download the paper from the site: >http://arxiv.org/abs/0903.3080That one's pretty cool, too. ;)> >Dale B. Dalrymple >Eric Jacobsen http://www.ericjacobsen.org http://www.dsprelated.com/blogs-1//Eric_Jacobsen.php
Reply by ●August 31, 20112011-08-31
On Aug 31, 5:33�pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote:> Rune Allnor wrote: > > On Aug 31, 1:46 am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: > > >>If the DFT input is composed of a single sinusoid that is > >>monochromatic, or a single frequency, or whatever one wishes to call > >>it, and the three coefficients around the DFT maximizer are known, > >>then one can deduce both the amplitude and frequency, regardless of > >>the relationship of the input frequency to the basis function > >>frequencies. � This assumes that the window function is known. > > > This is totally new to me. References? You are sure > > you don't confuse this with 3-pt parametric model > > fitting in time domain? > > Dear doctor Rune, > > Isn't it obvious that the 3-pt parametric model could be just as well > defined in the frequency domain? > > BTW, not very long ago a madman was proposing exactly this idea here and > was catcalled for that. > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultanthttp://www.abvolt.comNo, it's not. The 3-pt interpolation works because of the known sinusoidal form. I can't see that this would work in the genersl case. Rune
Reply by ●August 31, 20112011-08-31
On Aug 31, 5:32�pm, eric.jacob...@ieee.org (Eric Jacobsen) wrote:> On Tue, 30 Aug 2011 23:16:24 -0700 (PDT), Rune Allnor > > > > > > <all...@tele.ntnu.no> wrote: > >On Aug 31, 1:46=A0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: > >> On Tue, 30 Aug 2011 16:03:57 -0700 (PDT), Rune Allnor > > >> <all...@tele.ntnu.no> wrote: > >> >On Aug 26, 3:58=3DA0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote: > >> >> On Tue, 23 Aug 2011 13:21:52 -0500, Vladimir Vassilevsky > > >> >> <nos...@nowhere.com> wrote: > > >> >> >Eric Jacobsen wrote: > > >> >> >> On Sun, 21 Aug 2011 23:03:18 -0700 (PDT), sanaashau...@hotmail.com > >> >> >> wrote: > > >> >> >>>I am measuring the peak amplitude of each cycle of a sinusoid havin= > >g > >> >> >>>frequency of 125Hz but the frequency varies in the range 100Hz to > >> >> >>>150Hz after around every 3 cycles. I sample the signal for 8ms to > >> >> >>>capture 1 complete cycle of the sinusoid and then apply 128 point F= > >FT > >> >> >>>on it to get magnitude and phase information. The algorithm works > >> >> >>>pretty well if the frequency remains constant at 125Hz however as t= > >he > >> >> >>>frequency changes i get incorrect magnitude and phase due to spectr= > >al > >> >> >>>leakage problem. I tried using windowing but still the results devi= > >ate > > >> >> >>>from actual a lot. It has been more than a week I am trying to solv= > >e > > >> >> >>>this problem but in vain:( Can any body please help me to solve thi= > >s > >> >> >>>issue. > > >> >> >> Look into windows that provide flat-topped frequency response. =3DA= > >0 The=3D > >> >se > >> >> >> are used in spectrum analyzers for the purpose you mention. > > >> >> >Dear doctor Jacobsen, > > >> >> >A sinusoid with variable frequency is not a sinusoid. Hence any FFT > >> >> >based method will produce a wrong result for amplitude. > > >> >> One could argue that a sinusoid without infinite duration is also not > >> >> a sinusoid. =3DA0 Since such things do not exit one could then conclud= > >e > >> >> that any FFT based method will produce a wrong result for amplitude > >> >> for any signal given to it. > > >> >> Most of us can see beyond that. > > >> >> Eric Jacobsenhttp://www.ericjacobsen.orghttp://www.dsprelated.com/blog= > >s-1=3D > >> >//Eric_Jacobsen.php > > >> >The only case when the DFT coefficients are related to > >> >time domain amplitude, is when the sinusoidal coincides > >> >with a DFT basis function. > > >> >Consider a sinusoidal of length N and frequency (K+1)/2, K being > >> >some integer < N/2. No noise, quantization or anything like that; > >> >a perfect sinusoidal. > > >> >Now compute its N-length DFT. > > >> >How can you use the coefficientd to deduce the time > >> >domain amplitude of the sinusoidal? > > >> >Rune > > >> If the DFT input is composed of a single sinusoid that is > >> monochromatic, or a single frequency, or whatever one wishes to call > >> it, and the three coefficients around the DFT maximizer are known, > >> then one can deduce both the amplitude and frequency, regardless of > >> the relationship of the input frequency to the basis function > >> frequencies. =A0 This assumes that the window function is known. > > >This is totally new to me. References? You are sure > >you don't confuse this with 3-pt parametric model > >fitting in time domain? > > >Rune > > Because the shape of the sinx/x frequency response of the transform > bin is known it is possible to interpolate the peak location and > amplitude even if the samples don't line up exactly at the peak. �A > simple example is that if the tone is exactly halfway between bins so > that two bins are of equal amplitude, then, for a rectangular window, > the peak estimate is 1/(sin(pi/2)/(pi/2)) higher than the two equal > samples that straddle the peak. > > It's also clear when the two peak samples are equal that the tone is > halfway between bins. > > There are lots of different techniques for using the three > coefficients around the DFT peak to obtain fine frequency estimates > (and magnitude estimates) for isolated tones. � > > This is not the best treatise on the idea, but it touches on two > different methods for estimating frequency, with rough amplitude > estimates from the second. �My experience is that dft-based edtimates are robust, if not all that accurate. If that accuracy is insufficient, I'd consider the problem to be ill-posed: - parametric methods are not robust - interpolation methods give arbitrary results> http://www.ericjacobsen.org/FTinterp.pdf > > I *think* there's a longer reference list in this one: > > Jacobsen, E., Kootsookos, P., "Fast, Accurate Frequency Estimators", > IEEE Signal Processing Magazine, Vol. 24, Issue 3, pp. 123-125, May, > 2007 > > The general idea is pretty straighforward, though.I prefer to see this peer-reviewed.> It should be stated that these techniques start to break down when the > sinusoid being estimated isn't isolated. �There you go...> If there's a lot of > spectral content then estimating the peak amplitude of the time domain > signal from the FD information isn't very practical, IMHO, without > just doing an inverse transform and measuring it.Exactly. Rune
Reply by ●August 31, 20112011-08-31
On Aug 31, 11:10�am, Rune Allnor <all...@tele.ntnu.no> wrote:> On Aug 31, 5:33�pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > ...> > Dear doctor Rune, > > > Isn't it obvious that the 3-pt parametric model could be just as well > > defined in the frequency domain? > > > BTW, not very long ago a madman was proposing exactly this idea here and > > was catcalled for that. > > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com > > No, it's not. The 3-pt interpolation works because of the > known sinusoidal form. I can't see that this would work > in the genersl case. > > RuneYes, 3 point frequency domain interpolation to determine the frequency of a sinusoid only works for sinusoids. There is no "general case". There is time interpolation in the time domain and frequency interpolation in the frequency domain. No one has said that they are the same thing. Only that both have definitions relevant to their respective domains. In your youth you may only have been taught time domain interpolation, but "interpolation" isn't only "time domain interpolation" anymore, and hasn't been since the 1940s or 1950s (or before). Dale B. Dalrymple






