EEE 4510 Homework: IIR Filter Design, Implementation & Analysis
VerifiedAdded on 2023/06/14
|16
|1796
|386
Homework Assignment
AI Summary
This document presents a solution to an electrical engineering assignment (EEE 4510) involving the design and implementation of an IIR filter using MATLAB. The solution details the selection of a high-pass elliptic filter based on specific Z number digits, converts analogue frequencies to normalized radian frequencies, and provides the MATLAB code used for filter design and analysis. The code calculates filter coefficients, poles, and zeros, and includes frequency response plots and signal filtering. Further, the document addresses questions related to transfer functions, pole-zero plots, DTFT, and DFT, contrasting their properties and providing relevant MATLAB code and graphical representations. It also demonstrates the signal spectrum analysis for various N values. The document concludes with a list of cited works.

Surname 1
Name:
University:
Course:
Tutor:
Date:
SOLUTION:
Question 1:
a. My last two digits for my Z number are 20 therefore I am going to design high pass (3) elliptic
filter (0). The analogue frequencies in equation 1 below can be converted to normalized radian
frequencies as follows:
normalized radian frequencies= 2∗π∗f
sampling frequency
Therefore:
1000 HZ will be: 0.2π rad/sample
2000 HZ will be: 0.4π rad/sample
3000 HZ will be: 0.6π rad/sample
4000 HZ will be: 0.8π rad/sample
I have decided to place the pass and stop frequencies at 2500 Hz and 2200 Hz respectively.
b. I have used the following code to solve instruction 2 the results are as shown below:
clear all;%clearing and closing all files
clc;
close all
Name:
University:
Course:
Tutor:
Date:
SOLUTION:
Question 1:
a. My last two digits for my Z number are 20 therefore I am going to design high pass (3) elliptic
filter (0). The analogue frequencies in equation 1 below can be converted to normalized radian
frequencies as follows:
normalized radian frequencies= 2∗π∗f
sampling frequency
Therefore:
1000 HZ will be: 0.2π rad/sample
2000 HZ will be: 0.4π rad/sample
3000 HZ will be: 0.6π rad/sample
4000 HZ will be: 0.8π rad/sample
I have decided to place the pass and stop frequencies at 2500 Hz and 2200 Hz respectively.
b. I have used the following code to solve instruction 2 the results are as shown below:
clear all;%clearing and closing all files
clc;
close all
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Surname 2
Ws=2500/10000;Wp=2200/10000;Rp=0.5;Rs=60;%filter specifications
[N wp]=ellipord (Wp,Ws,Rp,Rs);
N %filter order
% filter coefficients and poles and zeros
[b a]=ellip (N, Rp, Rs, wp,'high');
[z p k]=ellip (N,Rp,Rs,wp);
Fvtool (b,a)
%testing the filter
fs =10000;
t=0:1/fs: 0.2;
w=2*pi*t;
x_t=cosd (w*1000) +cosd (w*2000-60) +cosd(w*3000+30)+cosd(w*4000-90);
figure
plot (t,x_t)
title('original signal')
xlabel ('time in seconds')
ylabel ('magnitude')
y_t=filter (b,a,x_t);
figure
plo t(t,y_t)
title ('filtered signal')
xlabel ('time in seconds')
ylabel ('magnitude')
[H, T]=impz (b,a);
N=8 order of the filter
Poles: p =
0.7872 + 0.1726i
0.7872 - 0.1726i
0.7716 + 0.4403i
0.7716 - 0.4403i
Ws=2500/10000;Wp=2200/10000;Rp=0.5;Rs=60;%filter specifications
[N wp]=ellipord (Wp,Ws,Rp,Rs);
N %filter order
% filter coefficients and poles and zeros
[b a]=ellip (N, Rp, Rs, wp,'high');
[z p k]=ellip (N,Rp,Rs,wp);
Fvtool (b,a)
%testing the filter
fs =10000;
t=0:1/fs: 0.2;
w=2*pi*t;
x_t=cosd (w*1000) +cosd (w*2000-60) +cosd(w*3000+30)+cosd(w*4000-90);
figure
plot (t,x_t)
title('original signal')
xlabel ('time in seconds')
ylabel ('magnitude')
y_t=filter (b,a,x_t);
figure
plo t(t,y_t)
title ('filtered signal')
xlabel ('time in seconds')
ylabel ('magnitude')
[H, T]=impz (b,a);
N=8 order of the filter
Poles: p =
0.7872 + 0.1726i
0.7872 - 0.1726i
0.7716 + 0.4403i
0.7716 - 0.4403i

