You are on page 1of 18

Design of 2D Finite-Impulse-Response (FIR) Filters

2-D FIR Filter Design Problem


Let

I (1 , 2 ): Frequency response of ideal filter


and

i ( n1 , n 2 ) : Impulse response of ideal filter

I (1 , 2 ) = i(n1 , n2 )e j1n1 e j2n2


n1

n2

9 I (1 , 2 ) consists of an infinite summation and cannot be realized in


practice
9 Approximate I (1 , 2 ) by a finite-degree polynomial function

H (1 , 2 ) =

N12

N 22

n1 = N11 n2 = N 21

h( n1 , n2 ) e j1n1 e j 2 n2
1
424
3

coefficients to be
computed

FIR Filter

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters

2-D FIR Filter design using windows


Truncates infinite sum
9 Id
Identical
ti l tto 1-D
1 D procedure
d
9 Spatial or time-domain method

Review of 1-D Procedure


) w( n )
1 Set h( n ) = i ( n ).
1.
2. Then

1
H ( ) =
2

I ( )W ( )d

3. The window w(n) should be chosen such that


- it is N-point long
- its DTFT W ( ) ( )
- w(n) should be conjugate symmetric if H() is to be linear-phase

w( n ) = w* ( N 1 n );

EEE 507 - Lecture 12

0 n N 1
Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters

2-D FIR Filter design using windows


The 2-D Procedure
1 Set
1.
S t h( n1 , n2 ) = i ( n1 , n2 ).
) w(n1 , n2 )
2. Then

H (1 , 2 ) =

1
4

I ( ,
1

)W (1 1 , 2 2 )d1d 2

3. The window w(n1,n2) should be chosen such that (Good


Window criteria)
- it is N1xN2 points in extent
- its DTFT W (1 , 2 ) (1 , 2 )
- w(n1,n2) should be conjugate symmetric if H(1,2) is to be
linear-phase
linear
phase

w(n1 , n2 ) = w* ( N1 1 n1 , N 2 1 n2 ); 0 n1 N1 1
0 n2 N 2 1
EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters

2 D FIR Filter design using windows


2-D
Choosing The 2-D Window
9 1-D windows often used for generating 2-D windows
9 Two common methods:
- Method 1:
w( n1 , n 2 ) = w1 ( n1 ).w2 ( n 2 )
a)) 2D window formed as the outer p
product of Good 1-D windows
b) w( n1 , n 2 ) has a rectangular region of support
c) Main lobe shape and side lobe heights can be calculated using
1-D results

W (1 , 2 ) = W1 (1 ).
) W2 ( 2 )

- Method 2:

w( n1 , n2 ) = w( n1 + n2 )
2

a) w(n) is a Good 1-D continous window function


b) w(n1,n2) is a sampled and approximately a circularly rotated
version of the 1-D window.
EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design
g of 2D Finite-Impulse-Response
p
p
((FIR)) Filters

2-D FIR Filter design using windows


Example 1: 11x11 lowpass FIR filter design based on an outer product
window and a 1-D Kaiser window

Perspective Plot of Magnitude Response

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design
g of 2D Finite-Impulse-Response
p
p
((FIR)) Filters

2-D FIR Filter design using windows


Example 1: 11x11 lowpass FIR filter design based on an outer
product window and a 1
1-D
D Kaiser window

Contour Plot of Magnitude Response

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design
g of 2D Finite-Impulse-Response
p
p
((FIR)) Filters

2-D FIR Filter design using windows


Example 2: 11x11 lowpass FIR filter design based on a rotated window
and a 1
1-D
D Kaiser window

Perspective Plot of Magnitude Response

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design
g of 2D Finite-Impulse-Response
p
p
((FIR)) Filters

2-D FIR Filter design using windows


Example 2: 11x11 lowpass FIR filter design based on a rotated
window
i d
and
da1
1-D
DK
Kaiser
i
window
i d

Contour Plot of Magnitude Response

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal FIR Filter Design
Error measure needed to assess how much the designed filter
I (1 , 2 ) deviates from the desired ideal filter H (1 , 2 )
Define

E (1 , 2 ) = H (1 , 2 ) I (1 , 2 )
= I (1 , 2 ) + h(n1 , n2 )e j1n1 e j 2 n2
n1

n2

