This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dsp.FilteredXLMSFilter System object

Package: dsp

Filtered XLMS filter


The dsp.FilteredXLMSFilter computes output, error and coefficients using Filtered-X Least Mean Squares FIR adaptive filter.

To implement the adaptive FIR filter object:

  1. Define and set up your adaptive FIR filter object. See Construction.

  2. Call step to implement the filter according to the properties of dsp.FilteredXLMSFilter. The behavior of step is specific to each object in the toolbox.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


fxlms = dsp.FilteredXLMSFilter returns a filtered-x Least Mean Square FIR adaptive filter System object, fxlms. This System object is used to compute the filtered output and the filter error for a given input and desired signal.

fxlms = dsp.FilteredXLMSFilter('PropertyName', PropertyValue,...) returns a FilteredXLMSFilter System object, fxlms, with each specified property set to the specified value.

fxlms= dsp.FilteredXLMSFilter(LEN,'PropertyName',PropertyValue,...) returns a FilteredXLMSFilter System object, fxlms, with the Length property set to LEN, and other specified properties set to the specified values. For the algorithm on how to implement this filter, refer to [1], [2].



Length of filter coefficients vector

Specify the length of the FIR filter coefficients vector as a positive integer value. This property is nontunable.

The default value is 10.


Adaptation step size

Specify the adaptation step size factor as a positive numeric scalar. The default value is 0.1. This property is tunable.


Adaptation leakage factor

Specify the leakage factor used in a leaky adaptive filter as a numeric value between 0 and 1, both inclusive. When the value is less than 1, the System object implements a leaky adaptive algorithm. The default value is 1, providing no leakage in the adapting method. This property is tunable.


Coefficients of the secondary path filter model

Specify the coefficients of the secondary path filter model as a numeric vector. The secondary path connects the output actuator and the error sensor. The default value is a vector that represents the coefficients of a 10th-order FIR lowpass filter. This property is tunable.


An estimate of the secondary path filter model

Specify the estimate of the secondary path filter model as a numeric vector. The secondary path connects the output actuator and the error sensor. The default value equals to the SecondayPathCoefficients property value. This property is not tunable.


Initial coefficients of the filter

Specify the initial values of the FIR adaptive filter coefficients as a scalar or a vector of length equal to the value of the Length property. The default value is 0.

This property is tunable.


Locked status of the coefficient updates

Specify whether to lock the filter coefficient values. By default, the value of this property is false, and the object continuously updates the filter coefficients. If this property is set to true, the filter coefficients do not update and their values remain the same.

This property is tunable.


msesimMean-square error for Filtered-X LMS filter
resetReset filter states for Filtered-X LMS filter
stepApply Filtered-X LMS filter to input
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Generate noise, create FIR primary path system model, generate observation noise, filter the primary path system model output with added noise, and create FIR secondary path system model.

x  = randn(1000,1);
g  = fir1(47,0.4);
n  = 0.1*randn(1000,1);
d  = filter(g,1,x) + n;
b  = fir1(31,0.5);

Use the Filtered-X LMS Filter to compute the filtered output and the filter error for the input and the signal to be cancelled.

mu = 0.008;
fxlms = dsp.FilteredXLMSFilter(32, 'StepSize', mu, 'LeakageFactor', ...
     1, 'SecondaryPathCoefficients', b);
[y,e] = fxlms(x,d);

Plot the results.

title('Active Noise Control of a Random Noise Signal');
xlabel('Time Index'); ylabel('Signal Value');  grid on;


[1] Kuo, S.M. and Morgan, D.R. Active Noise Control Systems: Algorithms and DSP Implementations. New York: John Wiley & Sons, 1996.

[2] Widrow, B. and Stearns, S.D. Adaptive Signal Processing. Upper Saddle River, N.J: Prentice Hall, 1985.

Extended Capabilities

Introduced in R2013b

Was this topic helpful?