0% found this document useful (0 votes)
23 views2 pages

Algorithm:: All All 'Enter The Value of N:'

The document describes an algorithm to test a system for linearity, time invariance, and stability. It takes in a value for n, defines input and output signals, filters the signals, and compares the actual and predicted output to test for linearity. It then tests for time invariance by comparing outputs with time-shifted inputs. Finally, it generates the impulse response and checks its magnitude to determine stability.

Uploaded by

aniruddh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Algorithm:: All All 'Enter The Value of N:'

The document describes an algorithm to test a system for linearity, time invariance, and stability. It takes in a value for n, defines input and output signals, filters the signals, and compares the actual and predicted output to test for linearity. It then tests for time invariance by comparing outputs with time-shifted inputs. Finally, it generates the impulse response and checks its magnitude to determine stability.

Uploaded by

aniruddh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ALGORITHM:

%Name:Aniruddh Vijay Pingle


%Reg.No.2016BEL011
clc;
close all;
clear all;
n=input('Enter the value of n:');
num=[2.2403 2.4908 2.2403];
den=[1 -0.4 0.75];
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
a=2;
b=3;
y1=filter(num,den,x1);
y2=filter(num,den,x2);
Y=a*y1+b*y2;
X=a*x1+b*x2;
Y1=filter(num,den,X);
er=Y1-Y;
if er<0.01
fprintf('System is linear \n');
else
fprintf('System is non-linear \n');
end
fprintf('Error is ');
disp(er)
%%
% Time invarience
yd=[zeros(1,10) y1];
x1d=[zeros(1,10) x1];
Yd=filter(num,den,x1d);
e=Yd-yd;
if e<0.1
fprintf('System is time invarient\n');
else
fprintf('System is time varient\n');
end

%% STABILITY

h=impz(num,den,n);
plot(h)

if h(end)<0.01
disp('system is stable')
else
disp('system is unstable')
end

1
COMMAND:
Enter the value of n:50
System is linear
Error is 0

System is time invarient


system is stable
>>

OUTPUT:

You might also like