0% found this document useful (0 votes)
218 views

EC-506 Scilab Laboratory Manual: Submitted by

This document is Ashutosh Yadav's Scilab laboratory manual submitted to Dr. Prashant Purohit of the Electronics and Communication Engineering Department at Lakshmi Narain College of Technology, Bhopal. It contains 10 experiments on topics like basic Scilab operations, generating signals, signal addition/subtraction, and plotting signals. The manual documents the code, outputs, and objectives for each experiment.

Uploaded by

sai project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
218 views

EC-506 Scilab Laboratory Manual: Submitted by

This document is Ashutosh Yadav's Scilab laboratory manual submitted to Dr. Prashant Purohit of the Electronics and Communication Engineering Department at Lakshmi Narain College of Technology, Bhopal. It contains 10 experiments on topics like basic Scilab operations, generating signals, signal addition/subtraction, and plotting signals. The manual documents the code, outputs, and objectives for each experiment.

Uploaded by

sai project
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

EC-506

SCILAB LABORATORY MANUAL

RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA,BHOPAL

SUBMITTED BY:
ASHUTOSH YADAV

EC-V-A (2019-2023)

Enroll. No.-0103EC191057

SUBMITTED TO:

Dr. PRASHANT PUROHIT

Department of Electronics and Communication Engineering

Lakshmi Narain College of Technology


Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

S.No. Name of Experiment Experiment Date Submission Remarks


Date
1. . To write scilab Code to perform Basic
Operations.

2. To write the program for Unit Step Discrete


Signal and Unit Step Continuous Signal.

3. To write the program of Unit Ramp Discrete


Signal, Exponential Discrete Signal , Unit
Ramp Continuous Signal and Exponential
Continuous Signal.
4. To generate signal shifting ,folding ,addition
& multiplication

5. To write the scilab code for addition and


subtraction of a two given signal (continuous
and discrete domain)
6. . To write scilab code for sine and cosine
wave

7. . To write scilab code to show marks of 10


students in bar graph

8. . To write scilab code to plot frequency


modulated signal

9. To write scilab code to plot an amplitude


modulated signal.

10. To write scilab code to plot phase modulated


signal.
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO 1
To write scilab Code to perform Basic Operations.

Sol:

-> %pi

%pi =

3.1415927

--> %e

%e =

2.7182818

--> %pi/2

ans =

1.5707963

--> p=[2 4 6;6 7 8;1 2 4]

p =
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

2. 4. 6.

6. 7. 8.

1. 2. 4.

--> q=[1 2 3;3 5 8;5 6 7]

q =

1. 2. 3.

3. 5. 8.

5. 6. 7.

--> z=p+q

z =

3. 6. 9.

9. 12. 16.

6. 8. 11.

--> z=p-q

z =

1. 2. 3.
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

3. 2. 0.

-4. -4. -3.

--> z=p*q

z =

44. 60. 80.

67. 95. 130.

27. 36. 47.

--> z=p/q

z =

2. -3.331D-16 8.327D-17

-0.25 1.110D-15 1.25

-0.75 1. -0.25

-->det(p)

ans =

-10.000000

-->inv(p)
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

ans =

-1.2 0.4 1.

1.6 -0.2 -2.

-0.5 9.252D-18 1.

-->factorial(5)

ans =

120.

--> x=[35 60 85]

x =

35. 60. 85.

-->lcm(x)

ans =

7140.

-->gcd(x)

ans =

5.
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->mean(x)

ans =

60.

EXP. NO. 2
Q2.)To write the program for unit Step Discrete Signal and
Unit Step Continuous Signal.
Sol:
-> t=0:4;

--> y=ones(1,5);

-->subplot(2,1,1);

-->plot2d3(t,y);

-->xlabel('Time');

-->ylabel('Amplitude');

-->title('Unit Step Discrete Signal');

-->subplot(2,1,2);

-->plot(t,y);

-->xlabel('Time');

-->ylabel('Amplitude');

-->title(‘Unit Step Continuous Signal’);


Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

( P.T.O)
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 3
To write the program of Unit Ramp Discrete Signal, Exponential Discrete Signal , Unit Ramp Continuous
Signal and Exponential Continuous Signal.

Sol:

n1=0:8;

--> y1=n1;

--> y2=exp(n1);

-->subplot(2,2,1);

-->plot2d3(n1,y1);

-->xlabel('Time');

-->ylabel('Amplitude');

-->title('Exponential Discrete Signal');

-->subplot(2,2,2);

-->plot2d3(n1,y2);

-->xlabel('Time');

-->ylabel('Amplitude');

-->title('Exponential Discrete Signal');

-->subplot(2,2,3);

-->plot(n1,y1);

-->xlabel('Time');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->ylabel('Amplitude');

-->title('Unit Ramp Continuous Signal');

-->subplot(2,2,4);

-->plot(n1,y2);

-->xlabel('Time');

-->ylabel('Amplitude');

-->title('Exponential Continuous Signal');


Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 4
To generate signal shifting ,folding ,addition & multiplication

PROGRAM:

n1=0:6; y1=[zeros(1,3),ones(1,4)];

y2=n1-2; y3=n1+2;

y4=n1; y5=y1+y2;

y6=y3.*y4;

subplot(3,2,1);

plot2d3(n1,y1);

xlabel('time');

ylabel('amplitude');

title('sample signal');

subplot(3,2,2);

plot2d3(n1,y2);

xlabel('time');

ylabel('amplitude');