Surname 3
0.7600 + 0.5773i
0.7600 - 0.5773i
0.7604 + 0.6315i
0.7604 - 0.6315i
Zeros: z =
-0.3736 + 0.9276i
-0.3736 - 0.9276i
0.4965 + 0.8680i
0.4965 - 0.8680i
0.6718 + 0.7407i
0.6718 - 0.7407i
0.7144 + 0.6997i
0.7144 - 0.6997i
-
Figure 1: Filter coefficients
0.7600 + 0.5773i
0.7600 - 0.5773i
0.7604 + 0.6315i
0.7604 - 0.6315i
Zeros: z =
-0.3736 + 0.9276i
-0.3736 - 0.9276i
0.4965 + 0.8680i
0.4965 - 0.8680i
0.6718 + 0.7407i
0.6718 - 0.7407i
0.7144 + 0.6997i
0.7144 - 0.6997i
-
Figure 1: Filter coefficients
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Surname 4
Figure 2: magnitude response
Figure 3: Phase response
Figure 2: magnitude response
Figure 3: Phase response
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Surname 5
Figure 4: Pole/zero plot
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
time in seconds
-3
-2
-1
0
1
2
3
magnitude
original signal
Figure 5: Original signal
Figure 4: Pole/zero plot
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
time in seconds
-3
-2
-1
0
1
2
3
magnitude
original signal
Figure 5: Original signal

Surname 6
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
time in seconds
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
magnitude
filtered signal
Figure 6: Filtered signal
Question 2:
a. H ( z )= 1− z−2
1+ 0.9025 z−2
( 1+0.9025 z−2 ) Y ( z ) = ( 1−z−2 ) X ( z )
Taking the inverse lapse we have:
Y[n] =-0.9025y [n-2]+x[n]-x[n-2]
The order of the filter is 2 because the highest feedforward and feedback filter order is 2.
b. From the long division we have transfer function as:
H(z)=1-1.9025Z-2+1.717Z-4-1.5496Z-6+1.399Z-8-1.262Z-10
close all;
clear all;
clc;
b= [1 -1];
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
time in seconds
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
magnitude
filtered signal
Figure 6: Filtered signal
Question 2:
a. H ( z )= 1− z−2
1+ 0.9025 z−2
( 1+0.9025 z−2 ) Y ( z ) = ( 1−z−2 ) X ( z )
Taking the inverse lapse we have:
Y[n] =-0.9025y [n-2]+x[n]-x[n-2]
The order of the filter is 2 because the highest feedforward and feedback filter order is 2.
b. From the long division we have transfer function as:
H(z)=1-1.9025Z-2+1.717Z-4-1.5496Z-6+1.399Z-8-1.262Z-10
close all;
clear all;
clc;
b= [1 -1];
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Surname 7
a= [1 0.9025];
[H W]=impz (b,a);
From the code the coefficients are:
H =
1.0000
-1.9025
1.7170
-1.5496
1.3985
-1.2622
c. The poles can be obtained as follows:
H ( z )= 1− z−2
1+ 0.9025 z−2 = z2+1
0.9025+ z2
Poles at: Z2 +0.9025=0 Z =± j0.95
Zeroes at: Z2 −1=0 Z=±1
The frequency response can be sketched as:
Figure 7: Sketch of the magnitude response
a= [1 0.9025];
[H W]=impz (b,a);
From the code the coefficients are:
H =
1.0000
-1.9025
1.7170
-1.5496
1.3985
-1.2622
c. The poles can be obtained as follows:
H ( z )= 1− z−2
1+ 0.9025 z−2 = z2+1
0.9025+ z2
Poles at: Z2 +0.9025=0 Z =± j0.95
Zeroes at: Z2 −1=0 Z=±1
The frequency response can be sketched as:
Figure 7: Sketch of the magnitude response
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Surname 8
Matlab code and the plot
close all;
clear all;
clc;
b= [1 0 -1];
a= [1 0 0.9025];
[H W]=impz (b,a);
Freqz (b,a)
Figure 8: Frequency response
d. The block diagram of the filter can be represented as:
Matlab code and the plot
close all;
clear all;
clc;
b= [1 0 -1];
a= [1 0 0.9025];
[H W]=impz (b,a);
Freqz (b,a)
Figure 8: Frequency response
d. The block diagram of the filter can be represented as:

