Thứ Ba, 12 tháng 10, 2010

bài 2.7 tín hiệu và hệ thống

clear;
t1=0;
t2=-1;
t3=t1+t2;
for ts=[0.2 0.1 0.005];
clf;
m=1;
for n=0:1:4/ts;
if (n*ts<=3)
x(m)=1;
else
x(m)=0;
end
m=m+1;
end
n=0:1:4/ts;
h=exp(-n*ts);
y=ts*conv(x,h);
L=length(y);
n=1;
for t=ts*(0:L-1);
if (t<=3)
x(n)=1;
else
x(n)=exp(3-t);
end
n=n+1;
end
t=ts*(0:L-1);
yf=x-exp(-t);
plot(t+t3,y,t+t3,yf,':')
disp('see the graph and press any key to continue')
pause
end

Không có nhận xét nào: