The VPF Harmonic Analysis Algorithm Based on Quasi-Synchronous DFT

Zhongjun Fu1, 3, Jianyu Wang1, *, Yun Ou2, Genyuan Zhou3, Feng'e Bai3, Xiaorong Zhao3
1 School of Automation, Nanjing University of Science and Technology, Nanjing, 210094 China
2 Changzhou Foreign Languages School, Changzhou 213017, China
3 School of Computer Engineering, Jiangsu University of Technology, Changzhou 213001, China

Article Metrics

CrossRef Citations:
Total Statistics:

Full-Text HTML Views: 1720
Abstract HTML Views: 735
PDF Downloads: 364
ePub Downloads: 271
Total Views/Downloads: 3090
Unique Statistics:

Full-Text HTML Views: 456
Abstract HTML Views: 366
PDF Downloads: 212
ePub Downloads: 154
Total Views/Downloads: 1188

© 2017 Fu et al.

open-access license: This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International Public License (CC-BY 4.0), a copy of which is available at: This license permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

* Address correspondence to this author at the School of Automation, Nanjing University of Science and Technology, Nanjing, 210094 China, 200, Xiaolingwei Rd., Nanjing, 210094 China, Tel: +8613951716181; E-mail:



The main source of spectral leakage in Quasi-synchronous DFT (QSDFT) harmonic analysis is the short-range leakage resulting from the fluctuating signals.


The QSDFT discrete spectrum stretching theorem, as is demonstrated in this paper, shows that the peak in frequency domain changes synchronously with the signal frequency drift. Based on QSDFT, an improved algorithm—Variable Picket Fence (VPF) is proposed.


The VPF means the sampling position in the frequency domain will synchronously change with the signal frequency drift. In this way, we can accurately capture the spectrum peak, thereby inhibiting short-range spectral leakage. Hence signal frequency drift can be obtained by measuring the fundamental phase difference between the adjacent sample points.


Simulation and application results prove that this proposed algorithm increases the accuracy of harmonic analysis by inhibiting short-range spectral leakage efficiently in the range of 45 to 55HZ.

Keywords: Harmonic Analysis, Fourier Transforms, Power system parameter estimation, Spectral Analysis, Synchronization.


Harmonic analysis technology splits complex signals into simple periodic signals to study the nature of things, for that reason, it is widely used in many fields like power quality monitoring, electronic products testing, electrical equipment monitoring, etc. The essence of the above technology is to have an accurate and efficient harmonic analysis algorithm.

