Professional Documents
Culture Documents
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
dBH cutoff dBH max 20 log10 12
dBH 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
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
18
Cascading Filters
Cascading filters improves rolloff slope:
wc
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 jn d
1
c
1
2 c
e jn d
sin c n
hn
n
Ideal lowpass filter
21
Ideal Lowpass Filter
sin c n
hn
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
hne jn
n0
linear phase
e
j N2
h 2
N
2
~
N /2
n1
hN2 ncos n
D = -q(w)/w = N/2 pure-real H(w) from cosine basis
27
Linear Phase FIR: Type 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
n1
j N2 n
e
j N2 n
je
j N2
2
N /2
n1
hN2 nsin 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 hN1
j N2
H e j
je
n1 2
n sin 2
n 1
fractional-sample
delay
33
Linear Phase FIR: Type 4
34
4 Linear Phase FIR Types
35
exercise
36