Professional Documents
Culture Documents
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.
In-Lab:
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');
Result:
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;
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:
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));
Result:
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
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;
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:
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
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')
Result:
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
Result :
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.