DSPRelated.com
Forums

Accuracy of frequency determination from FFT on ADC samples

Started by Dirk Bruere at NeoPax September 15, 2014
In practice, I have an approximate frequency of 125kHz that I need to measure accurately. Since I am already grabbing 2048 sample chunks at 500uS intervals and doing FFTs the question is: how accurately can an FFT determine the frequency? M

More generally, what is the relationship between sample rate, accuracy and the FFT method?

Of course, there are other methods such as counting and timing. Just wondering how they compare.
Hi, 

as a rule of thumb, the FFT bin spacing is the inverse of the capture
length. 
If your FFT bin spacing is, say, 2 KHz, and your frequency is 124 kHz or
126 kHz, it will fall between two bins. That's by no means "the" limit,
there are better methods than locating the bin with the highest magnitude.

Fundamentally, I don't think there is a limit in the absence of noise. As a
simple thought experiment (without using FFT), set up a numeric solver to
match a sine wave in amplitude and phase to the captured interval. It'll
lock in on the true result with arbitrary accuracy.	 

_____________________________		
Posted through www.DSPRelated.com
On Mon, 15 Sep 2014 02:55:48 -0700 (PDT), Dirk Bruere at
NeoPax <dirk.bruere@gmail.com> wrote:

>In practice, I have an approximate frequency of 125kHz that I need to measure accurately. Since I am already grabbing 2048 sample chunks at 500uS intervals and doing FFTs the question is: how accurately can an FFT determine the frequency? M > >More generally, what is the relationship between sample rate, accuracy and the FFT method? > >Of course, there are other methods such as counting and timing. Just wondering how they compare.
If you have *only* the target frequency present (or if there are no other nearby tones), you can increase the FFT resolution quite a bit by interpolation of the spectral lines on either side of the peak. In general, using a 32-segment piecewise-linear method that is specific for the chosen window function, I can get about 50x improvement from a 1024-sample FFT as long as the target peak is not too near DC... say, at least 3-4 lines above. Counting also works well, if there is a low-noise unambiguous trigger. For low frequencies (relative to your sample rate) you can count samples of a single cycle, interpolating to get fractional samples at either end, then invert to go from time to frequency. This can be *much* better than frequency-based methods. For higher frequencies you can do the same thing, but count the number of cycles you include. Best regards, Bob Masta DAQARTA v7.60 Data AcQuisition And Real-Time Analysis www.daqarta.com Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE Signal Generator, DaqMusiq generator Science with your sound card!
On Monday, September 15, 2014 1:44:37 PM UTC+1, Bob Masta wrote:
> On Mon, 15 Sep 2014 02:55:48 -0700 (PDT), Dirk Bruere at > > NeoPax <dirk.bruere@gmail.com> wrote: > > > > >In practice, I have an approximate frequency of 125kHz that I need to measure accurately. Since I am already grabbing 2048 sample chunks at 500uS intervals and doing FFTs the question is: how accurately can an FFT determine the frequency? M > > > > > >More generally, what is the relationship between sample rate, accuracy and the FFT method? > > > > > >Of course, there are other methods such as counting and timing. Just wondering how they compare. > > > > > > If you have *only* the target frequency present (or if there > > are no other nearby tones), you can increase the FFT > > resolution quite a bit by interpolation of the spectral > > lines on either side of the peak. In general, using a > > 32-segment piecewise-linear method that is specific for the > > chosen window function, I can get about 50x improvement from > > a 1024-sample FFT as long as the target peak is not too near > > DC... say, at least 3-4 lines above. > > > > Counting also works well, if there is a low-noise > > unambiguous trigger. For low frequencies (relative to your > > sample rate) you can count samples of a single cycle, > > interpolating to get fractional samples at either end, then > > invert to go from time to frequency. This can be *much* > > better than frequency-based methods. For higher frequencies > > you can do the same thing, but count the number of cycles > > you include. > > > > Best regards, > > > > > > Bob Masta > > > > DAQARTA v7.60 > > Data AcQuisition And Real-Time Analysis >
Thanks guys. I am really trying to measure deviations from a fundamental frequency of around 125kHz less than 0.1 Hz, ideally in less than 10mS. Still not sure if it's possible. What actually determines the limits of accuracy? [More samples I assume...]
Thanks guys. 
I am really trying to measure deviations from a fundamental frequency of around 125kHz less than 0.1 Hz, ideally in less than 10mS. Still not sure if it's possible. What actually determines the limits of accuracy? [More samples I assume...] 
On 15.9.14 15:59, Dirk Bruere at NeoPax wrote:
> Thanks guys. > I am really trying to measure deviations from a fundamental frequency of around 125kHz less than 0.1 Hz, ideally in less than 10mS. Still not sure if it's possible. What actually determines the limits of accuracy? [More samples I assume...]
0.1 Hz difference means 36 degrees in 10 ms, independent of the base frequency. If you have a stable enough phase detection, you may meet your goal. Small frequency differences need long time to measure reliably. -- -Tauno Voipio PS. 10 mS is the conductance of 100 ohms.
>> 124 kHz or 126 kHz
correction, I meant those are the nearest bins to 125 kHz (which falls between bins on a 2 kHz grid) _____________________________ Posted through www.DSPRelated.com
May I recommend Peter Kootsookos' great page on frequency estimation and tracking? 

https://sites.google.com/site/kootsoop/frequency-algorithms

Fourier-based methods may seem to be the most obvious, but in the face of reality other methods should be considered, too. If you can isolate the single tone, my favorite is to use one of the super-resolution methods. 
On Mon, 15 Sep 2014 05:59:30 -0700, Dirk Bruere at NeoPax wrote:

> Thanks guys. > I am really trying to measure deviations from a fundamental frequency of > around 125kHz less than 0.1 Hz, ideally in less than 10mS. Still not > sure if it's possible. What actually determines the limits of accuracy? > [More samples I assume...]
Number of samples, and noise that's present. Are you FFT-ing a pure tone that's nominally at 125kHz? Really pure, or does it have amplitude or phase modulation of some sort? Is there no other noise sources, either random or tones? What's your quantization noise? -- www.wescottdesign.com
On Mon, 15 Sep 2014 07:53:18 -0700 (PDT), julius <juliusk@gmail.com>
wrote:

>May I recommend Peter Kootsookos' great page on frequency estimation and tracking? > >https://sites.google.com/site/kootsoop/frequency-algorithms > >Fourier-based methods may seem to be the most obvious, but in the face of reality other methods should be considered, too. If you can isolate the single tone, my favorite is to use one of the super-resolution methods.
Ah, that's where it went. I had a broken link from a previous location on my site for a long time. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com