summaryrefslogtreecommitdiff
path: root/737/CH2/EX2.9/Example2_09.sce
diff options
context:
space:
mode:
Diffstat (limited to '737/CH2/EX2.9/Example2_09.sce')
-rw-r--r--737/CH2/EX2.9/Example2_09.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/737/CH2/EX2.9/Example2_09.sce b/737/CH2/EX2.9/Example2_09.sce
new file mode 100644
index 000000000..41ebc3c03
--- /dev/null
+++ b/737/CH2/EX2.9/Example2_09.sce
@@ -0,0 +1,23 @@
+//Example 2.9 Page 39
+//Assuming that a 3-bit ADC channel accepts analog input ranging from 0 to 5
+//volts, determine the following:
+//a. number of quantization levels
+//b. step size of the quantizer or resolution
+//c. quantization level when the analog voltage is 3.2 volts
+
+clc,clear,close;
+xmin = 0, xmax = 5;//volts
+m = 3;//bits
+
+L = 2^m;
+disp("L = "+string(L)+" bits");
+
+delta = (xmax-xmin)/L;
+disp("delta = "+string(delta)+" volts");
+
+x = 3.2*delta/6.25
+i = round((x-xmin)/delta);
+disp("i= "+string(i)+" volts");
+
+xq = xmin+5*delta;
+disp("xq= "+string(xq)+" volts");