DSP Blockset Previous page   Next Page
LMS Filter

Compute the filtered output, filter error, and filter weights for a given input and desired signal using the LMS adaptive filter algorithm

Library

Filtering / Adaptive Filters

Description

The LMS Filter block is capable of implementing an adaptive FIR filter using five different algorithms. 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 is the estimate of the desired signal. The output of the Output port can be sample or frame based. The Error port outputs the result of subtracting the output signal from the desired signal.

If you select LMS for the Algorithm parameter, the block calculates the filter weights using the least mean-square (LMS) algorithm. This algorithm is defined by the following equations.

The weight update function, for the LMS algorithm, is defined as

The variables are as follows.

Variable
Description
n
The current time index
u(n)
The vector of buffered input samples at step n

The vector of filter weight 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 adaptation step size

If you select Normalized LMS for the Algorithm parameter, the block calculates the filter weights using the normalized LMS algorithm. This algorithm is defined by the following equations.

The weight update function, for the normalized LMS algorithm, is defined as

To overcome potential numerical instability in the update of the weights, a small positive constant (a = 1e-10) has been added in the denominator.

If you select Sign-Error LMS for the Algorithm parameter, the block calculates the filter weights using the LMS algorithm equations. However, each time the block updates the weights, it replaces the error term, , with +1 if the error term is positive or -1 if the error term is negative.

If you select Sign-Data LMS for the Algorithm parameter, the block calculates the filter weights using the LMS algorithm equations. However, each time the block updates the weights, it replaces each sample of the input vector, , with +1 if the input sample is positive or -1 is the input sample is negative.

If you select Sign-Sign LMS for the Algorithm parameter, the block calculates the filter weights using the LMS algorithm equations. However, each time the block updates the weights, it replaces the error term, , with +1 if the error term is positive or -1 is the error term is negative. It also replaces each sample of the input vector, , with +1 if the input sample is positive or -1 is the input sample is negative.

Use the Filter length parameter to specify the length of the filter weights vector.

The Step-size (mu) parameter corresponds to µ in the equations. For convergence of the normalized LMS equations, 0<µ<2. You can either specify a step size using the input port, Step-size, or enter a value in the Block Parameters: LMS Filter dialog box.

Use the Leakage factor (0 to 1) parameter to specify the leakage factor,, where , in the leaky LMS algorithm shown below.

If you select LMS from the Algorithm list, the weight update function in the above equation is the LMS weight update function. If you select Normalized LMS from the Algorithm list, the weight update function in the above equation is the normalized LMS weight update function.

Enter the initial filter weights, , as a vector or a scalar in the Initial value of filter weights text box. 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

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:

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.

Dialog Box

Algorithm
Choose the algorithm used to calculate the filter weights.
Filter length
Enter the length of the FIR filter weights vector.
Specify step-size via
Select Dialog to enter a value for step-size in the Block parameters: LMS Filter dialog box. Select Input port to specify step-size using the Step-size input port.
Step-size (mu)
Enter the step-size. Tunable.
Leakage factor (0 to 1)
Enter the leakage factor, . Tunable.
Initial value of filter weights
Specify the initial values of the FIR filter weights.
Enable/disable adaptation via input port
Select this check box to enable the Adapt input port.
Reset input
Select this check box to enable the Reset input port.
Output filter weights
Select this check box to export the filter weights from the Wts port.

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
RLS Filter
DSP Blockset
Block LMS Filter
DSP Blockset
Fast Block LMS Filter
DSP Blockset

See "Adaptive Filters for related information.


Previous page  LMS Adaptive Filter LPC to LSF/LSP Conversion Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS