Sunteți pe pagina 1din 59

Part 1: FIR Filters Window Method

Tutorial ISCAS 2007


Copyright 2007 Andreas Antoniou
Victoria, BC, Canada
Email: aantoniou@ieee.org
July 24, 2007
Frame # 1 Slide # 1 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method
t
A simple method for the design of FIR lters is through the
use of the Fourier series in conjunction with the application
of a class of functions known as window functions.
t
Arbitrary specications can be achieved by using a method
proposed by Kaiser.
Note: The material for this module is taken from Antoniou,
Digital Signal Processing: Signals, Systems, and Filters
Chap. 9.)
Frame # 2 Slide # 2 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method
t
A fundamental property of digital lters in general is that
they have a periodic frequency response with period equal
to the sampling frequency
s
, i.e.,
H(e
j (+k
s
)T
) = H(e
j T
)
t
Therefore, an arbitrary desired frequency response,
H(e
j T
), can be represented by a Fourier series as
H(e
j T
) =

n=
h(nT)e
j nT
(A)
where
h(nT) =
1

s
_

s
/2

s
/2
H(e
j T
)e
j nT
d
are the Fourier series coefcients.
Frame # 3 Slide # 3 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd

H(e
j T
) =

n=
h(nT)e
j nT
(A)
If we let e
j T
= z in Eq. (A), we get
H(z) =

n=
h(nT)z
n
This is the transfer function of an FIR lter with impulse
response h(nT).
Frame # 4 Slide # 4 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
Since the Fourier series coefcients are dened over the range
< n < , two problems are associated with the Fourier
series method:
t
The FIR lter obtained is of innite length.
Frame # 5 Slide # 5 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
Since the Fourier series coefcients are dened over the range
< n < , two problems are associated with the Fourier
series method:
t
The FIR lter obtained is of innite length.
t
The lter is noncausal because the impulse response is
nonzero for negative time.
Frame # 5 Slide # 6 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
A nite lter length can be achieved by truncating the
impulse response such that
h(nT) = 0 for |n| > M
where M = (N 1)/2.
Frame # 6 Slide # 7 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
A nite lter length can be achieved by truncating the
impulse response such that
h(nT) = 0 for |n| > M
where M = (N 1)/2.
t
On the other hand, a causal lter can be obtained by
delaying the impulse response by a period MT seconds or
by M sampling periods.
Frame # 6 Slide # 8 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
Since delaying the impulse response by M sampling
periods amounts to multiplying the transfer function by z
M
,
the transfer function of the causal lter assumes the form
H

(z) = z
M
M

n=M
h(nT)z
n
Frame # 7 Slide # 9 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
Since delaying the impulse response by M sampling
periods amounts to multiplying the transfer function by z
M
,
the transfer function of the causal lter assumes the form
H

(z) = z
M
M

n=M
h(nT)z
n
t
The frequency response of the causal lter is obtained by
letting z = e
j T
in the transfer function, i.e.,
H

(e
j T
) = e
jMT
M

n=M
h(nT)e
jnT
and since |e
jMT
| = 1, delaying the impulse response by
M sampling periods does not change the amplitude
response.
Frame # 7 Slide # 10 A. Antoniou Part 1: FIR Filters Window Method
Example
Design a lowpass lter with a desired frequency response
H(e
j T
)
_
1 for ||
c
0 for
c
< ||
s
/2
where
s
is the sampling frequency.
Solution The Fourier series gives the impulse response of the
noncausal lter as
h(nT) =
1

s
_

c

c
e
j nT
d =
1

s
_
e
j nT
jnT
_

c
=
1
n
(e
j
c
nT
e
j
c
nT
)
2j
=
1
n
sin
c
nT (B)
Truncating and delaying the impulse response by M sampling
periods immediately yields the required design.
Frame # 8 Slide # 11 A. Antoniou Part 1: FIR Filters Window Method
Example Contd
0 2 4 6 8 10
50
40
30
20
1.0
0
1.0
, rad/s
G
a
i
n
,

d
B

