0% found this document useful (0 votes)
2 views7 pages

EX No 01

The document outlines a MATLAB program designed to generate various discrete time sequences, including unit impulse, unit step, unit ramp, exponential, sine, and cosine responses. It provides an algorithm and flowchart for the program's execution, along with sample code for each type of sequence. The result confirms the successful generation of these sequences using the specified MATLAB version.

Uploaded by

prog78659
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)
2 views7 pages

EX No 01

The document outlines a MATLAB program designed to generate various discrete time sequences, including unit impulse, unit step, unit ramp, exponential, sine, and cosine responses. It provides an algorithm and flowchart for the program's execution, along with sample code for each type of sequence. The result confirms the successful generation of these sequences using the specified MATLAB version.

Uploaded by

prog78659
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/ 7

Page No.

Ex. no: 1
Generation of Discrete Time Sequences
Date:

AIM:

To write a MATLAB program to generate discrete time sequences.

SOFTWARE REQUIRED:

MATLAB 8.5

ALGORITHM:

UNIT IMPULSE RESPONSE:

➢ Start the program

➢ Enter the value of N

➢ Generates Zeros and ones for the corresponding values of n to get the impulse response

➢ Plot the output.

UNIT STEP RESPONSE:

➢ Start the program

➢ Enter the value of N

➢ Generates ones for the corresponding values of n to get the unit step response

➢ Plot the output.

Department of Electronics & Communication Engineering


Page No.:

FLOW CHART:

Start

Get the
value of N


t=0:1:N-1

Generate the signal

Plot the o/p ↓
sequence ↓

Stop

Department of Electronics & Communication Engineering


Page No.:

UNIT RAMP RESPONSE:

➢ Start the program

➢ Enter the value of N

➢ Generates the corresponding values of n to get the unit ramp response

➢ Plot the output.

EXPONENTIAL RESPONSE

➢ Start the program

➢ Enter the value of N

➢ Generates the corresponding values of n to get the exponential response

➢ Plot the output.

SINE WAVE:

➢ Start the program

➢ Enter the value of N

➢ Generates the corresponding values of n to get the sine wave using sin function

➢ Plot the output.

COSINE WAVE:

➢ Start the program

➢ Enter the value of N

➢ Generates the corresponding values of n to get the cosine wave using cos function

➢ Plot the output.

Department of Electronics & Communication Engineering


Page No.:

Department of Electronics & Communication Engineering


Page No.:

PROGRAM:

clc;
clear all;
close all;
%UNIT IMPULSE SIGNAL%
N=8;
x=ones(1,1);
n=0;
subplot(3,3,1);
stem(n,x);
xlabel('n');
ylabel('x(n)');
title('UNIT IMPULSE SIGNAL');

%UNIT STEP SIGNAL%


N=8;
x=ones(1,N);
n=0:1:N-1;
subplot(3,3,2);
stem(n,x);
xlabel('n');
ylabel('x(n)');
title('UNIT STEP SIGNAL');

%UNIT RAMP SIGNAL%


N=8;
x=0:1:N-1;
n=0:1:N-1;
subplot(3,3,3);
stem(n,x);
xlabel('n');
ylabel('x(n)');
title('UNIT RAMP SIGNAL');

Department of Electronics & Communication Engineering


Page No.:

Department of Electronics & Communication Engineering


Page No.:

%EXPONENTIAL WAVE%
N=8;
x=.8.^n;
n=0:1:N-1;
subplot(3,3,4);
stem(n,x );
xlabel('n');
ylabel('x(n)');
title('EXPONENTIAL WAVEFORM');

%SINE WAVE%
N=8;
x=sin(.2*pi*n);
n=0:1:N-1;
subplot(3,3,5);
stem(n,x);
xlabel('n');
ylabel('x(n)');
title('SINE WAVE');

%COSINE WAVE%
N=8;
x=cos(.2*pi*n);
n=0:1:N-1;
subplot(3,3,6);
stem(n,x);
xlabel('n');
ylabel('x(n)');
title('COSINE WAVE');

Result: Thus the various elementary discrete time sequences were generated using MATLAB.

Department of Electronics & Communication Engineering

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy