Adaptive Filter Notes
Adaptive Filter Notes
Adaptive Filter Notes
Adaptive Filters
Introduction
Desired
Signal
x[n]
Observation
Signal
Wiener
Filter
y[ n]
MMSE
Estimate
of d[n]
1. Simon Haykin, Adaptive Filter Theory, fourth edition, Prentice Hall, 2002.
ECE 5655/4655 Real-Time DSP
91
Wiener Filter
An M tap discrete-time Wiener filter is of the form
y[n] =
M1
wm x [ n m ]
(9.1)
m=0
(9.2)
E { e [ n ] } = 0, m = 0, 1, , M 1
wm
(9.3)
(9.4)
Wiener Filter
This results in a filter that is optimum in the sense of minimum mean-square error
The resulting system of equations
M1
w m E { x [ n k ]x [ n m ] }
m=0
= E{x[n k](d[n])}
(9.5)
or
M1
w m xx [ m k ] =
m=0
xd [ k ]
(9.6)
(9.7)
...
...
R xx
xx [ 0 ] . . . xx [ M 1 ]
..
=
.
xx [ M + 1 ] . . . xx [ 0 ]
(9.8)
93
w o = w o0 w o1 w oM 1
(9.9)
(9.10)
w o = R xx p xd
(9.11)
As a matter of practice (9.11) can be solved using sample statistics, that is we replace the true statistical auto- and crosscorrelation functions with time averages of the form
N1
1
xx [ k ] ---N
x [ n + k ]x [ n ]
n=0
1
xd [ k ] ---N
N1
x [ n + k ]d [ n ]
n=0
(9.12)
(9.13)
94
Optimum at [1,1]
w0
w1
95
d[n]
Desired
Signal
x[n]
Observation
e[ n]
Error
Signal
y[ n]
MMSE
Estimate
of d[n]
Wiener
Filter
Adaptive
Algorithm
(9.14)
p xd = x [ n ]d [ n ]
(9.15)
where
x[n] = x[n] x[n 1] x[n M + 1]
(9.16)
The steps to the LMS algorithm, for each new sample at time
n, are:
Filter x [ n ] to produce:
y[n] =
M1
w
[ n ]x [ n ]
m [ n ]x [ n m ] = w
(9.17)
m=0
(9.18)
(9.19)
(9.20)
where
M1
tap-input power =
E{ x[n k] }
(9.21)
k=0
(9.22)
97
d[n]
Delay
x[n]
Adaptive
Filter
y[n]
e[n]
System Identification
s[n]
d[n]
Plant
Adaptive
Filter
x[n]
y[n]
e[n]
Equalization
s[n]
Training
Pattern
Delay
Plant/
Channel
Adaptive
+
Filter
x
[
n
]
+
Noise
y[n]
d[n]
e[n]
Interference Canceling
d[n]
Signal +
Interference
Interference
x[n]
Adaptive
Filter
y[n]
e[n]
x[n ]
Adaptive
Filter
e[n]
y[n]
99
(9.23)
A
SNR = ---------22 w
(9.24)
910
[n,x,y,e,wo,F,Wo] = lms_ale(10,1000,64,.01/64);
plot(n,e.^2)
subplot(211)
plot(n,x)
axis([600 1000 -1.5 1.5])
subplot(212)
plot(n,y)
plot(F,Wo)
911
Convergence Occurs
in Here (~275 samples)
x[n]
0.5
0
-0.5
-1
-1.5
600
650
700
750
650
700
750
800
850
900
950
1000
800
850
900
950
1000
y[n]
0.5
0
-0.5
-1
600
Index n
912
-5
Sinusoid Frequency
-10
|Wo(f)|dB
-15
-20
-25
-30
-35
-40
-45
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
Normalized Frequency f
A C version of the above MATLAB code would be very similar except all of the vector operations would have to be
replaced by for loops
TBD
913
Signal1 +
Signal2 (or noise)
Signal2
x[n]
Adaptive
Filter
y[n]
e[n]
#define LEFT 0
#define RIGHT 1
914
915
//"error" signal=(d+n)-yn
916
//init variables
//init weights of adaptive FIR
//init buffer for delay sampless
917
The left channel input (desired) is added to the right channel input (noise) and forms the LMS input d [ n ] (dplusn)
The right channel input by itself forms the input x [ n ]
(noise)
A direct form FIR filter is implemented using floats in the
first for loop
In the second for loop the filter tap weights w[n] are
updated using coefficient beta which can be adjusted using
a GEL file; the filter history in delay[n] is also updated in
this loop
GEL Slider to toggle
between dplusn
and the error E
918
30
20
10
0
10
20
30
40
50
60
500
1000
1500
2000
2500
Frequency
3000
3500
4000
30
20
10
0
10
20
30
40
50
60
500
1000
1500
2000
2500
Frequency
3000
3500
4000
919
x[n ]
Adaptive
Filter
e[n]
y[n]
920
921
922
12
923
30
20
10
0
10
20
30
40
50
60
924
500
1000
1500
2000
2500
Frequency
3000
3500
4000
30
20
10
0
10
20
30
40
50
60
500
1000
1500
2000
2500
Frequency
3000
3500
4000
925
926