FIR Lect
FIR Lect
FIR Lect
1
DIGITAL FILTERING
• In signal processing, the function of a filter is to remove unwanted parts of
the signal, such as random noise, or to extract useful parts of the signal,
such as the components lying within a certain frequency range
• Analog Filter:
– Input: electrical voltage or current which is the direct analogue of a
physical quantity (sensor output) and so on…..
– Components: resistors, capacitors and op amps &….
– Output: Filtered electrical voltage or current ,…….
– Applications: noise reduction, video signal enhancement, graphic
equalisers………
• Digital Filter:
– Input: Digitized samples of analog input (requires ADC)
– Components: Digital processor (PC/DSP/ASIC/FPGA)
– Output: Filtered samples (requires DAC)
– Applications: noise reduction, video signal enhancement, graphic
equalisers,Target tracking 2
IDEAL FILTER FREQUENCY RESPONSE
Filtering: process of extraction of desired signal from
noise
The response of the FIR filter depends only on the present and
past input samples.
A. Noise suppression
-ωc 0 ωc ω
Low-Pass Filters: Ideal Frequency Response
│Hd(ejω)│
ω
-π -ωc 0 ωc π
High-Pass Filters:Ideal magnitude frequency
response
│Hd(ejω)│
ω
-π -ωc2 –ωc1 0 ωc1 ωc1 π
Band-Pass Filters: ideal frequency response
│Hd(ejω)│
ω
-π -ωc2 –ωc1 0 ωc1 ωc2 π
Band-Stop Filters: Ideal magnitude frequency
response
0.8 z 1
Example: H (z) z1 1/ 0.8 p1 0.8
1 0.8z 1
z1 1/ 0.8 1/ p1
Linear Phase FIR DigitalFilter.
Introduction
:
24
FIR Filter Implementation …
Case II: M - Odd
25
FIR Filter Design
26
Types of Linear Phase FIR Filter
Window Method:
• Similar to FS method, it also offers a very simple and flexible way of computing
FIR filter coefficients.
• However, does not allow the over the filter parameters. designer adequate
control
30
Designing Steps for Fourier Series Method
A. Specifications:
a. Desired frequency response, Hd(w)
b. Cut-off frequency, wc =2Π(Fc/Fs) ; Fc-Cut-off frequency,
Fs -Sampling Freq.
c. No. of samples in Impulse response, N
B. Designing Steps:
1 Π
a. Find hd(n) by Inverse FT: hd(n) =2Π −Π
𝐻𝑑 𝑤 𝑒 𝑖𝑤𝑛 dw
31
Problem 1
32
Problem 1
33
Problem 1
34
After arranging impulses in causal form,
h(n) = [0.0637, 0, -0.1061, 0, 0.3183,
0.5, 0.0637, 0, -0.1061, 0, 0.3183, 0.5]
35
Verification of Problem 1
36
Problem 2
37
Problem 2
38
Problem 2
39
Realization of Problem 2
40
Verification of Problem 2
41
FIR Filter Design-
II. Window Technique
42
Gibb’s Phenomenon
Ideal Impulse response for LP Filter
Note that hD(n) is symmetrical about n = 0 (i.e. hD(n) = hD(-n)), so the filter will
have linear phase response.
Although hD(n) decreases as we move away from n = 0, the impulse
response is infinite in length (as n = ±∞).
Hence, this is not a FIR filter!
Gibb’s Phenomenon …
Ideal Impulse responses for different filter types
Gibb’s Phenomenon …
Truncation of Impulse response
• A possible solution is to truncate the ideal impulse response by setting
hD(n) = 0 for n greater than M (equivalent to a rectangular window).
• Rectangular window function -
w(n)=1, where, n = 0, 1, …, ± (N - 1)/2
= 0, elsewhere
• A practical approach is to multiply the ideal impulse response, hD(n) by a
suitable window function, w (n), whose duration is finite.
• This way the resulting impulse response decays smoothly towards zero.
Finally,
• The ideal impulse response, hD(n) is multiplied by finite duration window
w(n), to obtain the filter coefficients, h(n).
Gibb’s Phenomenon …
Truncation Effect on frequency response
13 coefficients 25 coefficients
h(n) hD(n)w(n)
Types of Window functions
• Rectangular
• Hamming
• Hanning
• Blackman
• Kaiser
Features of popular window functions
Window functions in time domain
1.2 1.2
Rectangular Window Hamming Window
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 20 40 60 0 20 40 60
1.2
Blackman Window
1
0.8
0.6
0.4
0.2
0
0 20 40 60
B. Designing Steps:
1 Π −𝑖𝑤α
a. Find hd(n) by Inverse FT: hd(n) =2Π −Π
𝑒 𝑒 𝑖𝑤𝑛 dw
51
Problem 1
52
Problem 1 ….
53
Problem 1 ….
54
Verification of Problem 1
h(n) = [0.1009, 0.1514, 0.1871, 0.2, 0.1871, 0.1514, 0.1009]
H(w)
55
Problem 2
56
Problem 2 ….
57
Problem 2 ….
58
Verification of Problem 2
h(n) = [-0.0081, 0.0469, -0.1441, 0.2, -0.1441, 0.0469, -0.0081]
H(w)
59
FIR Filter Design-
III. Frequency Sampling Technique
60
61
Comparison of FIR Filters with IIR Filters
FIR FILTERS IIR FILTERS
FIR filters always stable filters[Inherently IIR filters are mostly unstable, but sometimes,
stable] it may be stable.
It has linear phase characteristics and response It doesn’t have any linear phase response.
They can be realized in both recursive and non- They can be realized only with recursive
recursive structures structures
It has perfect design techniques and simple It has complex design techniques and
procedures. procedures.
FIR filters are free from limit cycle oscillations, They produce limit cycle oscillations due to
when implemented on FWLEs. [lower bit quantization effect
precision]
The design of narrow band FIR filter is not The design of narrow band IIR filter with
possible. specific frequency can be possible.
The cost of implementation is HIGH, since it The implementation cost is cheap.
requires more No. of Adders & Multipliers
The response of the FIR filter is having less The response of the IIR filter gives better
accuracy accuracy than FIR filters.
It cannot support to simulate the analog filters. It can also be used to simulate analog filters