summaryrefslogtreecommitdiff
path: root/737/CH2/EX2.7/Example2_07.sce
diff options
context:
space:
mode:
Diffstat (limited to '737/CH2/EX2.7/Example2_07.sce')
-rw-r--r--737/CH2/EX2.7/Example2_07.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/737/CH2/EX2.7/Example2_07.sce b/737/CH2/EX2.7/Example2_07.sce
new file mode 100644
index 000000000..384f58fb3
--- /dev/null
+++ b/737/CH2/EX2.7/Example2_07.sce
@@ -0,0 +1,19 @@
+//Example 2.7 page 31
+//Given a DSP system with a sampling rate of 8,000 Hz and a hold circuit used
+//after DAC,
+//a. Determine the percentage of distortion at the frequency of 3,400 Hz.
+//b. Determine the percentage of distortion at the frequency of 1,000 Hz.
+clc,clear,close;
+fs = 8000;
+T = 1/fs;
+//part a
+fa = 3400;
+x = fa*T;
+distortion = (1 - sin(x*%pi)/(x*%pi)) * 100;
+disp("(a) distortion % = " + string(distortion) + "%");
+
+//part b
+fb = 1000;
+x = fb*T;
+distortion = (1 - sin(x*%pi)/(x*%pi)) * 100;
+disp("(b) distortion % = " + string(distortion) + "%"); \ No newline at end of file