Accelerating the pace of engineering and science

# adaptfilt.apru

FIR adaptive filter that uses recursive matrix updating

## Syntax

ha = adaptfilt.apru(l,step,projectord,offset,coeffs,states,
...errstates,epsstates)

## Description

ha = adaptfilt.apru(l,step,projectord,offset,coeffs,states,
...errstates,epsstates)
constructs an affine projection FIR adaptive filter ha using recursive matrix updating.

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.apru.

Input Argument

Description

l

Adaptive filter length (the number of coefficients or taps). It must be a positive integer. l defaults to 10.

step

Affine projection step size. This is a scalar that should be a value between zero and one. Setting step equal to one provides the fastest convergence during adaptation. step defaults to 1.

projectord

Projection order of the affine projection algorithm. projectord defines the size of the input signal covariance matrix and defaults to two.

offset

Offset for the input signal covariance matrix. You should initialize the covariance matrix to a diagonal matrix whose diagonal entries are equal to the offset you specify. offset should be positive. offset defaults to one.

coeffs

Vector containing the initial filter coefficients. It must be a length l vector, the number of filter coefficients. coeffs defaults to length l vector of zeros when you do not provide the argument for input.

states

Vector of the adaptive filter states. states defaults to a vector of zeros which has length equal to (l + projectord - 2).

errstates

Vector of the adaptive filter error states. errstates defaults to a zero vector with length equal to (projectord - 1).

epsstates

Vector of the epsilon values of the adaptive filter. epsstates defaults to a vector of zeros with (projectord - 1) elements.

## Properties

Since your adaptfilt.apru 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.apru objects. To show you the properties that apply, this table lists and describes each property for the affine projection filter object.

Name

Range

Description

Algorithm

None

Defines the adaptive filter algorithm the object uses during adaptation

FilterLength

Any positive integer

Reports the length of the filter, the number of coefficients or taps

ProjectionOrder

1 to as large as needed.

Projection order of the affine projection algorithm. ProjectionOrder defines the size of the input signal covariance matrix and defaults to two.

OffsetCov

Matrix of values

Contains the offset covariance matrix

Coefficients

Vector of elements

Vector containing the initial filter coefficients. It must be a length l vector, the number of filter coefficients. coeffs defaults to length l vector of zeros when you do not provide the argument for input.

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).

ErrorStates

Vector of elements

Vector of the adaptive filter error states. errstates defaults to a zero vector with length equal to (projectord - 1).

EpsilonStates

Vector of elements

Vector of the epsilon values of the adaptive filter. epsstates defaults to a vector of zeros with (projectord - 1) elements.

StepSize

Any scalar from zero to one, inclusive

Specifies the step size taken between filter coefficient updates

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. PersistentMemory returns to zero any state that the filter changes during processing. States that the filter does not change are not affected. Defaults to true.

## Examples

Demonstrate quadrature phase shift keying (QPSK) adaptive equalization using a 32-coefficient FIR filter. This example runs the adaptation process for 1000 iterations.

```D  = 16;                        % Number of samples of delay
b  = exp(1j*pi/4)*[-0.7 1];      % Numerator coefficients of channel
a  = [1 -0.7];                  % Denominator coefficients of channel
ntr= 1000;                      % Number of iterations
s  = sign(randn(1,ntr+D)) + 1j*sign(randn(1,ntr+D)); % Baseband
n  = 0.1*(randn(1,ntr+D) + 1j*randn(1,ntr+D));  % Noise signal
r  = filter(b,a,s)+n;     % Received signal
x  = r(1+D:ntr+D); % Input signal (received signal)
d  = s(1:ntr);     % Desired signal (delayed QPSK signal)
mu = 0.1;                      % Step size
po = 4;                        % Projection order
offset = 0.05;                    % Offset
ha = adaptfilt.apru(32,mu,po,offset); [y,e] = filter(ha,x,d);
subplot(2,2,1); plot(1:ntr,real([d;y;e])); title('In-Phase Components');
legend('Desired','Output','Error');
xlabel('Time Index'); ylabel('Signal Value');
subplot(2,2,2); plot(1:ntr,imag([d;y;e])); title('Quadrature Components');
legend('Desired','Output','Error');
xlabel('Time Index'); ylabel('Signal Value');
subplot(2,2,3); plot(x(ntr-100:ntr),'.'); axis([-3 3 -3 3]);
title('Received Signal Scatter Plot');
axis('square');  xlabel('Real[x]'); ylabel('Imag[x]'); grid on;
subplot(2,2,4); plot(y(ntr-100:ntr),'.'); axis([-3 3 -3 3]);
title('Equalized Signal Scatter Plot');
axis('square'); xlabel('Real[y]'); ylabel('Imag[y]'); grid on;```

In the following component and scatter plots, you see the results of QPSK equalization.

## References

[1] Ozeki. K., T. Omeda, "An Adaptive Filtering Algorithm Using an Orthogonal Projection to an Affine Subspace and Its Properties," Electronics and Communications in Japan, vol. 67-A, no. 5, pp. 19-27, May 1984

[2] Maruyama, Y, "A Fast Method of Projection Algorithm," Proceedings 1990 IEICE Spring Conference, B-744

## See Also

Was this topic helpful?