# A Linear-Correction Algorithm for Quasi-Synchronous DFT

Authors: Zhongjun Fu; Jianyu Wang; Yun Ou; Genyuan Zhou; Xiaorong Zhao
Journal: Mathematical Problems in Engineering
 (2018)

---

## 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.


---

## Body

## 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 [1–3]. Thus, many solutions have been presented, including the windowed-interpolation algorithm [4–7] and quasi-synchronous DFT (QSDFT) [8–15].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,ft:(1)ft=A0+∑k=1∞Aksin⁡2πkf1t+φkHere, k is the harmonic order, Ak and φk are the amplitude and initial phase of the kth harmonic, respectively, and f1 is the frequency of ft.According to the sampling frequencyfS and the number of sampling points within a cycle N, uniformly spaced sampling is performed W+1 times in the range t0,t0+W×TS to obtain the sampled sequence fi, i=0toW. Here, W is determined by the integral method,W=nN, when using trapezoidal integration methods; n is the number of iterations.Appling Eqs. (2) and (3) to calculate the real part, ak and the imaginary part, bk, and thus the Ak and φk values of the kth harmonic, QSDFT is given by [8](2)ak=2Fakni=2Q∑j=0Wγjfi+jcos⁡k2πNjbk=2Fbkni=2Q∑j=0Wγjfi+jsin⁡k2πNj(3)Ak=ak2+bk2φk=tg-1akbkwhere i is the initial sampling point, normally i=0; γj is the weighting coefficient, determined by the integral method, nand N; and Q=∑j=0Wγj is the sum of all weighting coefficients, with Q=N+1n when W=nN.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:(4)μ=Nf1fS
If the signal frequency does not deviate,μ=1; if it does, μ≠1 and(5)Δμ=μ-1
SupposeN>2+Nf1/fS, fS/N>2Mf1, and n is a large number; the following equations can be deduced from [20]:(6)Fa1n=ρ11nA1cos⁡2πf1NTSCn+φ1∗Fb1n=ρ11nA1sin⁡2πf1NTSCn+φ1∗Here, M is the maximum harmonic order,(7)Cn=i0N+n12-12N(8)ρ11=1Nsin⁡πfΔNTSsin⁡πfΔTS
The fundamental initial phaseφ1i analyzed by QSDFT from the ith sample point is (9)φ1i=tg-1Fa1niFb1ni=2πf1NTSi0N+n12-12N+φ1∗
For two adjacent sampling points, the fundamental initial-phase difference is(10)φ1i+1-φ1i=2πf1fS
For engineering applications, the fundamental initial phases,φ1(0) and φ1(1), of the two adjacent sampling points can be calculated from two starting points i=0 and i=1 with Eq. (2), so μ is(11)μ=Ntg-1Fa1n1/Fb1n1-tg-1Fa1n0/Fb1n02π


### 2.3. VFP Algorithm

[19] showed that when signal-frequency deviation occurs, the sampling position in the frequency domain is still 2π/N (the corresponding analog frequency fS/N), leading to great spectral leakage. Adjusting the frequency-domain sampling position to μ2π/N (the corresponding analog frequency μfS/N) will suppress short-range spectrum leakage.Thus, the improved VFP equation is(12)ak=2Fakni=2Q∑j=0Wγjfi+jcos⁡kμ2πNjbk=2Fbkni=2Q∑j=0Wγjfi+jsin⁡kμ2πNjHowever, the introduction of the frequency-deviation rateμ leads to two problems for the implementation of the VFP harmonic analysis algorithm:( 1 ) the sine/cosine calculation of the Fourier transform factor cannot be achieved using the look-up-table method, and the computational cost increases significantly;( 2 ) the VFP harmonic calculation must be completed after the sample is completed and cannot be calculated step by step.


## 2.1. QSDFT Algorithm

