Sunteți pe pagina 1din 1

clc;

clear all;
n=-5:10;
u0= [0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 ]
u3= [0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 ]
x2= u0-u3
x3= [0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 ]
subplot(2,1, 1)
stem (n,x2,'filled');
subplot(2,1,2)
stem (n,x3,'filled');

n=0:10;
y=sin(n).*exp(-0.4*n)
i=[1 0 0 0 0 0 0 0 0 0 0 ]
subplot (3,1,1)
y_out=stem(n,y,'filled');
xlabel('time[sec]')
ylabel('x[n]')
subplot (3,1,2)
stem (n,i,'filled');
xlabel('time[sec]')
ylabel('x[n]')
z=conv(y,i);
subplot (3,1,3)
stem(n,z(1:length(n)),'filled')
xlabel('n')
ylabel('x[n]')

S-ar putea să vă placă și