At present, the commonly used method for harmonic analysis is Fourier transform (DFT and FFT). In engineering applications, finite points sampling strategy is widely applied to harmonic analysis, and also strictly synchronous sampling is very difficult to achieve that caused by sampling clock error and frequency drift of signals (Synchronous sampling means the sampling frequency always maintains a fixed proportional relationship with the signal frequency. Therefore, when applying DFT and FFT, two source of leakage — long-range leakage caused by truncation effect (finite points sampling) and short-range leakage caused by fence effect (asynchronous sampling) - lead to the inaccuracy and untrustworthy of the analysis [1-3]. For this reason, many solutions have been presented, such as the windowed interpolation algorithm [4-7], Non Harmonic Fourier Analysis [8-11], and the Quasi-synchronous DFT (QSDFT) [12-18].

QSDFT has the advantage of easy implementation, short sampling length, small system overhead, etc. However, in practical applications, limitation and defects in algorithms occur. To be more specific, the precision of analysis, particularly that of initial-phase is low when signal frequency drifts [19]. In this paper, based on the Discrete Spectrum Stretching Theorem, the concept of Variable Picket Fence (VPF) is proposed. After that we put forward an improved algorithm of QSDFT, namely VPF. Simulation and application results show that this algorithm is valid.


2.1. The QSDFT

Consider a periodic signal f (t)


Where: k is the harmonic order; Ak and k are amplitude and initial-phase of the k-th harmonic; f1 is the frequency of f (t).

According to the sampling frequency fS and the number of sampling points within a cycle N, in the range of [t 0, t 0 + W × TS] uniformly-spaced sampling W+1 times to obtain the sampled sequence f(i), i = 0 to W. Where W is determined by the integral method, W = n N when using Trapezoidal integration methods; n is the number of iterations.

Appling Eq. (2) and (3) to calculate the real part ak, the imaginary part bk, Ak and φk of the k-th harmonic, this is QSDFT [12].



Where: i is the start sampling point, normally i = 0; γj is the weighting coefficient, determined by the integral method, n and is the sum of all weighting coefficients, and Q = (N+1)n when W = nN.

2.2. The Inhibition of Long-Range Spectral Leakage by QSDFT

The signal used for harmonic analysis comes from rectangular window truncation of the infinite length signal which duration is T = NTS, TS = 1/fs and that leads to the spectral leakage of Fourier transform.

As to a sinusoidal signal f (t) = sin (100 πt) and N = 128, its DFT value can be retrieved from frequency domain at fixed sampling frequency , as is shown in Fig. (1). The analog frequency corresponding to 2π/N is fs/N. Fig. (1) illustrates that the discrete amplitude spectrum is no longer a single peak, instead countless peaks of varying sizes distribute in the entire frequency axis. In other words, the energy of frequency spectrum is leaked and no longer concentrated, which is commonly named long-range leakage. In the process of harmonic analysis, the leaked energy from each harmonic will affect each other, and cause analysis error [1].

For QSDFT, the main lobe of the discrete spectral is widened and the side lobe will be suppressed under the convergence of quasi-synchronous sampling. Fig. (1). shows the discrete amplitude spectrum of QSDFT, where the number of iterations n = 8, the main lobe is converged and the mutual influence of leaked energy from each harmonic is trivial. From this perspective, the quasi-synchronous sampling can be treated as a good window function and it can inhibit long-range leakage significantly, so sometimes it is also referred to as quasi-synchronous window [19].

Fig. (1). The discrete spectrum of DFT and QSDFT.

2.3. The Influence of Signal Frequency Deviation on QSDFT

In practical measurement, considering the influence of multi-factors - precision of sampling clock, integer multiple error of sampling clock, frequency drift of signals - it is difficult to implement exact whole-cycle synchronous sampling. The above factors lead to the short-range leakage of discrete spectrum, of which the causes can mainly be attributed to the frequency drift of signals. In theory, based on the convergence characteristics of multiple iterations, QSDFT can suppress the short-range leakage caused by frequency drift. However, in practical applications, the inhibitory effect on the short-range leakage is not significant.

Fig. (2) shows the QSDFT harmonic analysis error (number of iterations n=5) of the waveforms generated from Eq. (4).


Where: A2k-1 and ϕ2k-1 are arbitrary; f1 = 45 to 55Hz; Amplitude Relative Error = (Analyzed - Theoretical) / Theoretical* 100%; Initial-phase Absolute Error = (Analyzed - Theoretical).

As is in Fig. (2), high analytical precision of the amplitude of QSDFT occurs only in the range of 50Hz ± 1%, and the maximum relative error of the amplitude nearly reach 100% when in the range from 45 to 55Hz. It suggests that initial-phase from QSDFT is untrustworthy except when it is close to original frequency. For that reason, QSDFT can be applied only to such occasions with small signal frequency drift and low amplitude precision requirements, and it is not suitable for initial-phase analysis.


3.1. Discrete Spectrum Stretching Theorem

Definition: The rate of signal frequency deviation , is the degree of the signal frequency drift, which is defined as follows:


If the signal frequency does not drift, µ = 1; and if the signal frequency drifts, μ ≠ 1.

Assume that sampling frequency fS and N is fixed, the sampled sequence fi acquired from Eq. (1) is as follows:

Fig. (2). The harmonic analysis errors of QSDFT (n=5).

The frequency spectrum function of x-th harmonic is:


If the signal frequency has deviated µ,the sampled sequence f* (i) is:


Thus, the corresponding frequency spectrum function of x-th harmonic is:


Compare Eq. (7) and Eq. (9) can be obtained:


Eq. (10) means, if signal frequency has deviated µtimes, then the discrete spectrum of QSDFT is stretched μ times along the frequency axis, and the discrete spectrum peak of the k-th harmonic will appear in the position of kµf1 from kf1 (Fig. 3).

Fig. (3). The discrete amplitude spectrum of QSDFT with the signal frequency drift.

Fig. (4). The variable picket fence.

3.2. The Concept of Variable Picket Fence

Eq. (10) shows that the signal frequency drift will let the spectral peak deviated from the ideal position. When the signal frequency drift occurs, there will be great error if the sampling position in frequency domain still is 2π/N (the corresponding analog frequency fs/N). For example, when f1 = 55HZ, µ = 1.1, and the fundamental peak position is Nf1/fs = 1.1. However, in accordance with frequency domain sampling position 2π/N, the fundamental information obtained from Nf1/fs = 1 is inaccurate. If μ can be accurately estimated, and we can adjust frequency domain sampling position to µ2π/N (the corresponding analog frequency µfS/N), the amplitude and initial-phase information of the fundamental and the k-th harmonic will be obtained accurately (Fig. 4).

So, the improved equation is:


Variable Picket Fence (VFP) is a modified algorithm in which the frequency domain sampling position is not fixed, instead the position changes with the signal frequency drift. So VPF can accurately estimate the peak position of each harmonic, thereby obtain high precision results of the amplitude and initial-phase.

3.3. The Rate of Signal Frequency Deviation μ

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


Where: M is the maximum harmonic order,


The fundamental initial-phase φ1(i) analyzed by QSDFT from the i-th sampling point, is:


As to two adjacent sampling points, the fundamental initial-phase difference:


Eq. (16) means, although the fundamental initial-phase acquired by QSDFT is totally incorrect when the signal frequency drifts, the fundamental phase difference between adjacent sampling points is fixed, and it is only interrelated with the signal frequency f1 and the sampling frequency fS.

For engineering applications, the fundamental initial-phase φ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


3.4. The Analysis Process of VFP

According to the Eq. (11) and (17), the analysis process of VFP consists of five steps:

  1. Sampling W + 2 data. Standard QSDFT algorithm requires sampling W + 1 points, but due to the needs of two starting points i = 0 and i = 1, adding one more sampling point for VFP is necessary.
  2. Calculating Fna1 (0) and Fnb1 from i = 0 by Eq. (2).
  3. Calculating Fna1 (1) and Fna1 from i = 1 by Eq. (2).
  4. Calculating µ by Eq. (17).
  5. Calculating the amplitude and the initial-phase of each harmonic by Eq. (11).

If it is necessary, we can calculate the frequency of each harmonic according to μ and the sampling frequency fS.


We generated some waveform signals from Eq. (3) to verify the effectiveness of VPF. The signal frequency drifts from 45 to 55Hz, and we measured the signal with fS = 6400Hz, N = 128, and the number of iterations n = 5 to 8.

4.1. The Simulation Results of μ

The analysis accuracy of VPF is directly dependent on the precision of μ. The μ relative error from VPF is given in Table (1). The simulation results show the high accuracy of μ is available.

Table 1. The relative error(%) of µ.
μ Number of Iterations n
5 6 7 8
45 0.90 2.54*10-3 -3.67*10-4 3.33*10-6 0
46 0.92 6.20*10-4 -9.78*10-5 1.09*10-5 0
47 0.94 6.38*10-5 -1.06*10-5 0 0
48 0.96 0 0 0 0
49 0.98 0 0 0 0
50 1.00 0 0 0 0
51 1.02 0 0 0 0
52 1.04 -9.60*10-6 0 0 0
53 1.05 -1.04*10-4 -9.40*10-6 0 0
54 1.08 -3.89*10-4 -4.63*10-5 0 0
55 1.10 -8.36*10-4 -7.27*10-5 0 0

4.2. The Simulation Results of Amplitude

Due to pages limitation, only the simulation error figures of the amplitude and initial-phase from VPF are given. Fig. (5) shows the relative error of the amplitude. If n = 5, the maximum amplitude error equals to 0.0059632%; if n = 8, the maximum amplitude error equals to -0.0000015%.

4.3. The Simulation Results of Initial-Phase

Fig. (6) illustrates the simulation absolute error of the initial-phase from VPF. If n = 5, maximum initial-phase error equals to -0.3083002°; if n = 8, the maximum initial-phase error equals to 0.0002375°.

4.4. Analysis of Simulation Results

The following conclusions can be drawn from the simulation results:

  1. The amplitude and initial-phase obtained from VPF have a high precision.
  2. The number of iterations n has great impact on the analysis accuracy. With the increase of n, the analysis precision increases for almost one order of magnitude. The higher n selected by the system, the more accurate analysis results will be achieved.
  3. With the drift of the signal frequency, the analysis errors of μ, amplitude and initial-phase increases, and VPF has higher analysis accuracy within 47 to 53Hz.
  4. The analysis accuracy of the high-order harmonic is lower than the low-order harmonics, but it is not evident in the range from 47 to 53Hz.

The main source of the VPF analysis error is the tiny leak of the discrete spectrum caused by non-integer-period sampling, but this shortcoming can be compensated by increasing the number of iterations.

Fig. (5). The amplitude errors of VPF.

Fig. (6). The initial-phase errors of VPF.


For evaluating the performance of the VPF in practice, we embedded VFP to a measuring device JCQ-5 (Fig. 7a), which is designed to monitor the capacitive equipment online. The capacitive equipment is an important equipment in the power grid, usually requires online monitoring of its current i, and dissipation angle δ or dissipation factor tanδ to evaluate its current status (Fig. 7a).

Fig. (7). The measuring device JCQ-5.


Where: ϕi1 and ϕu1 respectively.

JCQ-5 consists of four parts: Voltage / Current Transformer, Signal Conditioning, Synchronous ADC AD7606, and CPU STM32F103 (Fig. 7b). JCQ-5 sampling i and u synchronously; and in this device, we set fs = 6400 HZ, N = 128, n = 8. It calculates the Ai1 (fundamental amplitude of i), ϕi1, ϕu1, δ and tanδ.

For comparison, we embedded the FFT, QSDFT, and VPF into JCQ-5, and recorded data 72 hours continuously to analyze the effectiveness of these algorithms. Their performance is shown in Fig. (8) and Table 2.

Fig. (8). Mean Square Error of A1i and δ.

Table 2. Experimental Result of FFT, QSDFT, and VPF.
Theoretical Value   (mA)   (°)
9.853 2.875
VPF Mean 9.852998070 2.874993387
Maximum 9.853049596 2.877338898
Mean Square Error 0.000029936 0.001456036
QSDFT Mean 9.852989073 2.885321323
Maximum 9.853480561 2.949487050
Mean Square Error 0.000265827 0.044159037
FFT Mean 9.853265129 2.803705487
Maximum 9.857960872 3.860644784
Mean Square Error 0.002947592 0.516855959

Fig. (8) gives an intuitive illustration of the comparison, and Table II demonstrates the measurement values from these algorithms. It can be noticed that the measurement accuracy of the raw FFT is the comparatively inferior in these methods, and the VPF has an advanced performance.


  1. Compared to QSDFT, VPF inhibited the short-range spectral leakage efficiently, loosed the requirements for synchronous sampling, and increased the analytical accuracy of amplitude, initial-phase and frequency of each harmonic significantly.
  2. Only increasing one sampling point and two calculation of fundamental initial-phase on the basis of QSDFT, the higher analytical precision will be obtained by VPF.
  3. The scale of calculation is increased correspondingly in the process of VPF, and on the other hand real-time computation is difficult to implement.
  4. For a harmonic analysis device working in non-real-time mode, VPF has many advantages, such as less sampling points, high precision, easy implementation, and it can be transplanted to the existing hardware system directly. Thus it is a high practical algorithm.


The authors declare no conflict of interest, financial or otherwise.


The authors would like to thank the Associate Editor and the reviewers for their helpful comments, which improved the quality of this paper.


[1] Harris FJ. On the use of windows for harmonic analysis with the discrete Fourier transform. Proc IEEE 1978; 66(1): 51-83.
[2] Jain VK, Collins WL, Davis DC. High-accuracy analog measurements via interpolated FFT. IEEE Trans Instrum Meas 1979; IM-28(2): 113-22.
[3] Wen H, Dai HF, Teng ZS. Performance comparison of windowed interpolation FFT and quasisynchronous sampling algorithm for frequency estimation. Math Probl Eng 2014; 2014: 1-7.
[4] Wen H, Teng ZS, Wang Y, Hu XG. Spectral correction approach based on desirable sidelobe window for harmonic analysis of industrial power system. IEEE Trans Ind Electron 2013; 60(3): 1001-10.
[5] Wu J, Zhao W. A simple interpolation algorithm for measuring multi-frequency signal based on DFT. Measurement 2009; 42(2): 322-7.
[6] Ferrero A, Salicone S, Toscani S. A fast, simplified frequencydomain interpolation method for the evaluation of the frequency and amplitude of spectral components. IEEE Trans Instrum Meas 2011; 60(5): 1579-87.
[7] Reljin IS, Reljin BD, Papic VD. Extremely flat-top windows for harmonic analysis. IEEE Trans Instrum Meas 2007; 56(3): 1025-41.
[8] Hirata Y. Non-harmonic Fourier analysis available for detecting very low-frequency components. J Sound Vibrat 2005; 287(3): 611-3.
[9] Oberholster A, Heyns P. A study of the non-harmonic fourier analysis technique In: Proceedings of the 21st International Congress on Condition Monitoring and Diagnostic Engineering Management; 2008; pp. 361-70.
[10] Neri P, Peeters B. Non-harmonic fourier analysis for bladed wheels damage detection. J Sound Vibrat 2015; 356: 181-94.
[11] Neri P. Bladed wheels damage detection through non-harmonic fourier analysis improved algorithm. Mech Syst Signal Process 2017; 88: 1-8.
[12] Dai XZ, Gretsch R. Quasi-synchronous sampling algorithm and its applications. IEEE Trans Instrum Meas 1994; 43(2): 204-9.
[13] Zhou F, Huang ZY, Zhao CY, Wei XM, Chen DY. Time-domain quasi-synchronous sampling algorithm for harmonic analysis based on newton’s interpolation. IEEE Trans Instrum Meas 2011; 60(8): 2804-12.
[14] Waldemar G. Kürten ihlenfeld, enrico mohns, M. serra, kristian dauke, and andreas suchy, “quasi-synchronous microcontroller-based highly accurate digital sampling of AC signals. IEEE Trans Instrum Meas 2007; 56(2): 414-7.
[15] Fu ZJ, Zhou GY, Chen JF. Non-integral harmonic analysis algorithm based on quasi-synchronous DFT. Yiqi Yibiao Xuebao 2012; 33(1): 235-40.
[16] Yu J, Xue H, Wen B. A novel non-synchronous sampling method for harmonic/interharmonic measurement in power systems. Intelligent Automation & Soft Computing 2012; 18(5): 491-500.
[17] Shen GF, Wang Q. Designed plan for improving accuracy of quasi-synchronous sampling harmonics analysis. Yiqi Yibiao Xuebao 2001; 22(5): 455-7.
[18] Zhou F, Zhao CY, Huang XY. Zhenyu, “Harmonic and Interharmonic Estimation Using Time-Domain Quasi-Synchronous Sampling Technique and Comb FIR Filter. Int Review Electric Eng IREE 2011; 6(6): 2773-84.
[19] Qiu HF, Zhou H. Study on the approachs of electrical harmonic analysis for asynchronous sampling. Chinese J Relay 2008; 36(1): 57-62.
[20] Dai X Z, Tang T Y. Quasi-synchronous sampling algorithm and its applications-Part 3: High accurate measurement of frequency, frequency deviation, and phase angle difference in power systems in Proceeding IEEE IMTC/93, 726-9.