You are on page 1of 36

ELEN E4810: Digital Signal Processing

Topic 6:
Filters - Introduction
1. Simple Filters
2. Ideal Filters
3. Linear Phase and FIR filter types

1
1. Simple Filters
 Filter = system for altering signal in
some ‘useful’ way
 LSI systems:
 are characterized by H(z) (or h[n])
 have different gains (& phase shifts)
at different frequencies
 can be designed systematically
for specific filtering tasks

2
FIR & IIR
 FIR = finite impulse response
 no feedback in block diagram
 no poles (only zeros)
 IIR = infinite impulse response
 poles (and perhaps zeros)

3
Simple FIR Lowpass hL[n]
1
/2
 hL[n] = { /2 /2}
1 1
n
-2 -1 1 2 3 4

(2 pt moving avg.)

z 1
H L z   1 z
1
2  1
 
2z
zero at
z = -1
1
ZP

ejw/2+e-jw/2 |HL(ejw)|

  HL e   e
j  j 2
cos 2
1
/2 sample delay pw
 4
Simple FIR Lowpass
 Filters are often |H(ejw)|
characterized by their
cutoff frequency wc: wc w
Cutoff frequency is most often defined
as the half-power point i.e.
j c 2
 
2
H e    21 max H e j
 H  12 H max
 If    cos 2
H e j

1 1
then  c  2 cos 2  2
 5
deciBels
 Filter magnitude responses are very
often described in deciBels (dB)
 dB is simply a scaled log value:
power =
dB  20 log10 level   10 log10  power level2
 Half-power also known as 3dB point:
H cutoff  12 H max
 dBH cutoff  dBH max  20 log10  12 
 dBH max  3.01

6
deciBels
 We often plot magnitudes in dB:

 A gain of 0 corresponds to - dB

7
Simple FIR Highpass hH[n]
1
/2
 hH[n] = {1/2 -1/2} -2 -1 2 3 4
n
-1/2

zero at
z 1 z=1
1
2 
H H z   1  z 1


2z 1
ZP

|HH(ejw)|
 
 H H e j  je  j 2 sin  2

 3dB point wc = p/2 (again) wc pw
8
FIR Lowpass and Highpass
 Note:
hL[n] = {1/2 1/2} hH[n] = {1/2 -1/2}
n
 i.e. hH n  (1) hL n j -j

 H H z   H L z  -1
1
1
-1
-j z j -z
i.e. 180° rotation of |HL(ejw)|
the z-plane, w
  p shift of frequency 2p
|HH(ejw)|
response w
9
Simple IIR Lowpass
IIR  feedback, zeros and poles,
conditional stability, h[n] less useful
1
1 z
H LP z   K 1
scale to make 1  z
gain = 1 at w = 0
 K = (1 - a)/2


pole-zero frequency FR on
diagram response log-log axes
10
Simple IIR Lowpass max = 1
1
1 z using K=(1-a)/2
H LP z   K 1
1  z
 Cutoff freq. wc from 2 max
 
H LP e j c

2
1    1 e 1 e  1
2  j j
 
 c


c

4 1  e  j

c
1  e  2
j c


2 1  sin  c
 cos  c  2
 
1  cos  c
Design Equation

11
Simple IIR Highpass
1  z 1
H HP z   K 1
1  z
Pass w = p  HHP(-1) = 1
 K = (1+a)/2

Design Equation:
1  sin  c

cos  c
(again)

12
Highpass and Lowpass
 Consider lowpass filter:
 1  0
 
H LP e j
 
~ 0 large 
 Then:
 0  0
 
1  H LP e j
 
~ 1 large 
• Highpass
• c/w (-1)nh[n]
just another z poly
 However,
1 - H LP ( z)  1 - H LP (z )
(unless H(ejw) is pure real - not for IIR)

13
Simple IIR Bandpass
2
1 1 z
H BP z  
2 1   1  z 1  z 2

K
1 z 1  z 
1 1

1 2 2
1  2r cos   z  r z
 1  
where r   cos  
2 
1
Center freq  c  cos 
Design

3dB bandwidth B  cos1  


2 

2
 1  
14
Simple Filter Example
 Design a second-order IIR bandpass
filter with wc = 0.4p, 3dB b/w of 0.1p
 c  0.4    cos  c  0.3090
2
B  0.1  2
 cos0.1     0.7265
1  2
1 1 z
  H BP z   1 2
2 1   1  z  z
 0.13671  z 2
 1 2 sensitive..
1  0.5335z  0.7265z
15
M
Simple IIR Bandstop
zeros at wc
1 2
1  1  2z  z
H BS z  
2 1   1  z 1  z 2
same poles as HBP
 Design eqns:
1
 c  cos     cos  c
1  2 
B  cos  2 
1  
 1 1
   2
1
cos B cos B
16
Cascading Filters
 Repeating a filter (cascade connection)
makes its characteristics more abrupt:
H(ejw) |H(ejw)|
w
H(ejw) H(ejw) H(ejw) |H(ejw)|3
w

 Repeated roots in z-plane:


1
ZP

17
Cascading Filters
 Cascade systems are higher order
