0% found this document useful (0 votes)
108 views

Lab Manual No 11: IIR Filter Design Using MATLAB

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING COMPUTER ENGINEERING DEPARTMENT Digital Signal Processing Lab Manual Lab Manual No 11: IIR Filter Design using MATLAB This lab manual provides a comprehensive guide to designing Infinite Impulse Response (IIR) filters using MATLAB. The manual covers the basic concepts of digital filtering, including the different types of filters (Lowpass, Highpass, Bandpass, and Bandstop) and introduces I

Uploaded by

Hussam Ather
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)
108 views

Lab Manual No 11: IIR Filter Design Using MATLAB

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING COMPUTER ENGINEERING DEPARTMENT Digital Signal Processing Lab Manual Lab Manual No 11: IIR Filter Design using MATLAB This lab manual provides a comprehensive guide to designing Infinite Impulse Response (IIR) filters using MATLAB. The manual covers the basic concepts of digital filtering, including the different types of filters (Lowpass, Highpass, Bandpass, and Bandstop) and introduces I

Uploaded by

Hussam Ather
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/ 4

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING


COMPUTER ENGINEERING DEPARTMENT

Digital Signal Processing

Lab Manual No 11

IIR Filter Design using MATLAB

Digital Signal Processing


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
COMPUTER ENGINEERING DEPARTMENT

Objectives:-

The objective of this lab is to understand the filter design using MATLAB.

Procedure:-

Filters are a basic component of all signal processing and telecommunication system. A filter is
a device or process that removes some unwanted components or features from a signal. Filtering
is a class of signal processing used to complete or partial suppression of some aspects of the
signal. Most often, this means to remove some frequencies and not others in order to suppress the
interfacing signals and reduce the background noise.

Types of Filters:-

In signal processing, the filters can be of four types, i.e. Lowpass Filters, Highpass Filter,
Bandpass Filters, and Bandstop Filters.

Infinite Impulse Response (IIR) Filters:-

Another type of filter is the Infinite Impulse Response (IIR) filter and the Impulse Response of
an IIR filter is of infinite duration. The IIR filters have the feedback, due to which they are also
known as Recursive filters. The general difference for an IIR filter is:

Where "ak" is the k-th feedback tap. The left "Σ" denoted the summation from k =1 to k =N-1,
"N" is the number of the feedback taps in the IIR filter. The right "Σ" denotes the summation
from k = 0 to k = M – 1, where "M" is the number of feedforward taps.

We have given the codes for IIR filter design using Butterworth, Chebyshev Type I, Chebyshev
Type II and Elliptic Filters.

IIR Butterworth Low pass Filter:-

%IIR Butterworth Lowpass Filter:


%A MATLAB program to design IIR Butterworth Lowpass Filter
clf; %Clear all figures

Digital Signal Processing


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
COMPUTER ENGINEERING DEPARTMENT

clear all; %Clear all variables


close all; %Close all figures
n = 6; %Define the order of the filter
fc = input('Enter the cutoff frequency');
fs = input('Enter the sampling frequency');
Wc = 2 * fc / fs; %Normalizing the frequencies
[b,a]=butter(n,Wc,'low'); %Calculation of filter coefficients
freqz(b,a,fs); %Plotting the filter response
title('Magnitude and Phase response of Butterworth IIR Lowpass
filter');

IIR Chebyshev Type I Filter:-

%IIR Chebyshev-Type-1 Lowpass Filter:


%A MATLAB program to design IIR Chebyshev Type I Lowpass Filter
clf; %Clear all figures
clear all; %Clear all variables
close all; %Close all figures
n = 6; %Define the order of the filter
R = 0.5; %Define the Passband peak-to-peak ripple in decibels
fc = input('Enter the cutoff frequency');
fs = input('Enter the sampling frequency');
Wc = 2 * fc / fs; %Normalizing the frequencies
[b,a]=cheby1(n,R,Wc,'low'); %Calculating filter coefficients
freqz(b,a,fs); %Plotting the filter response
title('Magnitude and Phase Response of Chebyshev-Type-1 IIR
Lowpass Filter');

IIR Chebyshev Type II Filter:-

%IIR Chebyshev-Type-2 Lowpass Filter:


%A MATLAB program to design IIR Chebyshev Type II Lowpass Filter
clf; %Clear all figures
clear all; %Clear all variables
close all; %Close all figures
n = 6; %Define the order of the filter
R = 20; %Stopband ripple in decibles
fc = input('Enter the cutoff frequency');
fs = input('Enter the sampling frequency');
Wc = 2 * fc / fs; %Normalizing the frequencies
[b,a]=cheby2(n,R,Wc,'low');%Calculation of filter coefficients
freqz(b,a,fs); %Plotting the filter response

Digital Signal Processing


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
COMPUTER ENGINEERING DEPARTMENT

title('Magnitude and Phase Response of Chebyshev-Type-2 IIR


Lowpass Filter');

IIR Elliptic Low pass Filter:-

%IIR Elliptic Lowpass Filter:


%A MATLAB program to design IIR Elliptic Lowpass Filter
clf; %Clear all figures
clear all; %Clear all variables
close all; %Close all figures
n = 6; %Define the order of the filter
Rp=10; %Passband Ripple in decibels
Rs = 20; %Stopband ripple in decibles
fc = input('Enter the cutoff frequency');
fs = input('Enter the sampling frequency');
Wc = 2 * fc / fs; %Normalizing the frequencies
[b,a]=ellip(n,Rp,Rs,Wc,'low');%Calculation of filter
coefficients
freqz(b,a,fs); %Plotting the filter response
title('Magnitude and Phase Response of Elliptic IIR Lowpass
Filter');

Lab Tasks:-

1. Run all the above codes and analyze the magnitude and
phase spectrum of the filter designed.
2. Calculate the Zero, poles and gain of the filter designed
and comment about the filter stability and causality.
3. Write a MATLAB program to design a Highpass IIR filter
using Butterworth, Chebyshev Type_1, Chebyshev Type_2,
and Elliptic filter methods. Use your own values. Compare
the Magnitude and Phase Response of the three by plotting
them on the same plot.

Digital Signal Processing

You might also like