Fast and Accurate Frequency Meter Using the Interpolated DFT Method

1Abstract—The Interpolated DFT is a non time-consuming supplement to the DFT algorithm. It allows to achieve a much greater frequency measurement accuracy than the DFT and is easily applicable to multitone spectrums. A very simple variant of the Interpolated DFT, proposed and analyzed in previous papers, was implemented in the frequency meter. The introduced device allows to check the correctness of the theoretical limitation and simulation results obtained earlier. The instrument is based on a microcontroller with a DSP unit and a 14-bit fast AD converter. The actual properties of the meter were introduced in the paper. The accuracy of the frequency measurement, the influence of the number of samples in a series and the influence of measured signal amplitude variation during acquiring a series of samples on the accuracy are consistent with the theoretical limits and simulation results with one exception. A boundary of the accuracy of frequency measurement related to used single-precision floating point format occurred. The limiting parameters of the introduced meter are: rate of measurements up to 410 per second and standard deviation about 7.6·10-8.


I. INTRODUCTION
Modern frequency spectrum analysis often involves the Discrete Fourier Transform calculation. The resolution of frequency of the signal is limited by the discrete nature of the obtained spectrum and relatively big frequency quant of that spectrum. However, the phenomenon of spectral leakage could be used to increase the precision of the frequency measurement using the DFT. The first Interpolated DFT algorithm was proposed in 1970 [1]. In the following years other versions of Interpolated DFT method were introduced [2]- [6] and applied in various areas [7], [8]. Most of the authors analysed their methods analytically or by simulations. The goal of this paper is to compare the practical properties of the Interpolated DFT with that of the theoretical limits. For this purpose, a frequency meter that implements one of the Interpolated DFT method was built.
To avoid ambiguity the following terminology will be used. The   The used version of Interpolated DFT is one introduced in [9]. The calculation of the frequency correction factor δp consists of only two steps. First, the auxiliary coefficient γ(δp) is calculated using the values of two greatest points on spectral line, A(L) and A(L-1) or A(L+1) Next the aforementioned coefficient is normalized to obtain the frequency correction factor δp where γ(0) and γ(0.5) are calculated using (1) and are constant for a chosen windowing function. What is more, γ(0.5) is equal to 1.5 for all even windowing functions e.g. cosine, Dolph-Chebyshev and Kaiser-Bessel windows. Thus, only one coefficient has to be calculated to use the proposed Interpolated DFT method with a new window. The method is identical to the analytical solution for the Blackmann-Harris windows with maximum side-lobe decay, including the popular Hanning window. For other mentioned popular windows systematic error is about a thousandth of the value of the frequency bin.

II. FREQUENCY METER
The block diagram of the frequency meter, that uses the Interpolated DFT method, is shown in Fig. 1.

A. Analog Part
The input analog signal is conditioned using a singleended-to-differential amplifier AD8138, and then sampled by a 14-bit A/D converter AD9244. A high sampling rate and high resolution A/D converter requires low jitter clock and that is why a discrete components crystal oscillator was

B. Digital Part
Digital samples of the input voltage signal are taken and processed by a 32-bit microcontroller STM32F407VGT, with a floating point and DSP units. The microcontroller multiplies samples by the Hanning window, calculates the FFT and estimates the frequency of the signal using the Interpolated DFT method (1) and (2). It is possible to set the FFT size to 1024, 2048, 4096 or 8192 time domain samples in series. Due to a limitation of the DSP library, the complex FFT is calculated for a FFT size of 1024 and 4096 samples, whereas for the other FFT sizes the real FFT is computed. Additionally, a histogram of the set of frequency measurements could be counted.
All calculations are made by the microcontroller, however the device is controlled by a personal computer via an USB interface. The PC software can display the measured frequency, series of samples in a time domain, discrete spectrum or histogram of the frequency measurements.

III. COMPARISON OF METER PROPERTIES TO THE THEORETICAL LIMITS
Tests were conducted in order to compare meter properties with the theoretical limits [10], [11] and the simulation values obtained earlier [12]. A Fluke 6080A/AN signal generator was the source of the input testing sinusoidal signal. The sampling frequency was set to 6,144 MHz. Table I contains the measurement results of input signal 1000 kHz obtained for different FFT sizes, from 1024 to 8192 samples. As expected, the bigger the FFT size the longer the measurement takes but also better accuracy is gained. The three most interesting remarks are as follows:

A. Basic Properties of the Meter and the Effect of the FFT Size
 it is possible to measure the frequency 410 times per second with the standard deviation of about 1.3 Hz,  a standard deviation about 0.076 Hz (7.6·10 -8 ) could be achieved at a rate of 66 measurements per second,  the greatest profit from the application of the Interpolated DFT method occurs at the FFT size of 4096 samples.
The profit from the application of the Interpolated DFT is defined as the ratio of the frequency bin to the standard deviation of measurements when the Interpolated DFT is used. It is worth mentioning that the total measurement time in all cases is about one order of magnitude greater than the acquiring time, so it is possible to improve the meter by using a faster DSP.
To illustrate the meter's quality, histograms of 1000 frequency measurements of input signal 1000 kHz are shown in Fig. 2 and Fig. 3. They were made for FFT sizes: 1024 and 8192 samples. It can be seen that the spread of measured values is much smaller for a greater FFT size. Moreover, for the 8192 sample case almost all measurements take one of four values, except very few ones that cannot be even seen in Fig. 3 due to the scale of the Y axis. It is consistent with the value of standard deviation of that series which is about 0.0762 Hz and it also reveals the limitation of the built meter. Software analysis led to the conclusion that the limit is caused by the resolution of the single-precision floatingpoint format used by a 32-bit device and software. Indeed, the smallest difference of real number values near 1000 that can be preserved, using single-precision floating-point format, is about 6.1·10 -5 . That is also the reason why the profit from the application of the Interpolated DFT is the greatest for the series of 4096 samples, not 8192 (Table I).

