summaryrefslogtreecommitdiff
path: root/2303/CH10/EX10.5/10_5.sce
diff options
context:
space:
mode:
Diffstat (limited to '2303/CH10/EX10.5/10_5.sce')
-rwxr-xr-x2303/CH10/EX10.5/10_5.sce35
1 files changed, 35 insertions, 0 deletions
diff --git a/2303/CH10/EX10.5/10_5.sce b/2303/CH10/EX10.5/10_5.sce
new file mode 100755
index 000000000..4a4cb41da
--- /dev/null
+++ b/2303/CH10/EX10.5/10_5.sce
@@ -0,0 +1,35 @@
+//Example 10.5
+
+clc;
+clear;
+close;
+
+fs1=64000; //original signal sampling frequency
+fs2=2048000; //new sampling frequency
+df=32; //decimation factor of filter
+fp=30000; //pass band edge frequency
+fs=32000; //stop band edge freqeucny
+tw=2000; //transition width
+pbdev=0.01; //pass band deviation in decibel
+sbatt=80; //stop band attenuation in decibe
+
+//Calculating delta-f
+df=tw/fs2;
+//Ca;culating passband and stop band deviations
+dp=10^(pbdev/20)-1;
+ds=10^-(sbatt/20);
+
+//filter coefficients required for order of filter
+a1=0.005309;
+a2=0.07114;
+a3=-0.4761;
+a4=-0.00266;
+a5=-0.5941;
+a6=-0.4278;
+
+D={log10(ds)*[a1*log10(dp^2)+a2*[log10(dp)]+a3]}+[a4*log10(dp^2)+a5*[log10(dp)]+a6];
+f=11.01217+0.51244*(log10(dp)-log10(ds));
+N=ceil(D/df-f+1);
+disp(N,"Order of filter is ");
+
+disp(N*fs2,"Number of multiplications required is: ")