Documentation

Contents

dsp.BlockLMSFilter System object

Package: dsp

Output, error, and weights using Block LMS adaptive algorithm

Description

The BlockLMSFilter object computes output, error, and weights using the Block LMS adaptive algorithm.

To compute the output, error, and weights:

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

  2. Call step to compute the output, error, and weights according to the properties of dsp.BlockLMSFilter. The behavior of step is specific to each object in the toolbox.

Construction

H=dsp.BlockLMSFilter returns an adaptive FIR filter, H, that filters the input signal and computes filter weights based on the Block Least Mean Squares (LMS) algorithm.

H=dsp.BlockLMSFilter('PropertyName',PropertyValue,...) returns an adaptive FIR filter, H, with each specified property set to the specified value.

H=dsp.BlockLMSFilter(length,blocksize,'PropertyName',...
PropertyValue,...)
returns an adaptive FIR filter, H, with the Length property set to length, the BlockSize property set to blocksize, and other specified properties set to the specified values.

Properties

Length

Length of FIR filter weights vector

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

BlockSize

Number of samples acquired before weight adaptation

Specify the number of samples of the input signal to acquire before the object updates the filter weights. The input frame length must be an integer multiple of the block size. The default is 32.

StepSizeSource

Source of adaptation step size

Choose to specify the adaptation step size factor as Property or Input port. The default is Property.

StepSize

Adaptation step size

Specify the adaptation step size factor as a scalar, nonnegative numeric value. The default is 0.1. This property applies only when you set the StepSizeSource property to 'Property'. This property is tunable.

LeakageFactor

Leakage factor used in Leaky LMS algorithm

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

InitialWeights

Initial values of filter weights

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

AdaptInputPort

Additional input to enable adaptation of filter weights.

Specify when the object should adapt the filter weights. By default, the value of this property is false, and the filter continuously updates the filter weights. When this property is set to true, an adaptation control input is provided to the step method. If the value of this input is nonzero, the filter continuously updates the filter weights. If the input is zero, the filter weights remain at their current value.

WeightsResetInputPort

Additional input to enable weights reset

Specify whether the FIR filter can reset the filter weights. By default, the value of this property is false, and the object does not reset the weights. When this property is set to true, a reset control input is provided to the step method, and the WeightsResetCondition property applies. The object resets the filter weights based on the values of the WeightsResetCondition property and the reset input to the step method.

WeightsResetCondition

Condition that triggers the resetting of filter weights

Specify the event to reset the filter weights as one of Rising edge, Falling edge, Either edge, or Non-zero. The object resets the filter weights based on the values of this property and the reset input to the step method. This property applies only when you set the WeightsResetInputPort property to true. The default is Non-zero.

WeightsOutputPort

Output filter weights

Set this property to true to output the adapted filter weights. The default is true.

Methods

cloneCreate adaptive block LMS filter object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
msepredPredicted mean-square error for Block LMS filter
msesimMean-square error for Block LMS filter
releaseAllow property value and input characteristics changes
resetReset internal states of adaptive FIR filter object
stepFilter inputs using Block LMS algorithm

Examples

expand all

Remove Noise Using Block LMS Adaptive Algorithm

 hblms = dsp.BlockLMSFilter(10,5);
 hblms.StepSize = 0.01;
 hblms.WeightsOutputPort = false;
 hfilt = dsp.FIRFilter;
 hfilt.Numerator = fir1(10,[.5, .75]);
 x = randn(1000,1); % Noise
 d = step(hfilt,x) + sin(0:.05:49.95)'; % Noise + Signal
 [y, err] = step(hblms, x, d);
 subplot(2,1,1);
 plot(d);
 title('Noise + Signal');
 subplot(2,1,2);
 plot(err);
 title('Signal');

Algorithms

This object implements the algorithm, inputs, and outputs described on the Block LMS Filter block reference page. The object properties correspond to the block parameters.

Was this topic helpful?