Professional Documents
Culture Documents
Lab 8
Lab 8
EE-20141
LAB SESSION 8
TASK#1:
clear all;close all;clc;
Num = poly([0]);
Den = poly([0.9*exp(j*0)]);
sys=tf(Num,Den,1) %tf(num,den,Ts) for DT system where Ts is sampling time
figure('color','w')
subplot(3,1,1); pzmap(sys)
xlim([-3 3]); ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#2:
clear all;close all;clc;
Num = poly([0]);
Den = poly([(0.9*exp(j*pi)),(0.9*exp(j*-pi))]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
KINZA PERVEZ
EE-20141
LAB SESSION 8
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#3:
clear all;close all;clc;
Num = poly([0]);
Den = poly([1*exp(j*0)]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
KINZA PERVEZ
EE-20141
LAB SESSION 8
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#4:
clear all;close all;clc;
Num = poly([0]);
Den = poly([(1*exp(j*-pi)),(1*exp(j*pi))]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
KINZA PERVEZ
EE-20141
LAB SESSION 8
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#5:
clear all;close all;clc;
Num = poly([0]);
Den = poly([1.1*exp(j*0)]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
KINZA PERVEZ
EE-20141
LAB SESSION 8
subplot(3,1,3)
impulse(sys,'r');grid
TASK#6:
clear all;close all;clc;
Num = poly([0]);
Den = poly([(1.1*exp(j*-pi)),(1.1*exp(j*pi))]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
KINZA PERVEZ
EE-20141
LAB SESSION 8
TASK#7:
clear all;close all;clc;
Num = poly([(0.8944*exp(j*(2*pi/3))),(0.8944*exp(j*-(2*pi/3)))]);
Den = poly([0]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#8:
clear all;close all;clc;
Num = poly([(1*exp(j*(pi/2))),(1*exp(j*-(pi/2)))]);
Den = poly([(0.8*exp(j*(pi/4))),(0.8*exp(j*-(pi/4)))]);
sys=tf(Num,Den,1) %tf(num,den,Ts) for DT system where Ts is sampling time
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
H=dfilt.df1(Num,Den); %Digital Filter with Direct Form-I approach
A=isfir(H)
KINZA PERVEZ
EE-20141
LAB SESSION 8
TASK#9:
clear all;close all;clc;
Num = poly([(1*exp(j*(pi/2))),(1*exp(j*-(pi/2)))]);
Den = poly([(1*exp(j*(pi/4))),(1*exp(j*-(pi/4)))]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
TASK#10:
clear all;close all;clc;
Num = poly([(1*exp(j*(pi/2))),(1*exp(j*-(pi/2)))]);
Den = poly([(1.2*exp(j*(pi/4))),(1.2*exp(j*-(pi/4)))]);
sys=tf(Num,Den,1) %tf(num,den,Ts) for DT system where Ts is sampling time
figure('color','w')
subplot(3,1,1); pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
H=dfilt.df1(Num,Den); %Digital Filter with Direct Form-I approach
A=isfir(H)
TASK#11:
clear all;close all;clc;
Num = poly([(0.8*exp(j*(pi/2))),(0.8*exp(j*-(pi/2)))]);
Den = poly([(0.8*exp(j*(pi/4))),(0.8*exp(j*-(pi/4)))]);
figure('color','w')
subplot(3,1,1);pzmap(sys)
xlim([-3 3]);ylim([-1.5 1.5])
subplot(3,1,2)
KINZA PERVEZ
EE-20141
LAB SESSION 8
[H w]=freqz(Num,Den);
mag=abs(H);
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180]);grid
subplot(3,1,3)
impulse(sys,'r');grid
H=dfilt.df1(Num,Den);
A=isfir(H)
TASK#12:
clear all;close all;clc;
Num = poly([(1.2*exp(j*(pi/2))),(1.2*exp(j*-(pi/2)))]);
Den = poly([(0.8*exp(j*(pi/4))),(0.8*exp(j*-(pi/4)))]);
figure('color','w')
subplot(3,1,1)
pzmap(sys)
xlim([-3 3])
ylim([-1.5 1.5])
subplot(3,1,2)
[H w]=freqz(Num,Den);
mag=abs(H);
KINZA PERVEZ
EE-20141
LAB SESSION 8
plot((w*180)/pi,mag)
xlabel('\omega (in degrees)')
ylabel('Gain |H(\omega)|')
title('Frequency Response')
xlim([0 180])
grid
subplot(3,1,3)
impulse(sys,'r')
grid
H=dfilt.df1(Num,Den);
A=isfir(H)