Вы находитесь на странице: 1из 19

International Islamic University Chittagong

Dept. of Electrical and Electronic Engineering

Segment-7B
FIR Filter Design (Windowing Technique)

EEE-3603 Digital Signal Processing

Prepared By
Mohammed Abdul kader
Assistant Professor, Dept. of EEE, IIUC
Contents
 Function of digital Filter
 Comparison of Analog and Digital Filter
 Filter kernel
 Types of filter
 Time domain and frequency domain parameters of filter.
 Design of all frequency selective filter from low pass filter kernel.

Reference Book:
The Scientist and Engineer's Guide to Digital Signal Processing, By Steven
W. Smith (2nd Edition)
Chapter-14 (Introduction to Digital Filters)
Digital Signal Processing: A practical approach, By Emmanuel C Ifeachor,
Barrie W Jervis
Chapter-5 (A framework for digital filter design)

2
Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Ideal low pass filter, Is it physically realizable?
In ideal lowpass filter, all frequencies below the cutoff frequency, 𝑓𝑐 , are passed with unity amplitude,
while all higher 𝑓𝑐 frequencies are blocked. The pass band is perfectly flat, the attenuation in the stop
band is infinite, and the transition between the two is infinitesimally small.
Taking the Inverse Fourier Transform of this ideal frequency response produces the ideal filter kernel
(impulse response) , called the sinc function, given by:

3
Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Ideal low pass filter, Is it physically realizable? (Cont.)

Convolving an input signal with this filter kernel provides a perfect low-pass filter. But the
problems are,
 Noncausal: The filter kernel (impulse response) of ideal filter is noncausal (has both
positive and negative index) and hence it cannot be realized in practice.
 Infinite Length: It continues to both negative and positive infinity without dropping to
zero amplitude. While this infinite length is not a problem for mathematics, it is a show
stopper for computers.

Due to the above problems the implementation of ideal filter is not possible, i.e. it cannot be
realized in practice

4 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Modification in Ideal low pass filter for practical realization

To get around this problem, we will make two modifications to the ideal lowpass filter
kernel:
First, it is truncated to M+1 points, symmetrically chosen around the main lobe, where M
is an even number. All samples outside these M+1 points are set to zero, or simply ignored.
Second, the entire sequence is shifted to the right so that it runs from 0 to M. This allows
the filter kernel to be represented using only positive indexes.

Since the modified filter kernel is only an approximation to the ideal filter kernel, it will not
have an ideal frequency response.

5 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Effect of modification in Ideal low pass filter: Gibbs Phenomenon
The abrupt discontinuity at the ends of the truncated sinc function excessive ripple in the
passband and poor attenuation in the stopband. Increasing the length of the filter kernel
does not reduce these problems; the discontinuity is significant no matter how long M is
made. The oscillatory behavior near the band edge of the filter is called the Gibbs
Phenomenon.

6 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Window function to reduce Gibbs phenomena
To alleviate the presence of large oscillations in both the passband and the stopband, we should
multiply a function with the filter kernel that contains a taper and decays towards zero gradually,
instead of abruptly.

Filter kernel is finite but has Oscillation in frequency


Filter kernel h(n) is infinite.
oscillations in frequency response response is reduced

h(n) 𝒉′ (𝒏) 𝒉′′ (𝒏)


Truncation
ℎ 𝑛 𝑤(𝑛)
+shifting

Figure (e) shows a smoothly tapered curve called a Blackman window. Multiplying the truncated-sinc,
(c), by the Blackman window, (e), results in the windowed-sinc filter kernel shown in (f). The idea is to
reduce the abruptness of the truncated ends and thereby improve the frequency response. Figure (g)
shows this improvement. The passband is now flat, and the stopband attenuation is so good it cannot be
seen in this graph. [See Figure in next slide]

7 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Window function to reduce Gibbs phenomena (Cont.)

8 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Different window functions

9 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Shapes of several window functions

10 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Comparison of Hamming and Blackman Window functions
• Although several different windows are available, only two windows are worth using, the
Hamming window and the Blackman window.
Hamming window:

