You are on page 1of 18

NAME BATAKRUSHNA PANDA

BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

EXPERIMENT 3
AIM: Verification of system characteristics.
OBJECTIVES:
a. Linearity.
b. Time invariance.
c. Stability
SOFTWARE REQUIRED: MATLAB

Pre-Lab:
Linearity
A system is said to be linear if it obeys homogeneity and superposition principle.
(a) Homogeneity:

If these relations are not obeyed, then the system is Non linear.

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

In-Lab:

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Programs And Results:


Question-1

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Program:-1(a)
clc;
clear all;
close all;
t=-10:0.01:10;
t1=(t-1);
for i=1:length(t);
if (t(i)>=0)
u(i)=1;
else
u(i)=0;
end
if (t(i)>=1)
U(i)=1;
else
U(i)=0;
end
end
f1=cos(pi*t);
f2=cos(pi*t1);
x1=u;
x2=U;
y1=x1.*f1;
y2=x2.*f1;
y=x2.*f2;
subplot(511)
plot(t,x1);
xlabel('time');
ylabel('amp');
subplot(512)
plot(t,x2);
xlabel('time');
ylabel('amp');
subplot(513)
plot(t,y1);
xlabel('time');
ylabel('amp');
subplot(514)
plot(t,y2);
xlabel('time');
ylabel('amp');

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
subplot(515)
plot(t,y);
xlabel('time');
ylabel('amp');
gtext('1441014138')

Result:

Here the signal is time variant.

Discussion:
Here in this above experiment I have designed a MATLAB program which plots unit step signal
i.e u(t), delay in unit step signal i.e u(t-1) and also this two signals were given input to the
system and the output was found to be y1(t) and y2(t) respectively. Since the outputs were
unequal so the signal is time variant.

Program:-1(b)

clc;
clear all;
close all;
t=-10:0.01:10;
t1=(t-1);
for i=1:length(t);
if (t(i)>=0)
u(i)=1;

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
else

u(i)=0;
end
if (t(i)>=1)
U(i)=1;
else
U(i)=0;
end
end
f1=cos(pi*t);
f2=cos(pi*t1);
x1=u;
y1=x1.*f1;
x2=U;
y2=x2.*f1;
y=y1+y2;
x=(x1+x2).*f1;
subplot(231)
plot(t,x1);
xlabel('time');
ylabel('amp');
subplot(232)
plot(t,x2);
xlabel('time');
ylabel('amp');
subplot(233)
plot(t,x);
xlabel('time');
ylabel('amp');
subplot(234)
plot(t,y1);
xlabel('time');
ylabel('amp');
subplot(235)
plot(t,y2);
xlabel('time');
ylabel('amp');
subplot(236)
plot(t,y);
xlabel('time');
ylabel('amp');
if(x==y)
display('function is linear');
else
display('function is non-linear')
end
gtext('1441014138')

Result:

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Here the signal is linear.

Discussion:
Here in this above experiment I have designed a MATLAB program which plots unit step signal
i.e u(t), delay in unit step signal i.e u(t-1) and also this two signals were given input to the
system and the output was found to be y1(t) and y2(t) respectively. Since the observed output
satisfies the desired input, the function is linear.

Program:-1(c)
clc;
clear all;
close all;
t=0:0.01:10;
for i=1:length(t)
if(t(i)>=0)
u(i)=1;
else
u(i)=0;
end
end
x1=u;
y1=x1.*cos(pi.*t);
x2=exp(-abs(t));
y2=x2.*cos(pi.*t);
x3=exp(-abs(t));

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
y3=cos(pi.*t)./x3;
subplot(3,2,1);
plot(t,x1);
title('x1(t)');
xlabel('time');
ylabel('amp')
subplot(3,2,2),
plot(t,y1);
title('y1(t)');
xlabel('time');
ylabel('amp')
subplot(3,2,3),
plot(t,x2);
title('x2(t)');
xlabel('time');
ylabel('amp')
subplot(3,2,4),
plot(t,y2);
title('y2(t)');
xlabel('time');
ylabel('amp')
subplot(3,2,5),
plot(t,x3);
title('x3(t)');
xlabel('time');
ylabel('amp')
subplot(3,2,6),
plot(t,y3);
title('y3(t)');
xlabel('time');
ylabel('amp')
if(y1==y2==0)
disp('stable');
else
disp('unstable');
end
gtext('1441014138')

Result:

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Here the signal is unstable.

Discussion:
Here in this above experiment I have designed a MATLAB program which plots unit step signal
i.e u(t), delay in unit step signal i.e u(t-1) and also this two signals were given input to the
system and the output was found to be y1(t) and y2(t) respectively. since the observed outputs
were not equal to zero so the signal is unstable.

Question-2

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Program:-2(a)
clc;
clear all;
close all;
t=0:0.001:4;
v=cos(pi*t);
for i=1:length(v)
if(v(i)>0.5)
x(i)=0.5;
else if(v(i)<-0.5)
x(i)=-0.5;

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
else

x(i)=v(i);

