Beruflich Dokumente
Kultur Dokumente
rls
Recursive least-squares FIR adaptive filter
Syntax
ha = adaptfilt.rls(l,lambda,invcov,coeffs,states)
Description
ha = adaptfilt.rls(l,lambda,invcov,coeffs,states) constructs an FIR direct form RLS adaptive filter ha.
For information on how to run data through your adaptive filter object, see the Adaptive Filter Syntaxes
section of the reference page for filter.
Input Arguments
Entries in the following table describe the input arguments for adaptfilt.rls.
Input Argument
Description
lambda
RLS forgetting factor. This is a scalar and should lie in the range (0, 1]. lambda
defaults to 1.
invcov
Inverse of the input signal covariance matrix. For best performance, you
should initialize this matrix to be a positive definite matrix.
coeffs
states
Vector of initial filter states for the adaptive filter. It must be a length l-1 vector.
states defaults to a length l-1 vector of zeros.
Properties
Since your adaptfilt.rls 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.rls objects. To show you the
properties that apply, this table lists and describes each property for the filter object.
Name
Range
Description
Algorithm
None
Coefficients
Vector containing l
elements
FilterLength
Any positive integer Reports the length of the filter, the number of
coefficients or taps. Remember that filter length is filter
order + 1.
ForgettingFactor
Scalar
ForgettingFactor
Scalar
InvCov
KalmanGain
PersistentMemory
false or true
States
Double array
Examples
System Identification of a 32-coefficient FIR filter over 500 adaptation iterations.
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
P0 = 10*eye(32); % Initial sqrt correlation matrix inverse
lam = 0.99;
% RLS forgetting factor
ha = adaptfilt.rls(32,lam,P0);
[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;
In this example of adaptive filtering using the RLS algorithm to update the filter coefficients for each iteration,
the figure shown reveals the fidelity of the derived filter after adaptation.
See Also
adaptfilt.hrls | adaptfilt.hswrls | adaptfilt.qrdrls