N=11
N=41
Frame # 9 Slide # 12 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
The amplitude response of the lter (magnitude of the
frequency response) exhibits oscillations in the passband
as well as the stopband, which are known as Gibbs
oscillations. They are caused by the truncation of the
Fourier series.
Frame # 10 Slide # 13 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
The amplitude response of the lter (magnitude of the
frequency response) exhibits oscillations in the passband
as well as the stopband, which are known as Gibbs
oscillations. They are caused by the truncation of the
Fourier series.
t
As the lter length is increased, the frequency of the
oscillations increases but the amplitude stays constant.
Frame # 10 Slide # 14 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
The amplitude response of the lter (magnitude of the
frequency response) exhibits oscillations in the passband
as well as the stopband, which are known as Gibbs
oscillations. They are caused by the truncation of the
Fourier series.
t
As the lter length is increased, the frequency of the
oscillations increases but the amplitude stays constant.
t
In other words, we do not seem to be able to reduce the
passband and stopband errors below a certain limit by
increasing the lter length.
Therefore, the lters that can be designed with the Fourier
series method are of little practical usefulness.
Frame # 10 Slide # 15 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
The standard technique for the reduction of Gibbs
oscillations is to truncate the innite-duration impulse
response, h(nT), through the use of a discrete-time
window function w(nT).
Frame # 11 Slide # 16 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
The standard technique for the reduction of Gibbs
oscillations is to truncate the innite-duration impulse
response, h(nT), through the use of a discrete-time
window function w(nT).
t
If we let
h
w
(nT) = w(nT)h(nT)
then a modied transfer function is obtained as
H
w
(z) = Z[w(nT)h(nT)]
=
1
2j
_

H(v)W
_
z
v
_
v
1
dv
where H(z) is the original transfer function and W(z) is the
z transform of the window function.
Frame # 11 Slide # 17 A. Antoniou Part 1: FIR Filters Window Method
Fourier Series Method Contd
t
Evaluating H
w
(z) on the unit circle z = e
j T
gives the
frequency response of the modied lter as
H
w
(e
j T
) =
T
2
_
2/T
0
H(e
j T
)W(e
j ()T
) d (C)
W(e
j T
) is the frequency spectrum of the window function
and the integral at the right-hand side is a convolution
integral.
Frame # 12 Slide # 18 A. Antoniou Part 1: FIR Filters Window Method
Window functions
Frequency spectrum of a typical window:
0
, rad/s

W(e
jT
)
A
ML
Main-lobe width
A
max

s
/2
s
/2
Frame # 13 Slide # 19 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
t
Windows are characterized by their main-lobe width, B
ML
,
which is the bandwidth between the rst negative and the
rst positive zero crossings, and by their ripple ratio, r,
which is dened as
r = 100
A
max
A
ML
% or R = 20 log
A
max
A
ML
dB
where A
max
and A
ML
are the maximum side-lobe and
main-lobe amplitudes, respectively.
Frame # 14 Slide # 20 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
t
Windows are characterized by their main-lobe width, B
ML
,
which is the bandwidth between the rst negative and the
rst positive zero crossings, and by their ripple ratio, r,
which is dened as
r = 100
A
max
A
ML
% or R = 20 log
A
max
A
ML
dB
where A
max
and A
ML
are the maximum side-lobe and
main-lobe amplitudes, respectively.
t
The main-lobe width and ripple ratio should be as low as
possible, i.e., the spectral energy of the window should be
concentrated as far as possible in the main lobe and the
energy in the side lobes should be as low as possible.
Frame # 14 Slide # 21 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
t
The way by which Gibbs oscillations can be controlled by
using a window is illustrated in the next few slides which
are based on Eq. (C), i.e.,
H
w
(e
j T
) =
T
2
_
2/T
0
H(e
j T
)W(e
j ()T
) d (C)
Frame # 15 Slide # 22 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
t
The way by which Gibbs oscillations can be controlled by
using a window is illustrated in the next few slides which
are based on Eq. (C), i.e.,
H
w
(e
j T
) =
T
2
_
2/T
0
H(e
j T
)W(e
j ()T
) d (C)
t
Let us consider the application of a generic window in the
design of a LP lter, assuming that the area under the
curve in the frequency spectrum of the window is 2/T.
Frame # 15 Slide # 23 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
1

c
H(e
jT
)
W(e
jT
)

s
/2

