# An Active Indoor Noise Control System Based on CS Algorithm
## 3 Simulation  
Numerous simulation experiments are performed in this section to validate the proposed method, and the classic FXLMS and FXNLMS algorithms are compared. The input microphone is 180 cm away from the error microphone in the simulation, and the canceling speaker is 50 cm away from the error microphone. On the same plane lies the input microphone, the canceling speaker, and the error microphone. The main parameters of the simulation are given in Table 1.  
The 200 Hz single tone signal is first investigated, with the simulation results given in Figure 5a, which represents the power spectrum of a 200 Hz single tone signal, demonstrating that the signals are focused in the 200 Hz frequency region; Figure 5b shows the change in the mean square error (MSE) during the iteration process of FxLMS and FxNLMS, demonstrating that the change is extremely minimal after 16,000 generations. The original signal's normalized frequency spectrum is shown in Figure 5c. The normalized frequency spectra of the FxLMS, FxNLMS, and CS techniques are shown in Figure 5d-f, respectively. The iterative phase of the CS algorithm is depicted in Figure 5g. It can be foundthat the CS algorithm has a faster convergence time than the LMS and NLMS algorithms. Finally, Figure 5f compares the three approaches. On 200 Hz signals, the three approaches show strong noise reduction results, with the FXLMS algorithm and the CS algorithm having the best impacts. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Frequency of signal & 200–20 KHz \\ The number of iterations & 35,000–40,000 \\ Sampling frequency & 16 KHz \\ \(\mu\) (for FXLMS and FXNLMS) & 0.05 \\ \(K\) (for CS) & 400 \\ \(N\) (Length of Filter coefficient) & 32 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The key parameters of simulation. Subsequently, we tried various single-tone signals given simultaneously. Figure 6a represents the spectrum of the noise. We set four frequencies, 1 KHz, 5 KHz, 10 KHz, and 20 KHz, accordingly. Figure 6d illustrates the frequency spectrum filtered using the FXLMS algorithm. It can be observed that most of the noise frequency bands are substantially removed; however, there are still sounds after filtering using the FXNLMS algorithm. Figure 5: Simulation of 200 Hz tune signal: (**a**) the power spectrum of the noise; (**b**) the iteration of LMS/NLMS; (**c**) spectrogram of noise signal; (**d**) spectrogram of filtered noise signal (reduction by FXLMS); (**e**) spectrogram of filtered noise signal (reduction by FXNLMS); (**f**) spectrogram of filtered noise signal (reduction by CS); (**g**) iteration of CS; (**h**) comparison of noise reduction effects. Finally, the frequency generated by the CS algorithm is quite pure. As can be observed from Figure 6h, the noise reduction impact of the CS algorithm is superior. Figure 6: Simulation of multi-tune signal (1 KHz, 5 KHz, 10 KHz, and 20 KHz): (**a**) the power spectrum of noise; (**b**) the iteration of LMS/NLMS; (**c**) spectrogram of noise signal; (**d**) spectrogram of filtered noise signal (reduction by FXLMS); (**e**) spectrogram of filtered noise signal (reduction by FXNLMS); (**f**) spectrogram of filtered noise signal (reduction by CS); (**g**) iteration of CS; (**h**) comparison of noise reduction effects. Finally, we tested some background noise. The signal spectrum of the noise is more chaotic, as seen in Figure 7a,c. In this case, the noise can be successfully eliminated after filtering, as shown in Figure 7d-f, and as shown in Figure 7h, the CS algorithm has a stronger noise suppression effect. Figure 7: Simulation of real noise signal: (**a**) the power spectrum of noise; (**b**) the iteration of LMS/NLMS; (**c**) spectrogram of noise signal; (**d**) spectrogram of filtered noise signal (reduction by FXLMS); (**e**) spectrogram of filtered noise signal (reduction by FXNLMS); (**f**) spectrogram of filtered noise signal (reduction by CS); (**g**) iteration of CS; (**h**) comparison of noise reduction effects.