Skip to main content
  • Original research
  • Open access
  • Published:

Power quality disturbance classification based on time-frequency domain multi-feature and decision tree


Accurate classification of power quality disturbance is the premise and basis for improving and governing power quality. A method for power quality disturbance classification based on time-frequency domain multi-feature and decision tree is presented. Wavelet transform and S-transform are used to extract the feature quantity of each power quality disturbance signal, and a decision tree with classification rules is then constructed for classification and recognition based on the extracted feature quantity. The classification rules and decision tree classifier are established by combining the energy spectrum feature quantity extracted by wavelet transform and other seven time-frequency domain feature quantities extracted by S-transform. Simulation results show that the proposed method can effectively identify six types of common single disturbance signals and two mixed disturbance signals, with fast classification speed and adequate noise resistance. Its classification accuracy is also higher than those of support vector machine (SVM) and k-nearest neighbor (KNN) algorithms. Compared with the method that only uses S-transform, the proposed feature extraction method has more abundant features and higher classification accuracy for power quality disturbance.

1 Introduction

With the development of grid interconnection, grid-connection of new energy generation, extensive application of power electronic equipment and access of impact load, the problem of power quality disturbance has attracted more and more attention [1]. In-depth study of the power quality influencing factors, accurate extraction of feature quantities, and accurate classification of power quality disturbance are required for improving and controlling power quality [2].

The processes of power quality disturbance classification consist of feature extraction and classification recognition. The methods of feature extraction mainly include Fast Fourier transform (FFT), Short-time Fourier transform (STFT), wavelet transform, S-transform, Hilbert yellow transform (HHT), etc. FFT is a conversion from the time domain to the frequency domain, and has orthogonal and complete features. The frequency analysis of a signal is considered from the perspective of the overall composition of frequency, but the local frequency characteristics of the signal cannot be analyzed. Thus, it is only suitable for the analysis of steady-state disturbance [3]. STFT has fast computation speed and the algorithm is easy to implement. It can detect and analyze the signal’s local spectrum features, but its window function is fixed with no ability of self-adaptation [4, 5]. Wavelet transform has the ability of multi-scale time-frequency resolution, which can be used for local analysis of signals, but signal analysis can be easily influenced by wavelet base and decomposition layer [6, 7]. S-transform is developed on the basis of wavelet transform and STFT. It not only overcomes their shortcomings, but also enables the analysis of amplitude change with time of a certain frequency component of the signal. Its window function changes with frequency, resulting in higher frequency resolution but also large amount of calculation [8, 9]. HHT is suitable for time-frequency analysis detecting methods of non-stationary and nonlinear signals, but is easy to generate modal aliasing during analysis [10]. At present, the main methods for power quality disturbance classification are artificial neural network, support vector machine (SVM), decision tree, K-neighbor (KNN), etc. Artificial neural network has long training time and is easy to fall into local optimal solution [11, 12] whereas SVM is susceptible to kernel function and cannot take into account both learning ability and generalization ability [13]. KNN classification requires large amount of computation and large memory [14], while the decision tree has the advantages of simple structure, convenient expansion and fast classification [15, 16].

Based on this, this paper mainly analyzes 6 types of single power quality disturbances, and the compound disturbances of swell + harmonic and sag + harmonic. Wavelet transform and S-transform are combined to extract more abundant feature quantities in time and frequency domains. According to the extracted feature quantities, the classification rules suitable for the 8 disturbance signals are established, and thus, accurate classification effect of disturbance signals can be obtained quickly by constructing decision tree classifier. Due to noise interference in actual power systems, the noise resistance of the proposed method is verified by adding gaussian white noise. The classification speed and accuracy of the proposed method are verified by simulation comparison.

2 Methods

This paper classifies 8 different disturbances, including the standard voltage(C0), voltage swell(C1), voltage sag(C2), voltage interruption(C3), transient oscillation(C4), flicker(C5), harmonic(C6), swell + harmonic (C7) and sag + harmonic(C8).

2.1 Feature extraction based on wavelet transform and S-transform

2.1.1 Wavelet transform extracts energy feature quantity

