Académique Documents
Professionnel Documents
Culture Documents
DHULIKHEL, KAVRE
LAB No: 1
Subject: ETEG(308)
subplot(2,1,2)
plot(w/pi,imag(h)); grid
title('imaginary part of H(e^{j\omega})');
xlabel('\omega/\pi');
ylabel('Amplitude');
pause
subplot(2,1,1)
plot(w/pi,abs(h)); grid
title('Magnitude spectrum |H(e^{j\omega})|');
xlabel('\omega/\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h)); grid
title('Phase spectrum arg[H(e^{j\omega})]');
xlabel('\omega/\pi');
ylabel('Phase,radians');
outputs:
2.
clf;
w = -4*pi:8*pi/511:4*pi;
num = [2 5 9 5 3]; den = [5 45 2 1 1];
h = freqz(num,den,w);
subplot(2,1,1)
plot(w/pi,real(h)); grid
title('Real part of H(e^{j\omega})');
xlabel('\omega/\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,imag(h)); grid
title('imaginary part of H(e^{j\omega})');
xlabel('\omega/\pi');
ylabel('Amplitude');
pause
subplot(2,1,1)
plot(w/pi,abs(h)); grid
title('Magnitude spectrum |H(e^{j\omega})|');
xlabel('\omega/\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h)); grid
title('Phase spectrum arg[H(e^{j\omega})]');
xlabel('\omega/\pi');
ylabel('Phase,radians');
Outputs :
3.
clear
clc
num = [2 5 9 5 3];
den = [5 45 2 1 1];
y=zplane(num,den);
Output:
4.
clear
clc
num = [2 5 9 5 3];
den = [5 45 2 1 1];
[z,p,k]=tf2zp(num,den)
Outputs:
z=
-1.0000 + 1.4142i
-1.0000 - 1.4142i
-0.2500 + 0.6614i
-0.2500 - 0.6614i
p=
-8.9576 + 0.0000i
-0.2718 + 0.0000i
0.1147 + 0.2627i
0.1147 - 0.2627i
k=
0.4000
5.
clear
clc
num = [2 5 9 5 3];
den = [5 45 2 1 1];
[z,p,k]=tf2zp(num,den);
sos=zp2sos(z,p,k)
Outputs:
sos =
output:
7.
clear
clc
L = input('enter the no of samples of inverse of G(z): ');
num = [2 5 9 5 3];
den = [5 45 2 1 1];
[g,t] = impz(num,den,L);
plot(t,g);
Command Window:
enter the no of samples of inverse of G(z): 50
output:
8.
clear
clc
num = [2 5 9 5 3];
den = [5 45 2 1 1];
[R,P,K] = residuez(num,den)
R=
0.3109 + 0.0000i
-1.0254 - 0.3547i
-1.0254 + 0.3547i
-0.8601 + 0.0000i
P=
-8.9576 + 0.0000i
0.1147 + 0.2627i
0.1147 - 0.2627i
-0.2718 + 0.0000i
K=
3.0000