-1


Hello!

I am working around a project, in which I have to measure a frequency of the signal coming to STM32 microprocessor. The frequency is about 2210 Hz.

I have done it by measuring period of square wave (sine wave passed through comparator) with Timer and then I have tried to appoximate it (array of period measurements is of about 100 elements) using moving average and least square fitting. Both results are about the same.

So, the question is - could I improve the frequency measurement accuracy by at least one order, using ADC convertion of sine wave (without passing through comparator) and then using FFT?

Any help would be appreciated!
Viacheslav.

1 Answers1

2

Possibly yes, depending on the type of noise or interference and the measurement duration allowed. There is more information available and thus greater resistance to interference from noise by using the entire waveform, and not just the zero crossings. For instance, the precise phase of a floating-point FFT result interpolates the sinewave's zero crossings to sub-sample resolution.

But don't just naively use the index of the FFT peak magnitude bin. In low noise, FFTs can be interpolated to sub-bin-width resolution. Or better yet, FFTs used in offset pairs, using the phase results relative to the centers of the 2 offset windows, can be used for phase vocoder frequency interpolation with even higher potential resolution.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • Thank you very much for your reply! But I have to write some restrictions: The main problem is time for measuring period of signal. I have only 50 ms to do it, so this measurement results in about only 100 measured periods(integer values) in output array. So, I would like to know, if I have any chance to get better accuracy with FFT in such small period of measurement. I have 12-bit ADC with maximum rate of 7.2 MSPS, so on 50ms cycle it can result in 360 kSamples. Is it really possible to get better accuracy? Thanks in advance, Viacheslav – Viacheslav Sep 03 '13 at 09:20