s
Frequency response of ideal lowpass filter
Frequency spectrum of window
Frame # 16 Slide # 24 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
1

s
/2

s
/2

s
/2

H
w
(e
jT
)

c

c
H(e
jT
)

W(e
j()T
)

c
Frame # 17 Slide # 25 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
1

s
/2

s
/2

s
/2

H
w
(e
jT
)

c

c
H(e
jT
)

c
W(e
j()T
)
Frame # 18 Slide # 26 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
1

s
/2

s
/2

s
/2

H
w
(e
jT
)

c

c
H(e
jT
)

W(e
j()T
)
Frame # 19 Slide # 27 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
From the illustrations, we conclude that
t
the steepness of the transition characteristic of the lter
obtained depends on the main-lobe width of the window,
and
Frame # 20 Slide # 28 A. Antoniou Part 1: FIR Filters Window Method
Window functions Contd
From the illustrations, we conclude that
t
the steepness of the transition characteristic of the lter
obtained depends on the main-lobe width of the window,
and
t
the amplitudes of the passband and stopband ripples
depend on the ripple ratio of the window.
Frame # 20 Slide # 29 A. Antoniou Part 1: FIR Filters Window Method
Kaiser Window function
t
One of the most important windows is the Kaiser window.
Frame # 21 Slide # 30 A. Antoniou Part 1: FIR Filters Window Method
Kaiser Window function
t
One of the most important windows is the Kaiser window.
t
This is a parametric window which has an independent
control parameter .
Frame # 21 Slide # 31 A. Antoniou Part 1: FIR Filters Window Method
Kaiser Window function
t
One of the most important windows is the Kaiser window.
t
This is a parametric window which has an independent
control parameter .
t
By choosing the value of and the lter length, N, arbitrary
specications can be achieved in lowpass (LP), highpass
(HP), bandpass (BP), and bandstop (BS) lters.
Frame # 21 Slide # 32 A. Antoniou Part 1: FIR Filters Window Method
Kaiser Window function Contd
Ripple ratio versus :
0 1 2 3 4 5 6 7 8 9 10
80
70
60
50
40
30
20
10
RR, dB

Frame # 22 Slide # 33 A. Antoniou Part 1: FIR Filters Window Method


Kaiser Window function Contd
Main-lobe width versus :
0 1 2 3 4 5 6 7 8 9 10
0
0.5
1
1.5
2
2.5
N=43
63
123
MB, rad

Frame # 23 Slide # 34 A. Antoniou Part 1: FIR Filters Window Method


Kaiser Window function Contd
The Kaiser window function is given by
w
K
(nT) =
_
_
_
I
0
()
I
0
()
for |n| M
0 otherwise
(D)
where
=
_
1
_
n
M
_
2
, I
0
(x) = 1 +

k=1
_
1
k!
_
x
2
_
k
_
2
and M = (N 1)/2. Its frequency spectrum is given by
W
K
(e
j T
) = w
K
(0) +2
M

n=1
w
K
(nT) cos nT
Frame # 24 Slide # 35 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters
An FIR LP lter that would satisfy the specications shown can
be readily designed by using a procedure due to Kaiser as
detailed in the next three slides.
G
a
i
n

1+
1

p

a
1.0

s
/2
A
p

A
a

Frame # 25 Slide # 36 A. Antoniou Part 1: FIR Filters Window Method


Design of FIR Lowpass Filters Contd
1. Determine the impulse response h(nT) using the Fourier
series assuming an idealized frequency response
H(e
j T
) =
_
1 for ||
c
0 for
c
< ||
s
/2
where
c
=
1
2
(
p
+
a
)
(see Eq. (B).)
Frame # 26 Slide # 37 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters Contd
1. Determine the impulse response h(nT) using the Fourier
series assuming an idealized frequency response
H(e
j T
) =
_
1 for ||
c
0 for
c
< ||
s
/2
where
c
=
1
2
(
p
+
a
)
(see Eq. (B).)
2. Choose such that the actual passband ripple, A
p
, is equal
to or less than specied passband ripple,

A
p
, and the actual
minimum stopband attenuation, A
a
, is equal or greater than
the specied minimum stopband attenuation,

