You are on page 1of 2

DSP’S FILE

EXPERIMENT NO:-03
Aim:-To develop elementary signal function modules for Unit Impulse, Unit Step, Unit
Ramp & Exponential.

Requirement:-PC having MATLAB Software.

Program:-
clc;
clear all;
close all;
a=input('What is your value you want to enter?')
n=-a:1:a;
b=length(n)
for i=1:b
if n(i)==0
UI(i)=1;
US(i)=1;
UR(i)=0;
elseif n(i)>0
UI(i)=0;
US(i)=1;
UR(i)=n(i);
Ex(i)=exp(n(i));
elseif n(i)<0
UI(i)=0;

end
end
subplot(4,2,1)
stem(n,UI);
xlabel('Time')
ylabel('Amplitude')
title('Unit Impulse')
subplot(4,2,2)
stem(n,US);
xlabel('Time')
ylabel('Amplitude')
title('Unit Step')
subplot(4,2,3)
stem(n,UR);
xlabel('Time')
ylabel('Amplitude')
title('Unit Ramp')
subplot(4,2,4)
stem(n,Ex);
xlabel('Time')
ylabel('Amplitude')
title('Exponential')

ABHISHEK CHAUHAN
16BEC1117
DSP’S FILE

Output:-

Result:- Commands were executed and results were observed. Graphs were plotted.

ABHISHEK CHAUHAN
16BEC1117

You might also like