Applicability of a Fast Fourier Transform for a harmonic analysis

Applicability for Fast Fourier Transform of signals with low entropy are discussed in this article. Firstly, FFT is studied for case of a harmonics set shifted relative to samples of FFT. A theoretical basis is analysed. A conclusion is that the error is goes down but it is high enough yet. Next, a method on a base of convolution with a harmonics spectrum neighbourhood and window’s spectrum is presented. A conclusion is that an amplitude error for harmonic measuring becomes good but a phase error continues to be bad one. Finally, a conclusion is that FFT concedes accuracy direct measuring methods. In case of accordance of characteristics of measure, FFT concedes in number of calculations.


Introduction
Fast Fourier transform (FFT) is a popular algorithm [1][2][3] that is used in measuring equipment [4][5][6]. The FFT inherits features of the DFT (but not vice versa), so we will discuss both the FFT and the DFT, understanding their common nature. We will consider non-sinusoidal currents and voltages, the forms of which are typical for tasks of electric power industry. These signals vary slightly with time. Their amplitude and frequency are stable enough during hundreds of periods. Using parameters of these signals at the current time, we can predict their behavior for a few seconds ahead with a high probability [7]. We call such signals as "low entropy signals" unlike radio signals that carry mostly information and have high entropy.
FFT calculates a spectrum of finite sequences [21]. However, due to the "low entropy" property, electrical signals are closer to infinite sequences. In other words, when we try to find the spectrum of an electrical signal, we faced with the classical problem of approximating the infinite-dimensional Hilbert space by a finite-dimensional one [22][23][24][25].
The purpose of this article is to consider the properties of such approximation for lowentropy quasi-periodic signals and to clarify the applicability of FFT.
From an engineering point of view, it is clear that both of the above problems can be solved in two ways: 1) division of the measurement range into two sub bands, and work in each sub band by a separate counter; 2) installation of a meter with a much higher dynamic range, which is equivalent to a significant reduction in the cutoff level.

Methods
Let our signal is periodic and consists of 50 harmonics. The frequency of the main harmonic is 50 Hz. Its amplitude is 100. The amplitude of the higher harmonics is 1. Their phases are random. The sampling frequency is 10 kHz. The use of DFT shows that all spectral samples equal to zero, except samples with frequencies 50, 100, 150 and so on to 2500 Hz. Amplitudes and phases of these samples equal to amplitudes and phases of original signal harmonics. It seems the calculation confirms the possibility of using DFT for measuring harmonics of electrical signals.
Let now a frequency of a main harmonic is 49.999 Hz. Using of DFT leads to errors in amplitudes of harmonics to 0.005, and a phase error to 9 degrees. The error arises because the FFT expands the sequence in a basis. The basis in our case are segments of complex sinusoids with frequencies of 50, 100, ..., 2500 Hz. The sinusoid with a frequency of 49.999 Hz is not presented in this set. Therefore, it is impossible to display this sinusoid correctly. It leads to increase in error.
The electrical signal spectrum is a lattice function. If frequencies of harmonics coincide with the frequencies of DFT samples, amplitudes of harmonics are determined using DFT correctly. If a frequency of a harmonic is shifted relatively to a frequency of a DFT sample, this sample cannot display it correct. This allows to conclude that method of measurement of harmonics of electrical signals using DFT has to be improved.

Correlation method in the frequency domain
A spectrum of the periodic signal consists Dirac's functions .If this signal is windowed then every Dirac's function If the frequency of the main harmonic is multiple of the sampling rate, samples in the neighbourhood all harmonics equal to the sequence of samples of a main lobe of the window spectrum accurate to the coefficient k C . We mark them as   0 Wm . If the frequencies of harmonics are located between DFT samples, we offer to find L sets of samples   l Wm that corresponded with harmonics between the two DFT points. To do this, the space between the two DFT points is divided uniformly by L-1 points. When the centre of the spectrum of the window moves to a point l, we get the corresponding set of samples   l Wm.
We change (1): Wm. The algorithm is as follows. They calculate the inner product between the samples of the signal's spectrum and   l Wm. The largest value of the inner product means the set of samples corresponding to the window located as close as possible to the measured harmonic is found. If the central frequency of the window spectrum and the harmonic coincide, the algorithm is (1). In case of frequency mismatch, formula (2) is converted to: where r is the misalignment of the centre frequency of the window and the harmonic frequency;

 
Rr is a autocorrelation function of the window spectrum The phase is:

