## 4 The Proposed Method
### Flow of the Proposed Denosing Method  
The adaptive threshold denoising method based on WTD-IFOA can be summarized as follows:  
Step 2.1: For the sake of convenient calculation, the sound signal is first quantized into a certain range. Then, the initial signal is decomposed by a \(J\)-level wavelet transform. \(i\)-th coefficient in \(j\)-th level can be presented as \(d_{ij}\), where \(i=1,\ 2,\ 3,\ \ldots,\ m,j=1,\ 2,\ 3,\ \ldots,\ J\), \(m\) is the length of the sound signal.  
Step 2.2: The parameters of IFOA are initialized, such as \(LR\), \(IN_{\_}{\max}\) and \(FR\), where \(FR\sim\) N(\(0\), \(L^{2}\)). For \(J\)-level WT, each level has an optimal threshold. So there are \(J\) groups of fruit flies, each group contains \(PA\) individuals. The initial location of the fruit fly group is obtained by Equation (6).  
Figure 2: Probability density functions of basic fly distance range and the improved.  
Step 2.3: The location of each individual is gained through the fly group and \(FR\). The distance and smell concentration of each fly are calculated according to Equation (8). Each smell concentration judgment is regarded as a potential threshold. Then, the useful signal and the noise component are separated according to the soft-threshold function. In order to judge the denoising performance of each fruit fly individual, the fitness function \(f\) is calculated as follows:  
\[f=\frac{1}{1+g} \tag{11}\]  
\[g=\frac{\left[r_{22}\times hr_{21}\right]^{2}}{r_{11}^{2}} \tag{12}\]  
where \(r_{22}\) is an autocorrelation of noise. As noise is yielded randomly, it has neither high autocorrelation nor zero autocorrelation. However, an ascending value implies that more original signal adheres to noise, thus the restructured signal will not be a good recovery. \(hr_{21}\) is a high-order cross-correlation between useful signal and the noise. If these coefficients are descending, then it implies that both signals become more independent to each other. Thus, the original signal and noise are toward separation gradually. \(r_{11}\) is an autocorrelation of useful signal. An ascending value implies that its own component is more than component of noise. Hence, the restructured signal has a good recovery [33]. \(r_{22}\), \(hr_{21}\) and \(r_{11}\) are defined as follows:  
\[r_{ij}=\frac{C_{ij}}{\sqrt{C_{ii}C_{jj}}}=\frac{\text{cov}[s_{i},s_{j}]}{ \sqrt{\text{cov}[s_{i}]\text{cov}[s_{j}]}},\ \ \ i,j=1,2 \tag{13}\]  
\[hr_{ij}=\frac{HC_{ij}}{\sqrt{HC_{ii}C_{jj}}}=\frac{\text{cov}[\varphi(s_{i}),s _{j}]}{\sqrt{\text{cov}[\varphi(s_{i})]\text{cov}[s_{j}]}},\ \ \ i,j=1,2 \tag{14}\]  
Figure 3: Flowchart of the improved fruit fly optimization algorithm.  
where \(s_{1}\) is the useful signal, \(s_{2}\) is the noise component, \(\mathrm{cov}[s_{i}\), \(s_{j}]=\mathrm{E}[[s_{i}-\mathrm{E}(s_{i})][s_{j}-\mathrm{E}(s_{j})]]\), \(\mathrm{cov}[s_{i}]=\mathrm{E}[[s_{i}-\mathrm{E}(s_{i})]^{2}]\), \(\mathrm{E}(s_{i})\) is mathematical expectation of \(s_{i}\) and \(\varphi(s_{i})=s_{i}^{2}+s_{i}^{3}\). \(r_{22}\), \(hr_{21}\) tend to minimum and \(r_{11}\) tends to the maximum when the location of each fruit fly group is placed in the best. Then \(g\) is the minimal and \(f\) is the maximal [34].  
Step 2.4: Fruit fly with maximal fitness is selected as _bestsmell_ and the corresponding fly number is named as _bestindex_. If the present _bestsmell_ is bigger than that of the former, _smellbest_, the corresponding coordinates are updated. Otherwise, _smellbest_, \(X\_axis\) and \(Y\_axis\) are reserved.  
Step 2.5: If the ending conditions are researched, _smellbest_, \(X\_axis\) and \(Y\_axis\) are treated as the optimum. Otherwise, Steps 2.3 and 2.4 are repeated.  
Step 2.6: The wavelet coefficients are adjusted according to the soft-threshold function and inverse wavelet transform is conducted consequently to obtain denoised signal. The flowchart of the process is shown in Figure 4.