Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
22 views

Module 4 - DSP

Uploaded by

stumiki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Module 4 - DSP

Uploaded by

stumiki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Module 4

FIR Filter Design: Properties of FIR digital filters, design of FIR


filters using rectangular and hamming windows, comparison of
IIR and FIR digital filters.
FIR Filters
● Commonly used techniques for the design of IIR filters have evolved from
applying transformations of continuous-time IIR systems into discrete-time IIR
systems.
● The design techniques for FIR filters are based on directly approximating the
desired frequency response or impulse response of the discrete-time system.
● The simplest method of FIR filter design method is called the window method.
● This method generally begins with an ideal desired frequency response that
can be represented as :
Where hd[n] is the corresponding impulse response sequence, which can be
represented in terms of Hd(ej⍵) as

● The most straightforward approach to obtaining an FIR approximation to such


systems is to truncate the ideal impulse response through the process
referred to as windowing.
● A simple way to obtain a causal FIR filter from hd[n] is to truncate hd[n], i.e. to
define a new system with impulse response h[n] given by :
We can represent h[n] as the product of the desired impulse response and a finite
duration “window” w[n] i.e.,

h[n]=hd[n]w[n]

Where for simple truncation, the window is the rectangular window :


It follows from modulation or windowing theorem that :

● That is H(ej⍵) is the periodic convolution of the desired ideal frequency


response with the Fourier transform of the window.
● The frequency response H(ej⍵) will be a smeared version of the desired
response Hd(ej⍵).
● If w[n]=1 for all n (i.e. we do not truncate at all), W(ej⍵) is a periodic impulse
train with period 2𝜋, and therefore, H(ej⍵)=Hd(ej⍵).
● This suggests that if w[n] is chosen such that W(ej⍵) is concentrated in a
narrow band of frequencies around i.e., it approximates an impulse, then
H(ej⍵) will look like Hd(ej⍵).
● The choice of window is governed by the desire to have w[n] as short as
possible in duration, so as to minimize computation in the implementation of
⍵=0,the filter, while having W(ej⍵) approximate an impulse, i.e. we want W(ej⍵)
to be highly concentrated in frequency so that the convolution faithfully
reproduces the desired frequency response.
Commonly used Windows
● Rectangular

● Bartlett (triangular)
● Hann

● Hamming

● Blackman
● The windows have the desirable property that their Fourier Transforms are
concentrated around ⍵=0.
● They have a simple functional form that allows them to be computed easily.
● The function 20log10|W(ej⍵)| is plotted for each of these windows with M=50.
● The rectangular window clearly has the narrowest main lobe, and thus, for a
given length, it should yield the sharpest transitions of H(ej⍵) at a discontinuity
of Hd(ej⍵).
● However, the first lobe is only about 13dB below the main peak, resulting in
oscillations of H(ej⍵) of considerable size around discontinuities of Hd(ej⍵).
● By tapering the window smoothly to zero, as with the Bartlett, Hamming,
Hann, and Blackmann windows, the side lobes are greatly reduced in
amplitude; however, the price paid is a much wider main lobe and thus wider
transitions at discontinuities of Hd(ej⍵).
Advantages of FIR filter over IIR filter
● FIR filters are always stable.
● FIR filters with exactly linear phase can easily be designed.
● FIR filters can be realized in both recursive and non-recursive structures.
● FIR filters are free of limit cycle oscillations, when implemented on a
finite-word length digital systems.
● Excellent design methods are available for various kinds of FIR filters.
Disadvantages of FIR filter
● The implementation of narrow transition band FIR filters are very costly, as it
requires considerably more arithmetic operations and hardware components
such as multipliers, adders and delay elements.
● Memory requirements and execution time are very high.
Design of FIR filters using windows
● The desired frequency response Hd(ej⍵) of a filter is periodic in frequency and
can be expanded in a Fourier series.
● The resultant series is given by :

