Engee documentation

EngeeDSP.RLSFilter

Calculates the output, error, and coefficients using the recursive Least Squares Method (RLS).

Library

EngeeDSP

Block

RLS Filter

Description

System object EngeeDSP.RLSFilter performs filtering of each channel of the input signal using the implementation of the RLS filter.

To filter each channel of the input signal, follow these steps:

  1. Create an object EngeeDSP.RLSFilter 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

  • rlsFilt = EngeeDSP.RLSFilter() — returns the adaptive RLS filter system object. rlsFilt, which filters the input signal and calculates the filtering error and filter weights for the specified input and required signals using the RLS algorithm.

  • rlsFilt = EngeeDSP.RLSFilter(Name=Value) — returns an RLS filter system object 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.

Using

  • y,e,wts = rlsFilt(x,d) — recursively adapts the reference input signal x to match it with the required signal d using a system object rlsFilt. Required signal d It represents a useful signal to which unwanted noise is added. Returns the output signal of the RLS filter y, error signal e, which is the difference between the reference input signal and the desired signal, and the filter coefficients wts. The filter adapts its coefficients until the error e it will not be minimized.

Arguments

Input arguments

# x — input signal

+ scalar | column vector

Details

The signal that will be filtered by the RLS filter system object. The input signal x and the required signal d they must have the same size and data type.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# d — required signal

+ scalar | column vector

Details

The RLS filter adapts its coefficients to minimize the error. e and the most accurate approximation of the input signal x to the required signal d.

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

Типы данных

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 required signal d. The filter outputs a signal that has reached the convergence state.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# e is the difference between the output and required signals

+ scalar | column vector

Details

The difference between the output signal y and the required signal d, returned as a scalar or column vector. The purpose of the RLS filter is to minimize this error. The object adapts its coefficients, striving for optimal values at which the output signal is as close as possible to the required one. Detailed information about the calculation of the value e see the Algorithms section.

Типы данных

Float32, Float64

Support for complex numbers

Yes

# wts — adaptive filter weights

+ scalar | column vector

Details

The filter weights returned as a scalar or column vector with the length specified by the property value FilterLength.

Data type wts corresponds to the data type y.

Типы данных

Float32, Float64

Support for complex numbers

Yes

Features

# ForgettingFactor — the forgetting coefficient of the RLS algorithm
Real number

Details

The forgetting coefficient of the RLS algorithm, given as a scalar in the range from 0 before 1. Value 1 means infinite memory when adapting to find new filter coefficients.

By default — 1.0.

# ResetPort — reset port
String

Details

By default — "None".

# SpecifyForgettingFactorVia — method for setting the forgetting coefficient
String

Details

By default — "Dialog".

# InitialValueOfFilterWeights — the initial value of the filter coefficients
Scalar / array of real and/or complex numbers

Details

The initial values of the filter coefficients, specified as a scalar or vector with a length equal to the filter length.

If the value is a scalar, the system object uses the scalar value to create a vector of filter weights. This vector has a length equal to the length of the filter FilterLength, and all its values are equal to a scalar value.

By default — 0.

# FilterLength — length of the filter coefficient vector
Int64 integer

Details

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

By default — 32.

# InitialInputVarianceEstimate — initial estimation of the covariance of the input data
Real number

Details

The initial values of the evaluation of the square root matrix from the covariance matrix of the input signal, specified as a scalar or square matrix, the dimension of which corresponds to the value of the property FilterLength. If a scalar value is set, the InitialInputVarianceEstimate property is initialized as a diagonal matrix whose diagonal elements are equal to this scalar.

By default — 0.1.

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

Algorithms

When selecting the Conventional RLS mode (standard RLS method), the system object EngeeDSP.RLSFilter recursively calculates an estimate of the weighting coefficients of the FIR filter using the least squares (RLS) method. This object evaluates the weighting factors (or parameters) of the filter needed to convert the input signal into the desired signal. The input signal can be a scalar or a column vector. The required signal must have the same data type, complexity, and dimension as the input signal. The corresponding RLS filter is described in matrix form through the matrix :













where

  • is the inverse of the exponential weighting factor;

  • — current time index;

  • — a vector of buffered input samples per step ;

  • — the inverse covariance matrix in the step ;

  • — gain vector per step ;

  • — the vector of estimates of the filter coefficients in the step ;

  • — filtered signal in the step ;

  • — evaluation of the error in the step ;

  • — the expected signal in the step ;

  • — the coefficient of forgetting;

  • — column vectors.

Literature

  1. M. Hayes, Statistical Digital Signal Processing and Modeling, New York: Wiley, 1996.

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

  3. A. A. Rontogiannis and S. Theodoridis, Inverse factorization adaptive least-squares algorithms, Signal Processing, vol. 52, no. 1, pp. 35–47, July 1996.

  4. S. C. Douglas, Numerically-robust O(N2) RLS algorithms using least-squares prewhitening, Proc. IEEE Int. Conf. on Acoustics, Speech, and Signal Processing, Istanbul, Turkey, vol. I, pp. 412–415, June 2000.

  5. A. H. Sayed, Fundamentals of Adaptive Filtering, Hoboken, NJ: John Wiley & Sons, 2003.