B. The Influence of Input Signal SNR
The existence of noise in the measured signal always limits the accuracy of the frequency measurement. The Cramer-Rao Lower Bound (CRLB) for the variance of estimator of frequency out of N samples when frequency, phase and amplitude are unknown is given by [10] 2 2 12 var( ) , where SNR is the signal-to-noise ratio of the sampled signal and T is the sampling interval. In the case of the Interpolated DFT variance of the measurements can be expressed as [11] 2 var( ) , where Cw is a single coefficient for a given window, that cumulates the influence of all the constant factors. Equation (3) is the absolute limit while (4) is the limit of the used algorithm. Figure 4 shows histograms of the three series of measurements of signals that differ only in amplitude. It is equivalent to differing in SNR when all other measurement conditions are unchanged. The lower the SNR, the wider the range of obtained values.   Fig. 5. Standard deviation of frequency measurement normalized in relation to frequency bin vs. input signal SNR. Each standard deviation value is calculated of 1000 measurements. The FFT size was set to 8192 samples. "Interpolated DFT limit" was plotted according to (4). Cramer-Rao Lower Bound was plotted according to (3) but using substitution T = 1/N in order to normalize in relation to frequency bin.
In the Fig. 5 the comparison between measurement results and both theoretical limits is shown. For the input signal of SNR lower than approximately 25 dB the standard deviation of measurements is exactly as predicted (4) while for SNR higher than 25 dB the standard deviation reaches a constant and minimum value. That lower accuracy limit of the meter is caused by the resolution of the 32-bit floating point format and not by the method used. This is not a trivial observation because most often the accuracy of the Interpolated DFT method, as well as the accuracy of the other frequency estimation methods, are given without taking into account the real implementation limitations.

C. The Consequences of Input Signal Amplitude Variations
The measured signal amplitude variations during sampling is another factor that has an impact on the Interpolated DFT accuracy [12]. Modulation of input signal amplitude is the simplest way of modelling that influence. The systematic error of measurements depends on all three amplitude modulation parameters: amplitude, frequency and phase (with respect to the start of acquiring the series of samples). The results for the carrier signal 1386 kHz, modulated with frequency of 1 kHz and the FFT size of 8192 samples, are presented in the Fig. 6 and Fig. 7. For those values the ratio of the modulation signal frequency and the frequency bin is about 1.333, which is in the range of the worst cases [12].   In many cases the process of acquiring samples is not correlated to the modulating signal phase. Therefore, it is enough to collect a set of frequency measurements, that are started randomly, to estimate the expected values of error and standard deviation of the frequency measurements. To be comparable with the measurement results analytical values have to be calculated as averages for sufficiently large number of different phases of modulating signal. The standard deviation values obtained are very similar to the theoretical ones (Fig. 6), but the measured average error differs somewhat from the analytically calculated values (Fig. 7). However, comparing Fig. 6 and Fig. 7 it could be noted that the absolute value of the mean error is at least 5 times smaller than the value of standard deviation for a given modulation index. Therefore, the mean error (Fig. 7) has much less impact on the total measurement error than the standard deviation (Fig. 6).

D. The Effect of Input Signal Frequency Variations
A set of frequency measurements of variable frequency signal has similar properties to a series of variable voltage samples acquired in a time domain. If the rate of frequency change is less than half the rate of frequency measurement, then the series of measurements correctly represents frequency changes (Fig. 8). If the frequency of the input signal changes faster than half the rate of frequency measurement then aliasing occurs (or only frequency mixing according to the pass-band Shannon sampling theory). The greater the rate of input signal frequency changes, the less accurate the single frequency measurement. This is due to the parameter changes of sampled signal during the acquiring process.

IV. CONCLUSIONS
The introduced meter, that uses the Interpolated DFT, allowed comparing the theoretical limits and simulation results obtained earlier with actual meter properties. It occurs that the accuracy of the frequency measurement, the influence of number of samples in a series and the influence of measured signal amplitude variation are consistent with the theoretical and simulation results except for one case.
For input signal of SNR higher than a certain value (25 dB for 8192 samples in series), the standard deviation of measurement reaches a minimum, constant value. Software tests and analysis of measurement results lead to the conclusion, that this is caused by the resolution of the used 32-bit floating-point format. Therefore, the accuracy of the Interpolated DFT method and other frequency estimation methods should be considered with particular attention to low SNR level signals because for the high SNR signals the real implementation limitations could occur. To work around that problem, a 64-bit floating-point format has to be used.
It should be pointed out, that due to using spectral analysis, the meter can simultaneously measure the frequencies of many non-overlapping spectrum lines. The limiting parameters of the introduced meter are: rate of measurements up to 410 per second or standard deviation about 7.6·10 -8 but those parameters could be improved by using faster and more precise calculating device.