% Answers to First Midterm exam Spring 2001
%(a)
T0=1/60;
deltaT=T0/10;
ts=0;
te=4*T0;
t=ts:deltaT:te;
%
i=abs(4*cos(120*pi*t-pi/3));
plot(t,i); title('i(t)');
xlabel('time in second');ylabel('A');
echo on
%average power 8W
pav=(1/(4*T0))*sum(i.^2)*deltaT
%Irms=sprt(8)=2.8284 (A)
irms=sqrt(pav)
echo off
pause
%(b)
deltaT=0.01;
tx=-1:deltaT:4;
th=1:deltaT:4;
x=3*ones(1,length(tx));
h=4-th;
ty=0:deltaT:8;
y=conv(x,h)*deltaT;
figure;subplot(3,1,1);plot(tx,x,'g');title('x(t)');
subplot(3,1,2);plot(th,h,'b');title('h(t)');
subplot(3,1,3);plot(ty,y,'k');title('y(t)');
pause
%(c)
b=[1 10^7 10^15];
a=[1 1.1*10^7 1.01*10^15];
figure;zplane(b,a);title('pole and zero diagram of problem 5');
pause
close all