Consider a periodic signal,ft:(1)ft=A0+∑k=1∞Aksin⁡2πkf1t+φkHere, k is the harmonic order, Ak and φk are the amplitude and initial phase of the kth harmonic, respectively, and f1 is the frequency of ft.According to the sampling frequencyfS and the number of sampling points within a cycle N, uniformly spaced sampling is performed W+1 times in the range t0,t0+W×TS to obtain the sampled sequence fi, i=0toW. Here, W is determined by the integral method,W=nN, when using trapezoidal integration methods; n is the number of iterations.Appling Eqs. (2) and (3) to calculate the real part, ak and the imaginary part, bk, and thus the Ak and φk values of the kth harmonic, QSDFT is given by [8](2)ak=2Fakni=2Q∑j=0Wγjfi+jcos⁡k2πNjbk=2Fbkni=2Q∑j=0Wγjfi+jsin⁡k2πNj(3)Ak=ak2+bk2φk=tg-1akbkwhere i is the initial sampling point, normally i=0; γj is the weighting coefficient, determined by the integral method, nand N; and Q=∑j=0Wγj is the sum of all weighting coefficients, with Q=N+1n when W=nN.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:(4)μ=Nf1fS
If the signal frequency does not deviate,μ=1; if it does, μ≠1 and(5)Δμ=μ-1
SupposeN>2+Nf1/fS, fS/N>2Mf1, and n is a large number; the following equations can be deduced from [20]:(6)Fa1n=ρ11nA1cos⁡2πf1NTSCn+φ1∗Fb1n=ρ11nA1sin⁡2πf1NTSCn+φ1∗Here, M is the maximum harmonic order,(7)Cn=i0N+n12-12N(8)ρ11=1Nsin⁡πfΔNTSsin⁡πfΔTS
The fundamental initial phaseφ1i analyzed by QSDFT from the ith sample point is (9)φ1i=tg-1Fa1niFb1ni=2πf1NTSi0N+n12-12N+φ1∗
For two adjacent sampling points, the fundamental initial-phase difference is(10)φ1i+1-φ1i=2πf1fS
For engineering applications, the fundamental initial phases,φ1(0) and φ1(1), of the two adjacent sampling points can be calculated from two starting points i=0 and i=1 with Eq. (2), so μ is(11)μ=Ntg-1Fa1n1/Fb1n1-tg-1Fa1n0/Fb1n02π


## 2.3. VFP Algorithm

[19] showed that when signal-frequency deviation occurs, the sampling position in the frequency domain is still 2π/N (the corresponding analog frequency fS/N), leading to great spectral leakage. Adjusting the frequency-domain sampling position to μ2π/N (the corresponding analog frequency μfS/N) will suppress short-range spectrum leakage.Thus, the improved VFP equation is(12)ak=2Fakni=2Q∑j=0Wγjfi+jcos⁡kμ2πNjbk=2Fbkni=2Q∑j=0Wγjfi+jsin⁡kμ2πNjHowever, the introduction of the frequency-deviation rateμ leads to two problems for the implementation of the VFP harmonic analysis algorithm:( 1 ) the sine/cosine calculation of the Fourier transform factor cannot be achieved using the look-up-table method, and the computational cost increases significantly;( 2 ) 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( 1 ) to construct the error curve between the fundamental amplitude error and the rate of signal-frequency deviation μ according to the law relating these quantities;( 2 ) 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 μ;( 3 ) 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 frequencyf1 deviates μ times to μf1, the spectrum peak of the QSDFT amplitude will stretch μ times along with the frequency axis to μfs/N, and amplitude-analysis error will result from it if the peak is still found at fs/N. 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
The discrete amplitude spectrum of QSDFT with signal frequency.Figure1 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 (13)a1Δμ=2Q∑j=0Wγjsin⁡2πΔμ+1Njcos⁡2πNjb1Δμ=2Q∑j=0Wγjsin⁡2πΔμ+1Njsin⁡2πNj(14)A1Δμ=a12Δμ+b12ΔμThe least-squares principle is employed to obtain the solution of Eq. (14); set(15)A1Δμ=∑i=0MβiΔμiThere are two unknown quantities,M and βi, in Eq. (15) when the error curve of the fundamental amplitude is known. Assuming that M is known, set(16)B=β0β1⋮βi⋮βM(17)Δk=1Δμk⋯Δμki⋯ΔμkMThus,(18)A1k=A1Δμk=ΔkBWe apply Eqs. (13) and (14) to produce L-group data A1k and Δk, denoted as(19)A=A10A11⋮A1k⋮A1L(20)Δ=Δ0Δ1⋮Δk⋮ΔL=1Δμ0⋯Δμ0i⋯Δμ0M1Δμ1⋯Δμ1i⋯Δμ1M⋮⋮⋱⋮⋱⋮1Δμk⋯Δμki⋯ΔμkM⋮⋮⋱⋮⋱⋮1ΔμL⋯ΔμLi⋯ΔμLMThen,(21)A=ΔBThe least-squares solution ofB is(22)B=ΔTΔ-1ΔTAThe remaining issue is to determine the unknown quantityM. Suppose the error between the fitted value and the true value is(23)δk=A1k-ΔkBThe mean square error ofδk is(24)G=∑k=0Lδk2=∑k=0LA1k-ΔkB2In a certain range searchingM to make G minimum, we can obtain the value of M.The number of iterations, n, is different, and the fundamental amplitude-error curve is not consistent. Table1 shows βi with different n.Table 1
Values ofβi with different n.
n = 5 n = 6 n = 7 n = 8  n = 5 n = 6 n = 7 n = 8 β 0 1 1 1 1 β 8 122.6894 276.8987 546.7441 975.7476 β 1 -4.72E-8 -3.2E-10 1.36E-11 1.83E-11 β 9 0.11220 -0.73669 0.00335 0.03638 β 2 -8.35318 -10.0238 -11.6945 -13.3651 β 10 -144.047 -407.863 -1005.52 -2107.86 β 3 -0.00017 -2.71E-6 -4.54E-8 -8.80E-9 β 11 -1.45938 2.12560 0.36084 -0.28833 β 4 32.09637 46.88846 64.47217 84.84648 β 12 108.3661 373.5219 1400.512 3430.099 β 5 -0.05003 -0.00260 -7.20E-5 -4.43E-7 β 13 2.51764 -2.75833 -1.69420 1.07551 β 6 -75.5957 -136.391 -223.338 -341.029 β 14   -1226.43 -3409.06 β 7 0.17132 0.11315 -0.00900 -0.00079 β 15   2.65455 -1.90542We also know that the spectral peak of the kth harmonic amplitude will deviate bykΔμ from the ideal position when the signal frequency deviates by Δμ, so the amplitude linear-correction function of QSDFT is(25)Ak=2Fkan2+Fkbn2A1kΔμ


