Output, error, and weights using Block LMS adaptive algorithm
The BlockLMSFilter object computes output, error, and weights using the Block LMS adaptive algorithm.
To compute the output, error, and weights:
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.
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.
Length of FIR filter weights vector
Specify the length of the FIR filter weights vector as a positive integer scalar. The default is 32.
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.
Source of adaptation step size
Choose to specify the adaptation step size factor as Property or Input port. The default is Property.
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.
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.
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.
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.
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.
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.
Output filter weights
Set this property to true to output the adapted filter weights. The default is true.
|clone||Create adaptive block LMS filter object with same property values|
|getNumInputs||Number of expected inputs to step method|
|getNumOutputs||Number of outputs of step method|
|isLocked||Locked status for input attributes and nontunable properties|
|msepred||Predicted mean-square error for Block LMS filter|
|msesim||Mean-square error for Block LMS filter|
|release||Allow property value and input characteristics changes|
|reset||Reset internal states of adaptive FIR filter object|
|step||Filter inputs using Block LMS algorithm|
Remove noise using the Block LMS adaptive algorithm:
hblms = dsp.BlockLMSFilter(10, 5); hblms.StepSize = 0.01; hblms.WeightsOutputPort = false; hfilt = dsp.DigitalFilter; hfilt.TransferFunction = 'FIR (all zeros)'; 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');
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.