Vous êtes sur la page 1sur 10

KATHMANDU UNIVERSITY

DHULIKHEL, KAVRE

LAB No: 1
Subject: ETEG(308)

Date: 22nd May 2018


1.
clf;
w = -4*pi:8*pi/511:4*pi;
num = [2 1]; den = [1 -0.6];
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:
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 =

0.4000 0.8000 1.2000 1.0000 9.2293 2.4344


1.0000 0.5000 0.5000 1.0000 -0.2293 0.0822
6.
clear
clc
num = [0.3 2.5 -0.2+j*0.4 -0.2-j*0.4];
den = [0.5 -0.75 0.6+j*0.7 0.6-j*0.7];
k=3.9;
y=zplane(num,den,k);

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

Vous aimerez peut-être aussi