Compute output, error, and coefficients using frequency domain FIR adaptive filter
DSP System Toolbox / Filtering / Adaptive Filters
The FrequencyDomain Adaptive Filter block implements an adaptive finite impulse response (FIR) filter in the frequency domain using the fast block least mean squares (LMS) algorithm. The Filter length and the Block length parameters specify the filter length and the block length values the algorithm uses. When you select the Output filter FFT coefficients check box, the block outputs the discrete Fourier transform of the current filter coefficients. The block offers the constrained and unconstrained versions of the algorithm with partitioned and nonpartitioned modes. For details, see Algorithms.
Input
— Data inputThe signal to be filtered by the frequencydomain FIR adaptive filter. The data input and the desired signal input must have the same size and data type. The length of the input vector must be divisible by the Block length parameter value.
The data input can be a variablesize signal as long as the frame length is a multiple of the Block length. You can change the number of elements in the column vector during the model simulation.
Data Types: single
 double
Complex Number Support: Yes
Desired
— Desired signalThe frequencydomain adaptive filter adapts its filter weights to minimize the error, Error, and converge the input signal to match the desired signal as closely as possible.
The data input and the desired signal must have the same size and data type. The length of the desired signal vector must be divisible by the Block length parameter value.
The desired signal can be a variablesize signal as long as the frame length is a multiple of the Block length. You can change the number of elements in the column vector during the model simulation.
Data Types: single
 double
Complex Number Support: Yes
Mu
— Step size inputAdaptation step size factor, specified as a real scalar in the range
(0,1]. Using a small step size ensures a small steadystate error.
However, a small step size decreases the resulting convergence speed of
the adaptive filter. Increasing the step size improves the convergence
speed, at the cost of increased steadystate mean squared error. When
the step size value is 1
, the algorithm provides the
optimal tradeoff between the convergence speed and the steadystate mean
squared error.
This port appears when you select the Specify step size from port parameter.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Leak
— Leakage factor inputLeakage factor used in leaky adaptive filter, specified as a real
scalar in the range (0,1]. When the value is less than 1, the block
implements a leaky adaptive algorithm. When the value is
1
, the block provides no leakage in the adapting
method.
This port appears when you select the Specify leakage factor from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Avrg
— Averaging factor inputAveraging factor used to compute the exponentially windowed fast Fourier transform (FFT) input signal powers for the coefficient updates, specified as a real scalar in the range (0,1].
This port appears when you select the Specify averaging factor from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Offset
— Offset for normalization termsOffset for the normalization terms in the coefficient updates, specified as a nonnegative real scalar value. Use this value to avoid division by zero or division by very small numbers if any of the FFT input signal powers become very small.
This port appears when you select the Specify offset from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Adapt
— Enable filter coefficient updatesIf you input a nonzero scalar value through this port, the block continuously updates its filter coefficients. If you input a zero through this port, the filter coefficients do not update, and their values remain at the current value.
This port appears when you select the Enable adapt port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Reset
— Enable filter states resetIf you input a nonzero scalar value through this port, the block resets all internal states. If you input a zero through this port, the internal states are not reset.
This port appears when you select the Enable reset port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Output
— Filtered outputFiltered output, returned as a column vector. The block adapts its filter weights to converge the input signal to match the desired signal as closely as possible. The filter outputs the converged signal.
Data Types: single
 double
Complex Number Support: Yes
Error
— Difference between output and desired signalDifference between the output signal and the desired signal, returned as a column vector. The objective of the adaptive filter is to minimize this error. The block adapts its weights to converge towards optimal filter weights which produce an output signal that matches the desired signal as closely as possible. For more details on how Error is computed, see References.
Data Types: single
 double
Complex Number Support: Yes
FFTCoeffs
— Current FFT coefficients of filterCurrent discrete Fourier transform of the filter coefficients,
returned as a row vector. For Constrained
FDAF
and Unconstrained FDAF
algorithms, the length of this vector is equal to the sum of the
Filter length value and the Block
length value. This port initially outputs the FFT values
of the Initial timedomain coefficients parameter.
During the model simulation, this port outputs the FFT values of the
current filter coefficients.
This port appears when you select the Output filter FFT coefficients check box.
Data Types: single
 double
