Checking Linearity of given signal

Checking Linearity of given signal,y(n)=nx(n)
Matlab Code
clc;
n=0:10;
a=2;
b=-3;
x1=cos(2*pi*.1*n);
x2=cos(2*pi*.5*n);
x=a.*x1+b.*x2;
y=n.*x;
y1=n.*x1;
y2=n.*x2;
yt=a.*y1+b.*y2;
d=y-yt;
subplot(3,1,1);
stem(n,y);
subplot(3,1,2);
stem(n,yt);
subplot(3,1,3);
stem(n,d);
axis([0 40 -10 20]);
Output:
Conclusion:A linear system is one that satisfies the superposition principles. Simply stated, the principle of superposition requires that the responses of the systems to a weighted sum of signal be equal to the corresponding weighted sum of the responses (outputs) of the systems to each of the individual input signals. Hence we have the following definition of linearity.Here from the figure1 we first plotted the linear combination of input and then plotted the linear combination of output and then plotted the difference.The difference between them is zero or equal.So the system is linear.

No comments:

Post a Comment