diff options
Diffstat (limited to '1592/CH3')
-rwxr-xr-x | 1592/CH3/EX3.13/Fig3_13_1.jpg | bin | 0 -> 7553 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.13/Fig3_13_2.jpg | bin | 0 -> 6311 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.13/example_3_13.sce | 45 | ||||
-rwxr-xr-x | 1592/CH3/EX3.14/Fig3_14_1.jpg | bin | 0 -> 5417 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.14/Fig3_14_2.jpg | bin | 0 -> 4895 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.14/example_3_14.sce | 43 | ||||
-rwxr-xr-x | 1592/CH3/EX3.16/Fig3_16.jpg | bin | 0 -> 4589 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.16/example_3_16.sce | 46 | ||||
-rwxr-xr-x | 1592/CH3/EX3.17/Fig3_17_1.jpg | bin | 0 -> 5226 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.17/Fig3_17_2.jpg | bin | 0 -> 5129 bytes | |||
-rwxr-xr-x | 1592/CH3/EX3.17/example_3_17.sce | 44 | ||||
-rwxr-xr-x | 1592/CH3/EX3.18/example_3_18.sce | 20 |
12 files changed, 198 insertions, 0 deletions
diff --git a/1592/CH3/EX3.13/Fig3_13_1.jpg b/1592/CH3/EX3.13/Fig3_13_1.jpg Binary files differnew file mode 100755 index 000000000..83bab99db --- /dev/null +++ b/1592/CH3/EX3.13/Fig3_13_1.jpg diff --git a/1592/CH3/EX3.13/Fig3_13_2.jpg b/1592/CH3/EX3.13/Fig3_13_2.jpg Binary files differnew file mode 100755 index 000000000..b5bb1d78b --- /dev/null +++ b/1592/CH3/EX3.13/Fig3_13_2.jpg 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)
diff --git a/1592/CH3/EX3.14/Fig3_14_1.jpg b/1592/CH3/EX3.14/Fig3_14_1.jpg Binary files differnew file mode 100755 index 000000000..59d92a36e --- /dev/null +++ b/1592/CH3/EX3.14/Fig3_14_1.jpg diff --git a/1592/CH3/EX3.14/Fig3_14_2.jpg b/1592/CH3/EX3.14/Fig3_14_2.jpg Binary files differnew file mode 100755 index 000000000..41ad7a314 --- /dev/null +++ b/1592/CH3/EX3.14/Fig3_14_2.jpg diff --git a/1592/CH3/EX3.14/example_3_14.sce b/1592/CH3/EX3.14/example_3_14.sce new file mode 100755 index 000000000..ecfab79c4 --- /dev/null +++ b/1592/CH3/EX3.14/example_3_14.sce @@ -0,0 +1,43 @@ +//Scilab Code for Example 3.14 of Signals and systems by
+//P.Ramakrishna Rao
+//CTFS coefficients of a periodic signal
+//x(wt) = Asin wt, 0<wt<pi, and 0, pi<|t|<2*pi
+clear;
+clc;
+A=6;
+T =2*%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:$)];
+figure(1);
+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(2);
+c = gca();
+c.y_location = "origin";
+c.x_location = "origin";
+plot2d3('gnn',k,abs(ck),9)
+poly1 = c.children(1).children(1);
+poly1.thickness = 3;
+title('|ck|')
+xlabel('k')
diff --git a/1592/CH3/EX3.16/Fig3_16.jpg b/1592/CH3/EX3.16/Fig3_16.jpg Binary files differnew file mode 100755 index 000000000..6b16ae51c --- /dev/null +++ b/1592/CH3/EX3.16/Fig3_16.jpg diff --git a/1592/CH3/EX3.16/example_3_16.sce b/1592/CH3/EX3.16/example_3_16.sce new file mode 100755 index 000000000..71fd614c9 --- /dev/null +++ b/1592/CH3/EX3.16/example_3_16.sce @@ -0,0 +1,46 @@ +//Scilab Code for Example 3.16 of Signals and systems by
+//P.Ramakrishna Rao
+//A=%pi or 3.14
+clear;
+clc;
+//Trignometric Fourier Coefficients
+for n=0:5
+a(n+1)=integrate('t*cos(2*%pi*n*t)','t',0,1);
+end
+for n=0:5
+b(n+1)=integrate('t*sin(2*%pi*n*t)','t',0,1);
+end
+disp(%pi*a(1),"an(a0)")
+disp("an(a1-->a5)")
+for n=1:5
+disp(2*a(n+1)*%pi)
+end
+disp("bn(b1-->b5)")
+for n=1:5
+disp(2*%pi*b(n+1))
+end
+//CTFS coefficients of a periodic signal
+//x(t) =t
+t = 0:0.01:1;
+xt =2*%pi*t;
+//
+for k =0:6
+ C(k+1,:) = exp(-sqrt(-1)*2*%pi*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";
+plot2d3('gnn',k,abs(ck))
+poly1 = c.children(1).children(1);
+poly1.thickness = 3;
+title('|ck|')
+xlabel('k')
diff --git a/1592/CH3/EX3.17/Fig3_17_1.jpg b/1592/CH3/EX3.17/Fig3_17_1.jpg Binary files differnew file mode 100755 index 000000000..631dc1534 --- /dev/null +++ b/1592/CH3/EX3.17/Fig3_17_1.jpg diff --git a/1592/CH3/EX3.17/Fig3_17_2.jpg b/1592/CH3/EX3.17/Fig3_17_2.jpg Binary files differnew file mode 100755 index 000000000..0b6cd4457 --- /dev/null +++ b/1592/CH3/EX3.17/Fig3_17_2.jpg 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')
diff --git a/1592/CH3/EX3.18/example_3_18.sce b/1592/CH3/EX3.18/example_3_18.sce new file mode 100755 index 000000000..4bc679ecd --- /dev/null +++ b/1592/CH3/EX3.18/example_3_18.sce @@ -0,0 +1,20 @@ +//Scilab Code for Example 3.18 of Signals and systems by
+//P.Ramakrishna Rao
+//A=%pi or 3.14
+clear;
+clc;
+//Trignometric Fourier Coefficients
+a(1)=integrate('sin(w)','w',0,%pi);
+for n=1:8
+a(2*n+1)=integrate('sin(w+2*n*w)','w',0,%pi)+integrate('sin(w-2*w*n)','w',0,%pi);
+end
+for n=0:8
+b(n+1)=0;
+end
+disp(abs(a(1)),"an(a0)");
+disp("an(a1-->a8)");
+n=1:8;
+disp(2*a(n+1));
+disp("bn(b1-->b8)");
+n=1:8;
+disp(b(n));
|