FIR adaptive filter that uses householder (RLS)
adaptfilt.hrls
will be removed in a future
release. Use dsp.RLSFilter
instead.
ha = adaptfilt.hrls(l,lambda,sqrtinvcov,coeffs,states)
ha = adaptfilt.hrls(l,lambda,sqrtinvcov,coeffs,states)
constructs
an FIR householder 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
.
Entries in the following table describe the input arguments
for adaptfilt.hrls
.
Input Argument  Description 

 Adaptive filter length (the number of coefficients or
taps) and it must be a positive integer. 
 RLS forgetting factor. This is a scalar and should lie
in the range (0, 1]. 
 Squareroot of the inverse of the sliding window input signal covariance matrix. This square matrix should be fullranked. 
 Vector of initial filter coefficients. It must be a length 
 Vector of initial filter states. It must be a length 
Since your adaptfilt.hrls
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.hrls
objects.
To show you the properties that apply, this table lists and describes
each property for the affine projection filter object.
Name  Range  Description 

 None  Defines the adaptive filter algorithm the object uses during adaptation 
 Vector of elements  Vector containing the initial filter coefficients. It
must be a length 
 Any positive integer  Reports the length of the filter, the number of coefficients or taps 
 Scalar  RLS forgetting factor. This is a scalar and should lie
in the range (0, 1]. Same as input argument 
 Vector of size (  Empty when you construct the object, this gets populated after you run the filter. 

 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. 
 Matrix of doubles  Square root of the inverse of the sliding window input signal covariance matrix. This square matrix should be fullranked. 
 Vector of elements, data type double  Vector of the adaptive filter states. 
Use 500 iterations of an adaptive filter object to identify a 32coefficient FIR filter system. Both the example code and the resulting figure show the successful filter identification through adaptive filter processing.
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 G0 = sqrt(10)*eye(32); % Initial sqrt correlation matrix inverse lam = 0.99; % RLS forgetting factor ha = adaptfilt.hrls(32,lam,G0); [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'); grid on; xlabel('Coefficient #'); ylabel('Coefficient Value');