| Filter Design Toolbox™ | ![]() |
FIR adaptive filter that uses sliding window fast transversal LMS
ha = adaptfilt.swftf(l,delta,blocklen,gamma,gstates,
dstates,...coeffs,states)
ha = adaptfilt.swftf(l,delta,blocklen,gamma,gstates,
dstates,...coeffs,states) constructs a sliding
window fast transversal least squares adaptive filter ha.
Entries in the following table describe the input arguments for adaptfilt.swftf.
Input Argument | Description |
|---|---|
l | Adaptive filter length (the number of coefficients or taps) and it must be a positive integer. l defaults to 10. |
delta | Soft-constrained initialization factor. This scalar should be positive and sufficiently large to maintain stability. delta defaults to 1. |
blocklen | Block length of the sliding window. This must be an integer at least as large as the filter length l, which is the default value. |
gamma | Conversion factor. gamma defaults to the matrix [1 -1] that specifies soft-constrained initialization. |
gstates | States of the Kalman gain updates. gstates defaults to a zero vector of length (l + blocklen - 1). |
dstates | Desired signal states of the adaptive filter. dstates defaults to a zero vector of length equal to (blocklen - 1). For a default object, dstates is (l-1). |
coeffs | Vector of initial filter coefficients. It must be a length l vector. coeffs defaults to length l vector of all zeros. |
states | Vector of initial filter states. states defaults to a zero vector of length equal to (l + blocklen - 2). |
Since your adaptfilt.swftf filter is an object, it has properties that define its behavior in operation. Note that many of the properties are also input arguments for creating adaptfilt.swftf objects. To show you the properties that apply, this table lists and describes each property for the filter object.
Name | Range | Description |
|---|---|---|
Algorithm | None | Defines the adaptive filter algorithm the object uses during adaptation |
BkwdPredictions | Returns the predicted samples generated during adaptation. Refer to [2] in the bibliography for details about linear prediction. | |
BlockLength | Block length of the sliding window. This must be an integer at least as large as the filter length l, which is the default value. | |
Coefficients | Vector of elements | Vector containing the initial filter coefficients. It must be a length l vector where l is the number of filter coefficients. coeffs defaults to length l vector of zeros when you do not provide the argument for input. |
ConversionFactor | Conversion factor. Called gamma when it is an input argument, it defaults to the matrix [1 -1] that specifies soft-constrained initialization. | |
DesiredSignal States | Desired signal states of the adaptive filter. dstates defaults to a zero vector with length equal to (blocklen - 1). | |
FilterLength | Any positive integer | Reports the length of the filter, the number of coefficients or taps |
FwdPrediction | Contains the predicted values for samples during adaptation. Compare these to the actual samples to get the error and power. | |
InitFactor | Soft-constrained initialization factor. This scalar should be positive and sufficiently large to prevent an excessive number of Kalman gain rescues. delta defaults to one. | |
KalmanGain | Empty when you construct the object, this gets populated after you run the filter. | |
KalmanGainStates | Contains the states of the Kalman gains for the adaptive algorithm. Initialized to a vector of double data type entries. | |
PersistentMemory | false or true | Determine whether the filter states get restored to their starting values for each filtering operation. The starting values are the values in place when you create the filter if you have not changed the filter since you constructed it. PersistentMemory returns to zero any state that the filter changes during processing. States that the filter does not change are not affected. Defaults to false. |
States | Vector of elements, data type double | Vector of the adaptive filter states. states defaults to a vector of zeros which has length equal to (l + projectord - 2). |
Over 500 iterations, perform a system identification of a 32-coefficient FIR filter.
x = randn(1,500); % Input to the filter
b = fir1(31,0.5); % FIR system to be identified
n = 0.1*randn(1,500); % Observation noise signal
d = filter(b,1,x)+n; % Desired signal
L = 32; % Adaptive filter length
del = 0.1; % Soft-constrained
% initialization factor
N = 64; % block length
ha = adaptfilt.swftf(L,del,N);
[y,e] = filter(ha,x,d);
subplot(2,1,1); plot(1:500,[d;y;e]);
title('System Identification of an FIR Filter');
legend('Desired','Output','Error');
xlabel('Time Index'); ylabel('Signal Value');
subplot(2,1,2); stem([b.',ha.Coefficients.']);
legend('Actual','Estimated');
xlabel('Coefficient #'); ylabel('Coefficient Value');
grid on;Review the figure for the results of the example. When you evaluate the example you should get the same results, within the differences in the random noise signal you use.

adaptfilt.ftf, adaptfilt.swrls, adaptfilt.ap, adaptfilt.apru
Slock, D.T.M., and T. Kailath, "A Modular Prewindowing Framework for Covariance FTF RLS Algorithms," Signal Processing, vol. 28, pp. 47-61, 1992
Slock, D.T.M., and T. Kailath, "A Modular Multichannel Multi-Experiment Fast Transversal Filter RLS Algorithm," Signal Processing, vol. 28, pp. 25-45, 1992
![]() | adaptfilt.ss | adaptfilt.swrls | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |