FIG. 1: This graphic shows successive approximation as exemplified by a balance scale. An object of unknown weight is compared with a series of weights of decreasing value.
It seems we will never be rid of the analog-versus-digital debate. Far from a debate, really, it usually amounts to little more than hand-wringing over how perfect audio used to be before a horde of ones and zeros came along and ruined everything. You've heard it all before — no DAW will ever sound as good as tape; no virtual instrument will ever sound as fat as a real analog synth; and computers are eating our brains.
The reality for those who live in the here and now is that analog and digital audio are inexorably linked. The physical world is analog, so all audio must be analog by the time it reaches our ears. Virtually all audio distribution, however, is digital. The most critical step in audio production is getting the signal back and forth between the two domains. This article will explore the conversion of audio from analog to digital and back.
The classic method of converting analog voltage to PCM digital audio is called successive approximation, which compares the input voltage with a series of progressively smaller reference voltages. Each time that the input exceeds the reference, a one is recorded; otherwise, a zero is recorded. Sixteen iterations are required to construct a 16-bit sample word. This is the same technique that you used in middle-school science class to weigh objects using a balance scale (see Fig. 1).
FIG. 2: Quantization noise is distributed evenly from 0 Hz to the Nyquist frequency. Oversampling A/D conversion raises the Nyquist frequency, reducing the level of quantization noise in the audio band. Noise shaping tilts the distribution further into the ultrasonic band.
Classic D/A conversion uses a ladder series of resistors of differing values. By switching them on in various combinations, the appropriate output voltage is achieved. Think of a series of lightbulbs of assorted intensities being switched on in different combinations to achieve varying levels of illumination, and you've got the idea.
These methods correspond directly to the PCM samples, with a stage of approximation or a value of resistor for each bit of the sample word. Various implementation challenges, however, have led developers to look for alternative conversion methods. One of the biggest challenges is the requirement for brickwall filters to prevent aliasing on input and imaging on output. Designing a sufficiently steep filter that does not distort within the audio band is difficult, to say the least. A second major challenge is achieving the required precision of the largest reference voltage in the A/D converter. The tiniest variation renders the smallest reference stage irrelevant.
From Many, One
Modern A/D converters more often start by taking one-bit samples at a rate that is many times higher than the nominal sampling rate. The bitstream is then digitally converted to PCM data at the appropriate bit depth and sampling rate. Similar principles are applied to D/A conversion. In a perfect world, the difference between the two approaches would be negligible, but one-bit design is generally considered to give a more practical combination of quality and cost. The most common one-bit design is called a sigma-delta converter. In math-speak, sigma means sum and delta means difference, and a sigma-delta converter compares the input voltage with the sum of the previous input samples. If the input is larger than the reference, a one is recorded; otherwise, a zero is recorded. Because only one comparison is made for each word, rather than 16 or 24, there is no concern about how accurately the device can hold the input voltage through a series of comparisons. Additionally, the problem of precision relative to smaller approximation stages is not a concern when there is only one stage.
The simplicity of a sigma-delta converter allows it to run at much higher sampling rates. Capturing more samples than are required by the nominal sampling rate is called oversampling. Less information is contained in each sample, but there are many more samples. If multibit samples are like film, in which each frame contains a detailed picture and a modest number of frames are displayed per second, then sigma-delta conversion is like laser animation, in which the position of a single point of light is updated so quickly that our eyes perceive solid lines and complex graphics.
Oversampling raises the Nyquist frequency, thereby relaxing the requirements of the input filter. If sampling takes place at 64 times the nominal sampling rate of 44.1 kHz, frequencies as high as 1.4 MHz can be captured without aliasing. A moderate and extremely well-behaved analog lowpass filter is sufficient to prevent foldover.
FIG. 3: The stair-step effect is the squaring off of the output waveform, inducing undesired high-frequency components. Oversampling D/A conversion creates smaller stair steps, effectively shifting the undesired frequencies into a range where they are more easily filtered.
Although quantization error is quite large in a one-bit system, oversampling reduces quantization noise within the audio band. Quantization noise is always spread uniformly from 0 Hz to the half-sampling (Nyquist) frequency. By raising the half-sampling frequency, oversampling moves most of the noise beyond the range of our ears (see Fig. 2; note that the sampling rate is referred to as Fs, and the half-sampling rate is Fs/2).
In order to reduce the quantization noise further, noise shaping is applied. As the captured samples are fed back to be compared with the input voltage, low-level noise called dither is applied to randomize its pattern. The feedback loop of dithered quantization noise being added to the input signal increases the total noise, but it shifts the spectrum of the noise so that it is more prominent at the Nyquist frequency and reduced in the audio band, as shown in Fig. 2.
Once the one-bit data has been captured, a decimation filter converts it to a standard PCM representation. At the same time, it lowpass-filters frequencies above the Nyquist frequency of the output sampling rate. This also removes the ultrasonic quantization noise. Although this is still a very steep filter, it is easier to implement in the digital domain, alleviating the distortions within the audio band characteristic of an analog brickwall input filter.
The steep output filter found in all D/A converters is also known as an anti-imaging filter. During each sample period, the converter emits a constant voltage that results in a squared-off wave (see Fig. 3). This is known as the stair-step effect. Just as the corners of a square wave when viewed on an oscilloscope represent the wave's overtones, the stair-step edges of the output wave constitute undesirable multiples of the actual signal. These images of the signal occur near integer multiples of the sample frequency and extend as low as the Nyquist frequency. The output filter is sometimes called a smoothing filter because it removes these corner frequencies and leaves only the continuous waveform of the intended signal.
Like the input filter, the output filter must be extraordinarily steep, creating severe design problems in the analog domain. Oversampling D/A converters raises the effective sampling rate by interpolating new samples between the existing samples. That pushes the image spectra high enough that lower-order (less steep) filters can adequately remove them without distorting the audio band.
As with the successive approximation A/D converter, a classical ladder D/A converter requires extreme precision from the largest-value resistor to keep from nullifying the action of the lowest-value resistor. One-bit D/A conversion alleviates this worry by requiring a single capacitor that is charged for a one and discharged for a zero. The multibit PCM stream is converted to a one-bit stream that is then filtered to produce the output signal.
The relatively simple design of one-bit oversampling A/D and D/A converters makes them attractive for reasons of cost and quality. Indeed, the shortest path between analog and digital is often a single bit.
Brian Smithers is Course Director of Audio Workstations at Full Sail Real World Education in Winter Park, Florida. His latest book is Mixing in Pro Tools: Skill Pack (Thomson Learning, 2006).