Complex Number Support: Yes
Method
— Method to calculate filter coefficientsConstrained FDAF
(default)  Partitioned constrained FDAF
 Unconstrained FDAF
 Partitioned unconstrained FDAF
Method used to calculate the filter coefficients, specified as::
Constrained FDAF
–– Imposes a
gradient constraint on the filter tap weights.
Partitioned constrained FDAF
––
Partitions the impulse response of the filter to reduce
latency.
Unconstrained FDAF
–– No gradient
constraint is imposed on the filter tap weights.
Partitioned unconstrained FDAF
––
Partitions the impulse response of the filter to reduce latency.
No gradient constraint is imposed on the filter tap
weights.
For more details, see Algorithms.
Filter length
— Length of filter coefficients vector32
(default)  positive, integervalued scalarLength of the FIR filter coefficients vector, specified as a positive, integervalued scalar.
Block length
— Block length for coefficient updates32
(default)  positive, integervalued scalarBlock length for the coefficients update, specified as a positive, integervalued scalar. The adaptive filter processes the input data and the desired signal as a block of samples of length set by this parameter. For details on how this data is processed by the filter, see Algorithms. The length of the input vector must be divisible by the Block length parameter value. The default value of the Block length parameter is set to the value of the Filter length parameter.
Specify step size from port
— Flag to specify step sizeWhen you select this check box, the adaptation step size is input through the Mu port. When you clear this check box, the step size is specified on the block dialog through the Step size parameter.
Step size
— Adaptation step size1
(default)  real scalar in the range (0,1]Adaptation step size factor, specified as a real scalar in the range
(0,1]. Setting the Step size parameter to
1
provides the fastest convergence during
adaptation.
Tunable: Yes
This parameter appears when you clear the Specify step size from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Specify leakage factor from port
— Flag to specify leakage factorWhen you select this check box, the leakage factor is input through the Leak port. When you clear this check box, the leakage factor is specified on the block dialog through the Leakage factor parameter.
LeakageFactor
— Adaptation leakage factor1
(default)  real scalar in the range (0,1]Leakage factor used in leaky adaptive filter, specified as a real scalar
in the range (0,1]. When the value is less than 1
, the
block implements a leaky adaptive algorithm. When the value is
1
, the block provides no leakage in the adapting
method.
Tunable: Yes
This parameter appears when you clear the Specify leakage factor from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Specify averaging factor from port
— Flag to specify averaging factorWhen you select this check box, the averaging factor for signal power is input through the Avrg port. When you clear this check box, the averaging factor is specified on the block dialog through the Averaging factor parameter.
Averaging factor
— Averaging factor for signal power0.9
(default)  real scalar in the range (0,1]Averaging factor used to compute the exponentially windowed FFT input signal powers for the coefficient updates, specified as a real scalar in the range (0,1].
Tunable: Yes
This parameter appears when you clear the Specify averaging factor from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Specify offset from port
— Flag to specify offsetWhen you select this check box, the offset for the normalization terms in the coefficient updates is input through the Offset port. When you clear this check box, the offset is specified on the block dialog through the Offset parameter.
Offset
— Offset for normalization terms0
(default)  nonnegative real scalarOffset for the normalization terms in the coefficient updates, specified as a nonnegative real scalar value. Use this value to avoid division by zero or division by very small numbers if any of the FFT input signal powers become very small.
Tunable: Yes
This parameter appears when you clear the Specify offset from port check box.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Initial FFT input signal power
— Initial FFT input signal power1
(default)  positive numeric scalarInitial common value of all of the FFT input signal powers, specified as a positive numeric scalar value.
If you change this value during the simulation, the change takes effect only after a reset event occurs.
Tunable: Yes
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Initial timedomain coefficients
— Initial timedomain coefficients of filter0
(default)  scalar  vectorInitial timedomain coefficients of the adaptive filter, specified as a scalar or a vector of length equal to the value you specify in the Filter length parameter. The adaptive filter block uses these coefficients to compute the initial frequencydomain filter coefficients.
If you change this value during the simulation, the change takes effect only after a reset event occurs.
Tunable: Yes
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
Enable adapt port
— Flag to enable coefficient updateWhen you select this check box, the Adapt input port is enabled. If you input a nonzero scalar value through this port, the block continuously updates its filter coefficients. If you input a zero through this port, the filter coefficients do not update and their values remain at the current value.
Enable reset port
— Flag to reset internal statesWhen you select this check box, the Reset input port is enabled. If you input a nonzero scalar value through this port, the block resets all internal states. If you input a zero through this port, the internal states are not reset.
Output filter FFT coefficients
— Flag to output the DFT of the filter coefficientsWhen you select this check box, the FFTCoeffs output port is enabled. Through this port, the block outputs the discrete Fourier transform of the current filter coefficients.
Simulate using
— Type of simulation to runCode generation
(default)  Interpreted execution
Code generation
Simulate model using generated C code. The first time you run a simulation, Simulink^{®} generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed than Interpreted execution
.
Interpreted execution
Simulate model using the MATLAB^{®} interpreter. This option shortens startup time but has slower simulation speed than Code generation
.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Frequencydomain adaptive filtering consists of three steps  filtering, error estimation, and
tapweight adaptation. This algorithm implements FIR filtering in the frequency domain using
the overlapsave or overlapadd method. For more implementation details of these two
methods, see the Algorithms section in the dsp.FrequencyDomainFIRFilter
object page. The error
estimation and the tapweight adaptation are implemented using the fast block LMS algorithm
(FBLMS).
The frequencydomain adaptive filter processes input data and the desired signal data as a block of samples using the fast block LMS (FBLMS) algorithm. Here is the block diagram of the frequencydomain adaptive filter using the FBLMS algorithm. The frequencydomain FIR filter in this diagram uses the overlapsave method.
where:
N –– Filter length
L –– Block length
μ –– Step size parameter
x(n) –– Input signal
X(k) –– Transformed input signal in the frequency domain
d(n) –– Desired signal
e(n) –– Error between the desired signal and the filter output
E(n) –– Transformed error signal in the frequency domain
W(k) –– Tapweights vector in the frequency domain
For more details on how the error is estimated and the tapweights are adapted, see [2].
The previous diagram is the constrained version. If you remove the gradient constraint portion of the algorithm, you have the unconstrained FBLMS implementation. For details on the convergence behavior of both constrained and unconstrained variations, see [2].
The latency of the filter roughly equals the length of the FIR numerator. If the impulse response of the filter is very long, the latency becomes significantly large. The partitioned FBLMS algorithm reduces latency by partitioning the impulse response. The nonpartitioned frequencydomain FIR filtering is faster than the timedomain filtering for long impulse responses, at the cost of increased latency. To mitigate the latency and make the frequency domain filtering even more efficient, the algorithm partitions the impulse response into multiple short blocks and performs overlapsave or overlapadd on each block. The results of the different blocks are then combined to obtain the final output. The latency of this approach is of the order of the block length, rather than the entire impulse response length. This reduced latency comes at the cost of additional computation. For more details on the implementation, see [2].
[1] Shynk, J.J."FrequencyDomain and Multirate Adaptive Filtering." IEEE Signal Processing Magazine, Vol. 9, No. 1, pp. 14–37, Jan. 1992.
[2] FarhangBoroujeny, B., Adaptive Filters: Theory and Applications, Chichester, England, Wiley, 1998.
[3] Stockham, T. G., Jr. "High Speed Convolution and Correlation." Proceedings of the 1966 Spring Joint Computer Conference, AFIPS, Vol 28, 1966, pp. 229–233.
dsp.FrequencyDomainFIRFilter
 dsp.FrequencyDomainAdaptiveFilter
 dsp.LMSFilter
 dsp.RLSFilter
 dsp.AffineProjectionFilter
 dsp.AdaptiveLatticeFilter
 dsp.FilteredXLMSFilter
 dsp.FIRFilter
 dsp.FastTransversalFilter
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.