A
a
.
A suitable value is
= min (

p
,

a
)
where

p
=
10
0.05

A
p
1
10
0.05

A
p
+1
and

a
= 10
0.05

A
a
Frame # 26 Slide # 38 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters Contd
3. With the required dened, the actual stopband
attenuation A
a
can be calculated as
A
a
= 20 log
10

Frame # 27 Slide # 39 A. Antoniou Part 1: FIR Filters Window Method


Design of FIR Lowpass Filters Contd
3. With the required dened, the actual stopband
attenuation A
a
can be calculated as
A
a
= 20 log
10

4. Choose parameter as
=
_

_
0 for A
a
21
0.5842(A
a
21)
0.4
+0.07886(A
a
21) for 21 < A
a
50
0.1102(A
a
8.7) forA
a
> 50
Frame # 27 Slide # 40 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters Contd
5. Choose parameter D as
D =
_
_
_
0.9222 for A
a
21
A
a
7.95
14.36
for A
a
> 21
Then select the lowest odd value of N that would satisfy
the inequality
N

s
D
B
t
+1 where B
t
=
a

p
Frame # 28 Slide # 41 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters Contd
5. Choose parameter D as
D =
_
_
_
0.9222 for A
a
21
A
a
7.95
14.36
for A
a
> 21
Then select the lowest odd value of N that would satisfy
the inequality
N

s
D
B
t
+1 where B
t
=
a

p
6. Form w
K
(nT) using Eq. (D).
Frame # 28 Slide # 42 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Lowpass Filters Contd
5. Choose parameter D as
D =
_
_
_
0.9222 for A
a
21
A
a
7.95
14.36
for A
a
> 21
Then select the lowest odd value of N that would satisfy
the inequality
N

s
D
B
t
+1 where B
t
=
a

p
6. Form w
K
(nT) using Eq. (D).
7. Form
H

w
(z) = z
M
H
w
(z) where H
w
(z) = Z[w
K
(nT)h(nT)]
and M = (N 1)/2.
Frame # 28 Slide # 43 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Bandpass Filters
t
The design method presented can be easily extended to
FIR HP, BP, and BS lters.
t
Consider the case where a BP lter is required that would
satisfy the following specications:
Passband ripple

A
p
Minimum stopband attenuation

A
a
Lower passband edge
p1
Upper passband edge
p2
Lower stopband edge
a1
Upper stopband edge
a2
Sampling frequency
s2
(

A
p
and

A
a
in dB and all frequencies in rad/s)
Frame # 29 Slide # 44 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Bandpass Filters Contd
G
a
i
n

1+
1

c1

c2

p1

p2

a1

a2
1.0

s
2
A
p

A
a

Frame # 30 Slide # 45 A. Antoniou Part 1: FIR Filters Window Method


Design of FIR Bandpass Filters Contd
The only differences in the design of BP lters are to
t
use the more critical of the two transition widths for the
design,
t
use the idealized frequency of a BP lter for the
determination of the initial impulse response.
Frame # 31 Slide # 46 A. Antoniou Part 1: FIR Filters Window Method
Design of FIR Bandpass Filters Contd
The more critical transition width is
B
t
= min[(
p1

a1
), (
a2

p2
)]
and hence the idealized frequency response for a BP lter is
deduced as
H(e
j T
) =
_

_
1 for
c2

c1
1 for
c1

c2
0 otherwise
where

c1
=
p1

B
t
2

c2
=
p2
+
B
t
2
Frame # 32 Slide # 47 A. Antoniou Part 1: FIR Filters Window Method
Example
Design an FIR BP lter satisfying the following specications:
t
Minimum attenuation for 0 200: 45 dB
t
Maximum passband ripple for 400 < < 600: 0.2 dB
t
Minimum attenuation for 700 1000: 45 dB
t
Sampling frequency: 2000 rad/s
Frame # 33 Slide # 48 A. Antoniou Part 1: FIR Filters Window Method
Example Contd
The idealized impulse response is obtained as
h(nT) =
1

s
_

s
/2

