Nichols plot

From formulasearchengine
Revision as of 10:04, 11 January 2014 by en>Farhoudk
Jump to navigation Jump to search

The Recursive least squares (RLS) adaptive filter is an algorithm which recursively finds the filter coefficients that minimize a weighted linear least squares cost function relating to the input signals. This is in contrast to other algorithms such as the least mean squares (LMS) that aim to reduce the mean square error. In the derivation of the RLS, the input signals are considered deterministic, while for the LMS and similar algorithm they are considered stochastic. Compared to most of its competitors, the RLS exhibits extremely fast convergence. However, this benefit comes at the cost of high computational complexity.

Motivation

RLS was discovered by Gauss but lay unused or ignored until 1950 when Plackett rediscovered the original work of Gauss from 1821. In general, the RLS can be used to solve any problem that can be solved by adaptive filters. For example, suppose that a signal d(n) is transmitted over an echoey, noisy channel that causes it to be received as

x(n)=k=0qbn(k)d(nk)+v(n)

where v(n) represents additive noise. We will attempt to recover the desired signal d(n) by use of a p+1-tap FIR filter, 𝐰:

d̂(n)=k=0pwn(k)x(nk)=𝐰n𝑇𝐱n

where 𝐱n=[x(n)x(n1)x(np)]T is the vector containing the p most recent samples of x(n). Our goal is to estimate the parameters of the filter 𝐰, and at each time n we refer to the new least squares estimate by 𝐰𝐧. As time evolves, we would like to avoid completely redoing the least squares algorithm to find the new estimate for 𝐰n+1, in terms of 𝐰n.

The benefit of the RLS algorithm is that there is no need to invert matrices, thereby saving computational power. Another advantage is that it provides intuition behind such results as the Kalman filter.

Discussion

The idea behind RLS filters is to minimize a cost function C by appropriately selecting the filter coefficients 𝐰n, updating the filter as new data arrives. The error signal e(n) and desired signal d(n) are defined in the negative feedback diagram below:

The error implicitly depends on the filter coefficients through the estimate d̂(n):

e(n)=d(n)d̂(n)

The weighted least squares error function C—the cost function we desire to minimize—being a function of e(n) is therefore also dependent on the filter coefficients:

C(𝐰𝐧)=i=0nλnie2(i)

where 0<λ1 is the "forgetting factor" which gives exponentially less weight to older error samples.

The cost function is minimized by taking the partial derivatives for all entries k of the coefficient vector 𝐰n and setting the results to zero

C(𝐰n)wn(k)=i=0n2λnie(i)e(i)wn(k)=i=0n2λnie(i)x(ik)=0k=0,1,,p

Next, replace e(n) with the definition of the error signal

i=0nλni[d(i)l=0pwn(l)x(il)]x(ik)=0k=0,1,,p

Rearranging the equation yields

l=0pwn(l)[i=0nλnix(il)x(ik)]=i=0nλnid(i)x(ik)k=0,1,,p

This form can be expressed in terms of matrices

𝐑x(n)𝐰n=𝐫dx(n)

where 𝐑x(n) is the weighted sample correlation matrix for x(n), and 𝐫dx(n) is the equivalent estimate for the cross-correlation between d(n) and x(n). Based on this expression we find the coefficients which minimize the cost function as

𝐰n=𝐑x1(n)𝐫dx(n)

This is the main result of the discussion.

Choosing λ

The smaller λ is, the smaller contribution of previous samples. This makes the filter more sensitive to recent samples, which means more fluctuations in the filter co-efficients. The λ=1 case is referred to as the growing window RLS algorithm. In practice, λ is usually chosen between 0.98 and 1.[1]

Recursive algorithm

The discussion resulted in a single equation to determine a coefficient vector which minimizes the cost function. In this section we want to derive a recursive solution of the form

𝐰n=𝐰n1+Δ𝐰n1

where Δ𝐰n1 is a correction factor at time n1. We start the derivation of the recursive algorithm by expressing the cross correlation 𝐫dx(n) in terms of 𝐫dx(n1)

𝐫dx(n) =i=0nλnid(i)𝐱(i)
=i=0n1λnid(i)𝐱(i)+λ0d(n)𝐱(n)
=λ𝐫dx(n1)+d(n)𝐱(n)

where 𝐱(i) is the p+1 dimensional data vector

𝐱(i)=[x(i),x(i1),,x(ip)]T

Similarly we express 𝐑x(n) in terms of 𝐑x(n1) by

𝐑x(n) =i=0nλni𝐱(i)𝐱T(i)
=λ𝐑x(n1)+𝐱(n)𝐱T(n)

In order to generate the coefficient vector we are interested in the inverse of the deterministic autocorrelation matrix. For that task the Woodbury matrix identity comes in handy. With

A =λ𝐑x(n1) is (p+1)-by-(p+1)
U =𝐱(n) is (p+1)-by-1
V =𝐱T(n) is 1-by-(p+1)
C =𝐈1 is the 1-by-1 identity matrix

The Woodbury matrix identity follows

