diff options
Diffstat (limited to '758/CH12/EX12.2/Ex_12_2.sce')
-rwxr-xr-x | 758/CH12/EX12.2/Ex_12_2.sce | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/758/CH12/EX12.2/Ex_12_2.sce b/758/CH12/EX12.2/Ex_12_2.sce new file mode 100755 index 000000000..2bfaf0cf8 --- /dev/null +++ b/758/CH12/EX12.2/Ex_12_2.sce @@ -0,0 +1,23 @@ +//Example 12.2
+clc;clear;close;
+N=8;n=0:N-1;
+f1=0.6;f2=0.62;
+x=cos(2*%pi*f1*n)+cos(2*%pi*f2*n);
+L1=8;
+for k=0:L1-1
+ P1(k+1)=1/N*abs(x*(cos(%pi*n*k/L1)-%i*sin(%pi*n*k/L1))')^2
+end
+L2=16;
+for k=0:L2-1
+ P2(k+1)=1/N*abs(x*(cos(%pi*n*k/L2)-%i*sin(%pi*n*k/L2))')^2;
+end
+L3=32;
+for k=0:L3-1
+ P3(k+1)=1/N*abs(x*(cos(%pi*n*k/L3)-%i*sin(%pi*n*k/L3))')^2;
+end
+subplot(311);
+plot2d3(0:L1-1,P1);title('L=8');
+subplot(312);
+plot2d3(0:L2-1,P2);title('L=16');
+subplot(313);
+plot2d3(0:L3-1,P3);title('L=32');
\ No newline at end of file |