e.g. longer (finite) impulse response:
h[n] h[n]*h[n] h[n]*h[n]*h[n]
1
/2 1
/4 1
/8
-2 -1 2 3 4
n -2 -1 2 3 4
n -2 -1 2 4
n
-1/2 - 1/ 2 -3/8

 In general, cascade filters will not be


optimal (...) for a given order

18
Cascading Filters
 Cascading filters improves rolloff slope:
wc

 But: 3dB cutoff frequency will change


(gain at wc  3N dB)
19
2. Ideal filters
 Typical filter requirements:
 gain = 1 for wanted parts (pass band)
 gain = 0 for unwanted parts (stop band)
 “Ideal” characteristics |H(ejw)|
“brickwall
would be like: LP filter”
 no phase distortion etc. w
 What is this filter?
 can calculate IR h[n] as IDFT of ideal
response...

20
Ideal Lowpass Filter
Given ideal H(ejw):
(assume q(w) = 0) -p -wc wc p w

  
h n  IDTFT H e  
j

 2    H e j e jn d

1

c
 1
2  c
e jn d
sin  c n
 hn 
n
Ideal lowpass filter

21
Ideal Lowpass Filter
sin  c n
hn 
n
 Problems!
 doubly infinite (n = -..)
 no rational polynomial  very long FIR
 excellent frequency-domain characteristics
 poor time-domain characteristics
(blurring, ringing – a general problem)

22
Practical filter specifications
• allow PB ripples • allow transition band
1
|H(ejw)| / dB w
-1
Pass band Stop band

Transition
-40

• allow SB ripples
 lower-order realization (less computation)
 better time-domain properties (less ringing)
 easier to design...
23
3. Linear-phase Filters
 |H(ejw)| alone can hide phase distortion
 differing delays for adjacent frequencies
can mangle the signal
 Prefer filters with a flat phase response
e.g. q(w) = 0 “zero phase filter”
 A filter with constant delay tp = D at all
freq’s has q(w) = -Dw “linear phase”
H e  
j
e ˜
 jD
H  
pure-real (zero-phase)
portion
 Linear phase can ‘shift’ to zero phase
24
Time reversal filtering
v[n] u[n] w[n]
Time Time
x[n] H(z) reversal H(z) reversal y[n]
 v[n] = x[n]*h[n]  V(ejw) = H(ejw)X(ejw)
 u[n] = v[-n]  U(ejw) = V(e-jw) = V*(ejw) if v real
 w[n] = u[n]*h[n]  W(ejw) = H(ejw)U(ejw)
 y[n] = w[-n]  Y(ejw) = W*(ejw)
= (H(ejw)(H(ejw)X(ejw))*)*
 Y(ejw) = X(ejw)|H(ejw)|2
 Achieves zero-phase result
 Not causal! Need whole signal first
25
Linear Phase FIR filters
 (Anti)Symmetric FIR filters are almost
the only way to get zero/linear phase
 4 types:

26
Linear Phase FIR: Type 1
 Length L odd  order N = L - 1 even
 Symmetric  h[n] = h[N - n]
(h[N/2] unique)
 
N

H e j
 hne jn
n0

linear phase
e
 j N2

h  2
N
2
~
N /2
n1
hN2  ncos n 
D = -q(w)/w = N/2 pure-real H(w) from cosine basis


27
Linear Phase FIR: Type 1

 Where are the N zeros?


hn  hn  H z   z H 1z 
N Conjugate
reciprocal
constellation
thus for a zero z Reciprocal

H    0  H   0
1 pair

 Reciprocal zeros No reciprocal


(as well as cpx conj) on u.circle
28
Linear Phase FIR: Type 2
 Length L even  order N = L - 1 odd
 Symmetric  h[n] = h[N - n]
(no unique point)
N1 / 2

 
H e j
e
 j N2
n1 hN1
2
 n cos  n  2
1

Non-integer delay ~
H(w) from double-length cosine basis
of N/2 samples
always
zero
 at w=p

29
Linear Phase FIR: Type 2

 Zeros:  
H z  z N
H 1z  LPF-like
N
 
j
at z = -1, H 1  1 H 1  H e  0
odd
30
Linear Phase FIR: Type 3
 Length L odd  order N = L - 1 even
 Antisymmetric  h[n] = -h[N - n]
 h[N/2]= -h[N/2] = 0
 H e 
j N /2
  h 2  n  e
N
n1 
 j N2 n 
e
 j N2 n 

 je
 j N2

2
N /2
n1
hN2  nsin n 
q(w) = p/2 - w·N/2
Antisymmetric 
p/2 phase shift in
addition to linear phase

31
Linear Phase FIR: Type 3

Zeros: H z   z N H 1 
z
 H 1  H 1  0 ; H 1  H 1  0
32
Linear Phase FIR: Type 4
 Length L even  order N = L - 1 odd
 Antisymmetric  h[n] = -h[N - n]
(no center point)
 
N /2
2 hN1
 j N2
 H e j
 je
n1 2
 n sin   2
n  1

p/2 offset offset sine basis

fractional-sample
delay


33
Linear Phase FIR: Type 4

 Zeros: H 1  H 1  0


(H(-1) OK because N is odd)

34
4 Linear Phase FIR Types

35
exercise

36

You might also like