dsphdl.LMSFilter
Description
The dsphdl.LMSFilter
System object™ estimates the filter weights and minimizes the error between a desired signal
and an observed signal using the mean square error (MSE) criteria. The System object adapts its weights until the error between the data and the desired data is
minimal. The System object accepts scalar and vector inputs of type real and complex.
You can use this System object for various applications, such as noise cancellation, system identification, and inverse system modeling. The System object provides an architecture suitable for HDL code generation and hardware deployment. The System object provides an architecture suitable for HDL code generation and hardware deployment.
To filter input data with an LMS filter:
Create the
dsphdl.LMSFilter
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Note
You can also generate HDL code for this hardware-optimized algorithm, without creating a MATLAB® script, by using the DSP HDL IP Designer app. The app provides the same interface and configuration options as the System object.
Creation
Description
creates an LMS
filter System object, LMSFilter
= dsphdl.LMSFilterLMSFilter
, with default properties.
sets properties by using one or more name-value arguments. For example,
LMSFilter
= dsphdl.LMSFilter(Name=Value
)FilterLength=64
sets the filter length to
64
.
Properties
Usage
Syntax
Description
[
returns the LMS filtered data, dataOut
,validOut
,error
,weights
]
= LMSFilt(dataIn
,desiredIn
,validIn
,adapt
)dataOut
and also returns error,
error
, and weights weights
data, for inputs,
dataIn
, desiredIn
, and
adapt
, when validIn
is
true
. validIn
and validOut
are logical scalars that indicate the validity of the input and output signals,
respectively.
To use this syntax, set the AdaptInputPort
,
ErrorOutputPort
, and WeightsOutputPort
properties to true
. For example:
LMSFilt = dsphdl.LMSFilter(___,AdaptInputPort=true, ... ErrorOutputPort=true, ... WeightsOutputPort=true); [dataOut,validOut,error,weights] = LMSFilt(dataIn,validIn,adapt)
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
References
[1] Hayes, M.H. Statistical Digital Signal Processing and Modeling. New York: John Wiley & Sons, 1996.
Extended Capabilities
Version History
Introduced in R2023a