s
/2
H(e
j T
)e
j nT
d
=
1
n
(sin
c2
nT sin
c1
nT)
The application of the design procedure described will give
= 3.9754
D = 2.580
N = 53
Frame # 34 Slide # 49 A. Antoniou Part 1: FIR Filters Window Method
Example Contd
0 200 400 600 800 1000
70
60
50
40
30
20
0
, rad/s
G
a
i
n
,

d
B

0.01
0.01
Frame # 35 Slide # 50 A. Antoniou Part 1: FIR Filters Window Method
Use of Ultraspherical Window Function
t
A more recent approach for the design of FIR lters that
parallels the method described is a method based on the
ultraspherical window function proposed by Bergen and
Antoniou (see References).
Frame # 36 Slide # 51 A. Antoniou Part 1: FIR Filters Window Method
Use of Ultraspherical Window Function
t
A more recent approach for the design of FIR lters that
parallels the method described is a method based on the
ultraspherical window function proposed by Bergen and
Antoniou (see References).
t
For certain specications, this new approach tends to give
more efcient designs, i.e., the minimum lter length that
will achieve the required specications is somewhat lower.
Frame # 36 Slide # 52 A. Antoniou Part 1: FIR Filters Window Method
D-Filter
A DSP software package that incorporates the design
techniques described in this presentation is D-Filter. Please see
http://www.d-lter.ece.uvic.ca
for more information.
Frame # 37 Slide # 53 A. Antoniou Part 1: FIR Filters Window Method
Summary
t
A method for the design of FIR lters using a procedure
proposed by Kaiser has been described.
Frame # 38 Slide # 54 A. Antoniou Part 1: FIR Filters Window Method
Summary
t
A method for the design of FIR lters using a procedure
proposed by Kaiser has been described.
t
The method is easy to apply and requires a minimal
amount of computation.
Hence it can be used to design lters on-line in real or
quasi-real time applications.
The method is implemented in a DSP software package
known as D-Filter.
Frame # 38 Slide # 55 A. Antoniou Part 1: FIR Filters Window Method
Summary
t
A method for the design of FIR lters using a procedure
proposed by Kaiser has been described.
t
The method is easy to apply and requires a minimal
amount of computation.
Hence it can be used to design lters on-line in real or
quasi-real time applications.
The method is implemented in a DSP software package
known as D-Filter.
t
The designs obtained are suboptimal, i.e., other methods
are available that would yield a lower lter order for the
same specications, for example, the weighted-Chebyshev
method which will be described in Part 2 of this tutorial.
Frame # 38 Slide # 56 A. Antoniou Part 1: FIR Filters Window Method
References
t
A. Antoniou, Digital Signal Processing: Signals, Systems,
and Filters, Chap. 9, McGraw-Hill, 2005.
t
J. F. Kaiser, Nonrecursive digital lter design using the
I
0
-sinh window function, in Proc. IEEE Int. Symp. Circuit
Theory, 1974, pp. 2023.
t
S. W. A. Bergen and A. Antoniou, Design of ultraspherical
window functions with prescribed spectral characteristics,
EURASIP Journal on Applied Signal Processing, vol. 13,
pp. 2053-2065, 2004.
t
S. W. A. Bergen and A. Antoniou, Design of nonrecursive
digital lters using the ultraspherical window function,
EURASIP Journal on Applied Signal Processing, vol. 13,
pp. 1910-1922, 2005.
Frame # 39 Slide # 57 A. Antoniou Part 1: FIR Filters Window Method
References Contd
t
T. Saramki, Adjustable windows for the design of FIR
lters A tutorial, 6th Mediterranean Electrotechnical
Conference, vol. 1, pp. 2833, May 1991.
t
R. L. Streit, A two-parameter family of weights for
nonrecursive digital lters and antennas, IEEE Trans.
Acoust., Speech, Signal Process., vol. 32, pp. 108118,
Feb. 1984.
t
A. Antoniou, Design of digital differentiators satisfying
prescribed specications, Proc. Inst. Elect. Eng., Part E,
vol. 127, pp. 2430, Jan. 1980.
Frame # 40 Slide # 58 A. Antoniou Part 1: FIR Filters Window Method
This slide concludes the presentation.
Thank you for your attention.
Frame # 41 Slide # 59 A. Antoniou Part 1: FIR Filters Window Method

S-ar putea să vă placă și