Adc Lab Manual
Adc Lab Manual
Program:
/Generate unit impulse signal
clc
close
clear;
t=-10:0.01:10;
yl-x.* (t = 0);
subplou4,1,1);
plot2d(t,yl);
xgrid(color("green");
agca();
a.x location="origin";
a.y location="origin";
xtitle ("Unit impulse "
signal", t time", "Amplitude");
/Generate unit slep signal
y2-x.*(t>=0);
subplot,1,2);
plot2d(t.y2);
grid( color("'green");
a gca);
Prepared by T.V.Chandra Shekar
a.x ocation="origin";
a.ocatioi="origin
xtitle (Unit step
signal,
"
t time", "u(t");
Generate sinfw) Signal
W
y3 sin(w*t);
subplot4,1,3);
plot2d(t,y3);
xgrid(color("green ");
a-gca);
a.x location="origin";
a. location="origin";
xtitle ('Sin signal", "ttime", "cos(wt))
/Generate ramp signal
y4 t. (t>= 0);
subplot 4,1,4);
plot2d(t,y4);
xgrid(color("green"));
agca);
a.xJocation="origin",
a.y location=""origin";
xtitle ("Ramp signal", "t time", "r(1)");
Generate sinc Signal
figure
y5 sinc(%pi*t);
subplot(4,1,1);
plot2d(t,y5);
xgrid(color("green");
a-gcal);
a.x location="origin";
a.ocation=""origin";
xtitle ('sinc
signal," t time, "Sinctt) );
Generate squarewave
t=(0.0.01:10*%pi);
y6squarewavet);
subplot( ,,-
Prepared by T,V. Chandra Shekar
plot(t/(2*opi), y6);
xgrid color("green");
a gca)
a.x location= "origin";
a.y location =
"origin";
a.data bounds [0,-2;5,2];
=
end
end
Subplot( 4,1,4);
plot(t,y);
xgrid(color("green"));
a =gca(;
a. cation= "origin";
a. cnuion= "origin";
a.dat bounds=[-2,-2;5,;
xiitleCTriangular Sienal', 't Time', 'Amplitue );
plot(t/*opi), y6);
gridcolor("preeu"));
agea():
a. lealton="orign";
a. locatton= "orign";
a.data bounds 10,-25,2;
Ntitle('Square Signal',t Time', Amplitue);
GCnerale sawtooth wave
t= -0.001:5;
y7 t- floor(t);
subplot(4,1,3);
plot(t.y7);xgrid(color("green");
a gea(O:
a.x locilion= "origin";
a. location= "origin";
Nitle('Sawtooth Signal', Time','Amplitude');
Generite Tricngular wvave
t= -1 0.01:1;
n= length(t);
y=[,zeros(1,length(t)-1)1
for n= 1length(t)
ifun)=0
y(n)=1+t(n);
end
ift(n)>=0
y(n)=-t(n);
end
end
subplot 4,1, 4);
plot t.y)
xgrid( colorgreen ));
agca):
a.
af1="oriin
a.
a.d.at.hounds|-2,-2:,|
xtitleCTTiangular Signal, 't lime', 'Amplitue );