𝐑x1(n) = [λ𝐑x(n1)+𝐱(n)𝐱T(n)]1
= λ1𝐑x1(n1)
λ1𝐑x1(n1)𝐱(n)
{1+𝐱T(n)λ1𝐑x1(n1)𝐱(n)}1𝐱T(n)λ1𝐑x1(n1)

To come in line with the standard literature, we define

𝐏(n) =𝐑x1(n)
=λ1𝐏(n1)𝐠(n)𝐱T(n)λ1𝐏(n1)

where the gain vector g(n) is

𝐠(n) =λ1𝐏(n1)𝐱(n){1+𝐱T(n)λ1𝐏(n1)𝐱(n)}1
=𝐏(n1)𝐱(n){λ+𝐱T(n)𝐏(n1)𝐱(n)}1

Before we move on, it is necessary to bring 𝐠(n) into another form

𝐠(n){1+𝐱T(n)λ1𝐏(n1)𝐱(n)} =λ1𝐏(n1)𝐱(n)
𝐠(n)+𝐠(n)𝐱T(n)λ1𝐏(n1)𝐱(n) =λ1𝐏(n1)𝐱(n)

Subtracting the second term on the left side yields

𝐠(n) =λ1𝐏(n1)𝐱(n)𝐠(n)𝐱T(n)λ1𝐏(n1)𝐱(n)
=λ1[𝐏(n1)𝐠(n)𝐱T(n)𝐏(n1)]𝐱(n)

With the recursive definition of 𝐏(n) the desired form follows

𝐠(n)=𝐏(n)𝐱(n)

Now we are ready to complete the recursion. As discussed

𝐰n =𝐏(n)𝐫dx(n)
=λ𝐏(n)𝐫dx(n1)+d(n)𝐏(n)𝐱(n)

The second step follows from the recursive definition of 𝐫dx(n). Next we incorporate the recursive definition of 𝐏(n) together with the alternate form of 𝐠(n) and get

𝐰n =λ[λ1𝐏(n1)𝐠(n)𝐱T(n)λ1𝐏(n1)]𝐫dx(n1)+d(n)𝐠(n)
=𝐏(n1)𝐫dx(n1)𝐠(n)𝐱T(n)𝐏(n1)𝐫dx(n1)+d(n)𝐠(n)
=𝐏(n1)𝐫dx(n1)+𝐠(n)[d(n)𝐱T(n)𝐏(n1)𝐫dx(n1)]

With 𝐰n1=𝐏(n1)𝐫dx(n1) we arrive at the update equation

𝐰n =𝐰n1+𝐠(n)[d(n)𝐱T(n)𝐰n1]
=𝐰n1+𝐠(n)α(n)

where α(n)=d(n)𝐱T(n)𝐰n1 is the a priori error. Compare this with the a posteriori error; the error calculated after the filter is updated:

e(n)=d(n)𝐱T(n)𝐰n

That means we found the correction factor

Δ𝐰n1=𝐠(n)α(n)

This intuitively satisfying result indicates that the correction factor is directly proportional to both the error and the gain vector, which controls how much sensitivity is desired, through the weighting factor, λ.

RLS algorithm summary

The RLS algorithm for a p-th order RLS filter can be summarized as

Parameters: p= filter order
λ= forgetting factor
δ= value to initialize 𝐏(0)
Initialization: 𝐰(n)=0,
x(k)=0,k=p,,1,
𝐏(0)=δ1I where I is the identity matrix of rank p+1
Computation: For n=1,2,

𝐱(n)=[x(n)x(n1)x(np)]

α(n)=d(n)𝐱T(n)𝐰(n1)
𝐠(n)=𝐏(n1)𝐱(n){λ+𝐱T(n)𝐏(n1)𝐱(n)}1
𝐏(n)=λ1𝐏(n1)𝐠(n)𝐱T(n)λ1𝐏(n1)
𝐰(n)=𝐰(n1)+α(n)𝐠(n).

Note that the recursion for P follows an Algebraic Riccati equation and thus draws parallels to the Kalman filter.[2]

Lattice recursive least squares filter (LRLS)

The Lattice Recursive Least Squares adaptive filter is related to the standard RLS except that it requires fewer arithmetic operations (order N). It offers additional advantages over conventional LMS algorithms such as faster convergence rates, modular structure, and insensitivity to variations in eigenvalue spread of the input correlation matrix. The LRLS algorithm described is based on a posteriori errors and includes the normalized form. The derivation is similar to the standard RLS algorithm and is based on the definition of d(k). In the forward prediction case, we have d(k)=x(k) with the input signal x(k1) as the most up to date sample. The backward prediction case is d(k)=x(ki1), where i is the index of the sample in the past we want to predict, and the input signal x(k) is the most recent sample.[3]

Parameter Summary

κf(k,i) is the forward reflection coefficient
κb(k,i) is the backward reflection coefficient
ef(k,i) represents the instantaneous a posteriori forward prediction error
eb(k,i) represents the instantaneous a posteriori backward prediction error
ξbmind(k,i) is the minimum least-squares backward prediction error
ξfmind(k,i) is the minimum least-squares forward prediction error
γ(k,i) is a conversion factor between a priori and a posteriori errors
vi(k) are the feedforward multiplier coefficients.
ϵ is a small positive constant that can be 0.01

