From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 737/CH2/EX2.7/Example2_07.sce | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 737/CH2/EX2.7/Example2_07.sce (limited to '737/CH2/EX2.7/Example2_07.sce') 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 -- cgit