summaryrefslogtreecommitdiff
path: root/1592/CH7/EX7.6/Example_7_6.sce
blob: 754c5deffddc16d6cd95c2298a98e9b2084ddb0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//Scilab Code for Example 7.6 of Signals and systems by
//P.Ramakrishna Rao
clc;
clear x y1 y y2 q t n;
clear;
//y(n)=x(n)-x(n-1);
x=[2,4,3,6,7]
for n=2:5
    y(1,n)=x(n)-x(n-1);
end
disp(y,'This input gives the output:');
disp('For a shift (n0) of 2 seconds');
disp('At n=3 seconds:');
n=5;
b=y(n-2);
a=x(n-2)-x(n-2-1);
disp(a,'x(n-2):');
disp(b,'is equal to y(n-2):');
disp('Hence the system is Shift invariant/fixed');