summaryrefslogtreecommitdiff
path: root/737/CH2/EX2.6/Example2_06.sce
diff options
context:
space:
mode:
Diffstat (limited to '737/CH2/EX2.6/Example2_06.sce')
-rw-r--r--737/CH2/EX2.6/Example2_06.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/737/CH2/EX2.6/Example2_06.sce b/737/CH2/EX2.6/Example2_06.sce
new file mode 100644
index 000000000..5c0298d92
--- /dev/null
+++ b/737/CH2/EX2.6/Example2_06.sce
@@ -0,0 +1,18 @@
+//Example 2.6 page 29
+//Given the DSP system shown in Figure 2.16, where a sampling rate of
+//40,000 Hz is used, the anti-aliasing filter is a Butterworth lowpass filter
+//with a cutoff frequency of 8 kHz, and the percentage of aliasing level at the
+//cutoff frequency is required to be less than 1%, determine the order of
+//the anti-aliasing lowpass filter.
+
+clc,clear,close;
+fs=40000,fc = 8000,fa=8000;//Hz
+aliasing_noise = 100;
+n = 0;
+while(aliasing_noise > 1)
+ n = n+1;
+ aliasing_noise = (1+(fa/fc)^(2*n))^(.5) / (1+((fs-fa)/fc)^(2*n))^(.5) * 100;
+ disp("n = "+string(n)+", Aliasing Noise Level = "+string(aliasing_noise)+"%" )
+end
+
+disp("To satisfy 1% aliasing noise level, we choose n = " +string(n)); \ No newline at end of file