Wavelet transform is used for multi-scale decomposition of power quality disturbance signals. The obtained wavelet coefficients reflect the distribution of signals on different decomposition scales, and their differences after decomposition of different disturbance signals can be used to represent the signals’ feature quantities. Due to the large amount of data of the wavelet coefficients as the feature quantities, the wavelet energy of different decomposition scales can be calculated through the wavelet coefficients to significantly reduce the feature dimension.

Power quality disturbances are nonlinear mutation signals. In order to analyze the disturbances such as transient oscillations and harmonics, which mainly cause high frequency band mutation, and improve the operation speed of the wavelet transform, the wavelet basis function needs to satisfy the requirement of tight support, orthogonality, higher vanishing moments and calculation speed. The Daubechies (dbN) series wavelets in the basic wavelet have the above characteristics and are most commonly used in the Mallat algorithm. With the increase of N (the wavelet order), dbN wavelet in time domain increases the support interval of wavelet, while reduces the overlap of windows between different scales and the spectrum leakage between frequency bands. Higher-order db wavelets have higher vanishing moments, though larger N is not necessary better as the vanishing moments are opposite to the characteristics of tight support. Therefore, combined with the characteristics of power quality disturbance signals, db4 wavelet basis is selected in this paper for wavelet analysis. In order to reduce the spectrum leakage of wavelet transform, the main frequency components of transient components are distributed as far as possible in the center of the wavelet frequency band, and the disturbance signals are decomposed by 10 layers. The wavelet energy of each decomposition layer [17] is:

$$ {E}_{Dj}={\sum}_{k=1}^N cdj{(k)}^2 $$

where, cdj is the detail coefficient of layer j, and N is the number of detail coefficient of layer j. The normalized value distribution of wavelet energy for the 8 disturbances is shown in Fig. 1.

Fig. 1
figure 1

Comparison of wavelet energy distribution of different power quality disturbance signals

It can be observed from Fig. 1 that the wavelet energy of each power quality disturbance signal is mainly concentrated in the 6th and 7th layers, while the 7th layer wavelet energy of harmonic, swell + harmonic and sag + harmonic is noticeably lower compared to the others. To avoid contingency, each disturbance randomly generates 300 samples that are superimposed by 30 dB of noise for testing. Finally, the 7th layer energy is set to the feature F1, and when the threshold value is 0.56, the harmonic and harmonic-containing disturbances are recognized with high precision.

2.2 S-transform extracts feature quantity

The S-transform is a reversible time-frequency analysis method proposed by Stockwell. Because the height and width of window function vary with frequency, it has the advantages of both the WT and STFT, and thus is widely used. Continuous S-transformation is defined as:

$$ S\left(\tau, f\right)={\int}_{-\infty}^{\infty }h(t)g\left(\tau -t,f\right){e}^{-j2\pi ft} dt $$
$$ g\left(\tau -t,f\right)=\frac{\mid f\mid }{\sqrt{2\pi }}e\frac{-{f}^2{\left(\tau -t\right)}^2}{2} $$

where h(t) is the disturbance signal, and g(τt, f) is the Gaussian window. In practical applications, the signal is obtained by sampling. Let the sampled signal be h[kT](k = 0,1,2…N − 1), where N is the number of sampling points and T is the sampling period, then the expression of discrete S-transformation is given as:

