Generation of Damped Sinusoidal, Unit Step, Ramp and Impulse Signal

Generation of Damped Sinusoidal, Unit Step, Ramp and Impulse Signal

Generation of Damped Sinusoidal signal

Matlab Code:

 

a=0.5;

f=1;

w=2*pi*f;

for(t=0:0.01:10)

    y=exp(-a*t)*sin(w*t);

    plot(t,y,'r');

    hold on;

end;

xlabel('time in sec');

ylabel('amplitude in cm');

title('Damped Sinusoidal Signal');

grid on;

Damped Sinusoidal Signal


Generation of Unit step function

  Matlab Code:

 

t=0:0.1:10;

t0=2;

y=0*(t<t0)+1*(t>=t0);

plot(t,y);

xlabel('Time');

ylabel('Amplitude');

title('Unit Step Function');

grid on;

Unit Step Function


Generation of Ramp wave

          Matlab Code:

 

m=1;

t=0:0.01:10;

y=m*t;

plot(t,y);

xlabel('Time');

ylabel('Amplitude');

title('Ramp Signal');

grid on;

Ramp Signal

Generation of Impulse wave

Matlab Code:

 

t=0:0.01:10;

t0=3;

for(t=t0)

    y=1;

end;

if(t>t0)

    y=0;

end;

if(t<t0)

    y=0;

end;

stem(t,y);

xlabel('Time');

ylabel('Amplitude');

title('Impulse Signal');

grid on;

Impulse Wave


If you have any doubts regarding any of the codes mentioned here then let me know in the comment section.

If you are an Electrical Engineering Student, then I would recommend you to have these books mentioned below for better understanding of concepts. 

Circuit theory by Abhijit Chakrabarti: https://amzn.to/3gnrht3

Basic Electrical Engineering by S Chand: https://amzn.to/3gnrht3

Comments

Popular posts from this blog

Generation of Normal Sinusoidal, Discrete Sinusoidal, Under Damped and Over Damped Signals using MATLAB