Signal and System - Lab Report-08 - FA19-BEE-140
Signal and System - Lab Report-08 - FA19-BEE-140
Instructor’s Name
MAM MEHWISH MEHMOOD
Gggggggggggggggggggggggggggggggggggggg
Lab 08- Properties of Convolution
Task 1: A system is described by the impulse response h(t) = t^2. Tell if this is a
BIBO stable system.
CODE:
syms t
h=t^2;
int(abs(h),t,0,inf)
ans = Inf
h1 = u.*exp(-3.*t);
h2 = t.*exp(-2.*t).*u;
y = h1 + h2;
syms t
final = exp(-3.*t)+(t.*exp(-2.*t));
int(abs(final),t,0,inf)
ans = 7/12
step=0.01;
t1=0:0.01:4;
t2=t1;
t3=t2;
figure();
h1= t1.*cos(2.*pi.*t1);
subplot(3,1,1);
plot(t1,h1,'r-.','linewidth',2)
xlabel('t')
legend('p(t)');
h2= t2.*exp(-2.*t2);
subplot(3,1,2);
plot(t2,h2,'b--','linewidth',2)
xlabel('t')
legend('q(t)');
title('ADD')
h3=ones(size(t3));
h12=h1+h2;
subplot(3,1,3);
plot(t2,h12,'m:','linewidth',2)
xlabel('t')
legend('s(t)');
title('EQUAL')
figure();
th=0:step:8;
h= conv(h12,h3)*step;
subplot(3,1,1)
plot(th,h,'r-.','linewidth',2)
xlabel('t')
legend('h(t)')
tx=0:step:2;
x=tx.*exp(-2.*tx);
subplot(3,1,2);
plot(tx,x,'b--','linewidth',2)
xlabel('t')
legend('x(t)')
title('Input signal')
ty=0:0.01:10;
y=conv(x,h)*step;
subplot(3,1,3);
plot(ty,y,'m:','linewidth',2)
xlabel('t')
legend('y(t)')
n = 0:2;
h1 = [2,3,4];
h2 = [-1,3,1];
h3 = [1,1,-1];
subplot(5,1,1)
stem(n,h1,'fill','Linewidth',2)
title('p[n]')
xlim([-0.2 2.2])
subplot(5,1,2)
stem(n,h2,'fill','Linewidth',2)
title('q[n]')
xlim([-0.2 2.2])
subplot(5,1,3)
stem(n,h3,'fill','Linewidth',2)
title('h3[n]')
xlim([-0.2 2.2])
pq=h1+h2;
subplot(5,1,4)
stem(n,pq,'fill','Linewidth',2)
title('r[n]')
xlim([-0.2 2.2])
n1 = 0:4;
rn = conv (pq,h3);
subplot(5,1,5)
stem(n1,rn,'fill','Linewidth',2)
title('s[n]')
xlim([-0.2 4.2])
figure();
n2 = 0:6;
rx = conv(rn,h1);
subplot(5,1,1)
stem(n2,rx,'fill','Linewidth',2)
title('t[n]')
xlim([-0.2 6.2])
n3 = 0:6;
h11 = conv(rn,h2);
subplot(5,1,2)
stem(n3,h11,'fill','Linewidth',2)
title('v[n]')
xlim([-0.2 6.2])
n4 = 0:6;
h = rx+h11;
subplot(5,1,3)
stem(n4,h,'fill','Linewidth',2)
title('h[n]')
xlim([-0.2 6.2])
xn = 0:1;
x = ones(size(xn));
subplot(5,1,4)
stem(xn,x,'fill','Linewidth',2)
title('x[t]');
xlim([-0.2 1.2])
ty = 0:7;
y = conv(x,h);
subplot(5,1,5)
stem(ty,y,'fill','Linewidth',2)
title('y[n]')
xlim([-0.2 7.2])
syms n