Generation of basic signals using  MATLAB 

AIM : To generate basic signals like unit impulse, unit step, unit ramp signal and Exponential signals.  

Objective: To generate basic signals like unit impulse, unit step, unit ramp signal and Exponential signals using MATlab.

Requirements : Computer with MATLAB  software  

(a). Program for the generation of UNIT impulse signal  

clc;  close all;  clear all;  

t=-2:1:2;  

y=[zeros(1,2),ones(1,1),zeros(1,2)] figure(1)  

subplot(2,2,1); stem(t,y);  

title('unit impulse');  

(b). Program for the generation of UNIT step signal  

clc;  close all;  clear all;  

n=input('enter the n value');

t=0:1:n-1;  

y=ones(1,n);  

figure(2)  

subplot(2,2,2);

stem(t,y);  

title('unit step');  

(c).Program for the generation of unit RAMP   signal  

clc;  close all;  clear all;  

n=input('enter the n value');  

t=0:n;  

y=ones(1,n);  

figure(3)  

subplot(2,2,3);

stem(t,t);  

title('unit ramp');  

(d).Program for the generation of Exponential  signal  

clc;  close all;  clear all;  

n=input('the length of i/p sequency');  

t=0:n  

a=input('enter the a value');  

y=exp(a*t); figure(4)

subplot(2,2,4);    

stem(t,y);  

xlabel('x-axis');   ylabel('y-axis'); title('unit exponential');

(e).  Program for Continuous time signal  

clc;  

close all;  

clear all;  

t=0:.01:pi;  

y= sin(2*pi*t);  

subplot(4,1,1);  

plot(t,y);  

ylabel('amp...');xlabel('(a)n...');title('sin signal')  

(f). Program for Discrete time cosine signal :  

t=0:.03:pi/3;  

y= cos(2*pi*t);  

subplot(4,1,2);  

stem(t,y);  

xlabel('a(n)');ylabel('amplitude');title('cosinusoidal');

Results: Continuous time sinusoidal signal, discrete time cosine signal and sum of sinusoidal signal is designed.

Outcomes: After finishing this experiment the students are able to  

? Generate elementary signals/ waveforms.

? Perform arithmetic operations on signals.

VIVA QUESTIONS:  

1. Define impulse signal  

2. Define ramp signal  

3. Define unit step signal  

4. Define exponent ional signal  

5. Define sinusoidal signal  

6. Define C.T.S  

7. Define D.T.S.