summaryrefslogtreecommitdiff
path: root/737/CH2/EX2.4/Example2_04.sce
diff options
context:
space:
mode:
Diffstat (limited to '737/CH2/EX2.4/Example2_04.sce')
-rw-r--r--737/CH2/EX2.4/Example2_04.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/737/CH2/EX2.4/Example2_04.sce b/737/CH2/EX2.4/Example2_04.sce
new file mode 100644
index 000000000..cbf4ee3a1
--- /dev/null
+++ b/737/CH2/EX2.4/Example2_04.sce
@@ -0,0 +1,19 @@
+//Example 2.4 page 27
+//Given the DSP system shown in Figures 2.16 to 2.18, where a sampling rate of 8,000 Hz is used and the anti-aliasing filter is a second-order Butterworth lowpass filter with a cutoff frequency of 3.4 kHz,
+//a. Determine the percentage of aliasing level at the cutoff frequency.
+//b. Determine the percentage of aliasing level at the frequency of 1,000 Hz.
+
+clc,clear,close;
+fs=8000,fc = 3400;//Hz
+n =2;
+
+//part a
+fa = 3400;//Hz, aliasing frequency
+aliasing_noise = (1+(fa/fc)^(2*n))^(.5) / (1+((fs-fa)/fc)^(2*n))^(.5) * 100;
+disp("(a) Aliasing Noise Level = "+string(aliasing_noise)+"%" )
+
+//part b
+fa = 1000;//Hz, aliasing frequency
+aliasing_noise = (1+(fa/fc)^(2*n))^(.5) / (1+((fa-fs)/fc)^(2*n))^(.5) * 100;
+disp("(b) Aliasing Noise Level = "+string(aliasing_noise)+"%" )
+