## 2 PQD Feature Detection System Model Using WPTM-Based Metrics
### PQD Feature Detection Using WPTM-Based Metrics
#### 2.3.2 WPTM and WPTM-Based Metrics
Then, the \(l\)th-level WPT components (i.e., WPCs) for the PQD input signal \(x[i]\) can be redefined with \(\overline{\theta}_{l}\) as follows:  
\[W_{l}^{p}[n]=\langle x[i],\psi_{l}^{p}[i-r]\rangle=\frac{\partial}{\partial u _{p}}\big{(}x*\overline{\theta}_{l}\big{)}(u), \tag{13}\]  
where \(n\) and \(r=2^{l}n\) are the time-shift and translation parameters, respectively. Thus, we rewrite the WPC matrix **W** in (11) with the gradient vector smoothened by \(\overline{\theta}_{l}\), as follows:  
\[\textbf{W}=\left[ \begin{array}{c}\textbf{W}_{l}^{1}\\ \vdots\\ \textbf{W}_{l}^{p}\end{array} \right]=2^{l}\left[ \begin{array}{c}\frac{ \partial}{\partial u_{l}}\big{(}x*\overline{\theta}_{l}\big{)}(\textbf{\emph{u }})\\ \frac{\partial}{\partial u_{2^{l}-1}}\big{(}x*\overline{\theta}_{l}\big{)}( \textbf{\emph{u}})\end{array} \right]=2^{l}\
abla\big{(}x*\overline{\theta}_{l} \big{)}(\textbf{\emph{u}}). \tag{14}\]  
Hereinafter, for simplicity, we will drop the subscript \(l\) of the WPC \(\textbf{W}_{l}^{p}\) in (11) and (14). Throughout the paper, for PQD feature detection, we define the WPTM **M** as a function of the **W** components, as follows:  
\[\textbf{M}=\Big{\{}M[n]=f\Big{(}\Big{|}W^{1}[n]\Big{|}\Big{|}\Big{|}\Big{|}W^{ 2}[n]\Big{|}\ldots,\Big{|}W^{p}[n]\Big{|}\Big{)}\Big{|}n=1,\ldots,N\Big{\}}. \tag{15}\]  
From (15), it is confirmed that the presented WPTM-based metrics exhibit greater degrees of freedom (\(P=2^{l}-1\)) than the existing wavelet-based or wavelet-correlation-based metrics. Thus, the proposed scheme exhibits improved PQD signal detection and local ization capability compared to the existing schemes [1]. This difference further increases under critical channel conditions, such as low SNR (\(\leq\)25 dB). Conventionally, considering only the Gaussian noise channel (AWGN), the PQD feature detection threshold \(th\) of each WPC can be initialized with the following universal threshold \(TH_{U}\)[24]:  
\[TH_{U}=th=\sigma_{d}^{p}\sqrt{2\log\lvert N\rvert}, \tag{16}\]  
where the parameter \(\sigma_{d}^{p}\) is the median of \(\mathbf{W}^{p}\); that is,  
\[\sigma_{d}^{p}=\frac{\text{med}(\mathbf{W}^{p})}{0.6745}. \tag{17}\]  
The PQD event is inherently random and its channel characteristics are not pure Gaussian. In particular, the numerical results (Section 3) indicate that the PQD edge detection (or localization) is much sensitive to random phase offset \(\varphi_{m}=\{\tau_{m}\text{ mod }T\}\times 2\pi/T\), where \(\varphi_{m}\sim U[0,\,2\pi)\) is uniformly distributed and m = 1 and 2 indicate the start and end edge locations, respectively, because of the shift variant characteristics of the wavelets or wavelet packets. When assuming the use of the universal threshold \(TH_{U}\), Figure 4 shows the average detection rate (DR) and FER curves of a sag signal with 80% \(pu\) (assuming Gaussian noise with SNR = 35 dB) along the phase offset axis. DR can be almost 0% at approximately \(\varphi_{m}\approx\pi/2\) or \(3\pi/2\). This means that even after the denoising step (see Steps 2-4 in Figure 1), \(TH_{U}\)[7] does not work well, especially for the detection of a random PQD event signal. The numerical results also prove that FER is very high when using \(TH_{U  
Hence, to avoid such high FER, we define a modified threshold with \"\(k\)\" factor (Table 3), whose value depends on the used metric, such as MV or RMS. In the proposed algorithm, an optimal value of \(k\) that maintains a low FER (<12%) without damaging the DR (even if it remains low at \(\varphi_{m}\approx\pi/2\) or \(3\pi/2\)) is obtained through simulation.