Hi everyone, I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want to determine accurately its frequency with a 20-Hz resolution. However my window is only 10 ms. A standard FFT doesn't yield such a resolution with this window size (I rule out zero-padding). Does anybody know any technic that may help to approach this resolution? I'll appreciate any comments or pointers. ThanX L.B. BTW, the CPU requirement is not critical at this point.
Frequency Estimator/ Resolution
Started by ●August 1, 2003
Reply by ●August 1, 20032003-08-01
"L. Bawr" <Lba@engineer.com> wrote in message news:5CwWa.13$Yz.6@charlie.risq.qc.ca...> Hi everyone, > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > to determine accurately its frequency with a 20-Hz resolution. However my > window is only 10 ms. A standard FFT doesn't yield such a resolution with > this window size (I rule out zero-padding). Does anybody know any technic > that may help to approach this resolution? > I'll appreciate any comments or pointers. > ThanX > L.B. > BTW, the CPU requirement is not critical at this point.L.B., Well, the temporal epoch is around 5x too short for comfort - as you've already alluded to. If the signal to noise ratio is high enough then you may be able to establish a set of equations to be solved for the amplitude and frequency of the sinusoid based on very few samples - and then perhaps average the results. The noise, including sampling noise, will contribute to the inaccuracy of this approach quite a bit I should think. Otherwise, you can Google on key words including Goertzel or frequency estimatin or spectral analysis. I don't think the Goertzel method helps solve your particular problem of having a very short temporal epoch. Here's an interesting review of some methods: http://gtas.dicom.unican.es/Publicaciones/Revistas/Mssp.pdf A *really* simple minded high-SNR approach would detect the zero crossings, interpolate to find a more exact location of the zeros, average zero spacing and compute frequency that way. You probably need to have a zero-mean signal for this to work. It's just a variant of setting up the equations I mentioned above: x(1)=a*sin(w*T+phi) x(2)=a*sin(w*2T+phi) . . x(n)=a*sin(w*nT+phi) You need to solve for a, w and phi. So, presumably 3 equations will do it. Perhaps better yet would be a least-squares solution using a larger number of equations. At some point the estimate will be perturbed by noise and by the actual signal dynamics. If it makes any sense at all, it doesn't make much sense to estimate the frequency of a sinusoid to within 20Hz in 10msec if the frequency is changing 20Hz/10msec or greater, i.e. 2Hz/msec or more does it? Fred
Reply by ●August 1, 20032003-08-01
Hi, I'd try eigen-decomposition of the autocorrelation matrix. Then you can simply find roots of an equation that give a good estimate of the sinusion frequency. A good explaination of this is in the Proakis DSP book 3rd ed. chapter 12. Also, here is a URL that might help: http://shay.ecn.purdue.edu/~ee538/ I'd start with module 22 and go through about 24 or 25. These are course notes from a professor at Purdue. I'd also check out exam 3 from fall 2000 problem 3 (it sounds like a good example of what your trying to do). I remember also deriving a solution for this straight from trigonometry. It was messy but an exact solution. Try going from the point of view that you have the DFT of a sine wave and you know (can guess or a priori) which bins of the FFT the sine's frequency is between. This solution may be susceptible to noise (I don't know). HTH, Brandon "L. Bawr" <Lba@engineer.com> wrote in message news:5CwWa.13$Yz.6@charlie.risq.qc.ca...> Hi everyone, > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > to determine accurately its frequency with a 20-Hz resolution. However my > window is only 10 ms. A standard FFT doesn't yield such a resolution with > this window size (I rule out zero-padding). Does anybody know any technic > that may help to approach this resolution? > I'll appreciate any comments or pointers. > ThanX > L.B. > BTW, the CPU requirement is not critical at this point. > >
Reply by ●August 1, 20032003-08-01
"L. Bawr" wrote:> > Hi everyone, > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > to determine accurately its frequency with a 20-Hz resolution. However my > window is only 10 ms. A standard FFT doesn't yield such a resolution with > this window size (I rule out zero-padding). Does anybody know any technic > that may help to approach this resolution? > I'll appreciate any comments or pointers. > ThanX > L.B. > BTW, the CPU requirement is not critical at this point.If the signal is only mostly a sine wave, you are out of luck. If it were known to be pure and low noise, there are techniques you could use. In the best of circumstances, it's hard to deduce an accurate frequency from 4 or 5 samples. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●August 1, 20032003-08-01
Brandon wrote:> > Hi, > I'd try eigen-decomposition of the autocorrelation matrix. Then you can > simply find roots of an equation that give a good estimate of the sinusion > frequency. A good explaination of this is in the Proakis DSP book 3rd ed. > chapter 12. Also, here is a URL that might help: > http://shay.ecn.purdue.edu/~ee538/ > I'd start with module 22 and go through about 24 or 25. These are course > notes from a professor at Purdue. I'd also check out exam 3 from fall 2000 > problem 3 (it sounds like a good example of what your trying to do). > > I remember also deriving a solution for this straight from trigonometry. It > was messy but an exact solution. Try going from the point of view that you > have the DFT of a sine wave and you know (can guess or a priori) which bins > of the FFT the sine's frequency is between. This solution may be > susceptible to noise (I don't know). > HTH, > Brandon > > "L. Bawr" <Lba@engineer.com> wrote in message > news:5CwWa.13$Yz.6@charlie.risq.qc.ca... > > Hi everyone, > > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > > to determine accurately its frequency with a 20-Hz resolution. However my > > window is only 10 ms. A standard FFT doesn't yield such a resolution with > > this window size (I rule out zero-padding). Does anybody know any technic > > that may help to approach this resolution? > > I'll appreciate any comments or pointers. > > ThanX > > L.B. > > BTW, the CPU requirement is not critical at this point. > > > >All of youse guys are forgetting that the signal is _mostly_ sinusoidal, with noticable departure. I don't think trig will work on such a small sample. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●August 2, 20032003-08-02
Jerry Avins <jya@ieee.org> writes:> "L. Bawr" wrote: > > > > Hi everyone, > > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > > to determine accurately its frequency with a 20-Hz resolution. However my > > window is only 10 ms. A standard FFT doesn't yield such a resolution with > > this window size (I rule out zero-padding). Does anybody know any technic > > that may help to approach this resolution? > > I'll appreciate any comments or pointers. > > ThanX > > L.B. > > BTW, the CPU requirement is not critical at this point. > > If the signal is only mostly a sine wave, you are out of luck. If it > were known to be pure and low noise, there are techniques you could use. > In the best of circumstances, it's hard to deduce an accurate frequency > from 4 or 5 samples.? Surely L.B. has 16000 / ( 1/ 0.01 ) = 160 samples to play with ? Or am I being thick? If I'm correct, then you could use any number of estimators. I'd start with the Quinn and Fernandes estimator to see if that does the trick. It's off-line, but you say that you're not too worried about CPU cycles at this stage. Check out the matlab code at www.itee.uq.edu.au/~kootsoop/qnf.m or the other frequency estimators available in matlab from my web-page ( same URL, minutes the "/qnf.m"; follow the frequency estimation link). Ciao, Peter K. -- Peter J. Kootsookos "Na, na na na na na na, na na na na" - 'Hey Jude', Lennon/McCartney
Reply by ●August 2, 20032003-08-02
"Peter J. Kootsookos" wrote:> > Jerry Avins <jya@ieee.org> writes: > > > "L. Bawr" wrote: > > > > > > Hi everyone, > > > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > > > to determine accurately its frequency with a 20-Hz resolution. However my > > > window is only 10 ms. A standard FFT doesn't yield such a resolution with > > > this window size (I rule out zero-padding). Does anybody know any technic > > > that may help to approach this resolution? > > > I'll appreciate any comments or pointers. > > > ThanX > > > L.B. > > > BTW, the CPU requirement is not critical at this point. > > > > If the signal is only mostly a sine wave, you are out of luck. If it > > were known to be pure and low noise, there are techniques you could use. > > In the best of circumstances, it's hard to deduce an accurate frequency > > from 4 or 5 samples. > > ? Surely L.B. has 16000 / ( 1/ 0.01 ) = 160 samples to play with ? > > Or am I being thick? > > If I'm correct, then you could use any number of estimators. I'd > start with the Quinn and Fernandes estimator to see if that does the > trick. It's off-line, but you say that you're not too worried about > CPU cycles at this stage. > > Check out the matlab code at www.itee.uq.edu.au/~kootsoop/qnf.m or the > other frequency estimators available in matlab from my web-page ( same > URL, minutes the "/qnf.m"; follow the frequency estimation link). > > Ciao, > > Peter K. > > -- > Peter J. Kootsookos > > "Na, na na na na na na, na na na na" > - 'Hey Jude', Lennon/McCartneyI guess I figured wrong. Let's see. Sample rate: 16 KHz. Sample interval: .0626 ms. Sample time: 10 ms. Sample count: 161. Does it help to say that my calculator died? Probably not. I'd have done it [wrong] in my head anyway. A least-squares fit of the best sinewave (three degrees of freedom: amplitude, frequency, and phase) should accommodate a fair amount of distortion and noise. Go to! Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●August 3, 20032003-08-03
Thank you very much eveyrone for the pointers. I really appreciate your interest in this post. It really helps. Thanks for the link with MATLAB scripts. I'll take some time to try a couple of them. Do these technics you guys have mentioned perform well on coherent signals? I was told that technics similar to MUSIC (called parametric methods in Fred's link) don't. My signal might contain several coherent single-frequency components. Any feedback on this point. TIA. L.B. L. Bawr a �crit:> Hi everyone, > I have a 4-6 KHz signal (mostly a sinewave) sampled @ 16 KHz and I want > to determine accurately its frequency with a 20-Hz resolution. However my > window is only 10 ms. A standard FFT doesn't yield such a resolution with > this window size (I rule out zero-padding). Does anybody know any technic > that may help to approach this resolution? > I'll appreciate any comments or pointers. > ThanX > L.B. > BTW, the CPU requirement is not critical at this point. > >
Reply by ●August 3, 20032003-08-03
"L. Bawr" <lba@engineer.com> writes:> Thank you very much eveyrone for the pointers. I really appreciate your > interest in this post. It really helps. Thanks for the link with MATLAB > scripts. I'll take some time to try a couple of them. > Do these technics you guys have mentioned perform well on coherent > signals? I was told that technics similar to MUSIC (called parametric > methods in Fred's link) don't. My signal might contain several coherent > single-frequency components. Any feedback on this point. > TIA.L.B., The Quinn-Fernandes technique should work OK, provided you initialise it close enough to the frequency you want. If there is another frequency that is stronger / closer to your initial guess, then it will probably pick up this one rather than the others. It works like a smoothed periodogram, so close frequencies may interfere also. The weighted phase averagers will suffer quite a bit from the other coherent signals... you might have to do some pre-filtering. Ciao, Peter K. -- Peter J. Kootsookos "Na, na na na na na na, na na na na" - 'Hey Jude', Lennon/McCartney
Reply by ●August 11, 20032003-08-11
Ok, Perhaps I'm way off in suggesting this but what about a hardware solution? Take your sine wave --> Schmitt trigger to make it into a square wave, time the rising edges with a fast clock(10MHz or faster) and a deep counter and you'll get a good idea of the period of the waveform in counter ticks. Take counter value * System_Clock_Period and invert that to get a number in Hz... The faster your system clock (which requires a deep counter) the better resolution you can get. Even with something as "coarse" as 10MHz, at 6kHz +/- 100 ns will result in a frequency error of ~3.6 Hz. -- Jay.






