Abstract

Spectral leakage in the harmonic measured by quasi-synchronous DFT (QSDFT) is mainly due to short-range leakage caused by deviation in the signal frequency. By analysing the short-range-leakage characteristic of QSDFT, a linear-correction algorithm (LCQS) for QSDFT’s harmonic-analysis results is proposed. LCQS contains two linear-correction equations: an amplitude-correction equation and an initial-phase-angle-correction equation. The former is constructed by the least-squares method, whereas the latter is generated based on the linear error characteristic of the QSDFT harmonic phase. Simulation and experimental results indicate that this proposed algorithm can efficiently increase the accuracy of the harmonic parameters over a wide frequency range by minimizing the short-range spectral leakage.

1. Introduction

Harmonic analysis technology can break down complex signals into simple periodic ones to facilitate their understanding. This technique is widely used in many fields such as power-quality monitoring, electronic product inspection, and electrical equipment monitoring. The Fourier transform method, including discrete Fourier transforms (DFTs) and fast Fourier transforms (FFTs), is the most widely used method for harmonic analysis. However, two types of spectrum leakage—i.e., long-range leakage caused by the truncation effect (finite points sampling) and short-range leakage caused by the fence effect (asynchronous sampling)—appear when DFT and FFT are applied, resulting in inaccurate and untrustworthy analytical results [13]. Thus, many solutions have been presented, including the windowed-interpolation algorithm [47] and quasi-synchronous DFT (QSDFT) [815].

The QSDFT algorithm is simple and easy to implement, and the measurement accuracy of the signal frequency is high when the frequency is deviated [3]. However, suppression of the short-range spectral leakage caused by signal-frequency deviation is insufficient, limiting analytical accuracy. Many improved methods to address this problem have been presented in the literature, such as parameter-adapted QSDFT [16], the periodic-sampling-points correction method [17], and the least-squares method [18]; however, none can completely suppress spectral leakage. [19] proposed the so-called variable picket fence (VPF) harmonic-analysis method, which effectively suppresses short-range spectrum leakage but requires two analytical operations to obtain results, making it unsuitable for real-time operation.

QSDFT uses the multiple iterations integral method to suppress spectral leakage; however, it causes the spectral equation to become extremely complex, preventing a simple interpolation-correction function for the frequency deviation from being obtained. In this paper, a linear-correction algorithm (LCQS) for QSDFT is proposed, containing two equations: the amplitude-correction equation and the initial-phase-angle-correction equation. It can easily correct the errors caused by frequency deviation. Simulation and application results show the validity of this algorithm.

2. QSDFT and VFP

2.1. QSDFT Algorithm

Consider a periodic signal, :Here, is the harmonic order, and are the amplitude and initial phase of the kth harmonic, respectively, and is the frequency of .

According to the sampling frequency and the number of sampling points within a cycle , uniformly spaced sampling is performed W+1 times in the range to obtain the sampled sequence , . Here, is determined by the integral method,, when using trapezoidal integration methods; is the number of iterations.

Appling Eqs. (2) and (3) to calculate the real part, and the imaginary part, , and thus the and values of the kth harmonic, QSDFT is given by [8]where is the initial sampling point, normally ; is the weighting coefficient, determined by the integral method, and ; and is the sum of all weighting coefficients, with when .

Strictly whole-cycle synchronous sampling is difficult to implement in the actual measurement process. Multiple factors, including the precision and integer-multiple error of the sampling clock and the signal-frequency deviation, will affect the sampling process, leading to short-range leakage of the discrete spectrum, as well as the most important source of leakage, namely, signal-frequency deviation. In theory, based on the convergence characteristics of multiple iterations, QSDFT can suppress short-range leakage caused by frequency deviation. However, the inhibitory effect upon the short-range leakage is not significant during practical applications.

[19] pointed out that high analytical precision for the amplitude of QSDFT occurs only in the range of 50 ± 0.1Hz and that the initial-phase from QSDFT is untrustworthy except when it is close to the original frequency. In other words, QSDFT is almost completely incapable of suppressing short-range spectrum leakage.

2.2. Rate of Signal-Frequency Deviation

Definition 1. The rate of signal-frequency deviation, , is the degree of signal-frequency deviation, which is defined as follows:If the signal frequency does not deviate, ; if it does, andSuppose , , and is a large number; the following equations can be deduced from [20]:Here, is the maximum harmonic order,The fundamental initial phase analyzed by QSDFT from the ith sample point is For two adjacent sampling points, the fundamental initial-phase difference isFor engineering applications, the fundamental initial phases, and , of the two adjacent sampling points can be calculated from two starting points and with Eq. (2), so is

2.3. VFP Algorithm

