0% found this document useful (0 votes)
130 views13 pages

Experiment:-1 AIM:-: Generation, Analysis and Plot of Discrete Time Signals: (A) Unit Sample and (B) Unit Step

The document contains descriptions of 8 experiments conducted to generate, analyze, and plot various discrete time signals using Scilab code. The experiments include generating unit step and unit sample responses, exponential and sinusoidal signals, adding and multiplying sequences, shifting and folding sequences, generating even and odd signals with different colors, convolving two signals, and shifting signals. Scilab programs are provided for each experiment.

Uploaded by

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

Experiment:-1 AIM:-: Generation, Analysis and Plot of Discrete Time Signals: (A) Unit Sample and (B) Unit Step

The document contains descriptions of 8 experiments conducted to generate, analyze, and plot various discrete time signals using Scilab code. The experiments include generating unit step and unit sample responses, exponential and sinusoidal signals, adding and multiplying sequences, shifting and folding sequences, generating even and odd signals with different colors, convolving two signals, and shifting signals. Scilab programs are provided for each experiment.

Uploaded by

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

Date of conduction:

Experiment:- 1
AIM:- Generation, Analysis and Plot of Discrete time signals:
(A) Unit Sample and
(B) Unit Step.

Program:n=-20:20;
x=zeros(1,length(n));
x(find(n>=0))=1;
plot2d3('gnn',n,x);
xlabel('Time');
ylabel('Amplitude');
title('Unit Step Response');

(B) Unit Sample Response


Program:n=-20:20;
x=zeros(1,length(n));
x(find(n==0))=1;
plot2d3('gnn',n,x);
xlabel('Time');
ylabel('Amplitude');
title('Unit Sample Response');

Date of conduction:

Experiment:-2

AIM:-Generation, Analysis and Plot of Discrete time signals:


(A) Exponential and
(B) Sinusoids.

Program:n=0:20;
a=0.9;
x=a.^n;
plot2d3('gnn',n,x);
xlabel('Time');
ylabel('Amplitude');
title('Exponential Function');

(B) Sine Function


Program:a=5;
n=-20:20;
w=0.1*%pi;
x=a*sin(w*n);
plot2d3(n,x);
xlabel('Time');
ylabel('Amplitude');
title('Sine Function');

Date of conduction:

Experiment:-3
AIM:- To Write a SCILAB program for sequences:
(A) Addition
(B) Multiplication.

Program:x1= {1,3,5,7,8};
x2={3,6,7,8,9,10,11};
n1=-2:2;
n2=-6:0;
n=min(min(n1),min(n2)):max(max(n1),max(n2));
x3=zeros(1,length(n));
x4=x3;
x3(find((n>=min(n1))&(n<=max(n1))))=x1;
x4(find((n>=min(n2))&(n<=max(n2))))=x2;
x=x3+x4;
plot2d3('gnn',n,x);

(B) Multiplication

Program:x1= {1,3,5,7,8};
x2={3,6,7,8,9,10,11};
n1=-2:2;
n2=-6:0;
n=min(min(n1),min(n2)):max(max(n1),max(n2));
x3=zeros(1,length(n));
x4=x3;
x3(find((n>=min(n1))&(n<=max(n1))))=x1;
x4(find((n>=min(n2))&(n<=max(n2))))=x2;
x=x3.*x4;
plot2d3('gnn',n,x);

Date of conduction:

Experiment:- 4
AIM:- To write scilab program for sequences(a)-Shifting
(b)-folding

(A) Shifting
Program:x=[5,6,-1,-2,1]
n=-2:2
x(n-5)=[5,6,-1,-2,1,0,0,0]
n1=5
p=n+n1
plot 2d3 ('gnn',p,x)

(B) Folding
Program:x=[5,6,-1,-2,1]
n=-2:2
p=(-n)
plot 2d3 (p,x)

Date of conduction:

Experiment:- 5
AIM:-Generation, Analysis and Plot of Discrete time signals:
(A) Even and
(B) Odd signals.
(A) Even Signal
Program:n=-7:7;
x1= [0,0,0,1,2,3,4];
x=[x1,5,x1(length(x1):-1:1)];
plot2d3('gnn',n,x);

(B) Odd Sgnal


Program:n=-7:7;
x1= [0,0,0,1,2,3,4];
x=[-(x1),0,x1(length(x1):-1:1)];
plot2d3(n,x);

Date of conduction:

EXPERIMENT:-6
AIM:- Generation of continuous and discrete waveform with different
colours.

Program:t=0:0.01:2;
w=2*%pi;
a=sin(w*t)
b=sin((w*t)+%pi)
c=sin((w*t)+(%pi/4))
plot(t,a,'v-k')
plot(t,b,'x-b')
plot(t,c,'o-r')

Date of conduction:

Experiment:-7
AIM:- Program to write SCILAB codes for the shifting of signals.
Program:x=[5,6,-1,-2,1]
n=-2:2
x(n-5)=[5,6,-1,-2,1,0,0,0]
n1=5
p=n+n1
plot 2d3 ('gnn',p, x)

Date of conduction:

Experiment:- 8

AIM:- SCILAB code to find linear convolution of two signals.


Program:x={1,2,3,4};
h={1,2,1,2};
y=convol(x,h);
disp(round(y));
1. 4. 8. 14. 15. 10. 8.
n=0:6;
plot2d3(n,y)
title('Convolution of Signals');
xlabel('Frequency');
ylabel('Amplitude');

You might also like