summaryrefslogtreecommitdiff
path: root/1592/CH10/EX10.8/example_10_8.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /1592/CH10/EX10.8/example_10_8.sce
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '1592/CH10/EX10.8/example_10_8.sce')
-rwxr-xr-x1592/CH10/EX10.8/example_10_8.sce47
1 files changed, 26 insertions, 21 deletions
diff --git a/1592/CH10/EX10.8/example_10_8.sce b/1592/CH10/EX10.8/example_10_8.sce
index e5f1e553c..bc7464bb9 100755
--- a/1592/CH10/EX10.8/example_10_8.sce
+++ b/1592/CH10/EX10.8/example_10_8.sce
@@ -1,21 +1,26 @@
-//Scilab Code for Example 10.8 of Signals and systems by
-//P.Ramakrishna Rao
-//Auto Correlation
-clear;
-clc;
-clear x n a;
-k=1;
-a=0.8;
-for n=-30:30;
- x(k)=a^(n)*u(n);
- k=k+1;
-end
-length(x)
-//computation of auto correlation sequence;
-r = xcorr(x);
-n=-60:60;
-a=gca();
-a.x_location="origin";
-a.y_location="origin";
-plot2d3(n,r,-4);
-title('rxx_auto-correlation');
+//Scilab Code for Example 10.8 of Signals and systems by
+//P.Ramakrishna Rao
+//Auto Correlation
+clear;
+clc;
+function [y]=u(t)
+ if t>=0
+ y=1
+else y=0
+ end
+endfunction
+k=1;
+a=0.8;
+for n=-30:30;
+ x(k)=a^(n)*u(n);
+ k=k+1;
+end
+length(x)
+//computation of auto correlation sequence;
+r = xcorr(x);
+n=-60:60;
+a=gca();
+a.x_location="origin";
+a.y_location="origin";
+plot2d3(n,r,-4);
+title('rxx_auto-correlation'); \ No newline at end of file