| DSP Blockset | ![]() |
Compute the filtered output, filter error, and filter weights for a given input and desired signal using the RLS adaptive filter algorithm
Library
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, or coefficients, needed to convert the input signal into the desired signal. Connect the signal you want to filter to the Input port. This input can be a sample-based or frame-based signal. Connect the signal you want to model to the Desired port. The desired signal must have the same data type, signal type (sample or frame based), and dimensions as the input signal. The Output port outputs the filtered input signal, which can be sample or frame based. The Error port outputs the result of subtracting the output signal from the desired signal.
The corresponding RLS filter is expressed in matrix form as
where
-1 denotes the reciprocal of the exponential weighting factor. The variables are as follows
The implementation of the algorithm in the block is optimized by exploiting the symmetry of the inverse correlation matrix P(n). This decreases the total number of computations by a factor of two.
Use the Filter length parameter to specify the length of the filter weights vector.
The Forgetting factor (0 to 1) parameter corresponds to
in the equations. It specifies how quickly the filter "forgets" past sample information. Setting
=1 specifies an infinite memory. Typically,

, where L is the filter length. You can specify a forgetting factor using the input port, Lambda, or enter a value in the Forgetting factor (0 to 1) parameter in the Block Parameters: RLS Filter dialog box.
Enter the initial filter weights,
, as a vector or a scalar for the Initial value of filter weights parameter. If you enter a scalar, the block uses the scalar value to create a vector of filter weights. This vector has length equal to the filter length and all of its values are equal to the scalar value.
where
is specified by the Initial input variance estimate parameter.
If you select the Enable/disable adaptation via input port check box, an Adapt port appears on the block. When the input to this port is nonzero, the block continuously updates the filter weights. When the input to this port is zero, the filter weights remain at their current values.
If you want to reset the value of the filter weights to their initial values, use the Reset input parameter. The block resets the filter weights whenever a reset event is detected at the Reset port. The reset signal rate must be the same rate as the data signal input.
From the Reset input list, select None to disable the Reset port. To enable the Reset port, select one of the following from the Reset input list:
Either edge -- Triggers a reset operation when the Reset input is a Rising edge or Falling edge (as described above)
Non-zero sample -- Triggers a reset operation at each sample time that the Reset input is not zero
Note
When running simulations in the Simulink MultiTasking mode, sample-based reset signals have a one-sample latency, and frame-based reset signals have one frame of latency. Thus, there is a one-sample or one-frame delay between the time the block detects a reset event, and when it applies the reset. For more information on latency and the Simulink tasking modes, see Excess Algorithmic Delay (Tasking Latency) and the topic called The Simulation Parameters Dialog Box in the Simulink documentation.
|
Select the Output filter weights check box to create a Wts port on the block. For each iteration, the block outputs the current updated filter weights from this port.
Example
The rlsdemo demo illustrates a noise cancellation system built around the RLS Filter block.
Dialog Box
Dialog to enter a value for the forgetting factor in the Block parameters: RLS Filter dialog box. Select Input port to specify the forgetting factor using the Lambda input port.
0 


1. A value of 1 specifies an infinite memory. Tunable.
References
Hayes, M.H. Statistical Digital Signal Processing and Modeling. New York: John Wiley & Sons, 1996.
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Kalman Adaptive Filter |
DSP Blockset |
| LMS Filter |
DSP Blockset |
| Block LMS Filter |
DSP Blockset |
| Fast Block LMS Filter |
DSP Blockset |
See "Adaptive Filters for related information.
| RLS Adaptive Filter | RMS | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |