diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /40/CH10/EX10.5a | |
download | Scilab-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/CH10/EX10.5a')
-rwxr-xr-x | 40/CH10/EX10.5a/Exa_10_5a.jpg | bin | 0 -> 18031 bytes | |||
-rwxr-xr-x | 40/CH10/EX10.5a/Exa_10_5a.sce | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/40/CH10/EX10.5a/Exa_10_5a.jpg b/40/CH10/EX10.5a/Exa_10_5a.jpg Binary files differnew file mode 100755 index 000000000..225001878 --- /dev/null +++ b/40/CH10/EX10.5a/Exa_10_5a.jpg diff --git a/40/CH10/EX10.5a/Exa_10_5a.sce b/40/CH10/EX10.5a/Exa_10_5a.sce new file mode 100755 index 000000000..42d0cbf29 --- /dev/null +++ b/40/CH10/EX10.5a/Exa_10_5a.sce @@ -0,0 +1,32 @@ +//Fir low pass filter design by frequency sampling
+z=%z;
+N=10;
+magHk=[1 1 1 0 0 0 0 0 1 1];
+k=[0:7 -1 -2];
+fik=-%pi*k'*(N-1)/N;
+for i=1:length(fik)
+ H1k(i)=magHk(i)*exp(%i*fik(i));
+end
+H1n=(dft(H1k,1));
+H2k=H1k;
+H2k(3)=0.5*%e^(-%i*1.8*%pi);
+H2k(9)=0.5*%e^(%i*1.8*%pi);
+H2n=(dft(H2k,1));
+H1Z=0;H2Z=0;
+for i=1:length(H1n)
+ H1Z=H1Z+H1n(i)*z^(-i);
+end
+for i=1:length(H2n)
+ H2Z=H2Z+H2n(i)*z^(-i);
+end
+F=0:0.01:1;
+F1=0:0.1:0.9;
+H1F=abs(horner(H1Z,exp(%i*2*%pi*F')));
+H2F=abs(horner(H2Z,exp(%i*2*%pi*F')));
+a=gca();
+plot2d(F1,magHk);
+plot2d(F,H2F);
+plot2d(F,H1F);
+xlabel('Digital Frequency F');
+ylabel('magnitude');
+xtitle('Low pass filter using frequency sampling');
\ No newline at end of file |