0% found this document useful (0 votes)
30 views8 pages

Experiment VII

The document outlines the implementation and design of low-pass and high-pass FIR and IIR filters, detailing the advantages of FIR filters such as stability and linear-phase response. It includes algorithms for designing both FIR and IIR filters, along with homework assignments and questions to reinforce learning. The document emphasizes the importance of filter specifications and methods for designing digital filters in signal processing.

Uploaded by

moafash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views8 pages

Experiment VII

The document outlines the implementation and design of low-pass and high-pass FIR and IIR filters, detailing the advantages of FIR filters such as stability and linear-phase response. It includes algorithms for designing both FIR and IIR filters, along with homework assignments and questions to reinforce learning. The document emphasizes the importance of filter specifications and methods for designing digital filters in signal processing.

Uploaded by

moafash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Experiment Low-pass and high-pass FIR and IIR Filters

PREPARED BY:

Prof. Ammar M. Abu-Hudrouss


Eng. MuhammadHashim I. Jabr

EXPECTED LEARNING OUTCOME:

Our aim is to become familiar with:


• Implementation of LP FIR filter for a given sequence.
• Implementation of HP FIR filter for a given sequence.
• Implementation of LP IIR filter for a given sequence.
• Implementation of HP IIR filter for a given sequence.

Part I: Low-pass and High-pass Finite Impulse-Response Filters

FIR filters are digital filters with finite impulse response. They are also known as
non-recursive digital filters as they do not have the feedback.

An FIR filter has two important advantages over an IIR design:


• Firstly, there is no feedback loop in the structure of an FIR filter. Due to not
having a feedback loop, an FIR filter is inherently stable. Meanwhile, for an IIR
filter, we need to check the stability.
• Secondly, an FIR filter can provide a linear-phase response. As a matter of fact, a
linear-phase response is the main advantage of an FIR filter over an IIR design
otherwise, for the same filtering specifications; an IIR filter will lead to a lower
order.

1
FIR FILTER DESIGN
An FIR filter is designed by finding the coefficients and filter order that meet
certain specifications, which can be in the time-domain (e.g., a matched filter) and/or the
frequency domain (most common). Matched filters perform a cross-correlation between
the input signal and a known pulse-shape. The FIR convolution is a cross-correlation
between the input signal and a time-reversed copy of the impulse-response. Therefore,
the matched-filter's impulse response is "designed" by sampling the known pulse-shape
and using those samples in reverse order as the coefficients of the filter.
When a particular frequency response is desired, several different design methods are
common:
1. Window design method
2. Frequency Sampling method
3. Weighted least squares design

WINDOW DESIGN METHOD


In the window design method, one first designs an ideal IIR filter and then
truncates the infinite impulse response by multiplying it with a finite length window
function. The result is a finite impulse response filter whose frequency response is
modified from that of the IIR filter.

2
Algorithm of the implementation of LP FIR filter for a given sequence:

Step I: Enter the pass band frequency (fp) and stop band frequency (fq).

Step II: Get the sampling frequency (fs), length of window (n).

Step III: Calculate the cut off frequency, fn

Step IV: Use boxcar, hamming, Blackman Commands to design


window.

Step V: Design filter by using above parameters.

Step VI: Find frequency response of the filter using MATLAB


command freqz.

Step VII: Plot the magnitude response and phase response of the filter.

Homework:
Design LP FIR filter using Bartlett and hamming window.

Answer the following questions:

1. Define filter.
2. What are the different types of filters?
3. Why are FIR filters generally preferred over IIR filters in multirate (decimating and
interpolating) systems
4. Difference between IIR and FIR filters?
5. Differentiate ideal filter and practical filter responses.
6. What is the filter specifications required to design the analog filters?
7. What is meant by frequency response of filter?
8. What is meant by magnitude response?
9. What is meant by phase response?
10. Difference between FIR low pass filter and high pass filter.

3
Algorithm of the implementation of HP FIR filter for a given sequence:

Step I: Enter the pass band frequency (fp) and stop band frequency (fq).

Step II: Get the sampling frequency (fs), length of window (n).

Step III: Calculate the cut off frequency, fn

Step IV: Use boxcar, hamming, Blackman Commands to design


window.

Step V: Design filter by using above parameters.

Step VI: Find frequency response of the filter using MATLAB


command freqz.

Step VII: Plot the magnitude response and phase response of the filter.

Homework:
Design HP FIR filter using Rectangular and hanning Window.

Answer the following questions:

1. What is a filter?
2. Differentiate analog filter and digital filter.
3. Define FIR filter.
4. What are the differences between recursive and non-recursive systems?
5. List a few Applications of FIR filters.
6. Explain advantages of FIR filters over IIR filters.
7. Explain limitations of FIR filters.
8. What are the different methods to design FIR filters?
9. Explain different window functions.
10. Differentiate rectangular, triangular and Kaiser Windows.

4
Part II: Low-pass and High-pass Infinite Impulse-Response Filters

IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they
have the feedback (a recursive part of a filter) and are known as recursive digital filters
therefore.

