diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /737/CH2/EX2.7/Example2_07.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '737/CH2/EX2.7/Example2_07.sce')
-rw-r--r-- | 737/CH2/EX2.7/Example2_07.sce | 19 |
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 |