Features of implementation of the meter using FFT
The basic operation in FFT is Calculations in the FFT are recursive. Results of one stage are used as initial data for the next stage. It's necessary to scale the result to avoid overflow. The result simply lose a low bit. According to (4), a total energy of 1 Y and 2 Y equals to twice total energy of the 1 X and Therefore: But the samples 1 Y and 2 Y are divided into 2 (scaling to prevent overflow). That is, the RMS amplitude of the samples 1 Y and 2 Y decreases in 2 , and a quantization noise remains the same. This situation is inevitable in low-cost signal processors. This truncation of the signal at each stage of the FFT leads to increasing of the noise caused by rounding.

Discussion
The window using weakens the influence on the measurement results of the ending samples, decreasing their amplitude. They don't take part in calculations. This leads to an increase in the noise level in the signal, since the noise is averaged to a lesser extent.
The next problem arising from the window using is observed in the measurements in real-time mode. In this case, the flow of samples from the ADC is divided into time intervals, which are windowed (Fig. 1).
As we see, most of the samples are suppressed. If an artefact is in the areas that occupy about 90%, the measuring algorithm ignores it. If the artefact is in the middle of the window, the impact of this artefact on the measurement results will be much higher. Compensation of this effect is possible when using window overlay (see Fig. 2). Due to the overlap, previously suppressed samples are again involved in the measurement process, but the computational cost is multiplied.  The window action can be compared to the filter action. In real measuring systems, socalled measuring filters are used, which allow to clear the signal from wideband and concentrated noise. Calculations show that the filter of order N with a bandwidth of N -1 sampling frequency cannot have the suppression in the rejection band more than 20 db. That is, the DFT in principle cannot provide good selectivity in the neighbouring frequency when the measured signal is concentrated in a single spectral sample. Therefore, it isn't possible to measure a narrow-band signal with DFT under conditions of closely located interference.
Finally, consider the question of the measurement of the phase of the harmonics when FFT is used. The reason for the large error in phase measurement is that the phase between the DFT samples changes very much − up to 180 degrees. Accordingly, in order to measure it, it is necessary to find the correction term   * l Wm from (3) for the point as close as possible to the measured harmonic. Finding this member significantly increases the number of operations. Let us estimate the required performance of the calculation to provide a given error in the measurement of the harmonic phase. Suppose we need to calculate the harmonic phase with an accuracy 1 degree. To do this, the first step is to find the maximum sample of the FFT in the neighbourhood of the first harmonic frequency. If the Chebyshev window with the parameter 1000 is used, then in the neighbourhood the real harmonic there will be about 10 FFT samples with the significant for calculations amplitude.
We calculate the number of real operations in the calculation (2). Given that the samples   * l l Wm E may be calculated in advance. The inner product of two sequences of 10 samples requires 10 complex multiplications and 9 complex additions, which corresponds to 78 real additions and multiplications.
Let us determine the number of inner products to calculate the phase of the first harmonic. Let the desired harmonic is in the neighbourhood   1 2,1 2  of the maximal spectral sample. At this interval, the phase changes from -0.9 to 0.9 degree. If we divide this interval by 100 points, the phase will change from -0.9 to 0.9 degree in the neighbourhood each point. That satisfies our conditions. The calculation of the inner product at all 100 points requires 7800 real operations. Once the first harmonic has been found, we proceed to the search for the second harmonic. The algorithm will be the same, only the search area increases by 2 times and instead of 100 inner products, we have to calculate 200 ones. For the 3rd harmonic we have