end
end
end
subplot(411)
plot(t,x)
xlabel('time')
ylabel('amp')
v1=0.3*cos(pi*t);
for i=1:length(v1)
if(v1(i)>0.5)
x1(i)=0.5;
else if(v1(i)<-0.5)
x1(i)=-0.5;
else
x1(i)=v1(i);
end
end
end
subplot(412)
plot(t,x1)
xlabel('time')
ylabel('amp')
v2=v+v1;
for i=1:length(v2)
if(v2(i)>0.5)
x2(i)=0.5;
else if(v2(i)<-0.5)
x2(i)=-0.5;
else
x2(i)=v2(i);
end
end
end
subplot(413)
plot(t,x2)
xlabel('time')
ylabel('amp')
if x2==x+x1
display('linear')
else
display('non-linear')
end
x3=x+x1;
subplot(414)
plot(t,x3)
xlabel('time')
ylabel('amp')
gtext('1441014138')

Result:

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Here the signal is non-linear.

Discussion:
Here in this above experiment I have designed a MATLAB program which generates the
response of the zenor-diode for a given input signal. It is observed that sum of the individuals
ouputs (x+x1) are not equal to the output (x2) of sum of input signals (v+v1) when given to the
system.Hence the signal is non-linear.

Program:-2(b)
clc;
clear all;
close all;
t=0:0.001:4;
v1=cos(pi*t);
t1=(t-1);
v2=cos(pi*t1);
for i=1:length(v2)
if (v2(i)>0.5)
x(i)=0.5;
else if (v2(i)<-0.5)
x(i)=-0.5;
else

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
end
end

x(i)=v2(i);

end
subplot(411)
plot(t1,x)
xlabel('time');
ylabel('amp');
subplot(412)
plot(t1,v2)
xlabel('time');
ylabel('amp');
for i=1:length(v1)
if (v1(i)>0.5)
x1(i)=0.5;
else if (v1(i)<-0.5)
x1(i)=-0.5;
else
x1(i)=v1(i);
end
end
end
subplot(413)
plot(t,x1)
xlabel('time');
ylabel('amp');
for i=1:length(t)
if (t(i))>=1
u(i)=1;
else
u(i)=0;
end
end
x2=x1.*u;
subplot(414)
plot(t,x2)
xlabel('time');
ylabel('amp');
if x2==x
display('time invariant')
else
display('time variant')
end
gtext('1441014138')

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138

Result:

Here the signal is time-variant.

Discussion:
Here in this above experiment I have designed a MATLAB program which plots input signals
and its corresponding output signals. It is observed that the delayed output is not equal to the
original output hence the signal is time-variant.

Post-lab:
Let y( t ) = x( t )*f( t ), f( t ) = u( t )-u( t-2 ) and x( t ) = u( t ), test whether the system is linear,
causal, time variant and stable. Plot, calculate and predict.

Program:
clc;
clear all;
close all;
t=-10:.01:10;
for i=1:length(t);
if t(i)>=0
u(i)=1;
else

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
u(i)=0;
end
end
x=u;
subplot(311);
plot(t,x);
for i=1:length(t);
if t(i)>=2
u1(i)=1;
else
u1(i)=0;
end
end
f=u-u1;
subplot(312);
plot(t,u1);
y=x.*f;
subplot(313)
plot(t,f);
if y==f
disp('linear');
else
disp('non linear');
end
t1=t+2;
for i=1:length(x);
if t1(i)>=0
u2(i)=1;
else
u2(i)=0;
end
end
x1=u2;
subplot(411)
plot(t,x);
xlabel('time')
ylabel('amp')
subplot(412)
plot(t1,x)
xlabel('time')
ylabel('amp')
for i=1:length(x);
if t1(i)>=2
u3(i)=1;
else
u3(i)=0;
end
end
f1=u2-u3;
subplot(413)
plot(t1,f1)
xlabel('time')
ylabel('amp')
y1=x1.*f1;
for i=1:length(x);

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
if t1(i)>=-2
u4(i)=1;
else
u4(i)=0;
end
end
y2=y.*u4;
subplot(414);
plot(t,y2);
xlabel('time')
ylabel('amp')
if y2==y
disp('time invariant');
else
disp('time variant');
end
gtext('1441014138')

Result :

Here the signal is linear, time-invariant, unstable.

NAME BATAKRUSHNA PANDA


BRANCH -EEE
SECTION -C
REGD NUMBER -1441014138
Discussion:
Here in this above experiment I have designed a MATLAB program which plots unit step signal
i.e u(t), delay in unit step signal i.e u(t-2) and also this two signals were given input to the
system and the output was found to be y1(t) and y2(t) respectively. Since the observed outputs
are equal so the signal is time-invariant. Since the observed output satisfies the desired input, the
function is linear. Since the observed outputs were not equal to zero so the signal is unstable.

Comment:
Form the above experiment we concluded that how to know about the time variant or not,
linearity or not, stable or not by using the soft wire mat lab.It is easy to find out the signal is time
variant or not, linearity or not, stable or not by using mat lab. We can also generate input and
output of the zener diode and plot them and also find out whether the input and output are linear
or not and time variant or not by using the software MATLAB.

You might also like