## 3 Results and Discussion
### Preprocessing of Gas Monitoring Data
#### 3.2.2 Pretreatment of NH\({}_{3}\) and H\({}_{2}\)S Concentration Data  
High- and Low-Frequency Signal Features Are Extracted by Wavelet Decomposition  
Obviously, NH\({}_{3}\) and H\({}_{2}\)S change dynamically with time. It may be caused by the complexity of gas changes and equipment instability. The abnormal signal shows randomness and discontinuity in the time domain. In particular, there are many abnormal points in NH\({}_{3}\), which will seriously affect the accuracy of subsequent analysis if not treated. Each layer of the signal is decomposed into a low-frequency trend part and a high-frequency detail part by using the characteristic that wavelet decomposition can effectively divide non-stationary signal information. Then, the K-means algorithm is used for fine identification and processing of high-frequency outliers to improve the accuracy of the gas concentration data set. This is also the premise and basis of the follow-up study on the harmful gas release in the purification process of _Limnoperna fortunei_. Db5 wavelet was used to decompose the above data, and the signal diagram as shown in Figure 7 was obtained. After five layers of decomposition, the original concentration data can be divided into a low-frequency array a5 and five high-frequency arrays d1-d5. Compared with a one-dimensional original sequence, arrays in different frequency domains can express potential information of data more effectively and accurately. The amplitude of d1 in the time domain shows randomness, and the main spectrum in the frequency domain is mainly concentrated in the high-frequency domain, containing a large number of outliers. From d1 to d5, the frequency of variation decreases in turn, and the main spectrum is closer to the low-frequency concentration. The frequency of useful signals is mainly concentrated at a5, reflecting the baseline trend of gas concentration. Identify Outliers of High-Frequency Signals Based on K-Means Algorithm  
For gas concentration, the outliers are usually abnormally large or abnormally small. Any outliers will affect the quantitative analysis results of harmful gas release characteristics of _Limnoperna fortunei_, so the outliers in the gas concentration data set were comprehensively identified in this paper. By combining the analysis of the working state of gas monitoring equipment (sensor stability, drift, and failure) and the performance of original sequence data, it is judged that when the number of K-means algorithm clusters is 4, it can not only explain different data conditions but also ensure the stability of clustering results. The identification results of outliers by the K-means algorithm are shown in Figure 8. The  
Figure 6: Changes of H\({}_{2}\)S concentration during the puttefaction of _Limnoperna fortunei_. abnormal small values in the concentration of harmful gas are reflected in clusters 1 and 4, and the abnormal large values are reflected in clusters 2 and 3. Among them, cluster no. 1 in the figure is an obviously abnormal small value, and cluster no. 2 is an obviously abnormal large value, which should be directly deleted. Cluster no. 3 and cluster no. 4 are fuzzy outliers, which can be retained or continued processing. By analyzing the overall fluctuation of the sequence, it was empirically determined that cluster 3 and cluster 4 were abnormal data caused by sensor drift, which may affect the accuracy of subsequent quantitative analysis of harmful gas concentration, so it was also deleted. Figure 8: K-means outlier recognition. Figure 7: Decomposition of NH\({}_{3}\) (**a**) and H\({}_{2}\)S (**b**) concentration data by db5 wavelet.