## 4 Enhanced LMS Methods with IMC
### Novel Adaptive Filtering Algorithm Based on the IMC 1: Non-Recursive Method  
#### 4.1.1 Conceptual Explanation  
As mentioned, the LMS algorithm could cause instability of the whole control system, or an incorrect solution may be obtained after convergence, since neglecting the secondary path dynamics \(\mathbf{P}_{c}\) is essentially unavoidable in realistic situations. The FX-LMS algorithm overcomes this inadequacy by using a reference filter for the input and by compensating for time and phase delays that are induced by several auxiliary parts that are included in the filtering system (sensors, converters, amplifiers, etc.).  
However, the model of the secondary path dynamics must also be identified offline in advance, in order to obtain the coefficients of the filter, which adds to the effort that is needed to implement the control system. Thus, the IMC can be substituted for the filter after the reference signal in the FX-LMS system, as shown in Figure 3. The IMC system is inserted before the secondary path dynamics, so that the effect of \(\mathbf{P}_{c}\) can be compensated without destabilizing the adaptive filtering system. If we roughly know the dynamics of the secondary path, there is no need to identify it offline beforehand, and the control system can be implemented immediately. The key point for this novel method is that the filtered-X LMS algorithm is not needed for the system with secondary path dynamics and the offline process for identification is not required if we have 'even' a rough model of the secondary path.  
The shaded region of Figure 3 indicates the IMC system for the secondary path dynamics \(\mathbf{P_{c}}\). The internal model controller \(Q\) is designed based on an estimated model \(\mathbf{\hat{P}_{c}}\). Let the value right before the internal model controller \(Q\) be \(t_{k}\). Then, the following equation holds.  
\[t_{k}=y_{k}-\left(t_{k}\mathbf{Q}\mathbf{P_{c}}-t_{k}\mathbf{Q}\mathbf{\hat{P}_{ c}}\right) \tag{9}\]  
The last two terms on the right-hand side are as follows.  
\[t_{k}\mathbf{Q}\mathbf{P_{c}}=y_{k} \tag{10a}\] \[\to t_{k}\mathbf{Q}=\frac{y_{k}^{*}}{\mathbf{P_{c}}}\] (10b) \[\to t_{k}=\frac{y_{k}^{*}}{\mathbf{Q}\mathbf{P_{c}}}\] (10c) \[t_{k}\mathbf{Q}\mathbf{\hat{P}_{c}}=\frac{y_{k}^{*}}{\mathbf{P_{c}}}\cdot \mathbf{\hat{P}_{c}}=\frac{\mathbf{\hat{P}_{c}}}{\mathbf{P_{c}}}y_{k}^{*} \tag{10d}\]  
From Equation (10b-d), Equation (9) becomes the following:  
\[\frac{y_{k}^{*}}{\mathbf{Q}\mathbf{P_{c}}}=y_{k}-y_{k}^{*}\bigg{(}1-\frac{ \mathbf{\hat{P}_{c}}}{\mathbf{P_{c}}}\bigg{)} \tag{11}\]  
By arranging Equation (11) with \({y_{k}^{*}}\), the difference between the original filter output \(y_{k}\) and the IMC compensated filter output \({y_{k}^{*}}\) can be obtained as follows.  
\[\frac{y_{k}^{*}}{y_{k}}=\frac{1}{1-\frac{\mathbf{\hat{P}_{c}}}{\mathbf{P_{c}} }+\frac{1}{\mathbf{\hat{P}_{c}}}} \tag{12}\]  
If an exact model of the secondary path dynamics can be obtained, \(\mathbf{\hat{P}_{c}}=\mathbf{P_{c}}\), and Equation (12) becomes the following:  
\[\frac{y_{k}^{*}}{y_{k}}=\mathbf{Q}\mathbf{P_{c}}=\frac{1}{\left(\lambda s+1 \right)^{r}} \tag{13}\]  
\(y_{k}\) and \({y_{k}^{*}}\) would be very close to each other after applying the IMC if the value \(\lambda\) can be selected properly, and the system instability that is caused by the secondary path dynamics would be decreased.  
Figure 3: Schematic of a new digital filtering system with LMS, based on the internal model control (IM-LMS 1).