## 2 Power Quality Disturbance Feature Extraction  
### Feature Extraction Based on Discrete Wavelet Transform  
Wavelet transform [18] is used to analyze stationary and non-stationary signals in various scenes, which can analyze local discontinuities in the signal. Mathematically, continuous wavelet transform (CWT) for a continuous signal with respect to the wavelet function \(\psi(t)\) is given by (1). \[f_{\text{CWT}}(a,b)=\frac{1}{\sqrt{a}}\!\int_{-\infty}^{\infty}\!f(t)\psi(\frac{t-b }{a})dt\ \ a,b\in R,\ \ a\
eq 0 \tag{1}\]  
Parameters \(a\) and \(b\) represent scale and conversion parameters, \(f(t)\) represents the original signal. In the practical application of CWT, there is redundant information that is not suitable for computer analysis. The study [11] found that DWT is more suitable for the analysis of PQDs, as shown in Equation (2). \[g_{\text{DWT}}(m,n)=\frac{1}{\sqrt{a_{0}{}^{m}}}\!\sum_{k}f(k)\psi(\frac{n-kb _{0}a_{0}{}^{m}}{a_{0}{}^{m}}) \tag{2}\]  
The scaling and translation parameters are replaced by functions of \(m\) and \(n\) integers, i.e., \(a=a_{0}{}^{m}\) and \(b=kb_{0}a_{0}{}^{m}\), respectively, whereas \(f(k)\) is the sequence of discrete points of the continuous time signal \(f(t)\). In the feature extraction process, the PQD signal is decomposed using a discrete wavelet transform. This wavelet analysis is actually a measure of the similarity between the mother wavelet and the input signal. The correct choice of wavelet master function is one of the main problems in the execution of DWT applications. In this paper, the widely used Daubechies4 wavelet filter is used as a mother wavelet [19]. The number of decomposition levels \(l\) is also very important. Choosing a higher \(l\) will bring more information into the system. In the text, the PQD signal is decomposed into eight levels for feature extraction. The statistical parameters that are used for the feature extraction were obtained from the literature [17]. The seven statistical features are entropy (Ent), standard deviation (\(\sigma\)), mean (\(\mu\)), kurtosis (KT), skewness (SK), root mean square (RMS) and range (RG). These statistical feature values are calculated using the mathematical formulas of Equations (3) through (9). The power quality waveform is decomposed into eight levels, providing eight detail coefficients and one approximation coefficient, and the total features obtained is 63, which is done for each PQD in the 4500 \(\times\) 1280 signal matrix. Finally, a 4500 \(\times\) 63 feature matrix is obtained and normalized for classification. The original feature set according to DWT statistics is shown in Table 1.  
\(\mu\_1\) represents the mean feature provided by the first layer of detail coefficients, \(\sigma\_1\) represents the standard deviation feature provided by the first layer of detail coefficients, RMS\(\_1\) represents the root mean square feature provided by the first layer of detail coefficients, KT\(\_1\) represents the kurtosis feature provided by the first layer of detail coefficients, Ent\(\_1\) represents the entropy feature provided by the first layer of detail coefficients, SK\(\_1\) represents the skewness feature provided by the first layer of detail coefficients and RG\(\_1\) represents the range feature provided by the first layer of detail coefficients. Rang:  
\[RG_{i}=Max\!\left(A_{ij},D_{ij}\right)-Min\!\left(A_{ij},D_{ij}\right) \tag{3}\]