summaryrefslogtreecommitdiff
path: root/1592/CH5/EX5.11/Example5_11.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1592/CH5/EX5.11/Example5_11.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1592/CH5/EX5.11/Example5_11.sce')
-rwxr-xr-x1592/CH5/EX5.11/Example5_11.sce33
1 files changed, 33 insertions, 0 deletions
diff --git a/1592/CH5/EX5.11/Example5_11.sce b/1592/CH5/EX5.11/Example5_11.sce
new file mode 100755
index 000000000..7cf55d9d9
--- /dev/null
+++ b/1592/CH5/EX5.11/Example5_11.sce
@@ -0,0 +1,33 @@
+//Scilab Code for Example 5.11 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+wc=1;
+y=1;
+for n=-%pi:%pi/80:%pi
+ if n<-wc | n>wc then
+ X(1,y)=1;
+ y=y+1;
+ else X(1,y)=0;
+ y=y+1;
+ end
+end
+n=-%pi:%pi/80:%pi;
+a = gca ();
+a.y_location ="origin";
+a.x_location ="origin";
+plot(n,X);
+xlabel ( 'Frequency in Radians/Seconds' );
+title ('X(e^jw)) at Wc=1');
+A=1/%pi;
+for k=-10:10
+ x(k+11)=A*integrate('cos(w*k)','w',wc,%pi);
+end
+figure(1);
+k=-10:10;
+a = gca ();
+a.y_location ="origin";
+a.x_location ="origin";
+plot2d3(k,x);
+xlabel ( 'Time in Seconds' );
+title ('x(n) at Wc=1');