Professional Documents
Culture Documents
Notes On Filter PDF
Notes On Filter PDF
This filter produces an output which is a scaled average of three successive inputs,
with the centre point of the three weighted twice as heavily as its two adjacent
neighbours.
" !
# !$&% ! $'
which has two zeroes at ! ' ( !
"!
' i.e. ! )
. Remember
that this corresponds to a double damping at the Nyquist frequency. This will give
attenuation of HF signals i.e. a LPF effect. Alternatively we could argue to put a
71
pole at DC, some fraction *,+*
of the way along the real axis. This gives
-! ! .
+
.! $&+ % ! $&%
and thus
/ -!
. + ! $&% !$&%102"!
and in difference terms in the digital time domain
3
+456
which gives a LPF as a recurrent filter (which is thus an IIR filter). In general, we
may use out knowledge of the Laplace design of transfer functions to argue the
design in the z-domain as well. This is simple for low-order filters (as above), but
would be tedious at higher orders – there are other ways.
7 98 :
design below should still be easy to follow).
<;=(>4? A@ @
Consider an ideal low-pass characteristic (brick-wall filter) with a cut-
off frequency where sampling period:
We know that the continuous impulse response CB
is given by (and shown in
D B E
<; $ =; B
>QPSRUT9V<; BXW (6.1)
72
0.25 0.25
0.2 0.2
0.15 0.15
0.1 0.1
g[k]
g(t)
0.05 0.05
0 0
−0.05 −0.05
−0.1 −0.1
−10 −5 0 5 10 −10 −5 0 5 10
t kT (T=1)
Figure 6.1: Impulse response of brick wall filter in (left) continuous and (right)
discrete time domains.
A first solution
hence we could,
f i
g h g
3 'ed lm"
dkj
for the filter, we can also obtain its transfer function
g g
7 "! k f gn'eh d !$
dj
ating 7 -! on the unit circle (i.e. 7 I K1Mpo ). This is shown in Fig 6.3 using both
As before, we can obtain the actual frequency response of the filter by evalu-
73
0.25
0.2
0.15
shift g[k]
0.1
0.05
−0.05
−0.1
0 5 10 15 20
k
1.2
1 0
10
0.8
−1
10
0.6
0.4
−2
10
0.2
π/4
0
0 20 40 60 80 100 120 140 −3
10
π/4 0 20 40 60 80 100 120 140
Figure 6.3: Linear (left) and log (right) responses for 21 and 11 coefficients in the
brick wall filter.
Better solution
q
74
Hanning or Kaiser windows.
q
sr 0t+ elsewhere
.+Svuxw RSyU{ z .|E}(~}|
If +(v this is the Hamming window, if +(v this is the Hanning, or raised
cosine, window. Fig 6.4 shows the 11 point Hamming window. The Fourier
0.8
0.6
w[k]
0.4
0.2
0
0 2 4 6 8 10 12
k
transform of these windows consists of a central lobe which contains most of the
energy and side lobes which generally decay very rapidly.
The use of such a window to reduce the Fourier coefficients for the higher fre-
quency terms leads to a reduction in ripple amplitude, at the expense of a slightly
worse initial cut-off slope. The frequency response of the 21-coefficient FIR filter
filter (the filter weights on this case being computed from D5
3D5
" q
Fig. 6.3 is shown in Fig. 6.5 together with that of the equivalent “windowed”
) using
a Hamming window.
75
1.4
1.2
1 π/4
0.8
0.6
0.4
0.2
0
0 20 40 60 80 100 120 140
filters are always stable. However, if a sharp cut-off in the amplitude response is
required, a large number of coefficients are needed (usually 100).
76
6.3 Design of IIR filters
Most recursive filters have an infinite impulse response, because of the feedback
of previous outputs. Practical Infinite-Impulse-Response (IIR) filters are usually
based upon analogue equivalents (Butterworth, Chebyshev, etc.), using a transfor-
!
mation known as the bilinear transformation which maps the -plane poles and
zeros of the analogue filter into the -plane. However, it is quite possible to design
an IIR filter without any reference to analogue designs, for example by choos-
7 I KeMo k
ing appropriate locations for the poles and zeroes on the unit circle (Remember:
7 I K1Mpo `
wherever there is a zero on the unit circle, i.e. complete attenuation
of that frequency; on the other hand, when there is a pole near the
unit circle, i.e. high gain at that frequency).
!
available (some of which was explored in the first half of this lecture course).
!
The bilinear -transform is a mathematical transformation from the -domain
to the -domain which preserves the frequency characteristics and is defined by:
@
!! &$$&%% where
@ sampling period
8
!
Under this mapping, the entire axis in the -plane is mapped onto the unit
circle in the -plane; the left-half -plane is mapped inside the unit circle and the
right-half -plane is mapped outside the unit circle.
< <
The bilinear transformation gives a non-linear relationship between analogue
! bI K1Mpo
frequency and digital frequency . Since the frequency response of a digital
filter is evaluated by setting :
3.5
2.5
2
a
ω
1.5
0.5
0
0 0.5 1 1.5
ω
d
Figure 6.6: The bilinear mapping function.
78
6.4.1 Example: design of IIR filter using bilinear z-transform
Design a digital low-pass Butterworth filter with a 3dB cut-off frequency of 2kHz
and minimum attenuation of 30dB at 4.25kHz for a sampling rate of 10kHz.
Hz; hence @
$ sec.
Answer
V V
< @ L < ' @ b L v ¢>§(¨¢¦v ¦ rads/sec
' V
V
(ie. ¦ kHz and
¦v ¦ kHz – this shows the warping effect near ©"ª )
% '
The order of filter required can now be worked out as before: '
«¬ ®C¯ D DM° ± ³®C¯ D D%-d
U´ ¶¶ ·e
¡¸A¨
®-¯ M² ®C¯ %-dcµ% %
¹»º½¼ meets the specification
For a second-order Butterworth LPF,
7 -! %e$À ÁAÂ '
c¢v¤ ¡¢ ¢¸ ¤A ¨A%e$¥ À ÁA Äv¡¢¢¤¿¨¢¥
"% ÃÀ ÁAÂ %"ÃÀ Á¿Â
7 -! kv¡¢¢¤A¨A¥ ¡¢¢A¦cÅ
v #¸ ¢ ! ¢$&¤ %! $& % ! $' v¡A¢¢¦A¨ ! $'
7 -! bv¡A¢¥c¢¤
.v ¦¢¥¢
¸c#A¦ ! ! $&$&% % v! $
¸c' A¨¢ ! $'
from which we can finally write the following difference equation:
<Æv¿¢¥c¢¤
vÇv
¦
,v¡A¢¥cA¤ Ç
vÇv ¦¢¥¢¸c¿¦A5l
3
v
¸c¿¨c¿ È2p
7 "!
In order to check the magnitude characteristics of the frequency response, re-
write as:
7 -!
b
v
¡
A
¢
c
¥ A
¤ ! ' #
!
!' v
¢
¦ ¢
¥ c
¸ ¿
¦ !
¸cA¨¢
v
^ dc gain: < @ È !
which gives É\7
É
^ 3dB cut-off frequency < % @ (v >
Thus
I ¶
K k
v
¿
¢
c
¥ ¢
¤ x
u w v
¿
¨ Ê
> 8
¡
¿
¨ Ê
>
x
u w v
>Ê 8 >ÌÄ
7dz uxw ¡¨¿>Ê R 8 v ¨¿>ÍRUT9V v ¦¢¥¢¸cA¦ uÎw R v >Ê 8 RUTËV v >4Ä2v
¸cA¨c
R RUT9V R RJTËV
I ¶
K k
(
v
¡
A
¢
c
¥ ¢
¤ v
¢
¨ ¢
¢
¸
#
¨¢¸¢¸ 8
ie. 7 d a
v
¡
¢
¤ ¢
¿
¤ ¢
¦
¸
A
A
¦ ¢
¥ ¦ which gives É\7~É v¡¤Ac¤
z 8
80
7 I d ¶µ · z K
You can also check the 30dB minimum attenuation requirement by working out
.
6.4.2 Conclusion
With recursive IIR filters, we can generally achieve a desired frequency response
characteristic with a filter of lower order than for a non-recursive filter (especially
if elliptic designs are used). A recursive filter has both poles and zeroes which
can be selected by the designer, hence there are more free parameters than for a
non-recursive filter of the same order (only zeroes can be varied). However, when
the poles of an IIR filter are close to the unit circle, they need to be specified very
accurately (typically 3 to 6 decimal places) if instability is to be avoided.
81