For this reason, IIR filters have much better frequency response than FIR filters of
the same order. Unlike FIR filters, their phase characteristic is not linear which can cause
a problem to the systems which need phase linearity. For this reason, it is not preferable
to use IIR filters in digital signal processing when the phase is of the essence. Otherwise,
when the linear phase characteristic is not important, the use of IIR filters is an excellent
solution.

There is one problem known as a potential instability that is typical of IIR filters only.
FIR filters do not have such a problem as they do not have the feedback. For this reason,
it is always necessary to check after the design process whether the resulting IIR filter is
stable or not.

IIR FILTER DESIGN


For the given specifications to Design a digital IIR filter, first we need to design
analog filter (Butterworth or Chebyshev). The resultant analog filter is transformed to
digital filter by using either “Bilinear transformation or Impulse Invariant
transformation”.

Algorithm of the implementation of LP IIR filter for a given sequence:

Step I: Enter the pass band ripple (rp) and stop band ripple (rs).

Step II: Enter the pass band frequency (wp) and stop band frequency
(ws).

Step III: Get the sampling frequency (fs).

Step IV: Calculate normalized pass band frequency, and normalized


stop band frequency w1 and w2 respectively. w1 = 2 * wp /fs w2 = 2 *
ws /fs

Step V: Make use of the following function to calculate order of filter


Butterworth filter order [n,wn]=buttord(w1,w2,rp,rs ) Chebyshev filter
order [n,wn]=cheb1ord(w1,w2,rp,rs)

Step VI: Design an nth order digital low pass Butterworth or Chebyshev
filter using the following statements. Butterworth filter [b, a]=butter (n,
wn) Chebyshev filter [b,a]=cheby1 (n, 0.5, wn)

5
Step VII: Find the digital frequency response of the filter by using ‘freqz( )’ function

Step VIII: Calculate the magnitude of the frequency response in decibels (dB) mag=20*log10
(abs (H))

Step IX: Plot the magnitude response [magnitude in dB Vs normalized frequency]

Step X: Calculate the phase response using angle (H)

Step XI : Plot the phase response [phase in radians Vs normalized frequency (Hz)].

INPUT:
Enter the IIR filter design specifications
Enter the passband ripple 15
Enter the stopband ripple 60
Enter the passband frequency 1500
Enter the stopband frequency 3000
Enter the sampling frequency 7000

Homework:

Design low-pass IIR filter using Chebyshev filter.

Answer the following questions:

1. List some advantages of digital filters over analog filters.


2. Write some differences between FIR and IIR filters.
3. What are the different methods to design IIR filters?
4. Why IIR filters are not reliable?
5. What are different applications of IIR filters?
6. What are advantages of IIR filters?
7. What are disadvantages of IIR filters?
8. Differentiate Butterworth and Chebyshev approximations.
9. What is meant by impulse response?
10. Difference between IIR low pass and High pass filters.

6
Algorithm of the implementation of HP IIR filter for a given sequence:

Step I: Enter the pass band ripple (rp) and stop band ripple (rs).

Step II: the pass band frequency (wp) and stop band frequency (ws).

Step III: Get the sampling frequency (fs).

Step IV: Calculate normalized pass band frequency, and normalized


stop band frequency w1 and w2 respectively. w1 = 2 * wp /fs w2 = 2 *
ws /fs

Step V: Make use of the following function to calculate order of filter


Butterworth filter order [n,wn]=buttord(w1,w2,rp,rs ) Chebyshev filter
order [n,wn]=cheb1ord(w1,w2,rp,rs)

Step VI: Design an nth order digital high pass Butterworth or


Chebyshev filter using the following statement. Butterworth filter
[b,a]=butter (n, wn,’high’) Chebyshev filter [b,a]=cheby1 (n, 0.5,
wn,'high')

Step VII: Find the digital frequency response of the filter by using ‘freqz( )’ function

Step VIII: Calculate the magnitude of the frequency response in decibels (dB) mag=20*log10
(abs (H))

Step IX: Plot the magnitude response [magnitude in dB Vs normalized frequency]

Step X: Calculate the phase response using angle (H)

Step XI: Plot the phase response [phase in radians Vs normalized frequency (Hz)].

INPUT:
Enter the IIR filter design specifications
Enter the passband ripple 15
Enter the stopband ripple 60
Enter the passband frequency 1500
Enter the stopband frequency 3000
Enter the sampling frequency 7000

7
Homework:

Design high-pass IIR filter using Chebyshev filter.

Answer the following questions:

1. What are the filter specifications required to design the analog filters?
2. What is meant by frequency response of filter?
3. What is meant by magnitude response?
4. What is meant by phase response?
5. Differentiate ideal filter and practical filter responses.
6. What are the different types of analog filter approximations?
7. Define order of the filter and explain important role it plays in designing of a filter.
8. Explain advantages and disadvantages of Butterworth filter
9. Explain advantages and disadvantages of Chebyshev filter 1
10. Why Chebyshev is better than Butterworth filter?

You might also like