[19] showed that when signal-frequency deviation occurs, the sampling position in the frequency domain is still (the corresponding analog frequency ), leading to great spectral leakage. Adjusting the frequency-domain sampling position to (the corresponding analog frequency ) will suppress short-range spectrum leakage.

Thus, the improved VFP equation is

However, the introduction of the frequency-deviation rate leads to two problems for the implementation of the VFP harmonic analysis algorithm:

the sine/cosine calculation of the Fourier transform factor cannot be achieved using the look-up-table method, and the computational cost increases significantly;

the VFP harmonic calculation must be completed after the sample is completed and cannot be calculated step by step.

3. Linear-Correction Algorithm

3.1. Amplitude Correction

Because the spectral function of QSDFT is too complex, it is almost impossible to derive a simple interpolation iterative formula to correct the analytical error caused by frequency deviation. This paper gives a linear amplitude-correction method based on the principle of least squares, the specific idea of which is

to construct the error curve between the fundamental amplitude error and the rate of signal-frequency deviation according to the law relating these quantities;

to obtain an equation for the error curve between the fundamental amplitude and using the least-squares method, as well as the linear-correction equation between the fundamental amplitude and ;

to extend the linear-correction equation of fundamental amplitude to each harmonic and obtain such an equation between each harmonic amplitude and .

We know that if the signal frequency deviates times to , the spectrum peak of the QSDFT amplitude will stretch times along with the frequency axis to , and amplitude-analysis error will result from it if the peak is still found at . For example, there are three fundamental signals of different frequencies with the same amplitude of 1: the ideal signal frequency of 50 Hz, and the deviated frequencies at 40 Hz and 55 Hz; using QSDFT to analyze the harmonics of these three signals, we find that they have peaks of amplitudes A, B, and C, respectively (Figure 1, left). Obviously, only the fundamental amplitude of 50 Hz obtained by QSDFT is correct, and the obtained fundamental amplitudes of the other two signals have larger errors.

Figure 1 suggests a means of obtaining the fundamental amplitude-error curve of QSDFT. This involves recording the fundamental amplitude-analysis results of these three signals, together with their frequency deviations (0Hz, +5Hz, and -10 Hz, resp.). Then, these deviations can be used as abscissas (in units of hertz) and the fundamental amplitude can be used as ordinates; points A, B, and C can then be plotted as Figure 1, right. Then, the fundamental signal from 20 Hz to 80 Hz will be continuously generated and QSDFT harmonic analysis will be carried out. The fundamental amplitude is recorded and plotted, and its error curve can be obtained (Figure 1, right). The equation of the QSDFT fundamental amplitude-error curve is

The least-squares principle is employed to obtain the solution of Eq. (14); set

There are two unknown quantities, and , in Eq. (15) when the error curve of the fundamental amplitude is known. Assuming that is known, set

Thus,

We apply Eqs. (13) and (14) to produce -group data and , denoted as

Then,

The least-squares solution of is

The remaining issue is to determine the unknown quantity . Suppose the error between the fitted value and the true value is

The mean square error of is

In a certain range searching to make minimum, we can obtain the value of .

The number of iterations, n, is different, and the fundamental amplitude-error curve is not consistent. Table 1 shows with different .

We also know that the spectral peak of the kth harmonic amplitude will deviate by from the ideal position when the signal frequency deviates by , so the amplitude linear-correction function of QSDFT is

3.2. Initial-Phase Angle Correction

Suppose , , and is a large number; the following equation can be deduced from [20]:

So,Here, is a constant.

Eq. (27) suggests that there is a linear relationship between the analytical results and the real values of the harmonic initial-phase-angle of signal-frequency deviation. However, no method for determining is given in [20].

A large number of simulation experiments show that is associated with the rate of signal-frequency deviation , the number of iterations , and the harmonic order and is not affected by the number of sampling points and other parameters. Thus, the initial-phase-angle linear-correction function of QSDFT iswhere .

3.3. Analytical Process of LCQS

The analytical process of LCQS consists of five steps:

sampling data. Adding one more sampling point is necessary for LCQS due to the need for two starting points, and ;

calculating , , , and for and , respectively, using Eq. (2);

calculating and by Eqs. (11) and (5);

calculating the raw amplitude and the initial phase of each harmonic by Eqs. (2) and (3);

correcting the amplitude and the initial phase of each harmonic using Eqs. (25) and (28), respectively.

4. Simulation

We design two groups of simulation experiments to examine the effectiveness of LCQS: an analytical-accuracy experiment and a time complexity experiment. For comparison, we also perform the same experiments with the Hanning interpolation [21], QSDFT, and VFP methods.

4.1. Analytical-Accuracy Experiment

