summaryrefslogtreecommitdiff
path: root/1592/CH3/EX3.17
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1592/CH3/EX3.17
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/CH3/EX3.17')
-rwxr-xr-x1592/CH3/EX3.17/Fig3_17_1.jpgbin0 -> 5226 bytes
-rwxr-xr-x1592/CH3/EX3.17/Fig3_17_2.jpgbin0 -> 5129 bytes
-rwxr-xr-x1592/CH3/EX3.17/example_3_17.sce44
3 files changed, 44 insertions, 0 deletions
diff --git a/1592/CH3/EX3.17/Fig3_17_1.jpg b/1592/CH3/EX3.17/Fig3_17_1.jpg
new file mode 100755
index 000000000..631dc1534
--- /dev/null
+++ b/1592/CH3/EX3.17/Fig3_17_1.jpg
Binary files differ
diff --git a/1592/CH3/EX3.17/Fig3_17_2.jpg b/1592/CH3/EX3.17/Fig3_17_2.jpg
new file mode 100755
index 000000000..0b6cd4457
--- /dev/null
+++ b/1592/CH3/EX3.17/Fig3_17_2.jpg
Binary files differ
diff --git a/1592/CH3/EX3.17/example_3_17.sce b/1592/CH3/EX3.17/example_3_17.sce
new file mode 100755
index 000000000..8eb250c7c
--- /dev/null
+++ b/1592/CH3/EX3.17/example_3_17.sce
@@ -0,0 +1,44 @@
+//Scilab Code for Example 3.17 of Signals and systems by
+//P.Ramakrishna Rao
+//CTFS coefficients of a periodic signal
+//x(wt) = Asin wt, 0<wt<pi
+clear;
+close;
+clc;
+A=3.14;
+T =%pi;
+T1 = T/2;
+t = 0:0.01:T1;
+Wo = 2*%pi/T;
+xt =A*sin(Wo*t);
+//
+for k =0:6
+ C(k+1,:) = exp(-sqrt(-1)*Wo*t.*k);
+ c(k+1) = xt*C(k+1,:)'/length(t);
+ if(abs(c(k+1))<=0.01)
+ c(k+1)=0;
+ end
+end
+c =c';
+c_conj = real(c(:))-sqrt(-1)*imag(c(:));
+ck = [c_conj($:-1:1)',c(2:$)];
+k = 0:6;
+k = [-k($:-1:1),k(2:$)];
+c = gca();
+c.y_location = "origin";
+c.x_location = "origin";
+//c.data_bounds=[-2,0;2,2];
+plot2d(t,xt,5)
+poly1 = c.children(1).children(1);
+poly1.thickness = 3;
+title('x(t)')
+xlabel('t')
+figure(1);
+c = gca();
+c.y_location = "origin";
+c.x_location = "origin";
+plot2d3('gnn',k,abs(ck))
+poly1 = c.children(1).children(1);
+poly1.thickness = 3;
+title('|ck|')
+xlabel('k')