title('advancing shifting signal');

subplot(3,2,3);

plot2d3(n1, y3);
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

xlabel('time');

ylabel('amplitude');

title('delay shifting signal');

subplot(3,2,4);

plot2d3(n1,y4);

xlabel('time');

ylabel('amplitude');

title('folded signal');

subplot(3,2,5);

plot2d3(n1,y5);

xlabel('time');

ylabel('amplitude');

title('addition of signal');

subplot(3,2,6) plot2d3(n1,y6);

xlabel('time');

ylabel('amplitude');

title('multiplication of signal');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 5
AIM: To write the scilab code for addition and subtraction of a two given signal (continuous and discrete
domain).

PROGRAM:

n1=0:10;

y1=[ones(1,5),zeros(1,6)];

y2=[zeros(1,3),ones(1,4),zeros(1,4)];

y3=y1+y2; y4=y1-y2; subplot(2,3,1);

plot2d3(n1,y1);

xlabel('time');

ylabel('amplitude');

title('1st signal');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

subplot(2,3,2);

plot2d3(n1,y2);

xlabel('time');

ylabel('amplitude');

title('2nd signal');

subplot(2,3,3);

plot2d3(n1,y3);

xlabel('time');

ylabel('amplitude');

title('addition of two discrete signal');

subplot(2,3,4);

plot(n1,y3);

xlabel('time');

ylabel('amplitude');

title('addition of two continuous signal');

subplot(2,3,5); plot2d3(n1,y4);

xlabel('time');

ylabel('amplitude');

title('subtraction of two discrete signal');

subplot(2,3,6);

plot(n1,y4);

xlabel('time');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

ylabel('amplitude');

title('subtraction of two continuous signal');

output
( p.t.o.)
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 6
AIM: To write scilab code for sine and cosine wave.

b=(0:%pi/100:6*%pi);

x=sin(b);

subplot(2,1,1);

xlabel('time');

ylabel('amplitude');

title('sine wave');

plot(b,x);

subplot(2,1,2);

y=cos(b);

xlabel('time');

ylabel('amplitude');

title('cosine wave');

plot(b,y);

output-
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP NO 7.
AIM: To write scilab code to show marks of 10 students in bar graph.

PROGRAM:

x=[1:10];

y=[75,58,90,87,25,85,92,42,60,95];

bar(x,y); xlabel('student');

ylabel('marks');

title('marks of 10 students by chandrakanttiwari');

OUTPUT:
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 8
AIM: To write scilab code to plot frequency modulated signal.

PROGRAM:

t=0:0.0001:1;

fm=5;

fc=40;

mi=5;

sm=sin(2*%pi*fm*t);
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

subplot(3,1,1);

plot(t,sm);

xlabel('time');

ylabel('amplitude');

title('message signal chetali');

sc=sin(2*%pi*fc*t);

subplot(3,1,2);

plot(t,sc,'g');

xlabel('time');

ylabel('amplitude');

title('carrier signal');

y=sin(2*%pi*fc*t+(mi.*sin(2*%pi*fm*t)));

subplot(3,1,3);

plot(t,y,'r');

xlabel('time');

ylabel('amplitude');

title('FM modulated signal');

OUTPUT:
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 9
AIM: To write scilab code to plot an amplitude modulated signal
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

t=0:0.0001:1;

-->vm=8;

-->vc=10;

-->fm=2;

-->fc=100;

-->sm=vm*sin(2*%pi*fm*t);

-->subplot(3,1,1);

-->plot(t,sm);

-->xlable('time');

Undefined variable: xlable

-->xlabel('time');

-->ylabel('amplitude');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->sc=vc*sin(2*%pi*fc*t);

-->subplot(3,1,2);

-->plot(t,sc,'g');

-->xlabel('time');

-->ylabel('amplitude');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');


Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('MESSAGE SIGNAL BY CHANDRAKANT TIWARI');

-->title('carrier SIGNAL BY CHANDRAKANT TIWARI');

--> y=(vc+vm*sin(2*%pi*vm*t)).*(sin(2*%pi*fc*t));

-->subplot(3,1,3);

-->plot(t,y,'r');

-->xlabel('amplitude');

-->xlabel('time');

-->ylabel('amplitude');

-->title('amplitude modulated sig. by chandrakant’);


Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

Output-
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

EXP. NO. 10
AIM: To write scilab code to plot phase modulated signal.

t=0:0.0001:1;

-->vm=1;

-->vc=1;

-->fm=10;

-->fc=25;

--> m=1;

-->sm=vm*sin(2*%pi*fm*t);

-->subplot(3,1,1);

-->plot(t,sm);

-->xlabel('time');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->ylabel('amplitude');

-->title('message signal by chandrakanttiwari');

-->sc=vc*sin(2*%pi*fc*t);

-->subplot(3,1,2);

-->plot(t,sc);

-->xlabel('time');

-->ylabel('amplitude');

-->title('carrier signal');

--> y=vc*sin(2*%pi*fc*t+m.*sin(2*%pi*fm*t));

-->subplot(3,1,3);

-->plot(t,y,'r');
Lakshmi Narain College of Technology, Bhopal
Department of Electronic and Communication Engineering
Name ASHUTOSH YADAV Enrollment no:0103EC191057 Class:EC
V‘A’(2019-23)

-->xlabel('time');

-->ylabel('amplitude');

-->title('phase modulated signal by chandrakanttiwari 0103EC181050');

You might also like