Some waveform signals are generated from Eq. (29) to verify the analytical accuracy of these four methods. The signals are measured with , , and the number of iterations :Here, and are arbitrary; to 50.5Hz; Amplitude Relative Error = (Analyzed-Theoretical)/Theoretical 100%; Initial-phase Absolute Error = (Analyzed-Theoretical).

Figure 2 shows the relative errors in the amplitude obtained by each of the four methods. In Figure 2, the x-axis is the signal frequency in Hz; the Y-axis is the harmonic order from 1 to 15; and the z-axis is the relative percent error in amplitude. As can be seen from Figure 2, the error of QSDFT is the largest and reaches 10% level; the error of Hanning interpolation is second and is to 10−4% level; the error of LCQS is to 10−7% level; and the error of VFP is minimal at 10−12% level.

Figure 3 illustrates the absolute error of the initial phase obtained by the four above-mentioned methods. In Figure 3, the x-axis is the signal frequency in hertz, the y-axis is the harmonic order from 1 to 15, and the z-axis is the absolute error of the initial-phase angle in degrees. As can be seen from Figure 3, the error in QSDFT is largest, reaching the 102-degree level; however, if 360-degree periodicity is considered, the error surface falls in a plane, which is also the theoretical basis for LCQS; the error of Hanning interpolation is second largest, reaching the 10−2-degree level; the error of LCQS reaches the 10−8-degree level, and that of VFP reaches the 10−9-degree level. However, the error of LCQS only slightly protrudes at the frequency and harmonic edges, and the overall error falls almost in a plane.

The analytical-accuracy experiments show that

LCQS makes up for the short-range leakage of the QSDFT algorithm, relaxes the requirement for synchronous sampling, and significantly increases the analytical accuracy of each harmonic.

Compared with QSDFT, LCQS can obtain high analytical precision simply by adding one sample point and one fundamental initial-phase calculation.

Compared with the VFP, LCQS greatly reduces the complexity of the algorithm and can be calculated step by step.

4.2. Time Complexity Experiment

In order to qualitatively describe the time complexity of the four harmonic-analysis methods, we designed a simulation experiment. A waveform signal is generated from Eq. (29), where and are arbitrary, , , , and the number of iterations is . In the MATLAB R2016b software environment, the analysis times of these four methods are recorded. To exclude other interference factors, the same 200 consecutive analytical experiments were performed, and the time average was taken. The experimental results are presented in Table 2.

The simulation results show that the time complexity of LCQS is only slightly higher than that of the QSDFT at different iterations, but about an order of magnitude lower than the VFP algorithm.

5. Experimental Results

To evaluate the practical performance of LCQS, we embedded LCQS into a measuring device, JCQ-5 (Figure 4(a)), designed to monitor the capacitive equipment online. This equipment is important to the power grid and usually requires online monitoring of its current, , and dissipation angle, , or dissipation factor, , to evaluate its status (Figure 4(a)):Here, and are the fundamental initial phases of and , respectively.

JCQ-5 consists of four parts: Voltage / Current Transformer, Signal Conditioning, Synchronous ADC AD7606, and a CPU STM32F103. JCQ-5 samples and synchronously; in this device, we set , , and . It calculates (fundamental amplitude of ), , , and . A highly precise and stable three-phase harmonic source JB706 (Figure 4(b)) was used as the signal source. The output parameters of JB706 were as follows: , , , , . The amplitude of the third and fifth harmonics was 5% and 1% of that of the fundamental, respectively.

For comparison, we also embedded the Hanning interpolation, QSDFT, and VPF into JCQ-5; their performances are shown in Table 3. Among them, the error of is relative error, the unit is %; the error of is absolute error, and the unit is degree. For the measurement accuracy of , QSDFT is inferior to the other methods, while VPF and LCQS have the same level of high accuracy. For the measurement accuracy of , Hanning has a relatively poor result because of its lower initial-phase analysis accuracy; QSDFT can also obtain the correct result, but only because the errors of and cancel each other out and the measurement results of and are not correct; VPF and LCQS still have the same high level of accuracy.

6. Conclusions

This paper proposed a linear-correction algorithm (LCQS) for QSDFT; it has the following features:

Compared to QSDFT, LCQS suppresses the short-range spectral leakage efficiently; compared to VPF, LCQS reduces the computations and can be operated in real time.

LCQS loosens the requirements for synchronous sampling and increases the analytical accuracy of amplitude and initial-phase determination significantly.

LCQS truly implements the linear correction of QSDFT harmonic-analysis results when the signal frequency deviates.

LCQS can work in real time and can be easily transplanted into existing hardware systems, making it a very practical algorithm.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This study has been supported by the National Natural Science Foundations of China under Grant no. 61472166.