1. Introduction
With the rapidly increasing penetration rate of new energy sources, such as wind power and photovoltaics in China and some other parts of the world, the capacity of power electronic equipment, such as electrical vehicle charging stations on the load side, is growing. Additionally, the proportion of power electronic equipment on the generation side has significantly changed in recent decades. Consequently, high-order harmonics, interharmonics, and superharmonics, which can cause severe potential damage to power equipment, such as capacitors and cables, are prevalent in the power grid. These harmonics not only deteriorate the power quality, leading to waveform distortion, but also threaten the safety and stability of the power system [
1,
2,
3,
4,
5].
The accurate measurement of harmonics is a prerequisite for effective harmonic management. The most common method for harmonic measurement is FFT, which is widely used due to its fast calculation speed and low computational hardware cost. Full cycle sampling is a mandatory requirement for FFT. However, ensuring complete full cycle sampling in practice is nearly impossible due to various interference factors such as frequency fluctuation. For example, a 20 ms sampling time corresponds to one cycle length waveform for a power system with a rated frequency of 50 Hz. If the frequency fluctuates from 50 Hz to 50.2 Hz, the 20 ms sampling time corresponds to one cycle length waveform and some additional sampling points rather than a complete cycle length waveform. In this case, spectral leakage occurs, necessitating windowing and interpolation methods for correction.
Window functions can generally be categorized into two types: single-window functions and composite window functions. Several scholars have applied various single-window functions to harmonic measurement, including the Blackman window [
6], Blackman–Harris window [
7], Nuttall window [
8], Hanning window [
9], and Rife–Vincent window [
10,
11]. Although these window functions differ, they are essentially combinations of several cosine functions with different coefficients. Due to the varying coefficients of each cosine function, the main lobe width and side lobe attenuation rates of the window differ. Meanwhile, interpolation algorithms include three-spectral-line interpolation [
12,
13], four-spectral-line interpolation [
14,
15], six-spectral-line interpolation [
16], etc.
Based on single-window functions, some scholars have designed compound convolution window methods to reduce the side lobe peaks and improve the side lobe attenuation rate. In [
17], the Rife–Vincent self-multiplication convolution window is utilized, which essentially performs one multiplication and one convolution operation on the Rife–Vincent window, resulting in superior spectral characteristics compared to a single Rife–Vincent window. In [
18], a Rife–Vincent compound convolution window with an adjustable parameter is designed, involving p-fold self-multiplication and q-fold convolution on the Rife–Vincent window. In [
19], the Blackman window and Nuttall window are convolved twice, achieving better measurement accuracy than a single window. However, this method still suffers from harmonic interference at approximate frequencies. The authors of [
20] applied the Kaiser convolution window to harmonic analysis, achieving high accuracy results.
In [
21,
22,
23], ZoomFFT is utilized to overcome the problem of approximate harmonic interference. The advantage of this method is its effective resolution of approximate harmonic interference. In [
24], a two-fold Hanning convolution window method is introduced; in [
25], the Hermite interpolation-based harmonic measurement method is studied; and in [
26], the fractional-order wavelet method is created. References [
27,
28] discuss several other harmonic detection algorithms, which are essentially similar to the aforementioned methods and will not be elaborated repeatedly due to space limitations. Additionally, references [
29] study a dynamical system of a spring–pendulum, contributing significantly to the inspiration of the algorithm.
Based on the aforementioned research, a new algorithm for wide frequency band harmonic measurement is proposed, combining different windows and ZoomFFT. Firstly, the phase difference of two adjacent spectral lines within the main lobe is 180° to preliminarily determine whether there is main lobe interference. When there is no interference within the main lobe, the composite window and spectral line interpolation algorithms are utilized to determine the parameters of the harmonics. When there is interference within the main lobe, the ZoomFFT algorithm is used to stretch the frequency axis of the harmonics with approximate frequencies, and then the above method is used for calculation. The simulation results demonstrate that the proposed algorithm can effectively identify harmonics and interharmonics with better resolution and accuracy of harmonic parameters than the competition algorithms.
2. Compound Convolution Window
To suppress spectrum leakage caused by frequency fluctuations, windowing and the interpolation method are performed on the discrete power signal to determine the parameters, including amplitude, frequency, and the initial phase of each harmonic. Generally, the expression of the window is given as follows.
where
N is the length of the window,
n represents the
n-th point of the window, and
m denotes the
m-th cosine component. The window consists of
M cosine signals, and the sum of the coefficients satisfies the following Equation (2).
The window function is a combination of multiple cosines, which can be composed of different windows by changing the number of terms
M and coefficients
. The main lobe widths and side lobe attenuation rates vary according to the types of windows, as shown in
Figure 1, and the key parameters, including main lobe width, side lobe level, and side lobe attention rate, are given in
Table 1.
Table 1 presents the main and side lobe properties of five typical windows. It is concluded that the main lobe width of the Hamming and Hanning windows is relatively narrow, while the side lobe level is high and the attenuation rate is slow. The sidelobe levels of the Blackman–Harris and Nuttall windows are −92 dB and −83 dB, respectively, which are lower than the side lobe levels of the Hamming and Hanning windows. Although the Blackman–Harris and Nuttall windows have the advantages of low side lobe levels and high attenuation rates, their main lobe width is larger than that of the Hamming and Hanning windows. It can be seen that it is difficult for a single window to meet the requirements of a low main lobe width and high side lobe attenuation rate simultaneously.
To overcome the above contradictions, several scholars proposed compound convolution windows, which can be obtained via convolution operations using different single windows, such as the compound convolution window based on the Rife–Vincent window. According to the convolution theorem, the convolution of a signal in the time domain corresponds to the product on the frequency spectrum. Hence, the main lobe width of compound convolution windows is narrower than that of a typical single window, while the side lobe levels of compound convolution windows are much lower, and the side lobe attenuation rates are much higher than that of a single window.
To illustrate the advantages of compound convolution windows, the side lobe properties on the frequency spectrum of a compound convolution window, which is convolution of a Blackman window and a Nuttall window, are presented. The spectrum corresponding to Formula (1) is shown as follows.
where
is the frequency spectrum of the rectangular window, which is shown as follows.
Let
be
; Formula (3) can be transformed into Formula (5), which is expressed as follows.
By substituting Equation (4) into Equation (5), the following expression is derived:
Generally,
N, the length of the signal, is much larger than 1, or
N ≫ 1. Therefore, Formula (6) can be simplified as Formula (7), which is given as follows.
The number of cosine terms in the Blackman window is
M = 3, with coefficients of 0.42, 0.5, and 0.08, respectively. The cosine coefficients of the Nuttall window are 0.3125, 0.46875, 0.1875, and 0.03125, respectively. Therefore, the formulae of the Blackman window and the Nuttall window are expressed as follows.
According to the convolution theorem, the frequency spectrum resulting from one convolution of the Blackman and Nuttall windows is equivalent to the product of Equations (8) and (9). This relationship is expressed by Formula (10) as follows.
The frequency spectra of the three formulas are shown in
Figure 2.
Figure 2 shows that the peak side lobe of the compound convolution window is around −150 dB, which is lower than the −58 dB of the Blackman window and the −83 dB of the Nuttall window. It is clear that the side lobe attenuation rate of the convolution window is also much faster than that of the two windows. Therefore, the suppression effect of a compound convolution window on spectral leakage caused by incomplete periodic sampling is better than that of a single window.
If a two-fold convolution operation is applied to the Blackman window and the Nuttall window, the resulting spectrum is the square of Formula (10) as follows.
The spectra of Formulas (10) and (11) are shown in
Figure 3.
As shown in
Figure 3, the side lobe of the two-fold compound convolution window is better than that of the one compound convolution window, and the peak value of the side lobe of the two-fold compound convolution window is around −224 dB. Additionally, the side lobe attenuation rate is much higher. Similarly, the spectral characteristics of the triple compound convolution window are better than the two-fold compound convolution window. However, a two-fold compound convolution window is sufficient when the computational cost is taken into account. Considering all factors, the Blackman window and the Nuttall window are selected to compose the two-fold compound convolution window.
3. Spectral Line Interpolation
Due to frequency fluctuation and other factors, power line signals may experience incomplete periodic truncation. As a result, multiple spectral lines emerge near the true frequency points on the frequency axis rather than directly reflecting the true frequency values, as shown in
Figure 4. Therefore, spectral line interpolation is required to accurately determine the true values of harmonic frequencies.
Generally, spectral line interpolation algorithms consist of three spectral lines, four spectral lines, six spectral lines, etc. The accuracy of the calculation improves as the number of selected spectral lines increases. Since harmonic analysis does not require high real-time performance, six spectral lines are employed for the interpolation algorithm to achieve higher precision results.
For simplifying the expression and excluding the influence of harmonics, the discrete formula of a sine wave signal is expressed as follows.
where
A,
, and
are amplitude, frequency, and initial phase, respectively.
denotes the sampling rate, and
n corresponds to the
n-th sampling point. By multiplying this sinusoid signal, as given in Equation (12), with a two-fold compound convolution window, as described in Equation (11), the resulting equation is given by Equation (13).
and the corresponding spectrum is given in Equation (14), as follows.
The formula above consists of two parts: the positive frequency part and the negative frequency part. In practice, only the positive frequency part is preserved, and the negative frequency part is omitted, so Formula (14) can be simplified to Formula (15).
The discretization form of Formula (15) is given as follows.
Given that the spectral line of the real frequency is
, we choose six spectral lines
–
, which are approximate to
, as depicted in
Figure 4. The corresponding spectral line amplitude is
=
,
=
,
=
,
=
,
=
, and
=
. Let
=
and
[−0.5, 0.5]; we can obtain the following equations.
Similarly, we can obtain the following equations.
Given that the spectral lines
and
are closer to the actual frequency
, while the other spectral lines are relatively distant, a larger weight value of 6 is assigned to
and
, whereas the remaining weight values are 2, 2, 1, and 1, respectively. A new parameter
is introduced, for which the expression is given as follows.
By substituting Equations (17)–(22) into Equation (23), we can obtain
where
and
are given as follows.
It can be seen that
is a function of
from Equations (24)–(26). Due to the complexity of the equations, a polynomial is used to perform inverse fitting on this function, and we can obtain
=
. It is sufficient to fit the highest term up to seven times in general. Consequently, the correction formula for frequency, initial phase, and amplitude are given as follows.
To simplify the calculation of the aforementioned equation, the polynomial fitting method is employed, which leads to the introduction of a new mathematical function defined as follows.
Therefore, the correction formula for spectral amplitude is
where
is
The aforementioned Formulas (27), (28), and (31) serve as fundamental computational formulas for signal parameter analysis. In scenarios involving signals composed of multiple harmonic components, it is essential to identify the maximum amplitude spectral line corresponding to each harmonic within the frequency spectrum.
4. Determination for Interference in Main Lobes
Insufficient frequency resolution may result in spectral main lobe interference caused by interharmonic components, leading to significant deviations in the calculated parameters of both harmonic and interharmonic components from their actual values. Therefore, it is necessary to study an effective methodology to identify main lobe interference phenomena.
Assuming that the DFT result of the signal in the power grid is
, we process the spectrum by discarding the negative frequency components while preserving the positive frequency components, and the new spectrum is given as follows.
Suppose that
and
are two adjacent spectral lines within the main lobe of the
i-th harmonic spectrum; Equations (34) and (35) can be obtained.
Given that
k2 =
k1 + 1, substituting
k2 =
k1 + 1 into (35) yields Equation (36) as follows.
Hence, the absolute value of the phase difference between
and
is
Based on Equation (37), in the absence of spectral lines interference within the main lobe, the absolute value of the phase difference between two adjacent spectral lines on the spectrum is
radians, which is equivalent to 180° degrees. In contrast, the absolute value of the phase difference between adjacent spectral lines deviates from 180°. Given the presence of unfavorable factors such as signal noise and calculation errors, the following formula is utilized to identify the main lobe interference.
where
denotes the phase of the spectral line
,
i is the
i-th harmonic component, and
is the threshold of
in Equation (38); here, the units of
are in degrees. From a theoretical perspective,
should ideally be 0° in the absence of interference within the main lobe. However, practical considerations, such as system noise and computational inaccuracies, typically result in a slight deviation, yielding
marginally greater than 0°. Based on empirical observations and theoretical analysis, we establish a conservative threshold of
= 5° for reliable interference detection. The phase difference caused by noise and errors is small, and the phase difference when main lobe interference occurs is high, so this 5° threshold can ensure the accurate identification of main lobe interference.
5. ZoomFFT
In power system scenarios, the frequency spacing between harmonics and interharmonics may be narrow, potentially inducing spectral aliasing phenomena during the harmonic analysis of power signals. This significantly compromises the accuracy of harmonic parameter estimation. To address this limitation, ZoomFFT is utilized to effectively suppress spectral aliasing while facilitating the calculation of harmonic parameters. The procedures of ZoomFFT are comprehensively presented as follows.
(1): Firstly, the presence of main lobe interference can be identified by Equation (38). In cases where main lobe interference is detected, it is necessary to ascertain the specific frequency band that is affected. Subsequently, the lowest frequency , the central frequency , and the highest frequency can be determined. By multiplying the signal x(t) of length N with the rotation factor , the frequency spectrum of the signal is shifted to zero frequency, yielding a new spectrum .
(2): A low-pass filter is applied to the new spectrum , retaining the low-frequency part of and eliminating the high-frequency part.
(3): The inverse fast Fourier transform (IFFT) is applied to the low-pass filtered data with N points, obtaining a time domain signal . Then, down sampling is carried out at intervals of D, producing a new signal of length N/D.
(4): FFT is applied to the signal of length N/D, which is then rearranged. By setting the number of Fourier transform points to N, a frequency spectrum of length N is generated. The original frequency interval , or − , is divided by D, resulting in a new frequency interval . Therefore, the frequency resolution increases by D times, achieving the objective of the local amplification of the spectrum.
In summary, a flowchart of the algorithm in this article is shown in
Figure 5.
6. Experimental Results and Analysis
To validate the effectiveness of the algorithm proposed in this study, voltage signals containing harmonics and interharmonics were analyzed. The amplitude, frequency, and phase parameters derived from the analysis are given in
Table 2.
The frequency of harmonics exceeds 2.5 kHz. According to the Nyquist theorem, the sampling frequency must be greater than 5 kHz. In this study, it was set to 6400 Hz. Furthermore, the sampling length was 10 cycles, which is equivalent to 1280 sampling points. The amplification factor D in ZoomFFT was chosen as 10.
To account for noise interference in real-life signals, Gaussian white noise with a signal-to-noise ratio of 50 dB was added to the signal to simulate the real noise. The harmonics and interharmonics of the signal were analyzed by using the algorithm proposed in this article, and the results are detailed in
Table 3.
As shown in
Table 2, the proposed algorithm effectively calculates the parameters of harmonics and interharmonics even under a signal-to-noise ratio of 50 dB. The relative errors of the amplitude, frequency, and initial phase of each harmonic were then determined by Equations (39) to (41) as follows.
where
,
, and
represent the real parameter of the
i-th harmonic or interharmonic and
,
, and
are the calculation result of the
i-th harmonic or interharmonic. The relative errors of the parameters for each harmonic are illustrated in
Figure 6,
Figure 7 and
Figure 8.
As illustrated in
Figure 6,
Figure 7 and
Figure 8, the relative errors between the calculated values and actual values of each harmonic and interharmonic parameter remain relatively minimal. Specifically, the relative errors of amplitude do not exceed 9 × 10
−3%, while the errors of frequency are within 5 × 10
−5%. Although the initial phase exhibits a comparatively larger error, it remains below 4 × 10
−2%, which is still considered negligible.
Additionally,
Figure 9 shows the different harmonic analysis results. The left picture shows the results of traditional FFT, which failed to identify the approximate frequencies.
In contrast, the right picture demonstrates that the proposed method can identify the approximate frequencies successfully, which proves the effectiveness of the method.
Furthermore, to validate the stability of the algorithm, five Monte Carlo experiments were conducted. The results demonstrate that the standard of amplitude is less than 0.04, the standard of frequency is less than 3.5 × 10−3 Hz, and the standard of initial phase is less than 1.5°. The findings indicate that the standards of the computation results are small enough, thereby confirming the reliability of the algorithm.
To verify the superiority of the proposed algorithm over the competing algorithms, a comparative analysis was conducted by using the Blackman window, the Hanning window, the Hamming window, ZoomFFT, and the proposed algorithm. Each algorithm was executed 10 times in Monte Carlo simulations to evaluate the computational time required for each run. The average of the 10 execution times was calculated and used as the representative time cost for a single run. The results are shown in
Table 4.
The statistics in
Table 3 demonstrate that the three windowed interpolation methods were unable to identify interharmonics and resulted in incorrect calculation results. Although ZoomFFT can successfully identify interharmonics, it demands a large number of sampling points and prolonged computation time, as it lacks a main lobe interference detection step and requires frequency axis amplification for each component. The proposed algorithm, which incorporates main lobe judgment and ZoomFFT, can precisely distinguish main lobe interference and calculate the parameters of both harmonics and interharmonics.
7. Conclusions
A combined algorithm integrating a compound convolution window and ZoomFFT was designed to achieve accurate measurement of harmonic and interhamonic parameters. This algorithm leverages the benefits of a two-fold compound convolution window, including the low side lobe peak and high attenuation rate, to effectively mitigate spectral leakage and aliasing. Furthermore, by incorporating the high-frequency resolution capability of ZoomFFT, the algorithm addresses the issue of inaccurate calculations caused by interference from adjacent interharmonics, ensuring enhanced accuracy in parameter estimation. The analysis results of simulated signals verified that the algorithm has the merits of high estimation accuracy and low time cost, providing an outstanding alternative for harmonic control in modern power grids. In the future, there is a need for further exploration into the development of an FPGA-based device, the integration of the proposed algorithm onto this device, and its practical application in the harmonic detection of real-life power grids.