Before Artikel : Transmitting digital data with discrete analog signals
D. Transmitting analog data with digital signals
It is often necessary to transmit analog data over a digital medium. For example, many scientific laboratories have testing equipment that generates test results as analog data. This analog data is converted to digital signals so that the original data can be transmitted through a computer system and eventually stored in memory or on a magnetic disk. A music recording company that creates a CD also converts analog data to digital signals. An artist performs a song that produces music, which is analog data. A device then converts this analog data to digital data so that the binary 1s and 0s of the digitized music can be stored, edited, and eventually recorded on a CD. When the CD is used, a person inserts the disc into a CD player that converts the binary 1s and 0s back to analog music. Let us look at the two techniques for converting analog data to digital signals.
1. Pulse Code Modulation
One encoding technique that converts analog data to a digital signal is pulse code modulation (PCM). Hardware—specifically, a codec—converts the analog data to a digital signal by tracking the analog waveform and taking “snapshots” of the analog data at fixed intervals. Taking a snapshot involves calculating the height, or voltage, of the analog waveform above a given threshold. This height, which is an analog value, is converted to an equivalent fixed-sized binary value. This binary value can then be transmitted by means of a digital encoding format. Tracking an analog waveform and converting it to pulses that represent the wave’s height above (or below) a threshold is termed pulse amplitude modulation (PAM). The term “pulse code modulation” actually applies to the conversion of these individual pulses into binary values. For the sake of brevity, however, we will refer to the entire process simply as pulse code modulation.
Figure 2-21 shows an example of pulse code modulation. At time t (on the x-axis), a snapshot of the analog waveform is taken, resulting in the decimal value 14 (on the y-axis). The 14 is converted to a 5-bit binary value (such as 01110) by the codec and transmitted to a device for storage. In Figure 2-21, the y-axis is divided into 32 gradations, or quantization levels. (Note that the values on the y-axis run from 0 to 31, corresponding to 32 divisions.) Because there are 32 quantization levels, each snapshot generates a 5-bit value (25 = 32).
What happens if the snapshot value falls between 13 and 14? If it is closer to 14, we would approximate and select 14. If closer to 13, we would approximate and select 13. Either way, our approximation would introduce an error into the encoding because we did not encode the exact value of the waveform. This type of error is called quantization error, or quantization noise, and causes the regenerated analog data to differ from the original analog data. To reduce this type of quantization error, we could have tuned the y-axis more finely by dividing it into 64 (i.e., double the number of) quantization levels. As always, we do not get something for nothing. This extra precision would have required the hardware to be more precise, and it would have generated a larger bit value for each sample (because 64 quantization levels requires a 6-bit value, or 26 = 64). Continuing with the encoding of the waveform in Figure 2-21, we see that at time 2t, the codec takes a second snapshot. The voltage of the waveform here is found to have a decimal value of 6, and so this 6 is converted to a second 5-bit binary value and stored. The encoding process continues in this way—with the codec taking snapshots, converting the voltage values (also known as PAM values) to binary form, and storing them—for the length of the waveform.
To reconstruct the original analog waveform from the stored digital values, special hardware converts each n-bit binary value back to decimal and generates an electric pulse of appropriate magnitude (height). With a continuous incoming stream of converted values, a waveform close to the original can be reconstructed, as shown in Figure 2-22.
Sometimes this reconstructed waveform is not a good reproduction of the original. What can be done to increase the accuracy of the reproduced waveform? As we have already seen, we might be able to increase the number of quantization levels on the y-axis. Also, the closer the snapshots are taken to one another (the smaller the time intervals between snapshots, or the finer the resolution), the more accurate the reconstructed waveform will be. Figure 2-23 shows a reconstruction that is closer to the original analog waveform. Once again, however, you do not get something for nothing. To take the snapshots at shorter time intervals, the codec must be of high enough quality to track the incoming signal quickly and perform the necessary conversions. And the more snapshots taken per second, the more binary data generated per second. The frequency at which the snapshots are taken is called the sampling rate. If the codec takes samples at an unnecessarily high sampling rate, it will expend much energy for little gain in the resolution of the waveform’s reconstruction. More often codec systems generate too few samples—use a low sampling rate—which reconstructs a waveform that is not an accurate reproduction of the original.
To reconstruct the original analog waveform from the stored digital values, special hardware converts each n-bit binary value back to decimal and generates an electric pulse of appropriate magnitude (height). With a continuous incoming stream of converted values, a waveform close to the original can be reconstructed, as shown in Figure 2-22.
Sometimes this reconstructed waveform is not a good reproduction of the original. What can be done to increase the accuracy of the reproduced waveform? As we have already seen, we might be able to increase the number of quantization levels on the y-axis. Also, the closer the snapshots are taken to one another (the smaller the time intervals between snapshots, or the finer the resolution), the more accurate the reconstructed waveform will be. Figure 2-23 shows a reconstruction that is closer to the original analog waveform. Once again, however, you do not get something for nothing. To take the snapshots at shorter time intervals, the codec must be of high enough quality to track the incoming signal quickly and perform the necessary conversions. And the more snapshots taken per second, the more binary data generated per second. The frequency at which the snapshots are taken is called the sampling rate. If the codec takes samples at an unnecessarily high sampling rate, it will expend much energy for little gain in the resolution of the waveform’s reconstruction. More often codec systems generate too few samples—use a low sampling rate—which reconstructs a waveform that is not an accurate reproduction of the original.
What then is the optimal balance between too high a sampling rate and toolow? According to a famous communications theorem created by Nyquist, the sampling rate using pulse code modulation must be at least twice the highest frequency of the original analog waveform to ensure a reasonable reproduction. Using the telephone system as an example and assuming that the highest possible voice frequency is 3400 Hz, the sampling rate should be at least 6800 samples per second to ensure reasonable reproduction of the analog waveform. The telephone system actually allocates a 4000-Hz channel for a voice signal, and thus samples at 8000 times per second.
Two problems are inherent with delta modulation. If the analog waveform rises or drops too quickly, the codec may not be able to keep up with the change, and slope overload noise results. What if a device is trying to digitize a voice or
music that maintains a constant frequency and amplitude, like one person singing one note at a steady volume? Analog waveforms that do not change at all present the other problem for delta modulation. Because the codec outputs a 1 or a 0 only for a rise or a fall, respectively, a nonchanging waveform generates a pattern of 1010101010…, thus generating quantizing noise. Figure 2-24 demonstrates delta modulation and shows both slope overload noise and quantizing noise.
2. Delta Modulation
A second method of analog data-to-digital signal conversion is delta modulation. Figure 2-24 shows an example. With delta modulation, a codec tracks the incoming analog data by assessing up or down “steps.” During each time period, the codec determines whether the waveform has risen one delta step or dropped one delta step. If the waveform rises one delta step, a 1 is transmitted. If the waveform drops one delta step, a 0 is transmitted. With this encoding technique, only 1 bit per sample is generated. Thus, the conversion from analog to digital using delta modulation is quicker than with pulse code modulation, in which each analog value is first converted to a PAM value, and then the PAM value is converted to binary.Two problems are inherent with delta modulation. If the analog waveform rises or drops too quickly, the codec may not be able to keep up with the change, and slope overload noise results. What if a device is trying to digitize a voice or
music that maintains a constant frequency and amplitude, like one person singing one note at a steady volume? Analog waveforms that do not change at all present the other problem for delta modulation. Because the codec outputs a 1 or a 0 only for a rise or a fall, respectively, a nonchanging waveform generates a pattern of 1010101010…, thus generating quantizing noise. Figure 2-24 demonstrates delta modulation and shows both slope overload noise and quantizing noise.
No comments:
Post a Comment