## 3 Envelope Detector-Aided, Machine Learning-Based Fault Type Detection Model
### Machine Learning-Based Fault Presence and Type Detection Models
#### 3.2.1 Feature Extraction Techniques
Thus, the ACF of the examined signal can be calculated as [50]:  
\[\hat{\mathbf{Z}}_{\ell}[\kappa]=\sum_{n=1}^{N}\mathbf{z}_{\ell}[n]\mathbf{z}_{ \ell}[n-\kappa],\text{ for }\kappa=1,2,\ldots,N,N+1,\ldots,2\times N. \tag{12}\]  
Thus, the feature matrix for ACF can be created using both halves of the calculated components as  
\[\mathbf{X}_{\text{\tiny ACF}}=\left(\hat{\mathbf{Z}}_{1}[1:N],\hat{\mathbf{Z} }_{1}[N+1:2\times N],\ldots,\hat{\mathbf{Z}}_{6}[1:N],\hat{\mathbf{Z}}_{6}[N+ 1:2\times N]\right)^{T}\in\mathbb{R}^{12\times N}. \tag{13}\]  
Power Spectral Density  
The signal strength is another feature set that can be obtained with the power of the signal. Thus, by using (9), the feature matrix for PSD can be created [35]:  
\[\mathbf{X}_{\text{\tiny PSD}}=\frac{2}{f_{s}N}\Big{(}|\mathbf{Z}_{1}^{c}|^{2},|\mathbf{Z}_{2}^{c}|^{2},\ldots,|\mathbf{Z}_{6}^{c}|^{2}\Big{)}^{T}\in \mathbb{R}^{6\times(\lfloor N/2\rfloor+1)}. \tag{14}\]  
Wavelet Transform  
The WT is a common method to investigate power signals at different band filter levels and can provide changing sampling information with a Shannon Entropy calculation at each decomposition level [51]. Thus, the Shannon Entropy of each decomposition level for the recorded power grid signal is obtained to observe information changes as  
\[\hat{\mathbf{Z}}_{\ell}[r]=\sum_{n=1}^{N_{r}}\Omega_{\ell}^{r}[n]\log_{2}\left( \Omega_{\ell}^{r}[n]\right),\text{ for }r=1,2,\ldots,R, \tag{15}\]  
where \(N_{r}\) is the number of samples at the \(r\)th decomposition level, and \(R\) indicates the number of the decomposition value. In (15), \(\Omega_{\ell}^{r}\) shows the probability of energy at the \(r\)th decomposition level that can be defined as  
\[\Omega_{\ell}^{r}[n]=\frac{|\varphi_{\ell}^{r}[n]|^{2}}{\sum_{i=1}^{N_{r}}| \varphi_{\ell}^{r}[i]|} \tag{16}\]  
where \(\varphi_{\ell}^{r}\) is the high-pass filter outcome in the filter-bank algorithm designed for WT calculation that is defined as [52]:  
\[\varphi_{\ell}^{r}[n]=\sum_{i=-\inf}^{\inf}\mathbf{z}_{\ell}[i]\mathbf{h}[2n- i],\text{ for }n=1,2,\ldots,N_{r}, \tag{17}\]  
where \(\mathbf{h}\) is the filter that is designed based on the Daubechies wavelet signal. Notably, the bank filter is established as a cascaded design with high- and low-pass filters. In (17), the first input signal is the investigated signal \(\mathbf{z}_{\ell}\), but the input signal changes with the low-pass filter's outcomes when the decomposition number is increased. For instance, the input of (17) is \(\mathbf{z}_{\ell}\) for \(r=1\), and other decomposition values (i.e., \(r=2,3,\ldots,R\)) are defined with a low-pass filter, which is defined as  
\[\vartheta_{\ell}^{r}[n]=\sum_{i=-\inf}^{\inf}\mathbf{z}_{\ell}[i|\mathbf{g}[2n- i],\text{ for }n=1,2,\ldots,N_{r}, \tag{18}\]  
where \(g\) is the low-pass filter signal. Therefore, the feature matrix for WT can be established using (15):  
\[\mathbf{X}_{\text{WT}}=\left(\mathbf{\hat{Z}}_{1},\mathbf{\hat{Z}}_{2},\ldots,\mathbf{\hat{Z}}_{6}\right)^{T}\in\mathbb{R}^{6\times R}. \tag{19}\]