Engee documentation

EngeeDSP.AdaptiveLatticeFilter

Adaptive grid filter.

Library

EngeeDSP

Description

System object EngeeDSP.AdaptiveLatticeFilter Calculates the output data, error, and coefficients using a lattice-based adaptive FIR filter.

To implement the adaptive FIR filter system object, follow these steps:

  1. Create an object EngeeDSP.AdaptiveLatticeFilter and set its properties.

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

To learn more about how to work with system objects, see Engee System Objects.

Syntax

Creation

  • alf = EngeeDSP.AdaptiveLatticeFilter() — returns the system object alf adaptive FIR filter based on a lattice. This system object calculates the filtered output signal and the filter error for the given input signal and the desired signal.

  • alf = EngeeDSP.AdaptiveLatticeFilter(len) — returns the system object alf, which has for the property Length value set len.

  • alf = EngeeDSP.AdaptiveLatticeFilter(Name=Value) — returns an adaptive FIR filter object alf with the specified properties as a pair Name=Value, where Name — the name of the property, and Value — the appropriate value. You can specify multiple pairs «name-value» the order of the pairs does not matter. Unspecified properties retain their default values.

    Example:

    # создание системного объекта адаптивного КИХ-фильтра c длиной 16
    alf = EngeeDSP.AdaptiveLatticeFilter(Length = 16)

Using

  • у,err = alf(x,d) — filters the input signal x using d as the desired signal, and returns the filtered output signal to y and the filter error in err. The system object evaluates the filter weights necessary to minimize the error between the output signal and the desired signal. These coefficients can be accessed by accessing the Coefficients property of the object. This can only be done after calling the object. For example, to access optimized filter coefficients alf, call alf.Coefficients after transmitting the input and desired signals to the object.

Arguments

Input arguments

# x — input data

+ scalar | column vector

Details

The signal that needs to be filtered using an adaptive grid filter. The input signal x and the desired signal d they must have the same size and data type.

The input signal can be of variable size. You can change the number of elements in the column vector even when the object is locked. The system object is blocked when the object is called.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# d is the desired signal

+ scalar | column vector

Details

The adaptive grid filter adapts its coefficients to minimize error. err and the most accurate approximation of the input signal x to the desired signal d.

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

The desired signal can be of variable size. You can change the number of elements in the column vector even when the object is locked. The system object is blocked when the object is called.

Типы данных

Float32, Float64

Support for complex numbers

Yes

Output arguments

# y — filtered output signal

+ scalar | column vector

Details

The filtered output signal returned as a scalar or column vector. The object adapts the filter coefficients for the convergence of the input signal x to the desired signal d. The filter outputs a converging signal.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# err — the difference between the output and the desired signal

+ scalar | column vector

Details

The difference between the output signal y and the desired signal d, returned as a scalar or column vector. The purpose of the adaptive grid filter is to minimize this error. The object adapts its coefficients to converge to the optimal filter coefficients, which provide an output signal as close as possible to the desired signal. To access the coefficients of the adaptive lattice filter, call alf.Coefficients after transmitting the input and desired signals to the object’s algorithm.

Типы данных

Float32, Float64

Support for complex numbers

Yes

Features

# Length — length of the vector of filter coefficients
Real number

Details

The length of the vector of FIR filter coefficients, specified as a positive integer.

# Method — method for calculating filter coefficients
String

Details

The method used to calculate the filter coefficients is set as one of the following options:

  • "Least-squares Lattice" (by default);

  • "QR-decomposition Least-squares Lattice";

  • "Gradient Adaptive Lattice".

The algorithms used to implement these three different methods can be found in [1] and [2].

# Offset — offset for the denominator of the normalizing term StepSize
Real number

Details

The offset value for the denominator of the normalizing term StepSize, set as a non-negative scalar. A non-zero offset helps to avoid a situation of division by almost zero when the amplitude of the input signal is very small.

Dependencies

To use this property, set the Method value "Gradient Adaptive Lattice".

# ReflectionStepSize — step size of the reflection process

Details

The step size of the reflection process of the gradient adaptive lattice filter, set as a positive scalar of 0 before 1 inclusive. The default value is the value of the property StepSize.

Dependencies

To use this property, set the Method value "Gradient Adaptive Lattice".

# ForgettingFactor — the root-square coefficient of forgetting the lattice
Real number

Details

The root-square coefficient of forgetting the lattice, given as a positive scalar, less than or equal to 1. Setting this value to 1 it means endless memory during adaptation.

Dependencies

To use this property, set the Method value "Least-squares Lattice" or "QR-decomposition Least-squares Lattice".

# InitialPredictionErrorPower — The initial power of the prediction error
Real number

Details

The initial values for the prediction error vectors, given as a positive scalar.

If for a property Method the value is set "Least-squares Lattice" or "QR-decomposition Least-squares Lattice", the default value is 1.0. If for a property Method the value is set "Gradient Adaptive Lattice", the default value is 0.1.

# InitialCoefficients — initial filter coefficients

Details

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

# StepSize — step size of the collaborative gradient adaptive filter process
Real number

Details

The step size of the joint process of the gradient adaptive lattice filter, specified as a positive scalar, less than or equal to 1.

Dependencies

To use this property, set the Method value "Gradient Adaptive Lattice".

# AveragingFactor — energy estimation averaging coefficient
Real number

Details

The averaging coefficient, given as a positive scalar, is less than 1. Use this property to calculate the prediction error power for forward and reverse forecasting with an exponential window for coefficient updates. The default value is 1 − StepSize.

Dependencies

To use this property, set the Method value "Gradient Adaptive Lattice".

# LockCoefficients — the status of blocking coefficient updates

Details

Specify whether to block the values of the filter coefficients. By default, the value of this property is false, and the object is constantly updating the filter coefficients. If this property is set to true The filter coefficients are not updated, and their values remain unchanged.

Dependencies

To use this property, set the Method value "Gradient Adaptive Lattice".

Methods

Common to all system objects

step!

Run the system object operation algorithm

release!

Allow changing the value of a system object property

reset!

Resetting the internal states of a system object

Literature

  1. Griffiths, Lloyd J. «A Continuously Adaptive Filter Implemented as a Lattice Structure». Proceedings of IEEE Int. Conf. on Acoustics, Speech, and Signal Processing, Hartford, CT, pp. 683–686, 1977.

  2. Haykin, S. Adaptive Filter Theory, 4th Ed. Upper Saddle River, NJ: Prentice Hall, 1996.