From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1592/CH3/EX3.13/Fig3_13_1.jpg | Bin 0 -> 7553 bytes 1592/CH3/EX3.13/Fig3_13_2.jpg | Bin 0 -> 6311 bytes 1592/CH3/EX3.13/example_3_13.sce | 45 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100755 1592/CH3/EX3.13/Fig3_13_1.jpg create mode 100755 1592/CH3/EX3.13/Fig3_13_2.jpg create mode 100755 1592/CH3/EX3.13/example_3_13.sce (limited to '1592/CH3/EX3.13') 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 Binary files /dev/null and b/1592/CH3/EX3.13/Fig3_13_1.jpg 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 Binary files /dev/null and b/1592/CH3/EX3.13/Fig3_13_2.jpg 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) -- cgit