$$ \Big\{{}_{S\left[ KT,0\right]=\frac{1}{N}{\sum}_{m=0}^{N-1}H\left(\frac{m}{NT}\right),n=0}^{S\left[ KT,\frac{n}{NT}\right]={\sum}_{m=0}^{N-1}H\left(\frac{m+n}{NT}\right)G\left(m,n\right){e}^{j\frac{2\pi mk}{N}},n\ne 0} $$

where j, m, n = 0,1,2... N − 1, H(n/NT) and G(m, n) are the FFT of signal H[kT] and Gaussian window respectively, And are given as:

$$ \Big\{{}_{G\left(m,n\right)={e}^{-\frac{2{\pi}^2{m}^2}{n^2}}}^{H\left[ kT\right]=\frac{1}{N}{\sum}_{k=0}^{N-1}h\left[ kT\right]\kern0.28em {e}^{-\frac{j2\pi nk}{N}}} $$

The result of S-transformation is a two-dimensional complex matrix, which is modeled to obtain the modulus matrix. Its row vectors represent the change of amplitude of a certain frequency with time, and the column vectors represent the change of amplitude with frequency at a sampling moment. It reflects the time-frequency characteristics of the signal. If there is disturbance, it must be shown in the modulus matrix. According to the time-frequency matrix, the amplitude and frequency mutation of the disturbance can be detected.

According to IEEE’s relevant standards for power quality disturbances and the principles of their generation, it is concluded that swell, sag, interruption and flicker occur mainly in amplitude mutation, with the amplitude of flicker changing periodically. Harmonic and transient oscillations occur mainly in frequency mutation. S-transform has been carried out on standard signals and the 8 disturbances. Based on the differences in time, amplitude and frequency of each disturbance signal, the following characteristics are extracted.

(1) The maximum value F2, minimum value F3 and standard deviation F4 of the maximum amplitude vector of time can be calculated as:

$$ {F}_2=\max \left[{V}_{1t-A}(kT)\right] $$
$$ {F}_3=\min \left[{V}_{1t-A}(kT)\right] $$
$$ {F}_4=\sqrt{\frac{1}{N}{\sum}_{k=0}^{N-1}{\left[{V}_{1t-A}(kT)-{\overline{V}}_1\right]}^2} $$

where, V1t − A is the largest amplitude vector of time, k = 0,1,2... N − 1.

(2) Standard deviation F5 of the maximum frequency amplitude vector of 100 − 600 Hz frequency band is calculated as:

$$ {F}_5=\sqrt{\frac{1}{N-1}{\sum}_{f=100}^{600}{\left[{V}_{f-\max A}-\overline{V_m}\right]}^2} $$

where Vf − maxA is the maximum frequency amplitude vector, and \( \overline{V_m} \) is the average value of the maximum amplitude vector of the frequency band of 100 − 600 Hz. N is a sampling point in the range of 100 to 600 Hz.

(3) Mean value F6 and standard deviation F7 of the maximum frequency amplitude vector in the 700 − 1500 Hz frequency band are calculated as:

$$ {F}_6=\frac{fo}{\varDelta f}{\sum}_{f=700}^{1500}\left[{V}_{f-\max A}(f)\right] $$
$$ {F}_7=\sqrt{\frac{1}{N-1}{\sum}_{f=700}^{1500}{\left[{V}_{f-\max A}-\overline{V_h}\right]}^2} $$

where f0 refers to the frequency resolution of 5 Hz. The frequency range ∆f is 700 − 1500 Hz, and \( \overline{V_h} \) is the average value of the maximum amplitude vector of the frequency band of 700 − 1500 Hz, N is the sampling point in the 700-1500 Hz frequency band.

(4) The fluctuation time of the maximum amplitude curve is F8. Amplitude varying from small to large or from large to small is regarded as a fluctuation.

2.3 The establish of decision tree classifier model

Decision tree is a supervised learning algorithm, a kind of classifier similar to tree structure. The decision tree has the advantages of simple structure, convenient expansion and fast classification speed. It overcomes the disadvantages of SVM which is affected by kernel function, and is unable to give consideration to learning ability and generalization ability, and large computation and memory demand in KNN classification. Through classification rules to build the classification decision tree model. The structure of decision tree plays an important role in the accuracy of classification. In order to reduce the selection requirement of classification threshold and improve the classification accuracy, binary tree structure is adopted for classification.

Decision tree is usually used to recursively select the best feature and segment of the training data according to the feature, so as to optimize the classification process of each sub-data set. This process corresponds to the division of feature space and the construction of decision tree classification rules. According to the feature extraction method in Section 2.1, 300 groups of random disturbance samples are generated and 30 dB noise superimposed. The feature quantities F1~F8 are calculated and statistically analyzed. The different disturbance types and feature quantities are compared in Table 1.

Table 1 Analytical comparison of the disturbances and feature quantities

According to Table 1, the optimal feature is selected recursively and the following 14 classification rules are established: (1) F1 > 0.56 and F5 < 0.01; (2) F1 < 0.56 and 0.01 < F5 < 0.06; (3) F4 > 0.002 and F7 < 0.02; (4) F4 < 0.002; (5) F4 < 0.002 and F7 < 0.02; (6) F4 > 0.002 and F8 < 2; (7) F2 > 1.1; (8) F2 < 1.1; (9) F6 < 0.045 or F7 < 0.02; (10) F6 > 0.045 and F7 > 0.02; (11) F8 < 2 and F3 > 0.9; (12) F8 ≥ 2 and F3 < 0.9; (13) 0.1 < F3 < 0.9; (14) F3 < 0.1. The corresponding power quality disturbance classification decision tree is constructed as shown in Fig. 2.

Fig. 2
figure 2

Decision tree of power quality disturbance classification

2.4 Simulation experiment results and discussion

The mathematical model for power quality disturbances described in [9] is considered. Random noise-free disturbance samples with parameters are generated through MATLAB simulation for testing (300 samples of C0 ~ C8 each). The sampling frequency is 6.4 kHz, the fundamental frequency is 50 Hz, the weekly wave sampling points are 128, and the data length is 1280 points. Wavelet transform is used to extract the normalized wavelet energy of the 7th layer, and S-transform is used to extract the feature quantities of the disturbances in time and frequency domains. The extracted feature variables are inputted into the constructed decision tree classifier to realize the recognition of the power quality disturbance signals. Considering that actual power system is affected by noise, 20 dB, 30 dB, 40 dB, 50 dB Gaussian white noises are superimposed onto the samples respectively to generate a total of 13,500 samples.

To verify the effectiveness of the power quality disturbance classification method based on time-frequency domain multi-feature and decision tree, Table 2 compares the classification accuracy of the disturbance signals by using only S-transform (method 1) and the combination of wavelet transform and S-transform (method 2) to extract feature quantities under different noise conditions. Table 3 shows the classification effect of decision tree, SVM and KNN on disturbance signals under different noise conditions, whereas Table 4 shows the time required for classification of each detection algorithm under the condition of SNR = 30 dB.

Table 2 Comparison of recognition results of different feature extraction methods
Table 3 Comparison of recognition accuracy of different detection algorithms
Table 4 Classification time comparison of different detection algorithms

It can be seen from Table 2 that the classification effect of method 2 is better than that of method 1. The classification accuracies of both feature extraction methods decrease with the reduction of SNR, though the reduction of classification accuracy of method 1 is more significant than that of method 2. When SNR = 20 dB, the accuracy of method 2 is 97.1%, which is 4.5% higher than that of method 1. It indicates that the feature extraction method of wavelet transform + S-transform has better noise resistance and richer feature quantity than those of S-transform.

As shown in Table 3, the classification accuracies of DT, SVM and KNN algorithms decrease with the increase of noise intensity. When SNR = 20 dB, the accuracy of DT is 5.29% higher than that of SVM and 1.03% higher than that of KNN. In addition, as can be seen from Table 4, DT classification is faster than the other two methods.

3 Conclusion

For the various types of power quality disturbance, this paper proposes a power quality disturbance classification method based on time-frequency domain multi-feature and decision tree, for power quality improvement and governance. By combining the advantages of wavelet and S-transform, 8 time-frequency domain eigenvalues are extracted from 6 single disturbances and 2 compound disturbances. According to the extracted feature quantities, the classification rules of decision tree are established, and the decision tree model for classification is constructed. Simulation results show that the method is effective, and the extracted feature quantities can be effectively used for the classification, and classification of decision tree. Compared with only using S-transform, the proposed feature extraction method has richer feature quantities, higher classification accuracy and robustness to noise. For the feature quantities extracted in this paper, the classification accuracy of decision tree classifier is higher and the calculation speed faster than those of SVM and KNN.

The example in this paper is based on MATLAB simulation platform. Further research will try to apply the proposed method to practical power quality disturbance classification. Additional types of power quality disturbance will be included and the classification method will be made more universal.

Availability of data and materials

The power quality disturbance samples in this paper are generated by MATLAB using the power quality disturbance mathematical model.


  1. Xiao, X.N. (2010). Analysis and control of power quality [M]. Beijing: China Electric Power Press, 124–128.

  2. Zhang, Y., & Liu., Z.G. (2012). A new power quality hybrid disturbance classification method based on time-frequency domain multi-characteristic quantities [J]. Proceedings of the CSEE, 32(34), 83–90.

  3. Zhang, B. (2010). Power quality analysis method based on Mallat algorithm and fast Fourier transform [C]. Power Quality Seminar, 35–40.

  4. Jurado, F., & Saenz, J. R. (2002). Comparison between discrete STFT and wavelets for the analysis of power quality events[J]. Electr Power Syst Res, 62(3), 183–190.

    Article  Google Scholar 

  5. Huang, J.M, Qu, H.Z, & Li, X.M. (2016). Classification of mixed disturbance of power quality based on short-time Fourier transform and spectral kurdiness [J]. Power System Technology, 40(10), 3184–3191.

  6. Qu, H.Z, Liu, H., Li, X.M, et al. (2017). A feature combination optimization method for multi-disturbance classification of power quality [J]. Electric Powcr Automation Equipment, 37(3), 146–152.

  7. Luciano C.M. Andrade, Mário Oleskovicz, & Ricardo A.S. Fernandes. (2016). Adaptive threshold based on wavelet transform applied to the segmentation of single and combined power quality disturbances[J]. Neurocomputing, 38, 967–977.

  8. Wu, Y., Tang, Q., Teng Z.S, et al. (2016). Power quality disturbance signal feature extraction method based on improved S transform [J]. Proceedings of the CSEE, 36(10), 2682–2689.

  9. Huang, N.T, Peng, H., Cai, G.W, et al. (2017). Composite disturbance feature selection and optimal decision tree construction of power quality [J]. Proceedings of the CSEE, 37(3), 776–786.

  10. LI, X.N. (2017). Power quality disturbance detection and recognition based on hilbert-huang transformation [D], China University of Mining and Technology.

  11. Anamika Yadav, Yajnaseni Dash & V. Ashok. (2016). ANN based directional relaying scheme for protection of Korba-Bhilai transmission line of Chhattisgarh state[J]. Protection and Control of Modern Power Systems, 1(1), 15.

  12. He, J.L, Wang, G.P, Liu, D., et al. (2017). Location and identification of power quality disturbance in distribution network system based on lifting wavelet and improving BP neural network [J]. Power System Protection and Control, 45(10), 69–76.

  13. Ren, Z.H, & Wang, Q. (2008). Power quality disturbance identification based on optimal DDAGSVM multi-class classification strategy [J]. Power System Protection and Control, 46(5), 82–88.

  14. Panigrahi B.K., Pandi V.R. optimal feature selection for classification of power quality disturbances using wavelet packet-based fuzzy k-nearest neighbour algorithm[J]. Neurocomputing, 2009, 3(3): 296–306.

    Article  Google Scholar 

  15. Biswal, M., & Dash, P.K. (2013). Measurement and classification of simultaneous power signal patterns with an S-transform variant and fuzzy decision tree[J]. IEEE Transactions on Industrial Informatics, 9(4), 1819–1827.

    Article  Google Scholar 

  16. Zhou, Z.N. (2017). Research on power quality disturbance identification algorithm based on S transform [D]. Harbin Institute of Technology.

  17. Han, G., Zhao, J.W, Zhu, X., et al. (2015). Power quality disturbance identification based on multi-feature combination [J]. Proceedings of the CSU-EPSA, 27(8), 71–77.

Download references


The authors would like to thank Natural Science Basic Research Plan in Shaanxi Province of China for supporting the project.


The Project is supported by Natural Science Basic Research Plan in Shaanxi Province of China (Program No. 2019JM-544).

Author information

Authors and Affiliations



Zhao WJ and Sun JF performed the simulation examination, analyzed and interpreted the simulation results. Shang LQ designed and supervised the experiment, prepared and revised the manuscript. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Wenjing Zhao.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhao, W., Shang, L. & Sun, J. Power quality disturbance classification based on time-frequency domain multi-feature and decision tree. Prot Control Mod Power Syst 4, 27 (2019).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: