summaryrefslogtreecommitdiff
path: root/2279/CH5/EX5.3
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /2279/CH5/EX5.3
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '2279/CH5/EX5.3')
-rw-r--r--2279/CH5/EX5.3/Ex5_3.sce34
1 files changed, 34 insertions, 0 deletions
diff --git a/2279/CH5/EX5.3/Ex5_3.sce b/2279/CH5/EX5.3/Ex5_3.sce
new file mode 100644
index 000000000..f3de06d08
--- /dev/null
+++ b/2279/CH5/EX5.3/Ex5_3.sce
@@ -0,0 +1,34 @@
+//Continuous Time Fourier Series Coefficients of
+//a periodic signal x(t) = 5*cos((%pi/2*t)+(%pi/6))
+clear;
+close;
+clc;
+t = 0:0.01:1;
+T = 1;
+Wo = 2*%pi/T;
+xt = cos((%pi/2*t)+(%pi/6))
+x1t=cos((%pi/2*-t)+(%pi/6))
+
+//x(t) is expanded according to Euler's theorem
+x=5/2*(exp(%i*(%pi/2*t+%pi/6))+exp(-%i*(%pi/2*t+%pi/6)));
+a1=5/2*exp(%i*%pi/6);
+a_1=5/2*exp(-%i*%pi/6);
+ak=[zeros(1,5) a_1 0 a1 zeros(1,5)];
+k=-6:6;
+disp("The fourier series coefficients are...")
+disp(ak)
+disp("magnitude of Fourier series coefficient")
+disp(abs(ak))
+subplot(2,1,1)
+plot(k,abs(ak),'.');
+xtitle("Magnitude Spectrum","k","|ak|");
+if xt== x1t then
+ disp("The Given signal is even. It has no phase spectrum");
+else
+ phase=[zeros(1,5) atan(imag(a_1)/real(a_1)) 0 atan(imag(a1)/real(a1)) zeros(1,5)];
+ disp("Phase of Fourier series coefficient in radians")
+ disp(phase)
+ subplot(2,1,2)
+ plot(k,phase,'.');
+ xtitle("Phase Spectrum","k","ak in radians");
+end