Blackman window:
• Fig. (a) shows the shape of Hamming window and the Blackman window.
• Fig. (b) shows that, the hamming window has about 20% faster roll-off than the Blackman.

11 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Comparison of Hamming and Blackman Window functions (Cont.)
• Fig. (c) shows that the Blackman has a better stopband attenuation. The stopband attenuation for the
Blackman is -74dB (-0.02%), while the Hamming is only -53dB (-0.2%).
• Although it cannot be seen in these graphs, the Blackman has a passband ripple of only about 0.02%,
while the Hamming is typically 0.2%.
• In general, the Blackman should be your first choice; a slow roll-off is easier to handle than poor
stopband attenuation.

12
Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Filter lengths vs roll-off of the windowed-sinc filter

13 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Lecture materials on "Design of FIR filter" By-
14 Mohammed abdul kader, Assistant Professor, EEE, IIUC
Designing the filter
Selection of cutoff frequency:
• The cutoff frequency is expressed as a fraction of the sampling rate and therefore must be between
0 to 0.5.
• If passband edge ripple (𝜔𝑝 ) and stopband edge ripple (𝜔𝑠 ) is given the cutoff frequency is
calculated as 𝜔𝑠 + 𝜔𝑝
𝜔𝑐 =
2
Selection of the length of filter kernel:
The length of the filter kernel is depends on the width of the transition band. It is calculated from the
information of the table (see next slide).
Selection of window:
It depends on the desired stopband attenuation.

15 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Designing the filter

Lowpass filter kernel

16 Lecture materials on "Design of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Design a FIR low-pass filter with ωp=0.4π and ωs=0.6π which exhibits a minimum attenuation
greater than 50dB in the stop-band.

Since we need attenuation greater than 50dB in the stop-band, we may use either the Hamming or
the Blackman. The Blackman window will lead to an overdesigned filter. This is due to the fact that,
for a given window length, M, the Blackman gives a wider main lobe which is not desired. Hence,
in this example, use of the Blackman will force us to use a larger M compared to utilizing the
Hamming window.

𝜔𝑠 + 𝜔𝑝 (0.6 + 0.4)𝜋
𝜔𝑐 = = = 0.5𝜋
2 2
In this example, the transition band is ωs−ωp=0.2π . Since the main lobe width of the Hamming
window is approximately 8π/M , we find M=40 . This means that the designed filter will be of
length 41.

Lecture materials on "Design of FIR filter" By-


17 Mohammed abdul kader, Assistant Professor, EEE, IIUC
𝑀−1
sin 𝜔𝑐 𝑛 −
ℎ𝑑 𝑛 = 2 , 0 ≤ 𝑛 ≤ 40
𝑀−1
𝜋 𝑛− 2

4𝜋𝑛
𝑤 𝑛 = 0.54 − 0.46 cos
𝑀−1

𝑀−1
sin 0.5𝜋 𝑛 − 4𝜋𝑛
ℎ 𝑛 = 2 {0.54 − 0.46 cos }, 0 ≤ 𝑛 ≤ 40
𝑀−1 𝑀 − 1
𝜋 𝑛− 2

Lecture materials on "Design of FIR filter" By-


18 Mohammed abdul kader, Assistant Professor, EEE, IIUC
n h(n)
21 0.316507
0 0
22 0
1 -0.00144
23 -0.10078
2 0
24 0
3 0.002437
25 0.055085
4 0
26 0
5 -0.00456
27 -0.03405
6 0
28 0
7 0.008109
29 0.021644
8 0
30 0
9 -0.01354
31 -0.01354
10 0
32 0
11 0.021644
33 0.008109
12 0
34 0
13 -0.03405
35 -0.00456
14 0
36 0
15 0.055085
37 0.002437
16 0
38 0
17 -0.10078
39 -0.00144
18 0
40 0
19 0.316507
19 20 on "Design0.5
Lecture materials of FIR filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC

Вам также может понравиться