Contents

dsp.FilteredXLMSFilter System object

Package: dsp

Filtered XLMS filter

Description

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.

Construction

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

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

H = dsp.FilteredXLMSFilter(LEN,'PropertyName',PropertyValue,...) returns a FilteredXLMSFilter System object, H, 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].

Properties

Length

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.

StepSize

Adaptation step size

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

LeakageFactor

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.

SecondaryPathCoefficients

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.

SecondaryPathEstimate

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 tunable.

InitialCoefficients

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.

LockCoefficients

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.

Methods

cloneCreate Filtered-X LMS filter object with same property values
isLockedLocked status for input attributes and nontunable properties
msesimMean-square error for Filtered-X LMS filter
releaseAllow property value and input characteristics changes
resetReset filter states for Filtered-X LMS filter
stepApply Filtered-X LMS filter to input

Examples

Active noise control of a random noise signal

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;
ha = dsp.FilteredXLMSFilter(32, 'StepSize', mu, 'LeakageFactor', ...
     1, 'SecondaryPathCoefficients', b);
[y,e] = step(ha,x,d);

Plot the results:

plot(1:1000,d,'b',1:1000,e,'r');
title('Active Noise Control of a Random Noise Signal');
legend('Original','Attenuated');
xlabel('Time Index'); ylabel('Signal Value');  grid on;

References

[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.

Was this topic helpful?