%Simulation of Delta-Sigma modulator
tspan=2;
T=0.08;eps=0.009;
G1=tf(1,[1 0]);
%G2=tf(1,[2*T^2 T 1]);
G2=tf(1,[T^2/2 T 1]);
[t,x,y]=sim('deltasigma',tspan);
subplot(411);
pl=plot(t,y(:,1),'b',t,y(:,4),'r-');
%set(gca,'Ytick',[-1 0 1]);
set(pl,'Linewidth', AM_data_linewidth);
axis([0 2 -1.2 1.2]);
ylabel('r')
subplot(412)
pl=plot(t,y(:,5));
set(pl,'Linewidth', AM_data_linewidth);
axis([0 2 -2 2]);
ylabel('e');
subplot(413)
pl=plot(t,y(:,2));
%set(gca,'Ytick',[-0.01 0 0.01]);
set(pl,'Linewidth', AM_data_linewidth);
axis([0 2 -0.01 0.01]);
ylabel('u')
subplot(414)
pl=plot(t,y(:,3));
%set(gca,'Xtick',[4 4.1 4.2 4.3 4.4 4.5]);
set(pl,'Linewidth', AM_data_linewidth);
axis([0 2 -1.2 1.2]);
xlabel('t');ylabel('y');
