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

Experiment No - 01: Generation of Discrete Time Signals Aim

The document describes an experiment to generate various discrete time signals using MATLAB. It lists the required hardware and software, and provides the procedure which involves writing MATLAB programs to generate unit step, unit ramp, sinusoidal, cosine, exponential, and unit impulse sequences. The programs take user inputs for length and other parameters and plot the resulting signal sequences.

Uploaded by

taazma
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)
662 views4 pages

Experiment No - 01: Generation of Discrete Time Signals Aim

The document describes an experiment to generate various discrete time signals using MATLAB. It lists the required hardware and software, and provides the procedure which involves writing MATLAB programs to generate unit step, unit ramp, sinusoidal, cosine, exponential, and unit impulse sequences. The programs take user inputs for length and other parameters and plot the resulting signal sequences.

Uploaded by

taazma
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/ 4

EXPERIMENT NO –01

GENERATION OF DISCRETE TIME SIGNALS

AIM: To generate a discrete time signal sequence (Unit step, Unit ramp, Sine, Cosine,
Exponential, Unit impulse) using MATLAB function.

APPARATUS REQUIRED:

HARDWARE : Personal Computer

SOFTWARE : MATLAB

PROCEDURE:

 Start the MATLAB program.

 Open new M-file

 Type the program

 Save in current directory

 Compile and Run the program

 If any error occurs in the program correct the error and run it again

 For the output see command window\ Figure window

 Stop the program.

PROGRAM: (Generation of Discrete Time Signals)

%Program for unit step sequence


N=input('Enter the length of unit step sequence(N)= ');
n=0:1:N-1;
y=a.^n;
subplot(3,2,1);
stem(n, y, 'k');
xlabel('Time');
ylabel('Amplitude');
title('Unit stepsequence');
%Program for unit ramp sequence
N1=input('Enter the length of unit ramp sequence(N1)= ');
n1=0:1:N1-1;
y1=n1; subplot(3,2,2);
stem(n1,y1,'k');
xlabel('Time');
ylabel('Amplitude');
title('Unit ramp sequence');

%Program for sinusoidal sequence


N2=input('Enter the length of sinusoidal sequence(N2)= ');
n2=0:0.1:N2-1;
y2=sin(2*pi*n2);
subplot(3,2,3);
stem(n2,y2,'k');
xlabel('Time');
ylabel('Amplitude');
title('Sinusoidal sequence');

%Program for cosine sequence

N3=input('Enter the length of the cosine sequence(N3)=');


n3=0:0.1:N3-1;
y3=cos(2*pi*n3);
subplot(3,2,4);
stem(n3,y3,'k');
xlabel('Time');
ylabel('Amplitude');
title('Cosine sequence');

%Program for exponential sequence


N4=input('Enter the length of the exponential sequence(N4)=');
n4=0:1:N4-1;
a=input('Enter the value of the exponential sequence(a)= ');
y4=(a*n4); subplot(3,2,5);
stem(n4,y4,'k');
xlabel('Time');
ylabel('Amplitude');
title('Exponential sequence');

%Program for unit impulse


n=-3:1:3;
y=[0,0,0,1,0,0,0];
subplot(3,2,6);
stem(n,y,'k');
xlabel('Time');
ylabel('Amplitude');
title('Unit impulse');
RESULT:
Thus the MATLAB programs for discrete time signal sequence (Unit step, Unit ramp, Sine, Cosine,
Exponential, Unit impulse) using MATLAB function written and the results were plotted.

You might also like