### 3.2. Initial-Phase Angle Correction

SupposeN>2+Nf1/fS, fS/N>2Mf1, and n is a large number; the following equation can be deduced from [20]:(26)φk=tg-1FaknFbkn=2πf1NTSCn+φk∗So,(27)φkn=tg-1FaknFbkn≈φk+CkHere, Ck 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 Ck is given in [20].A large number of simulation experiments show thatCk is associated with the rate of signal-frequency deviation μ, the number of iterations n, and the harmonic order k and is not affected by the number of sampling points N and other parameters. Thus, the initial-phase-angle linear-correction function of QSDFT is(28)φk=tg-1FkanFkbn-Ckwhere Ck=nkΔμπ.


### 3.3. Analytical Process of LCQS

The analytical process of LCQS consists of five steps:( 1 ) sampling W+2 data. Adding one more sampling point is necessary for LCQS due to the need for two starting points, i=0 and i=1;( 2 ) calculating Fa1n0, Fb1n0, Fa1n1, and Fb1n1 for i=0 and i=1, respectively, using Eq. (2);( 3 ) calculating μ and Δμ by Eqs. (11) and (5);( 4 ) calculating the raw amplitude and the initial phase of each harmonic by Eqs. (2) and (3);( 5 ) correcting the amplitude and the initial phase of each harmonic using Eqs. (25) and (28), respectively.


