summaryrefslogtreecommitdiff
path: root/67/CH8
diff options
context:
space:
mode:
Diffstat (limited to '67/CH8')
-rwxr-xr-x67/CH8/EX8.1/example81.sce18
-rwxr-xr-x67/CH8/EX8.10/example810.sce7
-rwxr-xr-x67/CH8/EX8.11/example811.sce6
-rwxr-xr-x67/CH8/EX8.12/example812.sce6
-rwxr-xr-x67/CH8/EX8.13/example813.sce6
-rwxr-xr-x67/CH8/EX8.14/example814.sce6
-rwxr-xr-x67/CH8/EX8.15/example815.sce9
-rwxr-xr-x67/CH8/EX8.16/example816.sce6
-rwxr-xr-x67/CH8/EX8.17/example817.sce6
-rwxr-xr-x67/CH8/EX8.2/example82.sce7
-rwxr-xr-x67/CH8/EX8.3/example8_3.sce7
-rwxr-xr-x67/CH8/EX8.4/example84.sce6
-rwxr-xr-x67/CH8/EX8.5/example85.sce7
-rwxr-xr-x67/CH8/EX8.6/example86.sce6
-rwxr-xr-x67/CH8/EX8.7/example87.sce8
-rwxr-xr-x67/CH8/EX8.8/example88.sce8
-rwxr-xr-x67/CH8/EX8.9/example89.sce6
17 files changed, 125 insertions, 0 deletions
diff --git a/67/CH8/EX8.1/example81.sce b/67/CH8/EX8.1/example81.sce
new file mode 100755
index 000000000..356a23826
--- /dev/null
+++ b/67/CH8/EX8.1/example81.sce
@@ -0,0 +1,18 @@
+//Example 8.1
+//Determine the convolution of the two finite duration sequence
+clc;
+x=[1,1,1];
+n1=-1:1;
+h=[1,1,1];
+n2=-1:1;
+y=convol(x,h);
+n=-2:1:2;
+disp(y,'y[n]=');
+a = gca ();
+a.y_location ="origin";
+a.x_location ="origin";
+plot2d3(n,round(y),5);
+poly1=a.children(1).children (1);
+poly1.thickness=2;
+xtitle('Plot of sequence y[n]','n','y[n]');
+funcprot(0); \ No newline at end of file
diff --git a/67/CH8/EX8.10/example810.sce b/67/CH8/EX8.10/example810.sce
new file mode 100755
index 000000000..06da8b82d
--- /dev/null
+++ b/67/CH8/EX8.10/example810.sce
@@ -0,0 +1,7 @@
+//Example 8.10
+//Find the IDFT of the following sequence
+clc;
+i=sqrt(-1);
+X=[3,2+i,1,2-i];
+x=fft(X,1);
+disp(x,'x[n]='); \ No newline at end of file
diff --git a/67/CH8/EX8.11/example811.sce b/67/CH8/EX8.11/example811.sce
new file mode 100755
index 000000000..43ea8d057
--- /dev/null
+++ b/67/CH8/EX8.11/example811.sce
@@ -0,0 +1,6 @@
+//Example 8.11
+//For the given x[n] determine X[k] using FFT algorithm
+clc;
+x=[1,2,3,4,4,3,2,1];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.12/example812.sce b/67/CH8/EX8.12/example812.sce
new file mode 100755
index 000000000..c1c7f0d67
--- /dev/null
+++ b/67/CH8/EX8.12/example812.sce
@@ -0,0 +1,6 @@
+//Example 8.12
+//For the given x[n] determine X[k] using FFT algorithm
+clc;
+x=[0,1,2,3,4,5,6,7];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.13/example813.sce b/67/CH8/EX8.13/example813.sce
new file mode 100755
index 000000000..4b2059d0f
--- /dev/null
+++ b/67/CH8/EX8.13/example813.sce
@@ -0,0 +1,6 @@
+//Example 8.13
+//Find the DFT of the following sequence
+clc;
+h=[1/3,1/3,1/3];
+H=fft(h,-1);
+disp(H,'H[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.14/example814.sce b/67/CH8/EX8.14/example814.sce
new file mode 100755
index 000000000..247762739
--- /dev/null
+++ b/67/CH8/EX8.14/example814.sce
@@ -0,0 +1,6 @@
+//Example 8.14
+//Find the DFT of the following sequence
+clc;
+h=[1/3,1/3,1/3];
+H=fft(h,-1);
+disp(H,'H[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.15/example815.sce b/67/CH8/EX8.15/example815.sce
new file mode 100755
index 000000000..647a3af32
--- /dev/null
+++ b/67/CH8/EX8.15/example815.sce
@@ -0,0 +1,9 @@
+//Example 8.15
+//Obtain the DFT of x[n]=(a^n).u[n]
+clc;
+a=0.5;
+for i=0:1:7
+ x(i+1)=a.^i;
+end
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.16/example816.sce b/67/CH8/EX8.16/example816.sce
new file mode 100755
index 000000000..2869a1824
--- /dev/null
+++ b/67/CH8/EX8.16/example816.sce
@@ -0,0 +1,6 @@
+//Example 8.16
+//Program to find DFT of sequence x=[1,1,1,1,1,1,1,0]
+clc ;
+x=[1,1,1,1,1,1,1,0];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.17/example817.sce b/67/CH8/EX8.17/example817.sce
new file mode 100755
index 000000000..81e72ff1c
--- /dev/null
+++ b/67/CH8/EX8.17/example817.sce
@@ -0,0 +1,6 @@
+//Example 8.17
+//Determine the DFT of the following sequence
+clc;
+x=[0,0,1,1,1,1,1,0,0,0];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.2/example82.sce b/67/CH8/EX8.2/example82.sce
new file mode 100755
index 000000000..740e9cd29
--- /dev/null
+++ b/67/CH8/EX8.2/example82.sce
@@ -0,0 +1,7 @@
+//Example 8.2
+//Find the response of an FIR filter with impulse response h[n]=[1,2,4] //to the input sequence x[n]=[1,2]
+clc;
+x=[1,2];
+h=[1,2,4];
+Y=convol(x,h);
+disp(Y,'y[n]='); \ No newline at end of file
diff --git a/67/CH8/EX8.3/example8_3.sce b/67/CH8/EX8.3/example8_3.sce
new file mode 100755
index 000000000..9494b3590
--- /dev/null
+++ b/67/CH8/EX8.3/example8_3.sce
@@ -0,0 +1,7 @@
+//Example 8.3
+//Compute DFT of x(n)={1,1,0,0} and IDFT of y(n)={1,0,1,0}
+clc;
+x=[1,1,0,0];
+Y=[1,0,1,0];
+X=fft(x,-1);
+y=fft(Y,1); \ No newline at end of file
diff --git a/67/CH8/EX8.4/example84.sce b/67/CH8/EX8.4/example84.sce
new file mode 100755
index 000000000..8962598a3
--- /dev/null
+++ b/67/CH8/EX8.4/example84.sce
@@ -0,0 +1,6 @@
+//Example 8.4
+//Compute DFT of the following sequence
+clc;
+x=[0.25,0.25,0.25];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.5/example85.sce b/67/CH8/EX8.5/example85.sce
new file mode 100755
index 000000000..9d058fe45
--- /dev/null
+++ b/67/CH8/EX8.5/example85.sce
@@ -0,0 +1,7 @@
+//Example 8.5
+//Find the DFT of the following sequence
+clc;
+x=[0.2,0.2,0.2];
+n=-1:1;
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.6/example86.sce b/67/CH8/EX8.6/example86.sce
new file mode 100755
index 000000000..fa434746b
--- /dev/null
+++ b/67/CH8/EX8.6/example86.sce
@@ -0,0 +1,6 @@
+//Example 8.6
+//Determine the DFT of the following sequence
+clc;
+x=[1,1,2,2,3,3];
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.7/example87.sce b/67/CH8/EX8.7/example87.sce
new file mode 100755
index 000000000..3c9befd72
--- /dev/null
+++ b/67/CH8/EX8.7/example87.sce
@@ -0,0 +1,8 @@
+//Example 8.7
+//DFT of x[n]=a.^n
+clc;
+a=0.5;//Say for a=0.5
+n=0:4;
+x=a.^n;
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.8/example88.sce b/67/CH8/EX8.8/example88.sce
new file mode 100755
index 000000000..1891ea27c
--- /dev/null
+++ b/67/CH8/EX8.8/example88.sce
@@ -0,0 +1,8 @@
+//Example 8.8
+//Compute 4-point DFT of the sequence x[n]=cos(n*pi/4)
+clc;
+n=0:3;
+pi=22/7;
+x=cos(n*pi/4);
+X=fft(x,-1);
+disp(X,'X[k]='); \ No newline at end of file
diff --git a/67/CH8/EX8.9/example89.sce b/67/CH8/EX8.9/example89.sce
new file mode 100755
index 000000000..01f10f784
--- /dev/null
+++ b/67/CH8/EX8.9/example89.sce
@@ -0,0 +1,6 @@
+//Example 8.9
+//Computing IDFT of the following sequence
+clc;
+X=[1,2,3,4];
+x=fft(X,1);
+disp(x,'x[n]='); \ No newline at end of file