Where
● hd[n] are know as Fourier coefficients having finite length.
● One possible way of obtaining FIR filter is to truncate the infinite Fourier
series at n=±(N-1)/2, where N is the length of the desired sequence.
● But abrupt truncation of the Fourier series results in oscillations in the
passband and the stopband.
● These oscillations are due to slow convergence of the Fourier series and this
effect is known as the Gibbs phenomenon.
● To reduce these oscillations, the Fourier coefficients of the filter are modified
by multiplying the infinite impulse response with a finite weighing sequence
w[n] called a window where
● After multiplying window sequence w[n] with hd[n], we get a finite duration
sequence h[n] that satisfies the desired magnitude response :
● The frequency response H(ej⍵) of the can be obtained by convolution of the
Hd(ej⍵) and W(ej⍵) given by :
● Because both Hd(ej⍵) and W(ej⍵) are periodic functions the operation is often
called as periodic convolution.
● The Fourier transform of a window consists of a central lobe and side lobes.
The central lobe contains most of the energy of the window.
● The window chosen for truncating the infinite impulse response should have
some desirable properties as :
1. The central lobe of the frequency response of the window should contain
most of the energy and should be narrow.
2. The highest side lobe level of the frequency response should be small.
3. The side lobes of the frequency response should decrease in energy rapidly
as ⍵ tends to 𝜋.
Rectangular window
● The rectangular window sequence is given by :

wR[n]=1 for -(N-1)/2 ≤ n ≤ (N-1)/2


=0 otherwise

An example for N=25 is given below :


● The spectrum of rectangular window is given by :

● The frequency spectrum for N=25 is given below.


● The frequency response is real and its zero occur when

Where k is an integer.
● The response for ⍵ between 2𝜋/N and -2𝜋/N is called the main lobe and the
other lobes are known as the side lobes.
● The main lobe of the response is the portion that lies between the first the two
zero crossings.
● The side lobes are defined as the portion of the response for ⍵ < -2𝜋/N or ⍵ >
2𝜋/N.
● As the window is made longer the main lobe becomes narrower and higher,
and the side lobe become more concentrated around ⍵=0.
● The main lobe width for the rectangular window is equal to 4𝜋/N.
● The higher side lobe is equal to approximately 22% of the main lobe
amplitude or -13dB relative to the maximum value at ⍵=0.
● The frequency response differs from the desired response in many ways :
1. It does not follow quick transitions in the desired response.
2. As the filter length N increases, the main lobe becomes narrower decreasing
the width of the transition region.
● The convolution of the desired response and the window response’s
sidelobes give rise to the ripples in both the passband and the stopband.
● For the rectangular window, the amplitude of the sidelobes is unaffected by
the length of the window. So increase in N will not reduce ripples, but increase
its frequency.
● The effect where maximum ripple occurs just before and after the transition
band is know as Gibbs phenomenon.
● The Gibbs phenomenon can be reduced by using a less abrupt truncation of
filter coefficients. This can be achieved by using a window function that tapers
smoothly towards zero at both ends.
Hamming window
● The equation for Hamming window is given by :

● The frequency response of Hamming window is given by :


● The peak side lobe is down about 41 dB from the main lobe peak.
● The magnitude and log magnitude response of lowpass filter designed using
Hamming window is shown. The first side lobe peak is -53dB.
● However at higher frequencies the stopband attenuation is low.
● Hamming window generates lesser oscillations in the side lobes.
Frequency Response of Linear Phase FIR filters
Case I : Symmetrical impulse response, N odd

Where
● H̅(ej⍵) is a real and even function of ⍵. The magnitude and phase of H(ej⍵) are

|H(ej⍵)|=|H̅(ej⍵)| and

● H̅(ej⍵) is called as zero-phase frequency response to distinguish it from the


magnitude response. The zero-phase frequency response of the filter may
take both positive and negative values, whereas the magnitude response is
strictly nonnegative.
● Case II : Symmetric impulse response for N even
● Case III : Antisymmetric N odd
● Case IV : Antisymmetric N even
● The impulse response of symmetric with odd number of samples can be used
to design all types of filters.
● The symmetric impulse response having even number of samples cannot be
used to design high pass filters.
● The frequency response of antisymmetric impulse response is imaginary and
this type of filters are most suitable for such filters as Hilbert transformers and
differentiators.
Fourier Series Method of Designing FIR Filters
● The desired frequency response of an FIR filter can be represented by as :

● The z-transform of the sequence is given by :


● The above equation represents a non-causal digital filter of infinite duration.
● To get an FIR filter transfer function, the series can be truncated by assigning

Then
● For symmetrical impulse response having symmetry at n=0

h(-n)=h(n)
● Therefore, the above equation can be written as :

● The above transfer function is not physically realizable. Realizability can be


brought about by multiplying the above equation by z-(N-1)/2 where (N-1)/2 is
delay in samples.
Examples of FIR filter design
Example 2

You might also like