Matlab

VERIFICATION OF BOTH LINEAR AND TIME INVARIANT SYSTEMS

LINEARITY PROPERTY:

If any system is claimed to be linear if it satisfies the superposition principal. Superposition principal state that Response to a weighted sum of input adequate to the corresponding weighted sum of the outputs of the system to every of the individual input signals.
If x(n) may be a input and y(n) may be a output then

y(n)=T[x(n)]

 y1(n) =T[x1(n)] and y2(n)=T[x2(n)]

 x3 =[a*x1(n) +b *x2(n) ]

Y3(n) = T [x3(n)]

 T [a*x1(n) + b*x2(n)] = a y1(n) +  b y2(n)

Program:

clc;

close all;

clear all;

% Verification of Linearity of a given System.

% a) y(n)=nx(n) b) y=x^2(n)

n=0:40;

a1=input(‘enter the scaling factor a1=’);

a2=input(‘enter the scaling factor a2=’);

x1=cos(2*pi*0.1*n);

x2=cos(2*pi*0.4*n);

x3=a1*x1+a2*x2;

%y(n)=n.x(n);

y1=n.*x1;

y2=n.*x2;

y3=n.*x3;

yt=a1*y1+a2*y2;

yt=round(yt);

y3=round(y3);

if y3==yt

 disp(‘given system [y(n)=n.x(n)]is Linear’);

else

 disp(‘given system [y(n)=n.x(n)]is non Linear’);

end

%y(n)=x(n).^2

x1=[1 2 3 4 5];

x2=[1 4 7 6 4];

x3=a1*x1+a2*x2;

y1=x1.^2;

y2=x2.^2;

y3=x3.^2;

yt=a1*y1+a2*y2;

if y3==yt

 disp(‘given system [y(n)=x(n).^2 ]is Linear’);

else

 disp(‘given system is [y(n)=x(n).^2 ]non Linear’);

end

Output will obtained as

Enter the scaling factor a1=3

Enter the scaling factor a2=5

Given system [y(n) =n.x(n)]is Linear

Given system is [y(n) =x(n).^2 ]non Linear

Time-Invariant System:

A system is named time-invariant if its input-output characteristics don’t change with time. X(t) is the input and Y(t) will be the output, X(t-k) is a delayed form of input by k seconds, Y(t-k) is delayed form of output by k seconds.

 If Y(t)=T[X(t)] while Y(t-k)=T[X(t-k)] then system is time invariant system.

clc;

close all;

clear all;

% Verification of your Time Invariance of a Discrete System

% a)y=x^2(n) b) y(n)=nx(n)

clc;

clear all;

close all;

n=1:9;

x(n)=[2 1 4 3 6 5 8 7 9];

d=3; % some time delay

xd=[zeros(1,d),x(n)];%x(n-k)

y(n)=x(n).^2;

yd=[zeros(1,d),y];%y(n-k)

disp(‘transformation of delay signal yd:’);

disp(yd)

dy=xd.^2; % T[x(n-k)]

disp(‘delay of transformation signal dy:’);

disp(dy)

if dy==yd

 disp(‘given system [y(n)=x(n).^2 ]is time invariant’);

else

 disp(‘given system is [y(n)=x(n).^2 ]not time invariant’);

end

y=n.*x;

yd=[zeros(1,d),y(n)];

disp(‘transformation of delay signal yd:’);disp(yd);

n1=1:length(xd);

dy=n1.*xd;

disp(‘delay of transformation signal dy:’);disp(dy);

if yd==dy

 disp(‘given system [y(n)=nx(n)]is a time invariant’);

else

 disp(‘given system [y(n)=nx(n)]not a time invariant’);

 end

Output:

Transformation of delay signal yd:

     0     0     0     4     1    16     9    36    25    64    49    81

Delay of transformation signal dy:

     0     0     0     4     1    16     9    36    25    64    49    81

Given system [y(n)=x(n).^2 ]is time invariant

Transformation of delay signal yd:

     0     0     0     2     2    12    12    30    30    56    56    81

Delay of transformation signal dy:

     0     0     0     8     5    24    21    48    45    80    77   108

Given system [y(n)=nx(n)]not a time invariant

Rajeshwari Chiluveru

Rajeshwari is a Smart TV and connectivity specialist with over 7 years of hands-on experience in troubleshooting real-world device issues. She has worked extensively on diagnosing problems such as WiFi not working, HDMI ARC/eARC failures, app errors, and connectivity issues across platforms like Samsung, Hisense, and Android TV. At Web Vidyalayam, she focuses on creating verified, step-by-step solutions based on practical testing rather than theory. Her goal is to simplify complex technical problems and help users fix their devices quickly and confidently.

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Hisense Smart TV WiFi Not Working? Easy Fixes That Work (2026 Guide)

Introduction: When your Hisense TV won't connect to WiFi, it is rarely a problem with…

1 month ago

Fix Hisense TV Storage Space Running Out: 2026 OS Logic Hub

Hisense Google TV Storage Space Running Out: Why it Happens and How to Fix It…

1 month ago

Samsung Smart TV HDMI ARC/eARC Not Working? Easy Fixes That Actually Work (2026 Guide)

Introduction: "Setting up a soundbar with your Samsung TV should be simple, but the HDMI…

1 month ago

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

2 months ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

2 months ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

2 months ago