You are on page 1of 10

ELEN E4810: Digital Signal Processing

Review Session
1. Filter design
2. Allpass & Minimum phase
3. IIR filter design
4. FIR filter design
5. Implementations
6. FFT

Dan Ellis 2012-12-12 1


Filter Design
 Filters select frequency regions
 Performance Margins
\G(ejW)\
0
passband
ripple
-10 Passband optimal minimum

transition band
filter stopband
will touch attenuation
-20 here
gain / dB

Stopband
-30

-40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 P
passband stopband frequency W
edge edge
frequency frequency

Dan Ellis 2012-12-12 2


Allpass Filters
 Constant gain, variable phase
 Mirror-image polynomial
d M + d M 1z 1 + ...+ d1z  ( M 1) + z M
AM (z ) = ± 1  ( M 1)
1+ d1z + ...+ d M 1z + d M z M

= ±z M ( )
DM z 1
DM (z )

Im{z}
1

0
 Reciprocal
−1
poles/zeros −3 −2 −1 0 1 2
Re{z}

Dan Ellis 2012-12-12 3


Minimum & Maximum Phase
 Min. phase + Allpass = Max. phase
o o

o pole-
zero
cancl’n
o

o o

(z   )(z   *
) x (z )(z )
 1  1
*
(z )(z
 1 
1 *
)
=
z ( z   )( z   *
) z

Dan Ellis 2012-12-12 4


Analog Filter Types
 {flat | ripple} x {passband | stopband}
Im{s}
× ΩΩc Butterworth Chebyshev I

Im{s}
1

×
gain / dB

gain / dB
0 0
0.5
Re{s} -10 -10 r
-20 -20 0

×  s 2N
= 1
-30 -30
  -0.5

×  c  -40 -40

-50 -50 -1
c p -1 -0.5 0 0.5 1
Re{s}
s-plane -60
0 0.5 1 1.5 2
-60
0 0.5 1 1.5 2

Chebyshev II Elliptical
gain / dB

gain / dB
0 0

-10 -10 r
-20 -20

-30 -30

-40
A -40
A
-50 -50
s p
-60 -60
0 0.5 1 1.5 2 0 0.5 1 1.5 2

Dan Ellis 2012-12-12 5


Bilinear Transform 1 z z 1
1
s= =
1+z 1 z+1
 Analog IIR to Discrete-time IIR
Im{s} Im{z} |G(ej )|
Im u.c. ej!
jΩΩ 0.8
Re{s} Re{z}
= 2tan 1( )
1 0.6

s-plane LHHP UCI z-plane 0.4

0.2

0
-60 -40 -20 0

0
|Ha(j )|

( ) = H a ( j)  =2 tan
j -20

Ge 1
 -40

-60

“Pre-warp” to design
0 1 2 3 4 5 6

Dan Ellis 2012-12-12 6


FIR Filters
 Linear Phase FIR filters, e.g. h[n] = h[N-n]
~
( ) =
N
1 H(!)
! H e j
h[n]e jn
n=0

h[n]
∠(!)

linear phase
=e
 j N2
(
h[ N
2 ] + 2n=1 h[ N2  n] cos n)
N /2

D n ZP D = -µ(!)/! = N/2

 Windowed ideal responses


W W W
P P P P P P

Hd(ej!) DTFT{wR[n]} Ht(ej!)

Dan Ellis 2012-12-12 7


Parks-McClellan FIR design
 Gradient descent to find best FIR filter
 At least M+2 alternating extrema
(order = 2M, length = order + 1)
>> h=firpm(10,
[0 0.4 0.6 1],


[1 1 0 0], [1 2]);
0.6 ~
h[n] 1 H(W) 1
0.4
0.5
0.2 0.5 0
-0.5
0

-0.2 n 0
W
-1 z-plane
-5 0 5 0 0.5 1 -1 0 1 2

Dan Ellis 2012-12-12 8


Implementations
 Polynomial indicates implementation
 Decompose into common blocks
(second order sections)

x + + + + + + y
p0
z-1 z-1 z-1
Æ1 -∞1 2Æ2 z-1 -2∞2 z-1
−(Æ22+Ø22) ∞22+±22

Dan Ellis 2012-12-12 9


FFT
N 1
X[k] = n=0 x[n] · WNnk
N N
1 1
= 2
m=0 x[2m] · W N + mk
WNk 2
m=0 x[2m + 1] · W N
mk
2 2
X0[<k>N/2] X1[<k>N/2]
N/2 pt DFT of x for even n N/2 pt DFT of x for odd n

different from before X0[0] same as before


0
WN/2
x[0] DFTN X X[0]
00 X0[1] WN0
x[4] 4 X[1]
X0[2] WN1
x[2] DFTN X01 X[2]
X0[3] WN2
x[6] 4
3
X[3]
WN/2 WN3
X1[0]
x[1] DFTN X
0
WN/2 X[4]
10 X1[1] WN4
x[5] 4 X[5]
X1[2] WN5
x[3] DFTN X11 X[6]
X1[3] WN6
x[7] 4 X[7]
3
WN/2 WN7

Dan Ellis 2012-12-12 10

You might also like