Impulse Continuous: Ramp Increasing

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Impulse

Continuous
clc;
clear all;
close all;
x=-5:5;
y=[zeros(1,5) ones(1,1) zeros(1,5)];
plot(x,y,'b.-')
tittle('impluse signsl')
xlabel('time')
ylabel('amplitude')

discrete
clc;
clear all;
close all;
x=-5:5;
y=[zeros(1,5) ones(1,1) zeros(1,5)];
stem(x,y,'b.-')
tittle('impluse signsl')
xlabel('time')
ylabel('amplitude')

ramp increasing
clc;
clear all;
close all;
x=[0,1,2,3,4]
t=0:4;
subplot(1,2,1)
plot(t,x,'r');
xlabel('x');
ylabel('y');
tittle('continous signal');
subplot(1,2,2);
stem(t,x,'b');
xlabel('x');
ylabel('y');
tittle('discrete signal');

ramp decreasing

clc;
clear all;
close all;
x=[4,3,2,1,0];
t=0:4;
subplot(1,2,1)
plot(t,x,'r');
xlabel('x');
ylabel('y');
title('continous ramp');
subplot(1,2,2);
stem(t,x,'b');
xlabel('x');
ylabel('y');
title('discrete ramp');

sine
clc;
clear all;
close all;
A=1;
f=50;
t=1/f;
t=(0:0.0001:5*t);
y=A*sin(2*pi*f*t);
subplot(1,2,1);
plot(t,y,'r');
ylabel('y');
xlabel('t');
title('continous sine');
subplot(1,2,2);
stem(t,y,'b');
ylabel('y');
xlabel('t');
title('discrete sine');

cos
clc;
clear all;
close all;
A=1;
f=50;
t=1/f;
t=(0:0.0001:5*t);
y=A*cos(2*pi*f*t);
subplot(1,2,1);
plot(t,y,'r');
ylabel('y');
xlabel('t');
title('continous sine');
subplot(1,2,2);
stem(t,y,'b');
ylabel('y');
xlabel('t');
title('discrete sine');

s clc;
clear all;
close all;
X=[zeros(1,5) ones(1,6)];
t=-5:5;
subplot(1,2,1);
plot(t,X,'r');
xlabel('x');
ylabel('y');
title('continous step');
subplot(1,2,2);
stem(t,X,'b');
xlabel('x');
ylabel('y');
title('discrete step');

tep

You might also like