1
Computer exercise 5: Recursive Least Squares
(RLS)
This computer exercise deals with the RLS algorithm. The example applica
tion is adaptive channel equalization, which has been introduced in compu
ter exercise 2. A description can be found in Haykin, edition 4, chapter 5.7,
pp. 285291, (edition 3: chapter 9.7, pp. 412421),
Computer Experiment on
Adaptive Equalization
(using the LMS algorithm). In this exercise you should
compare the RLS algorithm and the LMS algorithm. An implementation of
the LMS algorithm can be downloaded form the course web page, computer
exercise 2.
Computer exercise 5.1
The RLS update equations are given by
k
(
n
) =
λ

1
P
(
n

1)
u
(
n
)
1 +
λ

1
u
H
(
n
)
P
(
n

1)
u
(
n
)
ξ
(
n
) =
d
(
n
)

hatwide
w
(
n

1)
u
(
n
)
hatwide
w
(
n
) =
hatwide
w
(
n

1) +
k
(
n
)
ξ
*
(
n
)
P
(
n
) =
λ

1
P
(
n

1)

λ

1
k
(
n
)
u
H
(
n
)
P
(
n

1)
.
Create a function in Matlab that takes an input vector
u
and a reference
signal
d
, both of length
N
, and calculates the error
xi
for all time instants.
function [xi,w]=rls(lambda,M,u,d,delta)
%
Recursive Least Squares
%
Call:
%
[xi,w]=rls(lambda,M,u,d,delta);
%
%
Input arguments:
%
lambda
= forgetting factor, dim 1x1
%
M
= filter length, dim 1x1
%
u
= input signal, dim Nx1
%
d
= desired signal, dim Nx1
%
delta
= initial value, P(0)=delta^1*I, dim 1x1
%
%
Output arguments:
%
xi
= a priori estimation error, dim Nx1
%
w
= final filter coefficients, dim Mx1
Use
hatwide
w
(0) = [0
,
0
, ...,
0]
T
as initial values for the filter coefficients. For the
initial value of the inverse matrix
P
(0) choose a diagonal matrix with the
Adaptive Signal Processing 2007
Computer exercise 5
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2
value
δ

1
on the main diagonal. In Matlab this is done by
P=eye(M)/delta;
,
where
eye
returns an identity matrix of size
M
. Mind the correct order of
u
(
n
) = [
u
(
n
)
, u
(
n

1)
, ..., u
(
n

M
+ 1)]
T
! In Matlab this is best done by
uvec=u(n:1:(nM+1))
, where
uvec
corresponds to
u
(
n
) and
u
is required
to be a column vector.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '03
 AliJadbabaie
 Digital Signal Processing, RLS, Adaptive Signal Processing

Click to edit the document details