Embedded Target for Texas Instruments C6000 DSPs | ![]() ![]() |
Filter a scalar input using least-mean-square adaptive filtering
Library
Description
The LMS Adaptive FIR block performs least-mean-square (LMS) adaptive filtering. This filter is implemented using a direct form structure.
The following constraints apply to the inputs and outputs of this block:
This block performs LMS adaptive filtering according to the equations
For this block, the input and the output
are defined by
which combined with the first two equations, result in the following equations that this block follows:
and
must be produced externally to the LMS Adaptive FIR block. See Examples below for a sample model where this is done.
The LMS Adaptive FIR block supports discrete sample times and both little-endian and big-endian code generation.
Dialog Box
Algorithm
In simulation, the LMS Adaptive FIR block is equivalent to the TMS320C62x DSP Library assembly code function DSP_firlms2
. During code generation, this block calls the DSP_firlms2
routine to produce optimized code.
Examples
The following model uses the LMS Adaptive FIR block.
The portion of the model enclosed by the dashed line produces the signal and feeds it back into the LMS Adaptive FIR block. The inputs to this region are
and the desired signal
, and the output of this region is the vector of filter taps
. Thus this region of the model acts as a canonical LMS adaptive filter. For example, compare this region to the
adaptlms
function in the Filter Design Toolbox. adaptlms
performs canonical LMS adaptive filtering and has the same inputs and output as the outlined section of this model.
To use the LMS Adaptive FIR block you must create the input in some way similar to the one shown here. You must also provide the signals
and
. This model simulates the desired signal
by feeding
into a digital filter block. You can simulate your desired signal in a similar way, or you may bring
in from the workspace with a From Workspace or codec block.
![]() | General Real FIR | Matrix Multiply | ![]() |