Surname 9
Figure 9: Block diagram represention of the filter
Question 3
Pole-zero plots 1 has magnitude frequency response plot A.
Pole-zero plots 2 has magnitude frequency response plot C.
Pole-zero plots 3 has magnitude frequency response plot E.
Pole-zero plots 4 has magnitude frequency response plot B.
Pole-zero plots 5 has magnitude frequency response plot A.
Pole-zero plots 6 has magnitude frequency response plot D.
The transfer function for the first three plots will be given by:
H ( Z )= Z
Z2+1.2 Z +0.85
H ( Z )= Z +1
Z−0.981
H ( Z ) = Z
Z2+1
Figure 9: Block diagram represention of the filter
Question 3
Pole-zero plots 1 has magnitude frequency response plot A.
Pole-zero plots 2 has magnitude frequency response plot C.
Pole-zero plots 3 has magnitude frequency response plot E.
Pole-zero plots 4 has magnitude frequency response plot B.
Pole-zero plots 5 has magnitude frequency response plot A.
Pole-zero plots 6 has magnitude frequency response plot D.
The transfer function for the first three plots will be given by:
H ( Z )= Z
Z2+1.2 Z +0.85
H ( Z )= Z +1
Z−0.981
H ( Z ) = Z
Z2+1
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Surname 10
The frequency response for the above will be given respectively by:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-10
0
10
20
Magnitude (dB)
Figure 10: plot 1
The frequency response for the above will be given respectively by:
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-10
0
10
20
Magnitude (dB)
Figure 10: plot 1
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Surname 11
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
Magnitude (dB)
Figure 11: plot 2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-20
0
20
40
Magnitude (dB)
Figure 12: plot 3
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-50
0
50
Magnitude (dB)
Figure 11: plot 2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-100
-50
0
50
100
Phase (degrees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-20
0
20
40
Magnitude (dB)
Figure 12: plot 3

Surname 12
Question 4
The general representation of a DTFT is given by:
Therefore finite signal can be represented as:
X ( Ω ) =x ( 2 ) e− j 2 Ω +x ( 0 ) e− j 0 Ω + x ( 1 ) e− j Ω +x ( 0 ) e− j 0 Ω + x (−3 ) e j3 Ω+ x (−1 ) e j Ω +x ( 1 ) e− j Ω
Its z transform will be:
X ( Z )=x ( 2 ) Z−2+ x ( 0 ) Z−0 + x ( 1 ) Z−1 + x ( 0 ) Z0+ x (−3 ) Z3 + x (−1 ) Z1+x ( 1 ) Z−1
clear all;%clearing and closing all files
clc;
close all
n= [32 64 128];
X= [2 0 1 0 -3 -1 1];
H=fft(X);
H';
Stem (H,'filled')
grid
ylabel('signal spectrum')
Question 4
The general representation of a DTFT is given by:
Therefore finite signal can be represented as:
X ( Ω ) =x ( 2 ) e− j 2 Ω +x ( 0 ) e− j 0 Ω + x ( 1 ) e− j Ω +x ( 0 ) e− j 0 Ω + x (−3 ) e j3 Ω+ x (−1 ) e j Ω +x ( 1 ) e− j Ω
Its z transform will be:
X ( Z )=x ( 2 ) Z−2+ x ( 0 ) Z−0 + x ( 1 ) Z−1 + x ( 0 ) Z0+ x (−3 ) Z3 + x (−1 ) Z1+x ( 1 ) Z−1
clear all;%clearing and closing all files
clc;
close all
n= [32 64 128];
X= [2 0 1 0 -3 -1 1];
H=fft(X);
H';
Stem (H,'filled')
grid
ylabel('signal spectrum')
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 16
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.