The purpose of this exercise is to give you some practice with the variables involved in storing physical-world stimuli as digital information. These variables include transducers, analog/digital and digital/analog conversion, quantization, and encoding.
Similarly, a loudspeaker or earphone is a transducer that converts analog voltages into sound waves.
The exact format of the binary information that comes out of an a/d converter differs from device to device. For now, think as the a/d converter as a black box with one wire that brings the analog voltage into it and with n wires coming out of it, which continuously carry voltages representing binary ones and zeros. The converter discriminates among 2n voltage levels on the input wires, and always outputs the appropriate n-bit number representing the present input voltage.
For Example: Assume an A/D converter is designed to handle analog voltages that vary between -1.0 and +1.0 volts and that it has two wires for the binary outputs. This means that it would differentiate among four different input voltage levels as follows:
Analog voltage in | Binary number out |
---|---|
-1.0 to -0.5 | 0 0 |
-0.5 to 0.0 | 0 1 |
0.0 to +0.5 | 1 0 |
+0.5 to +1.0 | 1 1 |
Although both the input and outputs of an A/D converter are electrical voltages, the input voltage varies continuously in time, whereas the voltages of the output wires always have just one of two different values, one of which represents a binary zero and the other of which represents a binary one.
In this diagram, the waveform on the right is only a crude approximation of the original analog signal, on the left. This exercise deals with the parameters that affect how well the waveform coming out of the D/A converter approximates the one going into the A/D converter.
The time axis is divided by a process called sampling: The output of the A/D converter is recorded at periodic intervals. The time between samples is called the sampling interval, and its reciprocal (the number of samples per second) is called the sampling frequency or rate. The higher the sampling rate, the finer-grained the quantization, and the more accurately temporal changes in the input signal can be recorded.
The granularity of the voltage axis depends on the number of bits that the A/D converter uses to encode voltages. In the example given above, the A/D converter had two output wires, giving 22 = 4 voltage ranges for the quantization granularity. The more bits output by the A/D converter, the smaller the quantization granularity, and the more accurately the signal's intensity can be approximated.
Sampling Rate | Bits per Sample |
---|---|
4 KHz | 2 |
4 KHz | 4 |
4 KHz | 8 |
8 KHz | 4 |
16 KHz | 8 |
Construct the table for one complete cycle of the sine wave. You can write a program or a spreadsheet to generate the tables, if you like.
Draw a diagram showing the encoded waveform (like the right side of the diagram above) for each row of the table. Be sure to label both the X and Y axes to show the scale for each graph. You may generate these diagrams by hand on graph paper, using a spreadsheet, or by writing a Java program to draw the graphs.