The LMSFilter
implements an adaptive FIR filter
object that returns the filtered output, the error vector, and filter
weights. The LMS filter uses one of five different LMS algorithms.
To implement the adaptive FIR filter object:
Define and set up your adaptive FIR filter object. See Construction.
Call step
to implement the filter
according to the properties of dsp.LMSFilter
. The
behavior of step
is specific to each object in the
toolbox.
Note:
Starting in R2016b, instead of using the 
lms = dsp.LMSFilter
returns
an adaptive FIR filter object, lms
, that computes
the filtered output, filter error and the filter weights for a given
input and desired signal using the Least Mean Squares (LMS) algorithm.
lms = dsp.LMSFilter('
returns
an LMS filter object, PropertyName
', PropertyValue
,...)lms
, with each property set
to the specified value.
lms = dsp.LMSFilter(LEN,'
returns
an LMS filter object, PropertyName
',PropertyValue
,...)lms
, with the Length
property
set to LEN
, and other specified properties set
to the specified values.

Method to calculate filter weights Specify the method used to calculate filter weights as 

Length of FIR filter weights vector Specify the length of the FIR filter weights vector as a positive
integer. The default is 

How to specify adaptation step size Choose how to specify the adaptation step size factor as 

Adaptation step size Specify the adaptation step size factor as a nonnegative real
number. For convergence of the normalized LMS method, set the step
size greater than 

Leakage factor used in LMS filter Specify the leakage factor as a real number between 

Initial conditions of filter weights Specify the initial values of the FIR filter weights as a scalar
or vector of length equal to the 

Enable weight adaptation Specify when the LMS filter should adapt the filter weights.
By default, the value of this property is 

Enable weight reset Specify when the LMS filter should reset the filter weights.
By default, the value of this property is 

Reset trigger setting for filter weights Specify the event to reset the filter weights as 

Enable returning filter weights Specify how to output the adapted filter weights as one of the following:

maxstep  Maximum step size for LMS adaptive filter convergence 
msepred  Predicted meansquare error for LMS filter 
msesim  Meansquared error for LMS filter 
reset  Reset filter states for LMS filter 
step  Apply LMS adaptive filter to input 
Common to All System Objects  

clone  Create System object with same property values 
getNumInputs  Expected number of inputs to a System object 
getNumOutputs  Expected number of outputs of a System object 
isLocked  Check locked states of a System object (logical) 
release  Allow System object property value changes 
This filter's algorithm is defined by the following equations.
$$\begin{array}{c}y(n)={w}^{T}(n1)u(n)\\ e(n)=d(n)y(n)\\ w(n)=\alpha w(n1)+f(u(n),e(n),\mu )\end{array}$$
The various LMS adaptive filter algorithms available in this System object are defined as:
LMS:
$$f(u(n),e(n),\mu )=\mu e(n){u}^{*}(n)$$
Normalized LMS:
$$f(u(n),e(n),\mu )=\mu e(n)\frac{{u}^{\ast}(n)}{\epsilon +{u}^{H}(n)u(n)}$$
SignError LMS:
$$f(u(n),e(n),\mu )=\mu sign(e(n))u*(n)$$
SignData LMS:
$$f(u(n),e(n),\mu )=\mu e(n)sign(u(n))$$
where u(n) is real.
SignSign LMS:
$$f(u(n),e(n),\mu )=\mu sign(e(n))sign(u(n))$$
where u(n) is real.
The variables are as follows:
Variable  Description 

n  The current time index 
u(n)  The vector of buffered input samples at step n 
u*(n)  The complex conjugate of the vector of buffered input samples at step n 
w(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 
α  The leakage factor (0 < α ≤ 1) 