summaryrefslogtreecommitdiff
path: root/716/CH8/EX8.1.b
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /716/CH8/EX8.1.b
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 '716/CH8/EX8.1.b')
-rwxr-xr-x716/CH8/EX8.1.b/Solved_Ex8_1b.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/716/CH8/EX8.1.b/Solved_Ex8_1b.sce b/716/CH8/EX8.1.b/Solved_Ex8_1b.sce
new file mode 100755
index 000000000..595343139
--- /dev/null
+++ b/716/CH8/EX8.1.b/Solved_Ex8_1b.sce
@@ -0,0 +1,22 @@
+//Determine the fourier series representation of the given discrete time signal, x(n)=4cos(pi*n/2)
+clc;
+clear;
+n=-20:1:20;
+x=4*cos(%pi/2*n);
+N=4;
+for k=0:1:20
+ c=0;
+ for n=0:1:N-1
+ c=c+4*cos(%pi/2*n)*exp(-2*%i*%pi*k*n/N);
+ end
+ d(k+1)=c/N;
+end
+disp(d,'fourier series terms of given signal');
+k=0:1:20;
+subplot(1,2,1)
+dmag=abs(d);
+plot2d3(k,dmag);
+xtitle('Magnitude Spectrum','k values','|ck| magnitudes');
+subplot(1,2,2)
+plot2d3(k,atan(imag(d),real(d)));
+xtitle('Phase Spectrum','k values','angle(ck)'); \ No newline at end of file