( 1,n2) in
(n
finite-extent ROS

Choose the filter coefficients to minimize some function of this error


9 L2 Norm:

E2 = {

1
4 2

9 Lp Norm:

Ep = {
9 L Norm:

EEE 507 - Lecture 12

1
4 2

E (1 , 2 ) d1d2 }1 / 2
2

E (1 , 2 ) d1d2 }1 / p
p

E = max E ( , )
(1 , 2 )B
1 2
Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Least-Squares Designs
1

4 2

= [ h(n1 , n2 ) i (n1 , n2 ) ] 2 ;
n n

E =
2
2

E (1 , 2 ) d1d 2
2

If R is the region of support of h(n1,n2):

E 22 =

2
2
[
]
[
]
h
(
n
,
n
)

i
(
n
,
n
)
+
i
(
n
,
n
)
1 2
1 2
1
2

( n1 n2 )R

( n1 n2 )R

To minimize E22, set

(n1 , n2 ) R

else

= i (n1 , n2 ) (n1 , n2 )

i (n1 , n2 ) ,
h(n1 , n2 ) =
0 ,

where w(n1,n2) is a rectangular window with support R.


EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Design with Constraints
E (1 , 2 ) =

h(n , n

( n1 ,n2 )R

) exp[ j1n1 j2 n2 ] I (1 , 2 )

We have been treating the filter coefficients as if they were independent.


These may be constrained.
Example:
p Design
g of a zero-phase
p
filter with real coefficients
(i.e., H(1, 2) Symmetric) h( n1 , n2 ) = h( n1 , n2 )
E (1 , 2 ) = h(0,0) +

2h(n , n ) cos[ n + n ]
1

1 1

2 2

I (1 , 2 )

( n1 , n2 )R

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters

Optimal Design with Constraints


Example: Design of a zero-phase filter with real coefficients (continued)
=> H(1, 2) & h(n1,n2) even symmetric

E (1 , 2 ) = h(0,0) +

2h(n , n ) cos[ n + n ]
1

1 1

( n1 , n2 )R

= a (i )i (1 , 2 ) I (1 , 2 )
i =1

where (assuming filter is (2N+1)x(2N+1))

2N+1

2 2

I (1 , 2 )

()

F= # of degrees of freedom = # samples in region above


( 2 N + 1) 2 + 1
=
= 2N 2 + 2N + 1
2

i =1
h(0,0) ,
2h( n1 , n2 ) , i = ( 2 N + 1)n2 + n1 + 1

a(i) = ith free parameter =

i (1 , 2 ) = ith basis function


= cos(1n1 + 2 n2 ),

i = ( 2 N + 1) n2 + n1 + 1

Note: For any linear constraints, the error can be written in the form (*); but F,
( ), i((1, 2) will differ for different choices of constraints.
a(i),
EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal
O ti l D
Design
i with
ith C
Constraints
t i t
F

E (1 , 2 ) = a (i )i (1 , 2 ) I (1 , 2 )

i =1
where
F = # of degrees of freedom = # of free parameters
a(i) = ith free parameter
i (1 , 2 ) =ith basis function
Example: Suppose we want to design a 5x5 circularly symmetric
lowpass FIR filter. The ideal frequency response is given by:

1,
I (1 , 2 ) =
0,

12 + 2 2 R 2
otherwise

i ( n1 , n2 ) = f ( n1 + n2 ) = " JINC" function of


2

n1 + n2
2

So, we would like to have:


2
2
h ( n1 , n 2 ) = f ( n1 + n2 ) = h ( n1 , n2 ) = h ( n2 , n1 )

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Design with Constraints
Example: Design of a 5x5 circularly symmetric lowpass filter (continued)
2
2
h ( n , n ) = f ( n + n ) = h ( n , n ) = h ( n , n )
1

h( 2,2) h( 2,1) h( 2,0) h( 2,1) h( 2,2)


h( 2,1) h(1,1) h(1,0) h(1,1) h( 2,1)
h( 2,0) h(1,0) h(0,0)

h(1,0)

h( 2,0)

h( 2,1) h(1,1)

h(1,1)

h( 2,1)

h( 2,2) h( 2,1) h( 2,0) h( 2,1)

h( 2,2)

h(1,0)

only 6 out of the 25


parameters are free.

H (1 , 2 ) =

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Design with Constraints
Example: Design of a 5x5 circularly symmetric lowpass filter (continued)

H (1 , 2 ) =

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Design with Constraints
Example: Design of a 5x5 circularly symmetric lowpass filter (continued)
F

H (1 , 2 ) = a (i )i (1 , 2 ) =
i =1

where F =

a (1) =
a (2) =
a (3) =
M
a( F ) =
EEE 507 - Lecture 12

1 (1 , 2 ) =
2 (1 , 2 ) =
3 (1 , 2 ) =
M

F (1 , 2 ) =
Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Least-Square
Least Square Designs with Constraints
E2 =
2

1
4

a(i) ( ,
i

i =1

) I (1 , 2 ) d1d 2

Taking
g the derivative of E22 with respect
p
to the each of the a(i)
( ) and setting
g the
result to zero gives the following set of F linear equations:
F

a(i )
where

ik

i =1

= IK ;

K = 1,2,..., F

4 2
1

IK =
I
(

1
2
K (1 , 2 )d1d2
4 2
Note: If orthogonal basis { ( , )} , then
i
1
2

iK =

iK = 0; i K

i (1 , 2 )K (1 , 2 )d1d2

a(i ) =

Ii

ii

=> Equations become very easy to solve


Issues:
9 Integral may be difficult to solve
9 No possibility of frequency weighting.
EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

Design of 2D Finite-Impulse-Response (FIR) Filters


Optimal Designs with Constraints
Discrete Solutions
9 Previous difficulties can be partially alleviated by replacing E2 by

E2 Wm [ H (1m , 2 m ) I (1m , 2 m )]
m

= Wm [ a(i )i (1m , 2 m ) I (1m , 2 m )]


m

i=1

WM 0

- Weights

- Error can be controlled with the values of the weights and the
y
of the samples.
p
density/locations
- The coefficients that minimize E2 are given by
F

a(i )
where
h

ik

i =1

= IK ;

K = 1,2,..., F

iK = Wmi (1m , 2 m )K * (1m , 2 m )


m

I K = Wm I (1m , 2 m )K (1m , 2 m )
*

EEE 507 - Lecture 12

Copyright by Prof. Lina Karam

You might also like