summaryrefslogtreecommitdiff
path: root/1592/CH3/EX3.13
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.13
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.13')
-rwxr-xr-x1592/CH3/EX3.13/Fig3_13_1.jpgbin0 -> 7553 bytes
-rwxr-xr-x1592/CH3/EX3.13/Fig3_13_2.jpgbin0 -> 6311 bytes
-rwxr-xr-x1592/CH3/EX3.13/example_3_13.sce45
3 files changed, 45 insertions, 0 deletions
diff --git a/1592/CH3/EX3.13/Fig3_13_1.jpg b/1592/CH3/EX3.13/Fig3_13_1.jpg
new file mode 100755
index 000000000..83bab99db
--- /dev/null
+++ b/1592/CH3/EX3.13/Fig3_13_1.jpg
Binary files differ
diff --git a/1592/CH3/EX3.13/Fig3_13_2.jpg b/1592/CH3/EX3.13/Fig3_13_2.jpg
new file mode 100755
index 000000000..b5bb1d78b
--- /dev/null
+++ b/1592/CH3/EX3.13/Fig3_13_2.jpg
Binary files differ
diff --git a/1592/CH3/EX3.13/example_3_13.sce b/1592/CH3/EX3.13/example_3_13.sce
new file mode 100755
index 000000000..679352c92
--- /dev/null
+++ b/1592/CH3/EX3.13/example_3_13.sce
@@ -0,0 +1,45 @@
+//Scilab Code for Example 3.13 of Signals and systems by
+//P.Ramakrishna Rao
+//Complex Exponential Fourier Expansion
+//A=3.14 or pi
+clear;
+close;
+clc;
+T0=4;
+t=-5.99:0.01:6;
+t_temp=0.01:0.01:T0/2;
+s=length(t)/length(t_temp);
+x=[];
+for i=1:s
+ if modulo(i,2)==1 then
+ x=[x -ones(1,length(t_temp))*%pi];
+ else
+ x=[x ones(1,length(t_temp))*%pi];
+ end
+end
+figure(1);
+title('Signal');
+ylabel('x(t)');
+xlabel('t');
+plot(t,x,'r')
+w0=%pi/2;
+for k=-10:10
+ cc(k+11,:)=exp(-%i*k*w0*t);
+ ck(k+11)=x*cc(k+11,:)'/length(t);
+ if abs(ck(k+11))<0.01 then
+ ck(k+11)=0;
+ else if real(ck(k+11))<0.1 then
+ ck(k+11)=%i*imag(ck(k+11));
+ end
+ end
+ if k==0 then
+ c0=ck(k+11);
+ end
+end
+q=abs(ck);
+figure(2);
+title('Magnitude Spectrum');
+ylabel('|cn|');
+xlabel('fo');
+f=-10:1:10;
+plot2d3(f,q)