brief tutorial on how sample rate conversion improves the quality of digital-to-analog conversion. Ideal Digital-to-Analog Conversion. Have a look at the system ...
How Discrete Signal Interpolation Improves Digital-to-Analog Conversion Richard Lyons
We encounter the process of digital-to-analog conversion every day— not just in our home audio systems, but also in telephone calls (land lines and cell phones), telephone answering machines, CD & DVD players, iPhones, digital television, MP3 players, digital radio, and even talking greeting cards. This is a brief tutorial on how sample rate conversion improves the quality of digital-to-analog conversion.
Ideal Digital-to-Analog Conversion Have a look at the system shown in Figure 1(a). There I show a hardware depiction of a digital-toanalog converter (DAC)—a hardware device having multiple input pins that accept multibit binary words. In that figure the variable x(n) represents a sequence of binary words showing their individual binary bits from the least significant bit (LSB) to the most significant bit (MSB). In Figure 1(b) I show a hypothetical time-domain sequence of x(n) amplitude values, which we’ll call “samples”, where each sample is represented as a single black dot. We refer to the x(n) signal as a discrete, or“digital”, sequence. The variable n is referred to as the “time-domain index” of the discrete x(n) input signal. Critical to its operation, the DAC accepts a periodic-in-time, pulse-like, signal shown as fclk in Figure 1(a). The repetition rate, the frequency, of the fclk signal is the reciprocal of the time period between individual x(n) samples. The fclk signal, synchronized with the binary x(n) input sequence, triggers the DAC to ‘clock in’ the bits of the current x(n) sample. Finally, the DAC has a single output pin upon which is riding an analog (what the digital signal processing experts call “continuous”) voltage that we’ll call vDAC(t). The variable t in vDAC(t) represents time measured in seconds. Given the x(n) input sequence shown in Figure 1(b), we wish to generate the analog videal(t) signal shown in Figure 1(c) whose frequency-domain spectrum is depicted in Figure 1(d). In our frequency plots we only show the positive-frequency axis because we assume all signals are real-valued and all spectra are symmetrical and centered at zero Hz.
1
Voltage
Binary bits, x(n)
MSB LSB videal (t)
0
fclk
Analog voltage vDAC (t)
Digital to Analog Converter (DAC)
Amplitude
Richard Lyons
0
(a)
Ideal analog DAC output
(c)
x(n)
Videal (f) t
0 B
Binary DAC input
(b)
1/fclk
n
Ideal analog DAC output spectrum (d)
fclk
Freq (Hz)
Figure 1
The Nyquist Criterion In this discussion, if the highest-frequency spectral component of x(n), and therefore videal(t), is B Hz, we’re assuming that the fclk sample rate is greater than 2B Hz. That condition is the famous Nyquist criterion stipulating the periodic sampling condition required for error-free sampling (analog-todigital conversion) of analog signals. As a historical note, the notion of periodic sampling was studied by various engineers, scientists, and mathematicians such as the Russian V. Kotelnikov, the Swedishborn H. Nyquist, the Scottish E. Whittaker, and the Japanese I. Someya1. But it was the American mathematician Claude Shannon, acknowledging the work of others, who mathematically formalized the concept of periodic sampling as we know it today, named it in honor of the great American electrical engineer Harry Nyquist, and brought it to the broad attention of the world’s communications en-
Claude Shannon 1
2
Harry Nyquist
Luke, H. “The Origins of the Sampling Theorem,” IEEE Communications Magazine, April 1999, pp. 106–109.
How Discrete Signal Interpolation Improves Digital-to-Analog Conversion
gineers2. That was in 1948—the birth year of the transistor, marshmallows, and this author. OK, back to Figure 1. Unfortunately, commercially-available DACs will not produce our desired videal(t) output voltage based on the x(n) input sequence. So, given that apparently bad news, let’s now think about some hypothetical, and actual, DAC output signals and their spectra.
Some Hypothetical DAC Output Signals
Voltage
If we could build a DAC whose output voltage was a periodic series of super-narrow (widths measured in picoseconds) analog pulses as shown in Figure 2(a), whose amplitudes are equal the to amplitudes of x(n), the spectrum of such analog pulses would be the repetitive pattern shown in Figure 2(b).
0
Spectrum of the pulsed DAC output
Hypothetical pulsed analog DAC output 0B
t
(a)
1/fclk
fclk
Lowpass filter freq magnitude response 0B
fclk
(c)
2fclk
3fclk
...
Freq (Hz)
(b)
2fclk
3fclk
...
Freq (Hz)
Lowpass filter output spectrum 0 B
fclk
(d)
Freq (Hz)
Figure 2
Figure 2 illustrates one of the relationships between the time- and frequency-domain representations of a signal: if a time signal has periodic amplitude variations, such as the periodically-spaced pulses in Figure 2(a), its spectrum will be periodic. If our time signal’s super-narrow pulses are separated by 1/fclk seconds, the repetitive spectral energy will be separated by fclk Hz as shown in Figure 2(b). Now if we passed the analog pulsed signal in Figure 2(a) through an analog lowpass filter, whose frequency magnitude response is shown by the dashed lines in Figure 2(c), we’d produce our desired Figure 1(c) videal(t) signal having the spectrum shown in Figure 2(d). As straightforward as all of this seems to be, as it turns out, the electronics needed to generate the super-narrow Figure 2(a) pulses is prohibitively expensive, on the order of the cost of a new Harley Davidson Sportster motorcycle. This is far too costly to include in any telephone, music, or television product. Thankfully, DAC man2
Shannon, C. “A Mathematical Theory of Communication,” Bell Sys. Tech. Journal, Vol. 27, 1948, pp. 379–423, 623–656.
3
Richard Lyons
ufacturers have a far more affordable way of generating our desired videal(t) signal. Thinking again about Figure 1, we can view the discrete x(n) sample values in Figure 1(b) as being amplitude samples of our desired videal(t) analog signal in Figure 1(c). What we want is an interpolated version of x(n). But not merely two or four or ten new samples between each original x(n) sample, we seek an infinite number of samples between each original x(n) sample. We want so many new samples that our interpolated signal is continuous (analog). It’s not traditional interpolation we desire; we wish to perform interpolation on steroids. This notion of interpolation is not unusual. Some signal processing experts refer to the DAC process itself as interpolation3. Thinking about our idea of interpolation, it would be nice if we could build a DAC whose output voltage was that shown by the solid curve in Figure 3(a). As it turns out, that solid curve in Figure 3(a) is not a curve at all –it’s a series of straight lines connecting the x(n) sample values shown by the shaded dots. Let’s zoom in and think about the first bold-line segment of that curve as shown in Figure 3(b). To generate the voltage segment between the x(0) and x(1) amplitude values we’d have to electronically evaluate the following expression: v1st(t) = x(0) + [x(0) – x(1)]t, for 0 ≤ t < 1.
(1)
Equation (1) is a first-order (first-order in terms of t) polynomial, and that’s why the v1st(t) curve comprising the connected straight lines is called a “first-order hold” waveform. (The process of generating the v1st(t) waveform, based on the x(n) samples, is called “curve fitting” by signal processing folk). As with the hypothetical voltage in Figure 2(a), the electronic components needed to generate v1st(t) would be prohibitively expensive for our DAC applications. Let’s now review the less-expensive method for generating our desired videal(t) signal developed by commercial DAC designers.
Amplitude
v1st(t) (first-order hold waveform)
(b)
0
Amplitude
(a)
0
t
v1st,0