Professional Documents
Culture Documents
3 Matched Filter
3 Matched Filter
3 Matched Filter
Problem: we have two signals x[n] and y[n] . How “close” are they to each other?
0.8
0.6
Transmit
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 2 4 6 8 10 12 14 16 18 20
1.5
0.5
Receive 0
-0.5
-1
-1.5
-2
0 20 40 60 80 100 120 140 160 180
Example: Radar Return
Since we know what we are looking for, we keep comparing what we receive
with what we sent.
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0
-0.2
-0.2
-0.4
-0.4
-0.6
-0.6
-0.8
-0.8
-1
0 2 4 6 8 10 12 14 16 18 20
-1
0 2 4 6 8 10 12 14 16 18 20
1.5
0.5
Receive -0.5
-1
-1.5
-2
0 20 40 60 80 100 120 140 160 180
Problem: we have two signals x[n] and y[n] . How “close” are they to each other?
N 1
rxy x[n] y *[n]
n 0
Properties:
N 1 N 1
rxx x[n]x [n] x[n] 0
* 2
n 0 n 0
2
rxy rxx ryy
2
rxy rxx ryy if and only if y[n] C x[n] for some constant C
How we measure similarity (correlation coefficient)
Compute:
| rxy |
xy
rxx ryy
0 xy 1
xy 0 xy 1
1.5
2 2
1
1
1
0.5
0 0
0
-0.5 -1
-1
-1
-2
-2
-1.5
-3
-3 0 100 200 300 400 500 600 700 800 900 1000
-2 0 100 200 300 400 500 600 700 800 900
0 100 200 300 400 500 600 700 800 900
rxy 2.27
rxx 500
ryy 982
xy 0.003 NO Correlation!
Back to the Example: with return
1.5
2 2
1
0.5 1 1.5
0
0 1
-0.5
-1
-1 0.5
-1.5 -2
0
-2
0 100 200 300 400 500 600 700 800 900 -3
0 100 200 300 400 500 600 700 800 900
-0.5
0 100 200 300 400 500 600 700 800 900 1000
rxy 494
rxx 500
ryy 754
0.8 Good Correlation!
Inner Product in Matlab
x 2
1.5
2
1
1
0.5
0 0
-0.5
-1 -1
-1.5
-2
-2
-2.5
0 50 100 150 200 250 300 -3
0 50 100 150 200 250 300
Then:
Compute these:
19.7
rxy x * y ' 19.7 xy 0.0856 0
218.8 241.9
rxx x * x' 218.8
x,y are not correlated
ryy y * y ' 241.9
Example
0
rxx x * x' 229.6
-1
Then:
y
3
2
230.9
xy 0.9955 1
229.6 234.3
1
-1
x 2
2
1
1
0
0
-1
-1
-2
-2
-3
0 50 100 150 200 250 300
-3
0 50 100 150 200 250 300
Then:
Compute these:
230.9
rxy x * y ' 230.9 xy 0.9955 1
229.6 234.3
rxx x * x' 229.6
x,y are strongly correlated
ryy y * y ' 234.3
Typical Application: Radar
Send a Pulse…
s[n]
n
N
y[n]
n
n0
“Slide” the pulse s[n] over the received signal and see
when the inner product is maximum:
N 1
rys [n] y[n ]s *[] rys [n] 0, if n n0
0
y[] n
n0
s[]
N
Use Inner Product
“Slide” the pulse x[n] over the received signal and see
when the inner product is maximum:
N 1
rys [n] y[n ]s *[] MAX if n n0
0
y[] n0
s[]
N
Matched Filter
i.e. n n0 N 1
Example
0.8
0.6
0.4
s[n] 0.2
-0.2
-0.4
-0.6
-0.8
Max at n=119
-1
0 2 4 6 8 10 12 14 16 18 20
n0 119 20 1 100
Received signal:
12
y[n] 1.5
10
rˆ[n]
1
y[n]
8
0.5
6
h[n]
4
-0.5 2
0
-1
-2
-1.5
-4
-2
0 20 40 60 80 100 120 140 160 180
-6
0 20 40 60 80 100 120 140 160 180 200
A rss [n n0 ]
N 1
The term rss [ n] s[n ]s []
*
0
is called the “autocorrelation of s[n]”. This characterizes
the pulse.
Example: a square pulse
0 N 1 n N N n
N 1
rss [ n] s[n ]s *[] ?
0 N 1 N 1
rss [0] s[]s [] s[] N
* 2
0 0
N 2 N 2
0 0
N 1 k N 1 k
rss [k ] s[k ]s [] 1 N k
0
*
0
N 1 k N 1
rss [k ] s[
0
k ]s *
[] 1 N k
k
Compute it in Matlab
s[n]
20
1 18
16
0 N 1 n 14
12
10
8
N=20; % data length 6
rss=xcorr(s); % autocorr 0
-20 -15 -10 -5 0 5 10 15 20
25
1
20
0.8
0.6 15
0.4
0.2 10
0
5
-0.2
-0.4
0
-0.6
-0.8 -5
-1
0 5 10 15 20 25 30 35 40 45 50
-10
-15
-20
s[n], n 0,...,49
-50 -40 -30 -20 -10 0 10 20 30 40 50
30
1
25
0.8
0.6 20
0.4
15
0.2
0
10
-0.2
-0.4
5
-0.6
0
-0.8
-1 -5
0 5 10 15 20 25 30 35 40 45 50
-10
-50 -40 -30 -20 -10 0 10 20 30 40 50
50
2.5
40
2
1.5
30
1
0.5
20
0
-0.5
10
-1
-1.5
0
-2
-2.5
0 5 10 15 20 25 30 35 40 45 50
-10
-20
-50 -40 -30 -20 -10 0 10 20 30 40 50
s[n], n 0,...,49
s[n]
1
0.8 2
0.8
0.6
0.6
1.5
0.4
0.4 1
0.2
0.2 0.5
0
0
0
-0.2 -0.2
-0.5
-0.4 -0.4
-1
-0.6 -0.6
-1.5
-0.8 -0.8
-2
-1 -1
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
-2.5
0 5 10 15 20 25 30 35 40 45 50
30 50
rss [n]
25
25
20 40
15 20
30
10 15
5 20
10
0
5 10
-5
0 0
-10
-15 -5
-10
-20 -10
-50 -40 -30 -20 -10 0 10 20 30 40 50 -50 -40 -30 -20 -10 0 10 20 30 40 50
-20
-50 -40 -30 -20 -10 0 10 20 30 40 50
Two best!
Detection with Noise
w[n] 2
-1
-2
-3
-4
0 100 200 300 400 500 600 700 800 900 1000
White Noise
rss [n]
n
White Noise and Filters
1 M 1
1 M 1 N 1 N 1
h[1 ]h[2 ]w[n 1 ]w[n 2 ]
2
w[ n]
M n 0 M n 0 1 0 2 0
N 1 N 1
1 M 1
h[1 ]h[2 ] w[n 1 ]w[n 2 ]
1 0 2 0 M n 0
N 1 2 1
M 1
h[]
2
w[n]
0 M n 0
White Noise
N 1 2
PW h[ n] Pw
n 0
Back to the Match Filter
At the peak:
At the peak:
N 1 2
N 1
Arss [0] | As[n] | | s[n] |2
2
n 0 n 0
N 1 2
PW | s[n] | PW
n 0
N 1 2
N PS s[n]
SNR peak n 0 N SNR
N 1 2
s[n] PW
n 0
Example
2 30
1.5 25
20
1
15
0.5
10
0
5
-0.5
0
-1 -5
-1.5 -10
-15
-2 0 200 400 600 800 1000 1200
0 50 100 150 200 250 300
50
2
40
1.5
30
1
0.5 20
0
10
-0.5
0
-1
-1.5 -10
-2
0 50 100 150 200 250 300 -20
0 200 400 600 800 1000 1200
160
2 140
1.5 120
1 100
0.5 80
0 60
-0.5 40
-1 20
-1.5 0
-2
0 50 100 150 200 250 300
-20
-40
0 200 400 600 800 1000 1200 1400