DCSP-17: Matched Filter
Jianfeng Feng
Department of Computer Science Warwick Univ., UK
Filters
• Stop or allow to pass for certain signals
as we have talked before
• Detect certain signals such as radar etc
Matched filters
0,0,0.0,0,0, 0,0,0,1,1,-1,1,-1, 0,0,0,0,0, 0,0,0,0,0, 0At time 1
Matched filters
0,0,0.0,0,0, 0,0,0,1,1,-1,1,-1, 0,0,0,0,0, 0,0,0,0,0, 0At time 2
Matched filters
0,0,0.0,0,0, 0,0,0,1,1,-1,1,-1, 0,0,0,0,0, 0,0,0,0,0, 0At time 3
Matched filters
X=(0,0,0.0,0,0, 0,0,0,1,1,-1,1,-1, 0,0,0,0,0, 0,0,0,0,0, 0 …)
To develop a filter to detect the arriving of the signal
(1,1,-1,1,-1).
y(n)= a(0) x(n)+ a(1) x(n-1)+…+ a(N) x(n-N)
find
a = ( a(0),a(1),a(2),a(3),a(4) ) ????
X=(0,0,0.0, 0, 0, 0, 0, 0, 1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0 …)
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
at time zero, a tank or a flight is appeared and detected by a radar.
y(-9) = a(0) x(-9)+ a(1) x(-10)+ a(2) x(-11) + a(3) x(-12) +a(4) x(-13) = 0
y(-8) = a(0) x(-8)+ a(1) x(-9) + a(2) x(-10) +a(3) x(-11) +a(4) x(-12) = 0
…
y(-4) = a(0) x(-4)+ a(1) x(-5) + a(2) x(-6) +a(3) x(-7) +a(4) x(-8) = a(0)
y(-3) = a(0) x(-3)+ a(1) x(-4) + a(2) x(-5) +a(3) x(- 6) +a(4) x(-7) = a(0)+a(1)
y(-2) = a(0) x(-2)+ a(1) x(-3) + a(2) x(-4) +a(3) x(-5) +a(4) x(-6) = -a(0)+a(1)+a(2)
y(-1) = a(0) x(-1)+ a(1) x(-2) + a(2) x(-3) +a(3) x(-4) +a(4) x(-5) = a(0)-a(1)+a(2)+a(3)
y(0) = a(0) x(0)+ a(1) x(-1) + a(2) x(-2) +a(3) x(-3) +a(4) x(-4) = -a(0)+a(1)-a(2)+a(3)+a(4)
y(1 ) = a(0) x(1)+ a(1) x(0) + a(2) x(-1) +a(3) x(-2) +a(4) x(-3) = -a(1)+a(2)-a(3)+a(4)
…..
We have
2 2 2 2 2
2 2 2 2 2
y(0) = a(0)x(0)+a(1)x(-1)+a(2)x(-2)+a(3)x(-3)+a(4)x(-4)
(0) (1) (2) (3) (4)
(0) ( 1) ( 2) ( 3) ( 4)
a a a a a
x x x x x
The equality is true if and only if
a (i) = x (-i)
Matched Filter
A filter is called a matched filter for sequence s if
Advantage: easy to implement and efficient
Disadvantage: we know the exact signal we want to detect before hand.
Also known as Linear correlation detector
( ) ( )/ || ||a n s n s
6 8 4 3 2 10 -1 -2 -3 -4 -5 time
Question:
• Could you develop a matched filter to detect it?
• y (0) = a(0) x(0) + a(1) x(-1) + a(2) x(-2)
+ a(3) x(-3) +a(4) x(-4) + a(5)x(-5)
= a(0) a(0) + a(1) a(1) +a(2)a(2)
+a(3)a(3) + a(4)a(4)+a(5)a(5)
2ab <= a^2 + b^2 and the equality holds iff a=b
Correlation
( ) ( )
( ) ( )
( ) ( ) ( )
m
m
xxm
a n m x m
x m n x m
x m x m n r n
rxx(0)
rxx (1)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
Correlation between two sequences
( ) ( )
( ) ( )
( ) ( ) ( )
m
m
xym
y n m x m
y m n x m
y m x m n r n
rxy(0)
rxy (1)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
y(1) y(8) y(9) y(10) y(11) y(12)y(3) y(4) y(5) y(6) y(7)y(2)
X(1) X(8) X(9) X(10) X(11) X(12)X(3) X(4) X(5) X(6) X(7)X(2)
y(1) y(8) y(9) y(10) y(11) y(12)y(3) y(4) y(5) y(6) y(7)y(2)
Correlation measures the difference between two objects
D(X,Y)= 2 – 2 rXY(0)
if we assume that ||X|| = || Y || =1.
Image Enhancement
Contrast enhancement
Ideas:
Look at the following two images, generated from the following Matlab code
x1=abs(1*randn(205,232));
figure, imshow(x1);
X2=(rand(205,232));
figure,imshow(x2);
1 2 3 4
grey level
1 2 3 4
grey level
1 2 3 4
Property
For a random variable X, let F be its distribution function i.e.
F(x) = P(X<= x)
Then the distribution of F(X) is uniform
P(F(X) <=x)=x
Histogram Equalization
Note how the image is extremely grey; it lacks detail since the