# Harmonic Detection Method Based on Parameter Optimization VMD-IWT Combined Noise Reduction
## 4 Simulation Signal Verification  
To validate the effectiveness of the proposed method, several common denoising and harmonic detection methods are tested and compared with the proposed approach. The constructed harmonic signal with added noise is utilized for verification. The proposed algorithm is evaluated using power harmonic signals contaminated with noise. The parameters are as follows:  
\[f(t)=5\sin(2\pi\times 50t)+10\sin(2\pi\times 150t)+15\sin(2\pi\times 180t)+30 \sin(2\pi\times 284t)+noise \tag{14}\]  
Figure 1: Function of the new threshold for different values of a. The signal \(f(t)\) comprises fundamental waves, third harmonics, and interharmonics with frequencies of 180 Hz and 284 Hz, representing harmonic signals typical of real-world environments. White Gaussian noise is introduced to \(f(t)\) to create the original signal, with a signal-to-noise ratio of 10 dB. The sampling frequency is set to 1000 Hz, and the sampling number is 1000. Figures 2 and 3 depict the time-domain waveform and spectrum analysis diagram of the original signal. The RIME-VMD algorithm was employed to decompose the signal with noise. RIME was utilized to optimize the VMD parameters (\(K\),\(\alpha\)). The population size was set to 30, with a maximum of 20 iterations. The iteration range for \(K\) was set from 0 to 10 and for \(\alpha\) from 0 to 3000. After iteration, the fitness function reached a minimum value of 0.079748, and the optimal parameter combination (\(K\),\(\alpha\)) = (6, 1834) was obtained. To directly assess the advantages of the RIME-VMD algorithm, the WOA and PSO algorithms were each employed to optimize and compare VMD parameters. The parameter settings for each algorithm were consistent, and the fitness iteration convergence curve is depicted in Figure 4. As illustrated in Figure 4, the RIME algorithm demonstrates excellent convergence speed and high-precision convergence ability in optimizing VMD decomposition signals. Although the fitness value of the PSO algorithm is higher than that of WOA and RIME algorithms, the RIME algorithm achieves the minimum fitness value by the fourth iteration, indicating faster convergence speed and higher accuracy. Overall, the RIME algorithm outperforms the other two algorithms in terms of convergence speed and accuracy. The decomposition results of VMD after parameter optimization are presented in Figure 5. As depicted in Figure 5, it is evident that the RIME-VMD method effectively decomposed the noisy harmonic signal into 6 IMFs, accurately extracting sub-signals of each frequency while mitigating mode aliasing and end effects. Each IMF represents independent single-frequency harmonic components and noise components. IMF2 to IMF4 exhibit smooth and regular waveforms, albeit affected by noise, while IMF5 and IMF6 demonstrate distorted sine wave characteristics, containing a higher level of noise. Figure 3: Spectrum analysis diagram of the original signal. Figure 2: Time-domain waveform of the original signal. In order to effectively screen out valid IMFs and invalid IMFs, the absolute value of each IMF's correlation coefficient \(|\rho|\) is calculated after decomposing the signal to obtain IMFs, and the randomness of each IMF component is tested. Equation (10) is used to calculate the correlation coefficient of each IMF. The correlation coefficient of each IMF after harmonic signal decomposition is shown in Figure 6. First, based on the degree of correlation between the components shown in Table 1, the invalid IMF components with \(|\rho|<0.2\) are removed; the \(|\rho|\) values of IMF5 and IMF6 in Figure 6 are \(<\)0.2 and much smaller than other components, so they are discarded. Then, IMF1, IMF2, IMF3, and IMF4, which contain noise, are processed using the IWT denoising method. The wavelet parameters are set to db4, and the number of decomposition layers is set to 3 based on empirical values. Finally, the processed effective modal components are reconstructed to obtain the denoised signal. Figure 4: Fitness iteration curve. Figure 5: VMD decomposition results.