0% found this document useful (0 votes)
23 views4 pages

Adc Lab Manual

The document is a lab manual for generating various signals and sequences using Scilab software, including unit impulse, unit step, square, sawtooth, triangular, sinusoidal, ramp, and sinc signals. It provides the necessary code snippets and explanations for each signal generation, along with the use of specific functions for plotting. The manual is prepared by T.V. Chandra Shekar and is designed for use on a Linux system with Ubuntu 16.04 LTS.

Uploaded by

borkutanithin0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Adc Lab Manual

The document is a lab manual for generating various signals and sequences using Scilab software, including unit impulse, unit step, square, sawtooth, triangular, sinusoidal, ramp, and sinc signals. It provides the necessary code snippets and explanations for each signal generation, along with the use of specific functions for plotting. The manual is prepared by T.V. Chandra Shekar and is designed for use on a Linux system with Ubuntu 16.04 LTS.

Uploaded by

borkutanithin0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Vignana Bharathi Institute of Technology

Signals and Stochastics Lab Manual

2.Generation Of Various Signals and Sequences, such Unit


as Impulse, Unit
step, Square, Saw tooth, Triangular, Sinusoidal, Ramp, Sinc
Aim: To generate various Signals and Sequences, such as unit impulse, unit step,
Square, Saw tooth, Triangular, Sinusoidal, Ramp and Sinc.
Software: Sçilab 6.0.1 and system loaded with Linux flavor
of Ubuntu 16.04 LTS.
Pre-requisites: Mathematical relations of various signals.
Inbuilt functions used in thispiece of code
subplot Used for partitioning the given graph
plot Interpolated version of the curve is plotted using this function
plot2d3 Plain graph is plotted.
xtitle Used to set the labels and titles for the graph
gca Returns object of axis used to set axis properties.
Squarewave Used to generate square signal of period 2*T

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];
=

xtitle('Square Signal',t Time', Amplitue');


Generate sawtooth wave
t-5:0.001:5;
y7=t- floor(t);
subplot(4,1,3);
plout,y7 );xgrid(color("green");
a gca()
a.x location =
" origin";
a.y location= "origin";
xtitle('Sawtooth Signal,'t Time', Amplitude');
/Generate Tringular Wave
t -1:0.01:1;
n=l:1:length(t);
y=[l,zeros(1,length(t)-1)]
for n=1:length(t)
if t(n)<=0
y(n)= + t(n);
end
if t(n)>=0
y(n) = I - t(n);

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 );

You might also like