## 4 Simulation Test Analysis  
### Modeling and Analysis of Power Signals  
According to the power signal data, the common steady-state harmonics are the 3, 5, 7, 11, and 13 harmonics, which are also accompanied by some sudden changes, noise, and transient interference. Therefore, the signal model in this paper contains a 50 Hz fundamental wave component of 3, 5, 7, 11, 13, 19 harmonics, 23 and 33 harmonic attenuation components, and random noise \(\sigma(t)\). Due to the main research on the separation and extraction of each harmonic in the signal, the relative delay in the transmission process of the power grid is not considered temporarily. The signal model can include the three cases mentioned in Section 3 in the case of decomposing three layers, so that conclusion is better proved. The complex harmonic signal model is shown in Equation (12). \[ \begin{array}{ll}S(t)&=220\sin(100\pi t)+21\sin(300\pi t)\\ &+15\sin(500\pi t)+13\sin(700\pi t)\\ &+8\sin(1100\pi t)+5\sin(1300\pi t)\\ &+3\sin(1900\pi t)+3\sin(2300\pi t)e^{-20t}\\ &+2\sin(3300\pi t)e^{-20t}+0.2\sigma(t)\end{array}  \tag{12}\]  
In addition to the common steady-state harmonics, the signal \(S(t)\) also contains an exponentially decaying harmonic at the beginning, and a random noise \(\sigma(t)\) with random interference. The signal \(S(t)\) waveform is shown in Figure 4.  
Figure 4: Waveform of complex harmonic signal \(S(t)\). Figure 3: Harmonic detection improvement method flowchart. According to the national standard power quality public network harmonics requirements for harmonic detection, the actual sampling frequency is 6400 Hz, and the number of sampling points is 1024 [12]. According to the characteristics of the harmonic model, the number of decomposition layers does not need to be too large, so the number of decomposition layers selected by this method is three layers, and multi-resolution analysis is performed on the signal \(S(t)\). Taking into account the orthogonality and symmetry of the wavelet base, in order to make the band division effect better, the analysis wavelet used is db10. The decomposition and reconstruction calculation formula using the Mallat algorithm is as follows:  
The wavelet transform decomposition formula is shown in Equation (13):  
\[ \begin{array}{l}c_{n}^{k}=\frac{1}{\sqrt{2}}\sum\limits_{j\in Z}c_{j}^{k-1}h _{j-2n}^{\star}\\ d_{n}^{k}=\frac{1}{\sqrt{2}}c_{j}^{k-1}g_{j-2n}^{\star}\end{array}  \tag{13}\]  
The reconstruction formula is shown in Equation (14):  
\[c_{n}^{0}=\sum\limits_{k=1}^{N}{(\sum\limits_{j\in Z}d_{j}^{k}g_{j-2n})}+\sum \limits_{j\in Z}c_{j}^{N}h_{j-2n} \tag{14}\]  
where, scale \(k=1,2,\ldots\ldots N\), the maximum value of \(k\) decomposition in this paper is 3. \(h_{j},g_{j}\) is a discrete filter, and the value of \(j\) is limited in actual calculation. The transformation is from \(c_{n}^{0}\) to \(c_{n}^{1}\) and \(d_{n}^{1}\). This is the first layer decomposition. The original signal is decomposed into A1 layer and D1 layer. The second layer decomposition is obtained from \(c_{n}^{1}\) into \(c_{n}^{2}\) and \(d_{n}^{2}\), and the A1 layer is divided into A2 and D2 layers. In the same way, \(c_{n}^{N}\) and \(d_{n}^{N}\) can be obtained in the end. Reconstruction is the opposite of decomposition. First, \(c_{n}^{N-1}\) is obtained from \(c_{n}^{N}\) and \(d_{n}^{N}\). Similarly, \(c_{n}^{0}\) is finally synthesized. \(c_{n}^{N}\) is the low frequency part and \(d_{n}^{N}\) is the high frequency part. In order to verify the algorithm proposed in this paper, the layers of the signal model are analyzed. The A3 layer is the low frequency steady-state component part, the D3 layer is the high frequency steady-state part, the D2 layer is the high frequency steady-state and attenuation component coexisting part, and the D1 layer is the high frequency attenuation component.