# Robustness and Sensitivity Tuning of the Kalman Filter for Speech Enhancement
## 3 Proposed Speech Enhancement Algorithm
### Proposed \(K_{0}(n)\) Tuning Method  
Firstly, we constructed KF with \((\{\hat{a}_{i}\},\sigma_{w}^{2})\) and \(\hat{\sigma}_{v}^{2}\) and extracted the tuning parameters as shown in Figure 4. It can be seen from Figure 4a that \([\hat{a}^{2}(n)+\hat{\sigma}_{w}^{2}]\) achieves similar characteristics as the KF-oracle method (Figure 2d). Unlike \(\hat{\sigma}_{v}^{2}\) in the non-oracle case (Figure 2e), \(\hat{\sigma}_{v}^{2}\) becomes lower than \([\hat{a}^{2}(n)+\hat{\sigma}_{w}^{2}]\), as usually occurred in the oracle case (Figure 2d). The improvement of these parameters also enables \(J_{2}(n)\) and \(J_{1}(n)\) metrics (Figure 4b) to achieve quite similar characteristics as appear in the WGN condition (Figure 1c). Therefore, \(J_{2}(n)\) and \(J_{1}(n)\) metrics (Figure 4b) are now eligible to dynamically tune \(K_{0}(n)\) in real-life noise conditions. However, our investigation reveals that the \(J_{2}(n)\) metric is useful in tuning \(K_{0}(n)\) during speech pauses, since it is underestimated \(K_{0}(n)\) during speech presence of noisy speech [21]. On the contrary, since the \(J_{1}(n)\) metric approaches0 in speech regions of noisy speech, according to eq. (32), it minimizes the underestimation of \(K_{0}(n)\). In light of these observations, for each sample of \(y(n,k)\), we incorporated the \(J_{2}(n)\) metric during speech pauses and the \(J_{1}(n)\) metric during speech presence to dynamically _offset_ the bias in \(\tilde{K}_{0}(n)\). The proposed tuning algorithm requires a speech activity detector that operates on a sample-by-sample basis. However, the existing speech activity detector operates on a frame-by-frame basis. In addition, the incorporation of any external speech activity detector makes the proposed tuning algorithm a bit complex. To cope with the issues, we studied and found that the KF parameters can be adopted as a speech activity detector that operates on a sample-by-sample basis. Specifically, we found that \([\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}]\) and \(\hat{\sigma}_{v}^{2}\) can be adopted as a speech activity detector for each sample of \(y(n,k)\). For example, during speech pauses, the condition \(\hat{\sigma}_{v}^{2}\geq[\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}]\) holds (e.g., 0-0.15 s or 1.8-2.19 s of Figure 4a. Conversely, \([\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}]>>\hat{\sigma}_{v}^{2}\) is found in speech regions (e.g., 0.16-0.33 s or 0.9-1.06 s of Figure 4a). Therefore, at sample \(n\), if \(\hat{\sigma}_{v}^{2}\geq[\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}]\), \(y(n,k)\) is termed as silent and set the decision parameter (denoted by \(\zeta\)) as \(\zeta(n)=0\); otherwise, speech activity occurs and \(\zeta(n)=1\). Figure 5 reveals that the detected flags (0/1: silent/speech) by the proposed method are closely similar to that of the reference (0/-1: silent/speech, generated by visually inspecting the utterance sp05). Figure 5: Comparing the detected flags of Figure 2b to that of the reference corresponding to Figure 2a. At sample \(n\), if \(\zeta(n)=0\), the adjusted \(K_{0}^{\prime}(n)\) in the proposed SEA is given by:  
\[K_{0}^{\prime}(n)=\tilde{K}_{0}(n)[1-J_{2}(n)], \tag{40}\] \[=\left[\frac{\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}}{\hat{\alpha }^{2}(n)+\hat{\sigma}_{w}^{2}+\hat{\sigma}_{v}^{2}}\right]\left[\frac{\hat{ \alpha}^{2}(n)}{\hat{\alpha}^{2}(n)+\hat{\sigma}_{w}^{2}}\right],\] \[=\frac{\hat{\alpha}^{2}(n)}{\hat{\alpha}^{2}(n)+\hat{\sigma}_{w} ^{2}+\hat{\sigma}_{v}^{2}}.\]  
To justify the validity of \(K_{0}^{\prime}(n)\), Figure 6a shows the numerator and the denominator of Equation (40) computed from the noisy speech in Figure 2b. It can be seen that \(\hat{\alpha}^{2}(n)\approx 0\) during speech pauses (e.g., 0-0.15 s or 1.8-2.19 s of Figure 6a). According to Equation (40), \(K_{0}^{\prime}(n)\approx 0\).