EX No 01
EX No 01
Ex. no: 1
Generation of Discrete Time Sequences
Date:
AIM:
SOFTWARE REQUIRED:
MATLAB 8.5
ALGORITHM:
➢ Generates Zeros and ones for the corresponding values of n to get the impulse response
➢ Generates ones for the corresponding values of n to get the unit step response
FLOW CHART:
Start
↓
Get the
value of N
↓
t=0:1:N-1
↓
Generate the signal
↓
Plot the o/p ↓
sequence ↓
↓
Stop
EXPONENTIAL RESPONSE
SINE WAVE:
➢ Generates the corresponding values of n to get the sine wave using sin function
COSINE WAVE:
➢ Generates the corresponding values of n to get the cosine wave using cos function
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');
%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.