Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

FIR Lect

Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

Digital Signal Processing

Lecture: FIR Filter

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

Filter: system performing filtering

Analogue filtering: filtering performed on continuous-


time signals and yields continuous-time signals

Digital/discrete-time filtering: filtering performed on


digital/discrete-time signals and yields digital/
discrete-time signals
FIR FILTERS

The digital filter whose impulse response is of finite duration is


known as Finite impulse response filter.

The response of the FIR filter depends only on the present and
past input samples.

These FIR filters are also called non recursive filters.

So, in FIR the impulse response sequence is of finite duration, i.e.


it has a finite number of non-zero terms
Examples of filtering applications

A. Noise suppression

• Received radio signals.


• Signals received by imaging sensors, such as
television cameras or infrared imaging devices.
• Electrical signals measured from the human body
(such as brain, heart or neurological signals).
B. Enhancement of selected frequency range

• Treble and bass control or graphic equalizers in


audio systems.
• Enhancement of edges in image processing.
C. Bandwith limiting

• Bandwidth limiting as a means of aliasing


prevention in sampling.
• Application in FDMA communication systems
(Frequency Division Multiple Access - FDMA).
D. Removal or attenuation of specific frequencies

• Blocking of the DC component of a signal.


• Attenuation of interference from powerline (50 Hz).
Filter Specifications - Ideal Filters
Low-Pass Filters: Low-pass filters are designed to pass low
frequencies, from zero to a certain cut off frequency and to
block high frequencies. │H(e )│

-ωc 0 ωc ω
Low-Pass Filters: Ideal Frequency Response

Hd(ejω)= e-jωα ; -ωc≤ ω ≤ ωc


=0 ; elsewhere
High-Pass Filters: High-pass filters are designed to pass high
frequencies, from a certain cut off frequency to π , and to block
low frequencies.

│Hd(ejω)│

ω
-π -ωc 0 ωc π
High-Pass Filters:Ideal magnitude frequency
response

Hd(ejω)= e-jωα ; -π≤ ω ≤ -ωc


= e-jωα ; ωc ≤ ω ≤ π
Band-Pass Filters: Band-pass filters are designed to pass
a certain frequency range, which does not include zero,
and to block other frequencies

│Hd(ejω)│

ω
-π -ωc2 –ωc1 0 ωc1 ωc1 π
Band-Pass Filters: ideal frequency response

Hd(ejω)= e-jωα ; -ωc2 ≤ ω ≤ -ωc1


= e-jωα ; ωc1 ≤ ω ≤ ωc2
Band-Stop Filters: Band-stop filters are designed to block a
certain frequency range, which does not include zero, and to pass
other frequencies

│Hd(ejω)│

ω
-π -ωc2 –ωc1 0 ωc1 ωc2 π
Band-Stop Filters: Ideal magnitude frequency
response

Hd(ejω)= e-jωα ; -π ≤ ω ≤ -ωc2


e-jωα ; -ωc1 ≤ ω ≤ ωc1
e- ; ωc2 ≤ ω ≤ π
jωα
All-Pass Filters: A filter is called all-pass if its magnitude
response is identically a positive constant ( H (e j ) const).
at all frequencies. The phase response of an all-pass filter
is not restricted and is allowed to vary arbitrarily as a
function of the frequency.
In general, a rational filter is all-pass if only if it has the
same number of poles and zeros (including multiplicities),
and each zero is the conjugate inverse of a corresponding
pole: zk=1/pk.

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

Advantages and Disadvantages of


Linear Phase FIR Digital Filters
FIR digital filter has a finite number of non-zero
coefficients of its impulse response:
M N : h(n) 0 for n M
Mathematical model of a causal FIR digital filter:
M 1
y(n) h(k ) x(n k )
k 0

Digital FIR filters cannot be derived from analogue


filters, since causal analogue filters cannot have a finite
impulse response. In many digital signal processing
applications, FIR filters are preferred over their IIR
counterparts.
The advantages of FIR filters:
FIR filters can be designed with exact linear
phase. These linear phase filters are important for
applications where frequency dispersion due to
non-linear phase is hazardous. (For example
speech processing and data transmission)
 FIR filters are stable.
 Round off noise can be eliminated in FIR filters.
FIR filters can be efficiently implemented in
multirate DSP systems.
 FIR filters reduce the computation complexity.
The disadvantages of FIR filters:

As large number of impulse response samples


are required to properly approximate sharp cutoff
FIR filters the processing will become complex
due to slow convolution.

The delay of linear phase FIR filters can


sometimes create problems in some DSP
applications.
It will be shown that the linear phase condition is
obtained by imposing symmetry conditions on the
impulse response of the filter. In particular, we consider
two different symmetry conditions for h(k):

A. Symmetrical impulse response:


h(k) h(M 1 k) for k 0,1,2, ,M 1

B. Antisymmetrical impulse response:


h(k) h(M 1 k) for k 0,1, 2, ,M 1

The length of the impulse response of the FIR filter


(M) can be even or odd. Then, the four cases of linear
phase FIR filters can be obtained.
Ideal Specifications
• Unity magnitude over passband
• Zero magnitude over stopband
• Linear response over passband
FIR Filter Implementation
Case I: M - Even

:
24
FIR Filter Implementation …
Case II: M - Odd

25
FIR Filter Design

26
Types of Linear Phase FIR Filter

Length and Symmetry vs. Type of filter


Sr. No. Length Symmetry Type of filter
1 Odd +ve -
2 Even +ve LPF
3 Odd -ve BPF
4 Even -ve HPF
Tolerance scheme: magnitude-frequency response of a
LP Filter

The following parameters


are of interest:
• δp: Passband Deviation
• δs: Stopband Deviation
Actual Response
• fp or ωp : Passband Edge
Ideal Response Frequency
• fs or ωs Stopband Edge
Frequency
• Fs: Sampling Frequency
FIR Filter Design Methods
Fourier Series Method:
• Offers a very simple and flexible way of computing FIR filter
coefficients.

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

The Frequency Sampling Method


• The main attraction is that it allows for a recursive realization of FIR filters,
which can be computationally very efficient.
• However, it also lacks flexibility in specifying or controlling filter parameters.
FIR Filter Design-
I. Fourier Series Method

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

b. Find h(n): h(n)=hd(n), for n= - (N-1)/2 to (N-1)/2

c. Realize h(n) for n = 0 to N-1

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

After arranging impulses in causal form,


h(n) = [0.0623, 0.3027, 0.0935, 0.0623,
0.3027, 0.0935]

39
Realization of Problem 2

After arranging impulses in causal form,


h(n) = [0.0623, 0.3027, 0.0935, 0.0623, 0.3027, 0.0935]

40
Verification of Problem 2

41
FIR Filter Design-
II. Window Technique

42
Gibb’s Phenomenon
Ideal Impulse response for LP Filter

Ideal frequency response for LP

Ideal (infinite)Impulse response for LP

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

Infinite coefficients (no truncation)


Gibb’s Phenomenon…
Ideal impulse response hD(n)is multiplied by finite duration window
w(n) to get filter coefficients h(n)

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

Different window functions for N=61


Designing Steps for Window Technique
A. Specifications:
a. Desired frequency response, Hd(w) = 𝑒 −𝑖𝑤α, α = (N-1)/2
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

b. Find h(n): h(n)=hd(n)w(n), for n= 0 to (N-1)

c. Realize h(n) for n = 0 to N-1

51
Problem 1

52
Problem 1 ….

53
Problem 1 ….

h(n) = [0.1009, 0.1514, 0.1871, 0.2, 0.1871, 0.1514, 0.1009]

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

You might also like