| Target Support Package™ TC6 | ![]() |
C64x DSP Library — Filtering
The C64x 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:
The scalar input
must be a Q.15
data type.
The scalar input
must be a Q.15
data type.
The scalar output
is a Q1.30 data
type.
The output
has length equal
to the number of filter taps and is a Q.15 data type. The number of
filter taps must be a positive integer that is a multiple of four.
This block performs LMS adaptive filtering according to the equations
![]()
and
![]()
where
designates the
time step.
is a vector composed
of the current and last
scalar inputs.
is the desired
signal. The output
converges to
as the filter converges.
is a vector composed
of the current set of filter taps.
is the error, or
.
is the step size.
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 supports little-endian code generation only.
The rounding mode used is floor, and the saturation mode is wrap. All intermediate products have s32Q30 data type. The update equation is as follows:

where N is the number of filter taps.
Note This block does not implement a leaky LMS algorithm, so comparison to the leakage factor of the LMS block of the Signal Processing Blockset™ software is not appropriate. |

Designate the number of filter taps. The number of taps must be a positive integer that is also a multiple of four.
Enter the initial value of the filter taps.
If you select this option, the filter taps are produced as output H. If you do not select this option, H is suppressed.
In simulation, the LMS Adaptive FIR block is equivalent to the TMS320C64x DSP Library assembly code function DSP_firlms2. During code generation, this block calls the DSP_firlms2 routine to produce optimized code.
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 adaptfilt.lms function
in Filter Design Toolbox™ software. adaptfilt.lms 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.
![]() | C64x General Real FIR | C64x Matrix Multiply | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |