## 3 Proposed Method
### Computer Simulation of PQDs  
In this work, a set of signals for training is artificially obtained through computer models. The artificial PQD signals consist of 10 single types, including pure a sine signal, sag, swell, interrupt, harmonics, flicker, oscillatory transient, impulsive transient, periodic notch, and spike. The multiple types consist of sag with harmonics, swell with harmonics, and interrupt with harmonics. The definition of the PQD signals with the parameter variations is based on the IEEE-1159 standard [29], as presented in Table 1. Waveform signals with 10 cycles are generated for 2000 points at a 10 kHz sampling frequency. The parameter A represents the normalized amplitude at a constant value. The parameter \(\alpha\) represents the intensity levels of the sag, swell, and interruption. The expression \(u(t)\) denotes the time step function.  
In this work, all of the studied cases are based on pure normal-class sinusoidal signals that can vary their amplitude within 10% of their ideal magnitude. Additionally, the probability of a signal containing noise must be considered. Therefore, the simulated signal is coupled with Gaussian noise  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Label** & **PQD Type** & **Mathematical Mode** & **Parameters** \\ \hline C1 & Pure Sine & \(y(t)=A\sin(\omega t)\) & \(A=1\) \\  & & \(\omega=2\pi\ast 50\) \\ \hline C2 & Sag & \(y(t)=A[1-\alpha(u(t-t_{1})-u(t-t_{2}))]\sin(\omega t)\) & \(0.1\leq\alpha\leq 0.9\) \\  & & \(T\leq t_{2}-t_{1}\leq 9T\) \\ \hline C3 & Swell & \(y(t)=A[1+\alpha(u(t-t_{1})-u(t-t_{2}))]\sin(\omega t)\) & \(0.1\leq\alpha\leq 0.8\) \\  & & \(T\leq t_{2}-t_{1}\leq 9T\) \\ \hline C4 & Interrupt & \(y(t)=A[1-\alpha(u(t-t_{1})-u(t-t_{2}))]\sin(\omega t)\) & \(0.9\leq\alpha\leq 1;\) \\  & & \(T\leq t_{2}-t_{1}\leq 9T\) \\ \hline C5 & Harmonics & \(y(t)=A[a_{1}\sin(\omega t)+a_{3}\sin(\omega t)+a_{5}\sin(\omega t)+a_{7}\sin( \omega t)]\) & \(0.05\leq a_{3},a_{5},a\gamma\leq 0.15\) \\  & & \(\sum_{i}^{2}=1\) \\ \hline C6 & Flicker & \(y(t)=A\big{[}1+a_{j}\sin(\omega t)\big{]}\sin(\omega t)\) & \(0.1\leq\alpha\leq 0.2\) \\  & & \(5\leq j\leq 20 Hz\) \\ \hline C7 & Oscillatory transient & \(y(t)=A\big{[}\sin(\omega t)+\alpha^{-(t-t_{1})/\pi}\sin(\omega_{u}(t-t_{1})t)( u(t_{1})-u(t_{2}))\big{]}\) & \(0.1\leq\alpha\leq 0.8\) \\  & & \(0.57\leq t_{2}-t_{1}\leq 3T\) \\  & & \(8 ms\leq 7\leq 40 ms\) \\  & & \(300\leq f_{\alpha}\leq 900 Hz\) \\ \hline C8 & Impulsive transient & \(y(t)=A[1-\alpha(u(t-t_{1})-u(t-t_{2}))]\sin(\omega t)\) & \(0.0\leq\alpha\leq 0.144\) \\  & & \(0.057\leq t_{2}-t_{1}\leq 0.1T\) \\ \hline C9 & Periodic notch & \(y(t)=\sin(\omega t)-\mathrm{sign}(\sin(\omega t))\) & \(0.5\leq t_{1},t_{2}\leq 0.5T\) \\  & & \(\chi\left(\sum\limits_{n=0}^{5}K\times[u(t-(t_{1}-0.02n))-u(t-(t_{2}-0.02n))]\right)\) & \(0.01\leq f\leq 0.1\leq 0.05T\) \\  & & \(0.1\leq f\leq 0.1\leq 0.04\) \\ \hline C10 & Spike & \(y(t)=\sin(\omega t)+\mathrm{sign}(\sin(\omega t))\) & \(0.5\leq t_{1},t_{2}\leq 0.5T\) \\  & & \(\chi\left(\sum\limits_{n=0}^{5}K\times[u(t-(t_{1}-0.02n))-u(t-(t_{2}-0.02n))]\right)\) & \(0.01\leq f\leq 0.1\leq 0.05T\) \\  & & \(0.1\leq\xi\leq 0.4\) \\ \hline C11 & Sag with harmonics & \(y(t)=\) & \(0.1\leq a\leq 0.9;\) \\  & & \(T\leq t_{2}-t_{1}\leq 9T\) \\  & & \(A[1-\alpha(u(t-t_{1})-u(t-t_{2}))]\)\(\left[a_{1}\sin(\omega t)+a_{3}\sin(\omega t)+a_{5}\sin(\omega t)]\) & \(0.05\leq a_{3},a_{5},a\gamma\leq 0.15;\) \\  & & \(\sum_{i}^{2}=1\) \\ \hline C12 & Swell with harmonics & \(y(t)=\) & \(0.1\leq a\leq 0.9\) \\  & & \(T\leq t_{2}-t_{1}\leq 9T\) \\  & & \(A[1+\alpha(u(t-t_{1})-u(t-t_{2}))]\)\(\left[a_{1}\sin(\omega t)+a_{3}\sin(\omega t)+a_{5}\sin(\omega t)]\) & \(0.05\leq a_{3},a_{5},a\gamma\leq 0.15\) \\  & & \(\sum_{i}^{2}=1\) \\ \hline C1 contamination at different signal-to-noise ratios (SNRs) in this paper. The SNR is defined, as follows, where \(P_{\text{s}}\) represents the original signal power and \(P_{n}\) represents the noise power correspondingly.  
\[SNR=10*\log\left(\frac{P_{s}}{P_{n}}\right) \tag{10}\]