RLS Filter
Compute filtered output, filter error, and filter weights for given input and desired signal using RLS adaptive filter algorithm
Libraries:
DSP System Toolbox /
Filtering /
Adaptive Filters
Description
The RLS Filter block recursively computes the least squares estimate (RLS) of the FIR filter weights. The block estimates the filter weights (also known as the coefficients) needed to minimize the error e(n) between the output signal y(n) and the desired signal d(n). For more information, see Algorithms. For more information on adaptive filters, see Overview of Adaptive Filters and Applications.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Multidimensional Signals 

VariableSize Signals 

Algorithms
The RLS filter is expressed in matrix form as
$$\begin{array}{l}k(n)=\frac{{\lambda}^{1}P(n1)u(n)}{1+{\lambda}^{1}{u}^{H}(n)P(n1)u(n)}\hfill \\ y(n)=w(n1)u(n)\hfill \\ e(n)=d(n)y(n)\hfill \\ w(n)=w(n1)+{k}^{H}(n)e(n)\hfill \\ P(n)={\lambda}^{1}P(n1){\lambda}^{1}k(n){u}^{H}(n)P(n1)\hfill \end{array}$$
where λ^{−1} denotes the reciprocal of the exponential weighting factor.
The variables are as follows:
Variable  Description 

n  The current time index 
u(n)  The vector of buffered input samples at step n 
P(n)  The inverse covariance matrix at step n 
k(n)  The gain vector at step n 
$$w(n)$$  The vector of filtertap estimates at step n 
y(n)  The filtered output at step n 
e(n)  The estimation error at step n 
d(n)  The desired response at step n 
λ  The forgetting factor 
The implementation of the algorithm in the block is optimized by exploiting the symmetry of the inverse covariance matrix P(n). This decreases the total number of computations by a factor of two.
References
[1] Hayes, M.H. Statistical Digital Signal Processing and Modeling. New York: John Wiley & Sons, 1996.
Extended Capabilities
Version History
Introduced before R2006a