# A Four-Stage Method for Active Control with Online Feedback Path Modelling Using Control Signal
## 2 Proposed Method  
The proposed method shown in Figure 1 consists of four stages: controller initialization, feedback path estimation, active control operation, and feedback path changing detection for maintaining control operation. \(P(z)\) is the primary path between the reference microphone and error microphone, \(\hat{P}(z)\) is the estimate of the primary path, \(F(z)\) is the acoustic feedback path from output of control filter \(W(z)\) to the reference microphone, \(\hat{F}(z)\) is the estimate of \(F(z)\), \(S(z)\) is the secondary path from output of control filter to the error microphone, and \(\hat{S}(z)\) is the estimated secondary path. Five switches are used to manage the control flow: control signal generation (K\({}_{1}\)), control filter update (K\({}_{2}\)), feedback path estimation (K\({}_{3}\)), and detection of secondary path change (K\({}_{4}\), K\({}_{5}\)). Figure 2 depicts the flowchart of the proposed method. In the initialization, the primary path estimate \(\hat{P}(z)\) can be obtained by using the reference microphone signal and the error microphone signal with K\({}_{1}\) switched off, and the estimated secondary path \(\hat{S}(z)\) is assumed to be identified as \(S(z)\) to focus on feedback path modelling in the paper. To detect the path changes, three thresholds are defined:  
\[T_{\rm r}(n)=10\ \log_{10}\!\left[\frac{\sigma_{\rm e}^{2}(n)}{\sigma_{\rm p}^{2}(n )}\right]\!, \tag{1}\]  
\[T_{\rm s}(n)=10\ \log_{10}\!\left[\frac{\sigma_{\rm c}^{2}(n)}{\sigma_{\rm p}^{2}(n )}\right]\!, \tag{2}\]  
\[T_{\rm d}(n)=10\ \log_{10}\!\left|\sigma_{\rm x}^{2}(n)-\sigma_{l}^{2}(n) \right|\!, \tag{3}\]  
where \(T_{\rm r}(n)\) is the threshold to detect the residual noise level, \(T_{\rm s}(n)\) is the threshold to detect the accuracy of the estimated secondary path, \(T_{\rm d}(n)\) is the threshold to detect the feedback path change (stability). \(\sigma_{\rm e}^{2}(n)\) is the power of the measured error signal \(e(n)\), which can be estimated by  
\[\sigma_{\rm e}^{2}(n)=\lambda\sigma_{\rm e}^{2}(n-1)+(1-\lambda)\sigma^{2}(n), \tag{4}\]  
where \(\lambda=0.999\) is the forgetting factor with \(\sigma_{\rm e}^{2}(0)=0\), and the range of \(\lambda\) is \(0.9<\lambda<1\), in general [18]. \(\sigma_{\rm p}^{2}(n)\) is the power of the primary disturbance, which can be estimated similarly with Equation (4) by turning off K\({}_{1}\). For \(\sigma_{\rm c}^{2}(n)\) is the power of the modelling error signal \(\varepsilon(n)\), and \(\sigma_{\rm x}^{2}(n)\) is the power of the signal \(x(n)\). \(\sigma_{l}^{2}(n)\) is the power of the signal \(x_{l}(n)=\beta\tan\ln(x(n)/\beta)\), where \(\beta\) is a scaling parameter that determines the mapping of the signal \(x(n)\) to the linear range of \(\tanh\) function. The value of \(\beta\) is chosen by trial and error in such a way that the most likely range of the incoming reference signal \(r(n)\) lies in the linear range of the \(\tanh\) function, i.e., \(r(n)\approx\beta\tan\ln(r(n)/\beta)\), which is depicted in Figure 3. The normal residual noise level with control, the normal estimated secondary path accuracy and the normal threshold \(T_{\rm d}(n)\) are assumed to be \(T_{\rm r0}\), \(T_{\rm s0}\) and \(T_{\rm d0}\), respectively. All the powers are estimated recursively similar to Equation (4) with their initial values equal to zero, i.e., \(\sigma_{\rm p}^{2}(0)=0\), \(\sigma_{\rm x}^{2}(0)=0\), \(\sigma_{\rm x}^{2}(0)=0\) and \(\sigma_{l}^{2}(0)=0\). Figure 1: Schematic diagram of the proposed method for active control with online feedback path modelling using the control signal. residual error signal \(e(n)\) becomes 20 dB higher than the power of undesired noise \(p(n)\), it is considered as the start of howling. If howling happens, record \(2L_{f}\) (\(L_{f}\) denotes the length of \(\hat{F}(z)\)) controller output signal \(y(n)\) and reference microphone signal \(m(n)\) and use them directly to calculate a nominal estimate of \(F(z)\).