Inlab Task

You might also like

You are on page 1of 9

Shah hussain

Name

FA19-BEE-227
Registration Number

Class
4C

Instructor’s Name Mehwish Mehmood


Inlab task
Task 1
Part a
n=-2:2
x=2*n;
subplot(2,1,1)
title('graph 1')
stem(n,x,'LineWidth',4)
xlim([-2.5,2.5])
ylim([-5,5])
title('graph 1')
legend('y[n] = x[n]')
subplot(2,1,2)
stem(n,-x,'LineWidth',4)
xlim([-2.5,2.5])
ylim([-5,5])
title('graph 2')
legend('y[n] = x[-n]')
the system is dynamic
Part b

n=-2:2
x=2*n;
subplot(2,1,1)
title('graph 1')
stem(n,x,'LineWidth',4)
xlim([-2.5,2.5])
ylim([-5,5])
title('graph 1')
legend('y[n] = x[n]')
subplot(2,1,2)
stem(n,-x,'LineWidth',4)
xlim([-2.5,2.5])
ylim([-5,5])
title('graph 2')
legend('y[n] = x[-n]')
the system is non-causal
Part c
n = -2:4;
x1 = 2.*n;
x2 = n./3;
a1 = 2;
a2 = 3;
x = a1.*x1 + a2.*x2;
y = -x;
subplot(2,1,1)
stem(n,y,'LineWidth',4)
xlim([-4.5,4.5])
ylim([-20,12])
title('graph 1')
xlabel('n')
ylabel('y1')

y1 = -x1;
y2 = -x2;
y = a1.*y1 + a2.*y2;
subplot(2,1,2)
stem(n,y,'LineWidth',4)
xlim([-4.5,4.5])
ylim([-20,12])
title('graph 1')
xlabel('n')
ylabel('y2')
Part d
n = -2:4;
x = 2.*n;
n0 = 3;
subplot(3,1,1)
stem(-n,x,'LineWidth',4)
legend('y[n]')
subplot(3,1,2)
stem(-(n-n0),x,'LineWidth',4)
legend('y[n+3]')
x = 2.*(n+n0);
subplot(3,1,3)
stem(-n,x,'LineWidth',4)
legend('S(x[n-n0])')
Task 2
Part a
n = -2:2;
x = 2.*n;
subplot(2,1,1)
stem(n,x,'LineWidth',4)
title('graph 1')
xlim([-2.2 2.2])
ylim([-4.5 4.5])
legend('x[n]')
xlabel('n')

y = x;
N0=1-2.*n
subplot(2,1,2)
stem(N0,y,'LineWidth',4)
title('graph 2')
xlim([-3.2 5.2])
ylim([-4.5 4.5])
legend('y[n]')
xlabel('n')
part b
n = -2:2;
x = 2.*n;
subplot(2,1,1)
stem(n,x,'LineWidth',4)
title('graph 1')
xlim([-2.2 2.2])
ylim([-4.5 4.5])
legend('x[n]')
xlabel('n')

y = x;
N0=1-2.*n
subplot(2,1,2)
stem(N0,y,'LineWidth',4)
title('graph 2')
xlim([-3.2 5.2])
ylim([-4.5 4.5])
legend('y[n]')
xlabel('n')
Part c
n = -2:4;
x1 = 2.*n;
x2 = n./3;
a1 = 2;
a2 = 3;
x = a1.*x1 + a2.*x2;
p=1-2.*n
subplot(2,1,1)
stem(p,x,'LineWidth',2)
title('graph 1')
legend('a1.x1[n] + a2.x2[n]')

subplot(2,1,2)
y1 = a1.*x1;
y2 = a2.*x2;
y = y1 + y2;
stem(p,y,'LineWidth',2)
title('graph 2')
legend('a1.y1[n] + a2.y2[n]')
Part d
n = -2:4;
x = 2.*n;
n0 = 3;
subplot(2,1,1)
stem(n0+1-x,x,'LineWidth',2)
title('graph 1')
legend('S[n-3]')

y = 2.*(n-n0);
subplot(2,1,2)
stem(1-x,y,'LineWidth',2)
title('graph 2')
legend('S[x[n-3]]')

Critical analysis:
In this lab we learnt different chrematistics
of system such as causal non-causal ,linear
,non-linearity variant or invariant .static or
dynamic and stability .we observe above
characteristics on MATLAB.

You might also like