## 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( 1 ) to construct the error curve between the fundamental amplitude error and the rate of signal-frequency deviation μ according to the law relating these quantities;( 2 ) 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 μ;( 3 ) 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 frequencyf1 deviates μ times to μf1, the spectrum peak of the QSDFT amplitude will stretch μ times along with the frequency axis to μfs/N, and amplitude-analysis error will result from it if the peak is still found at fs/N. 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
The discrete amplitude spectrum of QSDFT with signal frequency.Figure1 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 (13)a1Δμ=2Q∑j=0Wγjsin⁡2πΔμ+1Njcos⁡2πNjb1Δμ=2Q∑j=0Wγjsin⁡2πΔμ+1Njsin⁡2πNj(14)A1Δμ=a12Δμ+b12ΔμThe least-squares principle is employed to obtain the solution of Eq. (14); set(15)A1Δμ=∑i=0MβiΔμiThere are two unknown quantities,M and βi, in Eq. (15) when the error curve of the fundamental amplitude is known. Assuming that M is known, set(16)B=β0β1⋮βi⋮βM(17)Δk=1Δμk⋯Δμki⋯ΔμkMThus,(18)A1k=A1Δμk=ΔkBWe apply Eqs. (13) and (14) to produce L-group data A1k and Δk, denoted as(19)A=A10A11⋮A1k⋮A1L(20)Δ=Δ0Δ1⋮Δk⋮ΔL=1Δμ0⋯Δμ0i⋯Δμ0M1Δμ1⋯Δμ1i⋯Δμ1M⋮⋮⋱⋮⋱⋮1Δμk⋯Δμki⋯ΔμkM⋮⋮⋱⋮⋱⋮1ΔμL⋯ΔμLi⋯ΔμLMThen,(21)A=ΔBThe least-squares solution ofB is(22)B=ΔTΔ-1ΔTAThe remaining issue is to determine the unknown quantityM. Suppose the error between the fitted value and the true value is(23)δk=A1k-ΔkBThe mean square error ofδk is(24)G=∑k=0Lδk2=∑k=0LA1k-ΔkB2In a certain range searchingM to make G minimum, we can obtain the value of M.The number of iterations, n, is different, and the fundamental amplitude-error curve is not consistent. Table1 shows βi with different n.Table 1
Values ofβi with different n.
n = 5 n = 6 n = 7 n = 8  n = 5 n = 6 n = 7 n = 8 β 0 1 1 1 1 β 8 122.6894 276.8987 546.7441 975.7476 β 1 -4.72E-8 -3.2E-10 1.36E-11 1.83E-11 β 9 0.11220 -0.73669 0.00335 0.03638 β 2 -8.35318 -10.0238 -11.6945 -13.3651 β 10 -144.047 -407.863 -1005.52 -2107.86 β 3 -0.00017 -2.71E-6 -4.54E-8 -8.80E-9 β 11 -1.45938 2.12560 0.36084 -0.28833 β 4 32.09637 46.88846 64.47217 84.84648 β 12 108.3661 373.5219 1400.512 3430.099 β 5 -0.05003 -0.00260 -7.20E-5 -4.43E-7 β 13 2.51764 -2.75833 -1.69420 1.07551 β 6 -75.5957 -136.391 -223.338 -341.029 β 14   -1226.43 -3409.06 β 7 0.17132 0.11315 -0.00900 -0.00079 β 15   2.65455 -1.90542We also know that the spectral peak of the kth harmonic amplitude will deviate bykΔμ from the ideal position when the signal frequency deviates by Δμ, so the amplitude linear-correction function of QSDFT is(25)Ak=2Fkan2+Fkbn2A1kΔμ


## 3.2. Initial-Phase Angle Correction

SupposeN>2+Nf1/fS, fS/N>2Mf1, and n is a large number; the following equation can be deduced from [20]:(26)φk=tg-1FaknFbkn=2πf1NTSCn+φk∗So,(27)φkn=tg-1FaknFbkn≈φk+CkHere, Ck 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 Ck is given in [20].A large number of simulation experiments show thatCk is associated with the rate of signal-frequency deviation μ, the number of iterations n, and the harmonic order k and is not affected by the number of sampling points N and other parameters. Thus, the initial-phase-angle linear-correction function of QSDFT is(28)φk=tg-1FkanFkbn-Ckwhere Ck=nkΔμπ.


## 3.3. Analytical Process of LCQS

The analytical process of LCQS consists of five steps:( 1 ) sampling W+2 data. Adding one more sampling point is necessary for LCQS due to the need for two starting points, i=0 and i=1;( 2 ) calculating Fa1n0, Fb1n0, Fa1n1, and Fb1n1 for i=0 and i=1, respectively, using Eq. (2);( 3 ) calculating μ and Δμ by Eqs. (11) and (5);( 4 ) calculating the raw amplitude and the initial phase of each harmonic by Eqs. (2) and (3);( 5 ) 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 fS=6,400Hz, N=128, and the number of iterations n=8:(29)ft=∑k=18A2k-1sin⁡2k-12πf1t+φ2k-1Here, A2k-1 and φ2k-1 are arbitrary; f1=49.5 to 50.5Hz; Amplitude Relative Error = (Analyzed-Theoretical)/Theoretical ∗ 100%; Initial-phase Absolute Error = (Analyzed-Theoretical)​°.Figure2 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 2
The amplitude errors of these four methods. (a) Hanning, (b) QSDFT, (c) VFP, and (d) LCQS.
(a) (b) (c) (d)Figure3 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.Figure 3
The initial-phase errors of these four methods. (a) Hanning, (b) QSDFT, (c) VFP, and (d) LCQS.
(a) (b) (c) (d)The analytical-accuracy experiments show that( 1 ) 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.( 2 ) Compared with QSDFT, LCQS can obtain high analytical precision simply by adding one sample point and one fundamental initial-phase calculation.( 3 ) 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 A2k-1 and φ2k-1 are arbitrary, f1=50Hz, fS=6,400Hz, N=128, and the number of iterations is n=8. 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.Table 2
The required time (s) for the four harmonic-analysis algorithms for different numbers of iterations.
n Hanning QSDFT VFP LCQS 4 0.001826 0.001139 0.010694 0.001844 5 0.002388 0.001440 0.013180 0.002208 6 0.002684 0.001729 0.015721 0.002438 7 0.003119 0.001979 0.017495 0.002757 8 0.003519 0.002218 0.020051 0.002998The 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.


