Package: dsp
Compute output, error and coefficients using Affine Projection (AP) Algorithm
The AffineProjectionFilter
object filters
each channel of the input using AP filter implementations.
To filter each channel of the input:
Define and set up your AP filter. See Construction.
Call step
to filter each channel
of the input according to the properties of dsp.AffineProjectionFilter
.
The behavior of step
is specific to each object in
the toolbox.
Note:
Starting in R2016b, instead of using the 
H = dsp.AffineProjectionFilter
returns
an adaptive FIR filter System object, H
. This System object computes
the filtered output and the filter error for a given input and desired
signal using the Affine Projection (AP) algorithm.
H = dsp.AffineProjectionFilter('
returns an AP filter System object, PropertyName
',PropertyValue
,
...)H
,
with each specified property set to the specified value.
H = dsp.AffineProjectionFilter(LEN, '
returns an AP filter System object, PropertyName
', PropertyValue
,
...)H
.
This System object has the Length property set to LEN
,
and other specified properties set to the specified values.

Method to calculate the filter coefficients Specify the method used to calculate filter coefficients as
one of  

Length of filter coefficients vector Specify the length of the FIR filter coefficients vector as
a scalar positive integer value. The default value is 

Projection order of the affine projection algorithm Specify the projection order of the affine projection algorithm
as a scalar positive integer value greater than or equal to 2. This
property defines the size of the input signal covariance matrix. The
default value is 

Affine projection step size Specify the affine projection step size factor as a scalar nonnegative
numeric value between 0 and 1, both inclusive. Setting step equal
to one provides the fastest convergence during adaptation. The default
value is 

Initial coefficients of the filter Specify the initial values of the FIR adaptive filter coefficients
as a scalar or a vector of length equal to the 

Initial values of the offset input covariance matrix Specify the initial values for the offset input covariance matrix.
This property must be either a scalar positive numeric value or a
positivedefinite square matrix with each dimension equal to the 

Initial values of the offset input covariance matrix inverse Specify the initial values for the offset input covariance matrix
inverse. This property must be either a scalar positive numeric value
or a positivedefinite square matrix with each dimension equal to
the 

Initial correlation coefficients Specify the initial values of the correlation coefficients
of the FIR filter as a scalar or a vector of length equal to 

Lock coefficient updates Specify whether the filter coefficient values should be locked.
When you set this property to 
clone  Create System object with same property values 
isLocked  Locked status for input attributes and nontunable properties 
msesim  Meansquare error for Affine Projection filter 
release  Allow property value and input characteristics changes 
reset  Reset the internal states of a System object 
step  Process inputs using the affine projection filter algorithm 
The affine projection algorithm (APA), is an adaptive scheme that estimates an unknown system based on multiple input vectors [1]. It is designed to improve the performance of other adaptive algorithms, mainly those that are LMSbased. The affine projection algorithm reuses old data resulting in fast convergence when the input signal is highly correlated, leading to a family of algorithms that can make tradeoffs between computation complexity with convergence speed [2].
The following equations describe the conceptual algorithm used in designing AP filters:
$$\begin{array}{l}Uap(n)=\left(\begin{array}{ccc}u{(n)}_{}& \dots & u(nL)\\ \vdots & \ddots & \vdots \\ u{(nN)}_{}& \cdots & u(nLN)\end{array}\right)=\left(\begin{array}{ccc}u(n)& u(n1)& \cdots \begin{array}{cc}& u(nL)\end{array}\end{array}\right)\\ yap(n)={U}^{T}ap(n)w(n)=\left(\begin{array}{c}y(n)\\ \xb7\\ \xb7\\ \xb7\\ y(nL)\end{array}\right)\\ dap(n)=\left(\begin{array}{c}d(n)\\ \xb7\\ \xb7\\ \xb7\\ d(nL)\end{array}\right)\\ eap(n)=dap(n)yap(n)=\left(\begin{array}{c}e(n)\\ \xb7\\ \xb7\\ \xb7\\ e(nL)\end{array}\right)\\ w(n)=w(n1)+\mu Uap(n){(}^{U}eap\end{array}$$
where C is either εI if the initial offset covariance is a scalar ε, or R if the initial offset covariance is a matrix R. The variables are as follows:
Variable  Description 

n  The current time index 
u(n)  The input sample at step n 
U_{ap}(n)  The matrix of the last L+1 input signal vectors 
w(n)  The adaptive filter coefficients vector 
y(n)  The adaptive filter output 
d(n)  The desired signal 
e(n)  The error at step n 
L  The projection order 
N  The filter order (i.e., filter length = N+1) 
μ  The step size 
[1] K. Ozeki, T. Umeda, "An adaptive Filtering Algorithm Using an Orthogonal Projection to an Affine Subspace and its Properties", Electron. Commun. Jpn. 67A(5), May 1984, pp. 19–27.
[2] Paulo S. R. Diniz, Adaptive Filtering: Algorithms and Practical Implementation, Second Edition. Boston: Kluwer Academic Publishers, 2002