dsp.FastTransversalFilter

Fast transversal least-squares FIR adaptive filter

Description

The dsp.FastTransversalFilter computes output, error and coefficients using a fast transversal least-squares FIR adaptive filter.

To implement the adaptive FIR filter object:

  1. Create the dsp.FastTransversalFilter object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

Creation

Description

ftf = dsp.FastTransversalFilter returns a System object™, ftf, which is a fast transversal, least-squares FIR adaptive filter. This System object computes the filtered output and the filter error for a given input and desired signal.

example

ftf = dsp.FastTransversalFilter(len) returns a dsp.FastTrasversalFilter System object with the Length property set to len.

ftf = dsp.FastTransversalFilter(Name,Value) returns a dsp.FastTransversalFilter System object with each specified property set to the specified value.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).

Specify the method used to calculate filter coefficients as either 'Fast transversal least-squares' or 'Sliding-window fast transversal least-squares'. For algorithms used to implement these two different methods, refer to [1]. This property is nontunable.

Specify the length of the FIR filter coefficients vector as a positive integer value.

Data Types: double

Specify the width of the sliding window as a positive integer value greater than or equal to the Length property value. The default vale is the value of the Length property.

Dependencies

This property applies only if the Method property is set to 'Sliding-window fast transversal least-squares'.

Data Types: double

Specify the fast transversal filter forgetting factor as a positive scalar in the range (0,1]. Setting this value to 1 denotes infinite memory while filter adaptation. Setting this property value to 1 denotes infinite memory while adapting to find the new filter. For best results, set this property to a value that lies in the range [1-0.5/L,1], where L is the Length property value.

Tunable: Yes

Dependencies

This property applies only if the Method property is set to 'Fast transversal least-squares'.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Specify the initial value of the forward and backward prediction error vectors as a positive numeric scalar. This scalar should be sufficiently large to maintain stability and prevent an excessive number of Kalman gain rescues.

Tunable: Yes

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Specify the initial value of the conversion factor of the fast transversal filter.

The value of this property depends on the Method property. If Method is set to:

  • 'Fast transversal least-squares' –– This property must be a positive numeric value less than or equal to 1

  • 'Sliding-window fast transversal least-squares' –– This property must be a two-element numeric vector. The first element of this vector must lie within the range [0,1], and the second element must be less than or equal to -1. In this case, the default value is [1,-1].

Tunable: Yes

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Specify the initial values of the FIR adaptive filter coefficients as a scalar or a vector of length equal to the value of the Length property.

Tunable: Yes

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Specify whether to lock the filter coefficient values. By default, the value of this property is false, and the object continuously updates the filter coefficients. If this property is set to true, the filter coefficients do not update and their values remain the same.

Tunable: Yes

Usage

Description

example

[y,err] = ftf(x,d) filters the input x, using d as the desired signal, and returns the filtered output in y and the filter error in err. The System object estimates the filter weights needed to minimize the error between the output signal and the desired signal.

Input Arguments

expand all

The signal to be filtered by the fast transversal filter. The input, x, and the desired signal, d must have the same size and data type.

The data input can be a variable-size signal. You can change the number of elements in the column vector even when the object is locked. The System object locks when you call the object to run its algorithm.

Data Types: single | double
Complex Number Support: Yes

The fast transversal filter adapts its filter weights, wts, to minimize the error, err, and converge the input signal x to the desired signal d as closely as possible. You can access the current filter weights by calling ftf.Coefficients, where ftf is the fast transversal filter object.

The input and the desired signal must have the same size and data type.

The desired signal can be a variable-size signal. You can change the number of elements in the column vector even when the object is locked. The System object locks when you call the object to run its algorithm.

Data Types: single | double
Complex Number Support: Yes

Output Arguments

expand all

Filtered output, returned as a scalar or a column vector. The object adapts its filter weights to converge the input signal x to match the desired signal d. The filter outputs the converged signal.

Data Types: single | double

Difference between the output signal y and the desired signal d, returned as a scalar or a column vector. The data type of err matches the data type of y. The objective of the adaptive filter is to minimize this error. The object adapts its weights to converge toward optimal filter weights that produce an output signal that matches closely with the desired signal.

Data Types: single | double

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

msesimEstimated mean squared error for adaptive filters
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

expand all

Note: If you are using R2016a or earlier, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).

ftf1 = dsp.FastTransversalFilter(11,'ForgettingFactor',0.99);
filt = dsp.FIRFilter;
filt.Numerator = fir1(10,.25);
x = randn(1000,1);
d = filt(x) + 0.01*randn(1000,1);
[y,e] = ftf1(x,d);
w = ftf1.Coefficients;
subplot(2,1,1);
plot(1:1000,[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([filt.Numerator; w].');
legend('Actual','Estimated'); 
xlabel('coefficient #'); 
ylabel('coefficient value');

References

[1] Haykin, Simon. Adaptive Filter Theory, 4th Ed. Upper Saddle River, NJ: Prentice Hall, 2002

Extended Capabilities

Introduced in R2013b