## 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 fS=6,400Hz, N=128, and the number of iterations n=8:(29)ft=∑k=18A2k-1sin⁡2k-12πf1t+φ2k-1Here, A2k-1 and φ2k-1 are arbitrary; f1=49.5 to 50.5Hz; Amplitude Relative Error = (Analyzed-Theoretical)/Theoretical ∗ 100%; Initial-phase Absolute Error = (Analyzed-Theoretical)​°.Figure2 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 2
The amplitude errors of these four methods. (a) Hanning, (b) QSDFT, (c) VFP, and (d) LCQS.
(a) (b) (c) (d)Figure3 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.Figure 3
The initial-phase errors of these four methods. (a) Hanning, (b) QSDFT, (c) VFP, and (d) LCQS.
(a) (b) (c) (d)The analytical-accuracy experiments show that( 1 ) 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.( 2 ) Compared with QSDFT, LCQS can obtain high analytical precision simply by adding one sample point and one fundamental initial-phase calculation.( 3 ) 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 A2k-1 and φ2k-1 are arbitrary, f1=50Hz, fS=6,400Hz, N=128, and the number of iterations is n=8. 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.Table 2
The required time (s) for the four harmonic-analysis algorithms for different numbers of iterations.
n Hanning QSDFT VFP LCQS 4 0.001826 0.001139 0.010694 0.001844 5 0.002388 0.001440 0.013180 0.002208 6 0.002684 0.001729 0.015721 0.002438 7 0.003119 0.001979 0.017495 0.002757 8 0.003519 0.002218 0.020051 0.002998The 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 (Figure4(a)), designed to monitor the capacitive equipment online. This equipment is important to the power grid and usually requires online monitoring of its current, i, and dissipation angle, δ, or dissipation factor, tan⁡δ, to evaluate its status (Figure 4(a)):(30)δ=π2-φi1-φu1Here, φi1 and φu1 are the fundamental initial phases of i and u, respectively.Figure 4
Harmonic analysis by JCQ-5. (a) Measuring model of the capacitive equipment, (b) JCQ-5 measuring the signal from JB706.
(a) (b)JCQ-5 consists of four parts: Voltage / Current Transformer, Signal Conditioning, Synchronous ADC AD7606, and a CPU STM32F103. JCQ-5 samplesi and u synchronously; in this device, we set fS=6,400Hz, N=128, and n=8. It calculates Ai1 (fundamental amplitude of i), φi1, φu1, δ and tan⁡δ. 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: Au1=81.6V, φu1=0°, Ai1=0.03A, φi1=85°, fu1=fi1=49.5~50.5Hz. 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 Table3. Among them, the error of Ai1 is relative error, the unit is %; the error of δ is absolute error, and the unit is degree. For the measurement accuracy of Ai1, 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 φu1 and φi1 cancel each other out and the measurement results of φu1 and φi1 are not correct; VPF and LCQS still have the same high level of accuracy.Table 3
Experimental results with different methods.
f A i 1/% δ/° Hanning QSDFT VPF LCQS Hanning QSDFT VPF LCQS 49.5 -0.5000 -1.3333 -0.1667 -0.2000 -0.079 -0.020 0.005 -0.006 49.7 -0.2667 -0.5000 -0.0333 -0.0667 -0.035 -0.017 -0.002 -0.002 50.0 0.0667 0.3333 0.0667 0.1000 0.018 0.008 0.002 0.001 50.3 -0.1000 -0.6667 -0.0667 -0.1000 -0.028 0.012 0.003 -0.003 50.5 0.4333 -1.4333 -0.1333 -0.1667 0.083 0.017 -0.006 0.006


## 6. Conclusions

This paper proposed a linear-correction algorithm (LCQS) for QSDFT; it has the following features:( 1 ) 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.( 2 ) LCQS loosens the requirements for synchronous sampling and increases the analytical accuracy of amplitude and initial-phase determination significantly.( 3 ) LCQS truly implements the linear correction of QSDFT harmonic-analysis results when the signal frequency deviates.( 4 ) LCQS can work in real time and can be easily transplanted into existing hardware systems, making it a very practical algorithm.



---

*Source: 1268905-2018-12-27.xml*