LRLS Algorithm Summary

The algorithm for a LRLS filter can be summarized as

Initialization:
For i = 0,1,...,N
Template:Padδ(1,i)=δD(1,i)=0 (if x(k) = 0 for k < 0)
Template:Padξbmind(1,i)=ξfmind(1,i)=ϵ
Template:Padγ(1,i)=1
Template:Padeb(1,i)=0
End
Computation:
For k ≥ 0
Template:Padγ(k,0)=1
Template:Padeb(k,0)=ef(k,0)=x(k)
Template:Padξbmind(k,0)=ξfmind(k,0)=x2(k)+λξfmind(k1,0)
Template:Pade(k,0)=d(k)
Template:PadFor i = 0,1,...,N
Template:Padδ(k,i)=λδ(k1,i)+eb(k1,i)ef(k,i)γ(k1,i)
Template:Padγ(k,i+1)=γ(k,i)eb2(k,i)ξbmind(k,i)
Template:Padκb(k,i)=δ(k,i)ξfmind(k,i)
Template:Padκf(k,i)=δ(k,i)ξbmind(k1,i)
Template:Padeb(k,i+1)=eb(k1,i)κb(k,i)ef(k,i)
Template:Padef(k,i+1)=ef(k,i)κf(k,i)eb(k1,i)
Template:Padξbmind(k,i+1)=ξbmind(k1,i)δ(k,i)κb(k,i)
Template:Padξfmind(k,i+1)=ξfmind(k,i)δ(k,i)κf(k,i)
Template:PadFeedforward Filtering
Template:PadδD(k,i)=λδD(k1,i)+e(k,i)eb(k,i)γ(k,i)
Template:Padvi(k)=δD(k,i)ξbmind(k,i)
Template:Pade(k,i+1)=e(k,i)vi(k)eb(k,i)
Template:PadEnd
End

Normalized lattice recursive least squares filter (NLRLS)

The normalized form of the LRLS has fewer recursions and variables. It can be calculated by applying a normalization to the internal variables of the algorithm which will keep their magnitude bounded by one. This is generally not used in real-time applications because of the number of division and square-root operations which comes with a high computational load.

NLRLS algorithm summary

The algorithm for a NLRLS filter can be summarized as

Initialization:
For i = 0,1,...,N
Template:Padδ(1,i)=0 (if x(k) = d(k) = 0 for k < 0)
Template:PadδD(1,i)=0
Template:Padeb(1,i)=0
End
Template:Padσx2(1)=λσd2(1)=ϵ
Computation:
For k ≥ 0
Template:Padσx2(k)=λσx2(k1)+x2(k) (Input signal energy)
Template:Padσd2(k)=λσd2(k1)+d2(k) (Reference signal energy)
Template:Padeb(k,0)=ef(k,0)=x(k)σx(k)
Template:Pade(k,0)=d(k)σd(k)
Template:PadFor i = 0,1,...,N
Template:Padδ(k,i)=δ(k1,i)(1eb2(k1,i))(1ef2(k,i))+eb(k1,i)ef(k,i)
Template:Padeb(k,i+1)=eb(k1,i)δ(k,i)ef(k,i)(1δ2(k,i))(1ef2(k,i))
Template:Padef(k,i+1)=ef(k,i)δ(k,i)eb(k1,i)(1δ2(k,i))(1eb2(k1,i))
Template:PadFeedforward Filter
Template:PadδD(k,i)=δD(k1,i)(1eb2(k,i))(1e2(k,i))+e(k,i)eb(k,i)
Template:Pade(k,i+1)=1(1eb2(k,i))(1δD2(k,i))[e(k,i)δD(k,i)eb(k,i)]
Template:PadEnd
End

See also

References

  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534
  • Simon Haykin, Adaptive Filter Theory, Prentice Hall, 2002, ISBN 0-13-048434-2
  • M.H.A Davis, R.B. Vinter, Stochastic Modelling and Control, Springer, 1985, ISBN 0-412-16200-8
  • Weifeng Liu, Jose Principe and Simon Haykin, Kernel Adaptive Filtering: A Comprehensive Introduction, John Wiley, 2010, ISBN 0-470-44753-2
  • R.L.Plackett,Some Theorems in Least Squares,Biometrika,1950,37,149-157,ISSN 00063444
  • C.F.Gauss,Theoria combinationis observationum erroribus minimis obnoxiae,1821, Werke, 4. Gottinge

Notes

43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.

  1. Emannual C. Ifeacor, Barrie W. Jervis. Digital signal processing: a practical approach, second edition. Indianapolis: Pearson Education Limited, 2002, p. 718
  2. Welch, Greg and Bishop, Gary "An Introduction to the Kalman Filter", Department of Computer Science, University of North Carolina at Chapel Hill, September 17, 1997, accessed July 19, 2011.
  3. Albu, Kadlec, Softley, Matousek, Hermanek, Coleman, Fagan "Implementation of (Normalised) RLS Lattice on Virtex", Digital Signal Processing, 2001, accessed December 24, 2011.