summaryrefslogtreecommitdiff
path: root/40/CH8
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /40/CH8
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 '40/CH8')
-rwxr-xr-x40/CH8/EX8.1/Exa_8_1.sce6
-rwxr-xr-x40/CH8/EX8.10/Exa_8_10.sce9
-rwxr-xr-x40/CH8/EX8.11/Exa_8_11.sce27
-rwxr-xr-x40/CH8/EX8.11/Exa_8_11_0.jpgbin0 -> 14316 bytes
-rwxr-xr-x40/CH8/EX8.11/Exa_8_11_1.jpgbin0 -> 18501 bytes
-rwxr-xr-x40/CH8/EX8.15a/Exa_8_15a.sce12
-rwxr-xr-x40/CH8/EX8.15b/Exa_8_15b.sce14
-rwxr-xr-x40/CH8/EX8.16/Exa_8_16.jpgbin0 -> 12762 bytes
-rwxr-xr-x40/CH8/EX8.16/Exa_8_16.sce12
-rwxr-xr-x40/CH8/EX8.17/Exa_8_17.sce8
-rwxr-xr-x40/CH8/EX8.18/Exa_8_18.sce9
-rwxr-xr-x40/CH8/EX8.19/Exa_8_19.sce10
-rwxr-xr-x40/CH8/EX8.2/Exa_8_2.sce6
-rwxr-xr-x40/CH8/EX8.20/Exa_8_20.sce9
-rwxr-xr-x40/CH8/EX8.21/Exa_8_21.sce11
-rwxr-xr-x40/CH8/EX8.22/Exa_8_22.sce9
-rwxr-xr-x40/CH8/EX8.23/Exa_8_23.sce10
-rwxr-xr-x40/CH8/EX8.24/Exa_8_24.sce24
-rwxr-xr-x40/CH8/EX8.3/Exa_8_3.sce24
-rwxr-xr-x40/CH8/EX8.4/Exa_8_4.sce21
-rwxr-xr-x40/CH8/EX8.5a/Exa_8_5a.sce42
-rwxr-xr-x40/CH8/EX8.5b/Exa_8_5b.sce42
-rwxr-xr-x40/CH8/EX8.5c/Exa_8_5c.sce7
-rwxr-xr-x40/CH8/EX8.6/Exa_8_6.sce20
-rwxr-xr-x40/CH8/EX8.7/Exa_8_7.sce7
-rwxr-xr-x40/CH8/EX8.8/Exa_8_8.sce9
-rwxr-xr-x40/CH8/EX8.9a/Exa_8_9a.sce15
-rwxr-xr-x40/CH8/EX8.9a/Exa_8_9a_0.jpgbin0 -> 15251 bytes
-rwxr-xr-x40/CH8/EX8.9a/Exa_8_9a_1.jpgbin0 -> 10575 bytes
-rwxr-xr-x40/CH8/EX8.9b/Exa_8_9b.sce15
-rwxr-xr-x40/CH8/EX8.9b/Exa_8_9b_0.jpgbin0 -> 18100 bytes
-rwxr-xr-x40/CH8/EX8.9b/Exa_8_9b_1.jpgbin0 -> 11424 bytes
-rwxr-xr-x40/CH8/EX8.9c/Exa_8_9c.sce15
-rwxr-xr-x40/CH8/EX8.9c/Exa_8_9c_0.jpgbin0 -> 16233 bytes
-rwxr-xr-x40/CH8/EX8.9c/Exa_8_9c_1.jpgbin0 -> 10728 bytes
-rwxr-xr-x40/CH8/EX8.9d/Exa_8_9d.sce15
-rwxr-xr-x40/CH8/EX8.9d/Exa_8_9d_1.jpgbin0 -> 13206 bytes
-rwxr-xr-x40/CH8/EX8.9d/exa_8_9d_0.jpgbin0 -> 15701 bytes
38 files changed, 408 insertions, 0 deletions
diff --git a/40/CH8/EX8.1/Exa_8_1.sce b/40/CH8/EX8.1/Exa_8_1.sce
new file mode 100755
index 000000000..000b8b907
--- /dev/null
+++ b/40/CH8/EX8.1/Exa_8_1.sce
@@ -0,0 +1,6 @@
+//DFT from defining relation
+//N-point DFT
+x=[1 2 1 0];
+XDFT=dft(x,-1);
+disp(XDFT,'The DFT of x[n] is');
+//DFT of periodic signal x with period N=4 \ No newline at end of file
diff --git a/40/CH8/EX8.10/Exa_8_10.sce b/40/CH8/EX8.10/Exa_8_10.sce
new file mode 100755
index 000000000..d9676ae26
--- /dev/null
+++ b/40/CH8/EX8.10/Exa_8_10.sce
@@ -0,0 +1,9 @@
+//DFS of sampled periodic signals
+xn=[0 ones(2:16) 0 -ones(18:32)];
+XDFS=0.032*dft(xn,-1);
+for i=1:length(XDFS)
+ if (abs(XDFS(i))<0.000001) then
+ XDFS(i)=0;
+ end
+end
+disp(XDFS,'The DFS of x[n] is'); \ No newline at end of file
diff --git a/40/CH8/EX8.11/Exa_8_11.sce b/40/CH8/EX8.11/Exa_8_11.sce
new file mode 100755
index 000000000..5b086398e
--- /dev/null
+++ b/40/CH8/EX8.11/Exa_8_11.sce
@@ -0,0 +1,27 @@
+//Effects of leakage
+n1=0:0.005:0.1;
+n2=0:0.005:0.125;
+n3=0:0.005:1.125;
+xt1=(2*cos(20*%pi*n1')+5*cos(100*%pi*n1'));
+xt2=(2*cos(20*%pi*n2')+5*cos(100*%pi*n2'));
+xt3=(2*cos(20*%pi*n3')+5*cos(100*%pi*n3'));
+XDFS1=abs(dft(xt1,-1))/20;
+XDFS2=abs(dft(xt2,-1))/25;
+XDFS3=abs(dft(xt3,-1))/225;
+f1=0:5:100;
+f2=0:4:100;
+f3=0:100/225:100;
+a=gca();
+a.x_location="origin";
+plot2d3('gnn',f1,XDFS1);
+xlabel('analog frequency');
+ylabel('Magnitude');
+xset('window',1);
+subplot(211);
+plot2d3('gnn',f2,XDFS2);
+xlabel('analog frequency');
+ylabel('Magnitude');
+subplot(212);
+plot2d3('gnn',f3,XDFS3);
+xlabel('analog frequency');
+ylabel('Magnitude'); \ No newline at end of file
diff --git a/40/CH8/EX8.11/Exa_8_11_0.jpg b/40/CH8/EX8.11/Exa_8_11_0.jpg
new file mode 100755
index 000000000..776d7a686
--- /dev/null
+++ b/40/CH8/EX8.11/Exa_8_11_0.jpg
Binary files differ
diff --git a/40/CH8/EX8.11/Exa_8_11_1.jpg b/40/CH8/EX8.11/Exa_8_11_1.jpg
new file mode 100755
index 000000000..e0746b696
--- /dev/null
+++ b/40/CH8/EX8.11/Exa_8_11_1.jpg
Binary files differ
diff --git a/40/CH8/EX8.15a/Exa_8_15a.sce b/40/CH8/EX8.15a/Exa_8_15a.sce
new file mode 100755
index 000000000..5905d9dbe
--- /dev/null
+++ b/40/CH8/EX8.15a/Exa_8_15a.sce
@@ -0,0 +1,12 @@
+//overlapp-add and overlap-save methods of convolution
+//overlap-add method
+xn=[1 2 3 3 4 5];
+xon=[1 2 3];
+x1n=[3 4 5];
+hn=[1 1 1];
+yon=convol(xon,hn);
+y1n=convol(x1n,hn);
+yon=[yon,0,0,0];
+y1n=[0,0,0,y1n];
+yn=yon+y1n
+yn1=convol(xn,hn) \ No newline at end of file
diff --git a/40/CH8/EX8.15b/Exa_8_15b.sce b/40/CH8/EX8.15b/Exa_8_15b.sce
new file mode 100755
index 000000000..b72139b8c
--- /dev/null
+++ b/40/CH8/EX8.15b/Exa_8_15b.sce
@@ -0,0 +1,14 @@
+//(b)overlap-save method
+xn=[1 2 3 3 4 5];
+hn=[1 1 1];
+xon=[0 0 1 2 3];
+x1n=[2 3 3 4 5];
+x2n=[4 5 0 0 0];
+yon=convol(xon,hn);
+y1n=convol(x1n,hn);
+y2n=convol(x2n,hn);
+yno=yon(3:5);
+yn1=y1n(3:5);
+yn2=y2n(3:5);
+yn=[yno yn1 yn2]
+YN=convol(xn,hn) \ No newline at end of file
diff --git a/40/CH8/EX8.16/Exa_8_16.jpg b/40/CH8/EX8.16/Exa_8_16.jpg
new file mode 100755
index 000000000..4a4bb37f1
--- /dev/null
+++ b/40/CH8/EX8.16/Exa_8_16.jpg
Binary files differ
diff --git a/40/CH8/EX8.16/Exa_8_16.sce b/40/CH8/EX8.16/Exa_8_16.sce
new file mode 100755
index 000000000..4bd0eb54e
--- /dev/null
+++ b/40/CH8/EX8.16/Exa_8_16.sce
@@ -0,0 +1,12 @@
+//signal interpolation using FFT
+xn=[0 1 0 -1];
+XDFT=dft(xn,-1)
+ZT=[0 -2*%i 0 zeros(1:27) 0 2*%i];
+xn1=dft(ZT,1);
+t=0:1/length(xn1):1-(1/length(xn1));
+a=gca();
+a.x_location="origin";
+plot2d(t,xn1);
+xlabel('time t');
+ylabel('Amplitude');
+xtitle('Interpolated Sinusoid:4 samples over one period'); \ No newline at end of file
diff --git a/40/CH8/EX8.17/Exa_8_17.sce b/40/CH8/EX8.17/Exa_8_17.sce
new file mode 100755
index 000000000..10f457b52
--- /dev/null
+++ b/40/CH8/EX8.17/Exa_8_17.sce
@@ -0,0 +1,8 @@
+//concept of periodogram
+xn=[0 1 0 -1];
+N=4;
+XDFT=dft(xn,-1);
+for i=1:length(XDFT)
+ p(i)=(1/N)*abs(XDFT(i)^2);
+end
+p//periodogram \ No newline at end of file
diff --git a/40/CH8/EX8.18/Exa_8_18.sce b/40/CH8/EX8.18/Exa_8_18.sce
new file mode 100755
index 000000000..c05785204
--- /dev/null
+++ b/40/CH8/EX8.18/Exa_8_18.sce
@@ -0,0 +1,9 @@
+//The DFT from the matrix formulation
+xn=[1;2;1;0];
+w=exp(-%i*%pi/2);
+for i=1:4
+ for j=1:4
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+XDFT=WN*xn
diff --git a/40/CH8/EX8.19/Exa_8_19.sce b/40/CH8/EX8.19/Exa_8_19.sce
new file mode 100755
index 000000000..77fcc0e9e
--- /dev/null
+++ b/40/CH8/EX8.19/Exa_8_19.sce
@@ -0,0 +1,10 @@
+//using DFT to find IDFT
+XDFT=[4;-2*%i;0;2*%i];
+XDFTc=[4;2*%i;0;-2*%i];
+w=exp(-%i*%pi/2);
+for i=1:4
+ for j=1:4
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+xn=1/4*(WN*XDFTc) \ No newline at end of file
diff --git a/40/CH8/EX8.2/Exa_8_2.sce b/40/CH8/EX8.2/Exa_8_2.sce
new file mode 100755
index 000000000..39450d7f1
--- /dev/null
+++ b/40/CH8/EX8.2/Exa_8_2.sce
@@ -0,0 +1,6 @@
+//The DTFT and conjugate symmetry
+//8-point DFT
+x=[1 1 0 0 0 0 0 0];
+XDFT=dft(x,-1);
+disp(XDFT,'The DFT of x is');
+disp('from conjugate symmetry we see XDFT[k]=XDFT[8-k]'); \ No newline at end of file
diff --git a/40/CH8/EX8.20/Exa_8_20.sce b/40/CH8/EX8.20/Exa_8_20.sce
new file mode 100755
index 000000000..a87b49079
--- /dev/null
+++ b/40/CH8/EX8.20/Exa_8_20.sce
@@ -0,0 +1,9 @@
+//A four point decimation-in-frequency FFT algorithm
+x=[1 2 1 0];
+w=-%i;
+xdft(1)=x(1)+x(3)+x(2)+x(4);
+xdft(2)=x(1)-x(3)+w*(x(2)-x(4));
+xdft(3)=x(1)+x(3)-x(2)-x(4);
+xdft(4)=x(1)-x(3)-w*(x(2)-x(4));
+XDFT=dft(x,-1);
+xdft,XDFT \ No newline at end of file
diff --git a/40/CH8/EX8.21/Exa_8_21.sce b/40/CH8/EX8.21/Exa_8_21.sce
new file mode 100755
index 000000000..0014814a8
--- /dev/null
+++ b/40/CH8/EX8.21/Exa_8_21.sce
@@ -0,0 +1,11 @@
+//A four point decimation-in-time FFT algorithm
+x=[1 2 1 0];
+w=-%i;
+xdft=[0 0 0 0];
+for i=1:4
+ for j=1:4
+ xdft(i)=xdft(i)+x(j)*w^((i-1)*(j-1));
+ end
+end
+XDFT=dft(x,-1);
+xdft,XDFT \ No newline at end of file
diff --git a/40/CH8/EX8.22/Exa_8_22.sce b/40/CH8/EX8.22/Exa_8_22.sce
new file mode 100755
index 000000000..3cc472315
--- /dev/null
+++ b/40/CH8/EX8.22/Exa_8_22.sce
@@ -0,0 +1,9 @@
+//A 4-point DFT from a 3-point sequence
+xn=[1;2;1];
+w=exp(-%i*%pi/2);
+for i=1:4
+ for j=1:3
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+XDFT=WN*xn \ No newline at end of file
diff --git a/40/CH8/EX8.23/Exa_8_23.sce b/40/CH8/EX8.23/Exa_8_23.sce
new file mode 100755
index 000000000..4a6985f9e
--- /dev/null
+++ b/40/CH8/EX8.23/Exa_8_23.sce
@@ -0,0 +1,10 @@
+//A 3-point IDFT from 4-point DFT
+XDFT=[4;-2*%i;0;2*%i];
+w=exp(-%i*%pi/2);
+for i=1:4
+ for j=1:3
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+WI=WN';
+xn=1/4*(WI*XDFT) \ No newline at end of file
diff --git a/40/CH8/EX8.24/Exa_8_24.sce b/40/CH8/EX8.24/Exa_8_24.sce
new file mode 100755
index 000000000..5ad54e146
--- /dev/null
+++ b/40/CH8/EX8.24/Exa_8_24.sce
@@ -0,0 +1,24 @@
+//The importance of Periodic extension
+//(a)For M=3
+x=[1 2 1];
+XDFT=dft(x,-1)
+w=exp(-%i*2*%pi/3);
+for i=1:3
+ for j=1:3
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+WI=WN';
+xn=1/3*WI*XDFT
+//The result is periodic with M=3 & 1 period equals x[n]
+//(b)For M=4
+y=[1 2 1 0];
+YDFT=dft(y,-1)
+w=exp(-%i*%pi/2);
+for i=1:4
+ for j=1:4
+ WN(i,j)=w^((i-1)*(j-1));
+ end
+end
+WI=WN';
+yn=1/4*WI*YDFT
diff --git a/40/CH8/EX8.3/Exa_8_3.sce b/40/CH8/EX8.3/Exa_8_3.sce
new file mode 100755
index 000000000..fcf7eb76f
--- /dev/null
+++ b/40/CH8/EX8.3/Exa_8_3.sce
@@ -0,0 +1,24 @@
+//Circular shift and flipping
+//(a)right circular shift
+y=[1 2 3 4 5 0 0 6];
+f=y;g=y;h=y;
+for i=1:2
+ b=f(length(f));
+ for j=length(f):-1:2
+ f(j)=f(j-1);
+ end
+ f(1)=b;
+end
+disp(f,'By right circular shift y[n-2] is');
+//(b)left circular shift
+for i=1:2
+ a=g(1);
+ for j=1:length(g)-1
+ g(j)=g(j+1);
+ end
+ g(length(g))=a;
+end
+disp(g,'By left circular shift y[n+2] is');
+//(c)flipping property
+h=[h(1) h(length(h):-1:2)];
+disp(h,'By flipping property y[-n] is'); \ No newline at end of file
diff --git a/40/CH8/EX8.4/Exa_8_4.sce b/40/CH8/EX8.4/Exa_8_4.sce
new file mode 100755
index 000000000..847b1bfa2
--- /dev/null
+++ b/40/CH8/EX8.4/Exa_8_4.sce
@@ -0,0 +1,21 @@
+x=[1 2 1 0];
+XDFT=dft(x,-1)
+//(a)time shift property
+y=x;
+for i=1:2
+ a=y(1);
+ for j=1:length(y)-1
+ y(j)=y(j+1);
+ end
+ y(length(y))=a;
+end
+YDFT=dft(y,-1)
+disp(YDFT,'By Time-Shift property DFT of x[n-2] is');
+//(b)flipping property
+g=[x(1) x(length(x):-1:2)]
+GDFT=dft(g,-1)
+disp(GDFT,'By Time reversal property DFT of x[-n] is');
+//(c)conjugation property
+p=XDFT;
+PDFT=[p(1);p(4:-1:2)];
+disp(YDFT,'BY conjugation property DFT of x*[n] is');
diff --git a/40/CH8/EX8.5a/Exa_8_5a.sce b/40/CH8/EX8.5a/Exa_8_5a.sce
new file mode 100755
index 000000000..63e5aa5a4
--- /dev/null
+++ b/40/CH8/EX8.5a/Exa_8_5a.sce
@@ -0,0 +1,42 @@
+//properties of DFT
+//a1)product
+xn=[1 2 1 0];
+XDFT=dft(xn,-1)
+hn=xn.*xn
+HDFT=dft(hn,-1)
+HDFT1=1/4*(convol(XDFT,XDFT))
+HDFT1=[HDFT1,zeros(8:12)];
+HDFT2=[HDFT1(1:4);HDFT1(5:8);HDFT1(9:12)];
+HDFT3=[0 0 0 0];
+for i=1:4
+ for j=1:3
+ HDFT3(i)=HDFT3(i)+HDFT2(j,i);
+ end
+end
+disp(HDFT3,'DFT of x[n]^2 is');
+//a2)periodic convolution
+vn=convol(xn,xn);
+vn=[vn,zeros(8:12)];
+vn=[vn(1:4);vn(5:8);vn(9:12)];
+vn1=[0 0 0 0];
+for i=1:4
+ for j=1:3
+ vn1(i)=vn1(i)+vn(j,i);
+ end
+end
+VDFT=dft(vn1,-1);
+VDFT1=XDFT.*XDFT;
+disp(VDFT1,'DFT of x[n]*x[n] is');
+//a3)signal energy(parcewell's theorem)
+xn2=xn^2;
+E=0;
+for i=1:length(xn2)
+ E=E+abs(xn2(i));
+end
+XDFT2=XDFT^2
+E1=0;
+for i=1:length(XDFT2)
+ E1=E1+abs(XDFT2(i));
+end
+E,(1/4)*E1;
+disp(1/4*E1,'The energy of the signal is'); \ No newline at end of file
diff --git a/40/CH8/EX8.5b/Exa_8_5b.sce b/40/CH8/EX8.5b/Exa_8_5b.sce
new file mode 100755
index 000000000..05c7e80c0
--- /dev/null
+++ b/40/CH8/EX8.5b/Exa_8_5b.sce
@@ -0,0 +1,42 @@
+//b1)modulation
+XDFT=[4 -2*%i 0 2*%i];
+xn=dft(XDFT,1)
+for i=1:length(xn)
+ zn(i)=xn(i)*%e^((%i*%pi*(i-1))/2);
+end
+disp(zn,'The IDFT of XDFT[k-1] is');
+ZDFT=[2*%i 4 -2*%i 0];
+zn1=dft(ZDFT,1)
+//b2)periodic convolution
+HDFT=(convol(XDFT,XDFT))
+HDFT=[HDFT,zeros(8:12)];
+HDFT=[HDFT(1:4);HDFT(5:8);HDFT(9:12)];
+HDFT1=[0 0 0 0];
+for i=1:4
+ for j=1:3
+ HDFT1(i)=HDFT1(i)+HDFT(j,i);
+ end
+end
+HDFT1;
+hn=dft(HDFT1,1)
+hn1=4*(xn.*xn);
+disp(hn1,'The IDFT of XDFT*XDFT is');
+//b3)product
+WDFT=XDFT.*XDFT;
+wn=dft(WDFT,1)
+wn1=convol(xn,xn);
+wn1=[wn1,zeros(8:12)];
+wn1=[wn1(1:4);wn1(5:8);wn1(9:12)];
+WN=[0 0 0 0];
+for i=1:4
+ for j=1:3
+ WN(i)=WN(i)+wn1(j,i);
+ end
+end
+disp(WN,'The IDFT of XDFT.XDFT is');
+//b4)Central ordinates and signal Energy
+E=0;
+for i=1:length(xn)
+ E=E+abs(xn(i)^2);
+end
+disp(E,'the signal energy is'); \ No newline at end of file
diff --git a/40/CH8/EX8.5c/Exa_8_5c.sce b/40/CH8/EX8.5c/Exa_8_5c.sce
new file mode 100755
index 000000000..bc4c62f5d
--- /dev/null
+++ b/40/CH8/EX8.5c/Exa_8_5c.sce
@@ -0,0 +1,7 @@
+//Regular convolution
+xn=[1 2 1 0];
+yn=[1 2 1 0 0 0 0];
+YDFT=dft(yn,-1)
+SDFT=YDFT.*YDFT
+sn=dft(SDFT,1)
+sn1=convol(xn,xn) \ No newline at end of file
diff --git a/40/CH8/EX8.6/Exa_8_6.sce b/40/CH8/EX8.6/Exa_8_6.sce
new file mode 100755
index 000000000..be5c3cbb9
--- /dev/null
+++ b/40/CH8/EX8.6/Exa_8_6.sce
@@ -0,0 +1,20 @@
+//Signal and spectrum replication
+xn=[2 3 2 1];
+XDFT=dft(xn,-1)
+yn=[xn xn xn];
+YDFT=dft(yn,-1)
+YDFT1=3*[XDFT(1:1/3:length(XDFT))];
+for i=2:3
+ YDFT1(i:3:length(YDFT1))=0;
+end
+YDFT1(12:-1:11)=0;
+disp(YDFT1,'the DFT of x[n/3] is');
+hn=[xn(1:1/3:length(xn))]
+for i=2:3
+ hn(i:3:length(hn))=0;
+end
+hn(12:-1:11)=0;
+hn
+HDFT=dft(hn,-1)
+HDFT1=[XDFT;XDFT;XDFT];
+disp(HDFT1,'the DFT of y[n]=[x[n],x[n],x[n]] is'); \ No newline at end of file
diff --git a/40/CH8/EX8.7/Exa_8_7.sce b/40/CH8/EX8.7/Exa_8_7.sce
new file mode 100755
index 000000000..9d9c9e16d
--- /dev/null
+++ b/40/CH8/EX8.7/Exa_8_7.sce
@@ -0,0 +1,7 @@
+//relating DFT and IDFT
+XDFT1=[4 -2*%i 0 2*%i];
+xn1=dft(XDFT1,1);
+disp(xn1,'The IDFT of XDFT1');
+XDFT2=[12 -24*%i 0 4*%e^(%i*%pi/4) 0 4*%e^(-%i*%pi/4) 0 24*%i];
+xn2=dft(XDFT2,1);
+disp(xn2,'The IDFT of XDFT1'); \ No newline at end of file
diff --git a/40/CH8/EX8.8/Exa_8_8.sce b/40/CH8/EX8.8/Exa_8_8.sce
new file mode 100755
index 000000000..7fad7f114
--- /dev/null
+++ b/40/CH8/EX8.8/Exa_8_8.sce
@@ -0,0 +1,9 @@
+//Relating DFT and DTFT
+xn=[1 2 1 0];
+XDFT=dft(xn,-1);
+//for F=k/4,k=0,1,2,3
+for k=1:4
+ XF(k)=1+2*%e^(-%i*%pi*(k-1)/2)+%e^(-%i*%pi*(k-1));
+end
+XF,XDFT
+disp(XF,'The DFT of x[n] is');
diff --git a/40/CH8/EX8.9a/Exa_8_9a.sce b/40/CH8/EX8.9a/Exa_8_9a.sce
new file mode 100755
index 000000000..b61b2c4d9
--- /dev/null
+++ b/40/CH8/EX8.9a/Exa_8_9a.sce
@@ -0,0 +1,15 @@
+//DFT and DFS of sinusoids
+n2=0:0.5/1000:5.5/100;
+xt=4*cos(100*%pi*n2');
+n=0:(0.5)/100:(5.5)/100;//F=3/12 hence N=12
+xn=4*cos(100*%pi*n');
+XDFT=dft(xn,-1);
+n1=0:11;
+a=gca();
+a.x_location="origin";
+plot2d(n2,xt);
+plot2d3('gnn',n,xn);
+xset('window',1);
+b=gca();
+b.x_location="origin";
+plot2d3('gnn',n1,XDFT);
diff --git a/40/CH8/EX8.9a/Exa_8_9a_0.jpg b/40/CH8/EX8.9a/Exa_8_9a_0.jpg
new file mode 100755
index 000000000..7d2fad5b0
--- /dev/null
+++ b/40/CH8/EX8.9a/Exa_8_9a_0.jpg
Binary files differ
diff --git a/40/CH8/EX8.9a/Exa_8_9a_1.jpg b/40/CH8/EX8.9a/Exa_8_9a_1.jpg
new file mode 100755
index 000000000..b0bd756d8
--- /dev/null
+++ b/40/CH8/EX8.9a/Exa_8_9a_1.jpg
Binary files differ
diff --git a/40/CH8/EX8.9b/Exa_8_9b.sce b/40/CH8/EX8.9b/Exa_8_9b.sce
new file mode 100755
index 000000000..d32e7094c
--- /dev/null
+++ b/40/CH8/EX8.9b/Exa_8_9b.sce
@@ -0,0 +1,15 @@
+//DFT and DFS of sinusoids
+n2=0:1/1280:31/128;
+xt=4*sin(72*%pi*n2');
+n=0:1/128:31/128;//F=9/32 hence N=32
+xn=4*sin(72*%pi*n');
+XDFT=abs(dft(xn,-1));
+n1=0:31;
+a=gca();
+a.x_location="origin";
+plot2d(n2,xt);
+plot2d3('gnn',n,xn);
+xset('window',1);
+b=gca();
+b.x_location="origin";
+plot2d3('gnn',n1,XDFT);
diff --git a/40/CH8/EX8.9b/Exa_8_9b_0.jpg b/40/CH8/EX8.9b/Exa_8_9b_0.jpg
new file mode 100755
index 000000000..3ae80d7a6
--- /dev/null
+++ b/40/CH8/EX8.9b/Exa_8_9b_0.jpg
Binary files differ
diff --git a/40/CH8/EX8.9b/Exa_8_9b_1.jpg b/40/CH8/EX8.9b/Exa_8_9b_1.jpg
new file mode 100755
index 000000000..e757639cc
--- /dev/null
+++ b/40/CH8/EX8.9b/Exa_8_9b_1.jpg
Binary files differ
diff --git a/40/CH8/EX8.9c/Exa_8_9c.sce b/40/CH8/EX8.9c/Exa_8_9c.sce
new file mode 100755
index 000000000..67632bb96
--- /dev/null
+++ b/40/CH8/EX8.9c/Exa_8_9c.sce
@@ -0,0 +1,15 @@
+//DFT and DFS of sinusoids
+n2=0:1/840:6/21;
+xt=4*sin(72*%pi*n2')-6*cos(12*%pi*n2');
+n=0:1/21:6/21;//F=3/12 hence N=12
+xn=4*sin(72*%pi*n')-6*cos(12*%pi*n');
+XDFT=abs(dft(xn,-1));
+n1=0:6;
+a=gca();
+a.x_location="origin";
+plot2d(n2,xt);
+plot2d3('gnn',n,xn);
+xset('window',1);
+b=gca();
+b.x_location="origin";
+plot2d3('gnn',n1,XDFT);
diff --git a/40/CH8/EX8.9c/Exa_8_9c_0.jpg b/40/CH8/EX8.9c/Exa_8_9c_0.jpg
new file mode 100755
index 000000000..924bb1475
--- /dev/null
+++ b/40/CH8/EX8.9c/Exa_8_9c_0.jpg
Binary files differ
diff --git a/40/CH8/EX8.9c/Exa_8_9c_1.jpg b/40/CH8/EX8.9c/Exa_8_9c_1.jpg
new file mode 100755
index 000000000..55efa132d
--- /dev/null
+++ b/40/CH8/EX8.9c/Exa_8_9c_1.jpg
Binary files differ
diff --git a/40/CH8/EX8.9d/Exa_8_9d.sce b/40/CH8/EX8.9d/Exa_8_9d.sce
new file mode 100755
index 000000000..2d5d4b294
--- /dev/null
+++ b/40/CH8/EX8.9d/Exa_8_9d.sce
@@ -0,0 +1,15 @@
+//DFT and DFS of sinusoids
+n2=0:1/2400:23/240;
+xt=1+4*sin(120*%pi*n2')+4*sin(40*%pi*n2');
+n=0:1/240:23/240;//F=9/32 hence N=32
+xn=1+4*sin(120*%pi*n')+4*sin(40*%pi*n');
+XDFT=abs(dft(xn,-1));
+n1=0:23;
+a=gca();
+a.x_location="origin";
+plot2d(n2,xt);
+plot2d3('gnn',n,xn);
+xset('window',1);
+b=gca();
+b.x_location="origin";
+plot2d3('gnn',n1,XDFT); \ No newline at end of file
diff --git a/40/CH8/EX8.9d/Exa_8_9d_1.jpg b/40/CH8/EX8.9d/Exa_8_9d_1.jpg
new file mode 100755
index 000000000..baec0a646
--- /dev/null
+++ b/40/CH8/EX8.9d/Exa_8_9d_1.jpg
Binary files differ
diff --git a/40/CH8/EX8.9d/exa_8_9d_0.jpg b/40/CH8/EX8.9d/exa_8_9d_0.jpg
new file mode 100755
index 000000000..2d0969b63
--- /dev/null
+++ b/40/CH8/EX8.9d/exa_8_9d_0.jpg
Binary files differ