Multirate DSP and Its Application in D/A Conversion
2022-09-12 08:04:57

This article reviews the basics of D/A conversion and explains how multirate DSP can lead to a more efficient system.

In part one of this series, you can read about this topic for A/D conversion: Multirate DSP and Its Application in A/D Conversion.

The Conceptual Operation of an Ideal DAC

As shown in Figure 1, an ideal D/A converter receives a sequence of quantized values, y(n), and generates a weighted impulse train, ys(t). As the graph of y(n) in Figure 1 implies, y(n) is a discrete sequence of values. We know the value of y(n) for a specific n, but the graph does not provide any information about the sampling rate with which the underlying continuous-time signal was sampled. The D/A stage needs to know the sampling period, T, to produce the impulse corresponding to a particular value of y(n) at the time nT.

Figure 1. The operation of an ideal D/A converter. Image courtesy of Digital Signal Processing.

Suppose that each value of y(n) is represented by m bits, ym1ym2y0, and the converter is a binary-weighted one. Hence, we have

 

ys(nT)=k=0m1yk2kRref


where Rref is a reference voltage, current, or charge. So far, our ideal D/A stage has converted a discrete-time quantized sequence, y(n), into a continuous-time analog signal, ys(t).

Why Do We Need a Reconstruction Filter after a DAC?

ys(t) is equal to the underlying continuous-time signal, yc(t), only at t=nT, and it is zero otherwise. How can we recover the original yc(t) from ys(t)? Assume that y(n) was obtained by sampling the original signal, yc(t), with a sampling period of T. Hence,

 

ys(t)=yc(t)×n=+δ(tnT)

 

In a previous article, we saw how multiplying a continuous-time signal, yc(t), by an impulse train with period T leads to replicas of the spectrum of yc(t) at multiples of 2πT. That’s why ys(t) in Figure 1 contains not only the spectrum of the underlying continuous-time signal but also its replicas at multiples of the sampling frequency. This is illustrated in Figure 2. To recover yc(t), we need to get rid of the high-frequency components. This is achieved by the analog lowpass filter of Figure 1, which is called a reconstruction filter.

Figure 2. Multiplying a signal by an impulse train leads to replicas of the input spectrum at multiples of the sampling frequency Ωs. Image courtesy of Discrete-Time Signal Processing.

To further clarify the requirements of the reconstruction filter, assume that we have utilized a sampling frequency of 2ΩN to sample yc(t), which has all its energy below ΩN, i.e., Yc(jΩ)=0 for |Ω|>ΩN. In this case, we need a sharp reconstruction filter which passes the frequency components up to ΩN and eliminates the unwanted frequency components of Ys(jΩ) just above ΩN. Since this sharp filtering characteristic is not practical, we need to change our design.

For a given Yc(jΩ), if we increase the sampling frequency, the replicas would go to higher frequencies, and the reconstruction filter could have a smoother transition from passband to stopband. For example, assume that yc(t) represents an analog music waveform with energy in the band 0<|Ω|2π<22kHz. If we had sampled yc(t) with a sampling frequency 8 times higher than the Nyquist sampling rate, fs,new=352kHz, then the reconstruction filter would have had a transition band of (ΩsΩN)ΩN=2π×308kHz (see Figure 2). However, it is not efficient to use 352,000 samples per second to represent a signal which has all its energy below 22kHz. For example, this sampling scheme would increase the memory for storing the samples by 8 times compared to a system which uses fs=44kHz. That’s why, even if we have utilized oversampling during A/D conversion, we apply decimation to our digital data to reduce the number of samples.

As a result, y(n) will generally use the smallest possible number of samples to represent a given yc(t). The question is: can we process y(n) in the digital domain and increase the sample rate by interpolating between the existing samples? If we can do this, we can increase the sample rate and thereby achieve the important goal of relaxing the requirements of the reconstruction filter.

Interpolation

We want to digitally increase the sampling rate of y(n), but how? Suppose that we place L1 zero-valued samples between adjacent samples of y(n) (see Figure 3 for L=2).

 

Figure 3. Adding one zero-valued sample between adjacent samples of a discrete-time signal. Image courtesy of IEEE.

Obviously, this increases the sample rate, but the samples that we have added essentially seem to carry no information, because they are not at all related to the existing samples of y(n). However, examining the Fourier transform of the obtained sequence proves to be worthy. Let’s name the new sequence yl(n), then we have yl(n)=y(n/L) when n is a multiple of L and zero otherwise. We obtain the Fourier transform of yl(n) as

 

Yl(ejω)=n=+yl(n)ejnω

 

However, yl(n) is non-zero only when n=kL, where k is an integer. Considering the fact that non-zero values of yl(n) are related to y(n), we obtain

 

Yl(ejω)=k=+yl(kL)ejkLω=k=+y(k)ejkLω=Y(ejLω)

 

The above equation means that the spectrum of yl(n) is the same as that of y(n) except for scaling which needs to be applied to the ω axis. This is illustrated in Figure 4.

Figure 4. The effect of adding L-1 zero-valued samples between adjacent samples of y(n). Image courtesy of IEEE.

Examining the above spectra, we see that it is possible to extract the spectrum of Y(ejω) from that of Yl(ejω). To this end, we only need to apply a sharp low-pass filter with the normalized cutoff frequency of πL to yl(n). This will omit all the frequency components above πL, which are generally referred to as images (see Figure 4). Note that this filter is digital, and we can achieve a sharp magnitude response along with a linear phase response in the digital domain.

While Figure 4 suggests that the ω axis of Yl(ejω) is scaled compared to the spectrum of Y(ejω), there is no frequency scaling if we consider the frequency in terms of cycles per second. We know that f=ω2πT, where T is the sampling period and ω is the normalized frequency. In Figure 4(a), the sampling period is T=1fs, and the point associated with ω=π gives f=fs2. In Figure 4(b), the sampling period is TL and ω=πL corresponds to

 

f=πL2πTL=fs2   

 

Therefore, while the sample rate is increased by L, there is no scaling on the frequency axis if we consider the frequency in terms of cycles per second.

In summary, to increase the sampling rate of a discrete-time sequence y(n), we place L1 zero-valued samples between adjacent samples and apply a lowpass filter with the normalized cutoff frequency of πL to the obtained sequence. This is illustrated in Figure 5.

Figure 5. Upsampling followed by a low-pass filter with a normalized cutoff frequency of πL performs interpolation. Image courtesy of IEEE.

 

Now, let’s go back to the problem of designing an efficient D/A stage.

Interpolation Relaxes the Requirements of the Reconstruction Filter

As discussed above, increasing the sampling rate of y(n) can move replicas of the spectrum of yc(t) to higher frequencies and thereby make the implementation of the analog filter more feasible. Figure 6 shows how we can apply interpolation in the digital domain before the D/A stage.

 

Figure 6. Interpolation prior to the D/A stage. Image courtesy of Digital Signal Processing.

 

As shown in the figure, there are two sample rates in this system, fs and Lfs. The interpolation filter has a cutoff frequency of fs2 and is used to remove the images discussed above. In this way, the requirements for the analog filter are less demanding because it only needs to suppress the very-high-frequency components that are at multiples of Lfs.

Zero-Order Hold at the Output of a Practical D/A Converter

In Figure 1, we assumed that the output of an ideal DAC is an impulse train; however, in practice, it is not possible to generate these narrow pulses. Instead, a practical DAC generally holds the last output value until the next value is generated. This is called zero-order hold and can be represented by placing a sample-and-hold at the output of an ideal DAC (see Figure 7).

 

Figure 7. Practical DACs generally apply zero-order hold to the output values. Image courtesy of Digital Signal Processing.

 

As the figure suggests, the spectrum of ys(t) must be multiplied by the transfer function of the zero-order hold block. It can be shown that the transfer function of zero-order hold is

 

H(jΩ)=thsin(Ωth2)Ωth2

Equation 1

 

where th denotes the hold time, which is generally equal to the sampling period, T=1fs.

Assume that y(n) in Figure 7 corresponds to a continuous-time signal yc(t) that has all its energy below fN=fs2, and that we have obtained y(n) by sampling yc(t) with sampling rate fs. In this case the response of the zero-order hold and the spectrum of ys(t) will be as shown in Figure 8.

Figure 8. The magnitude response of the zero-order hold, H(j2πf), and the spectrum of ys(t). Image courtesy of CMOS Integrated Analog-to-Digital and Digital-to-Analog Converters.

Figure 8 shows that the frequency components of yc(t) that are around fs2 are attenuated much more than the low-frequency components. Examining H(jΩ) at Ω=0 and Ω=2πfs2, we observe that the zero-order hold function exhibits nearly 3.9dB more attenuation for Ω=2πfs2 than for the low-frequency components near Ω=0. This is a well-known amplitude reduction called sin(x)x distortion.

Now, suppose that we apply L-fold interpolation to y(n) and increase the sample rate to fs,new=Lfs. In this case, we have th=1Lfs. What would be the attenuation of H(jΩ) for the high-frequency components of yc(t) around fN=fs2? Substituting the values in Equation 1, we obtain

 

|H(j0)|=th

|H(j2πfs2)|=thsin(π2L)π2L

 

As we use a larger L, sin(π2L)π2L tends toward one and the attenuation of H(jΩ) decreases.

In summary, interpolation not only relaxes the requirements of the reconstruction filter but also makes the sin(x)x distortion less severe.

Summary

  • An ideal D/A converter receives a sequence of quantized values, y(n), and generates a weighted impulse train, ys(t).
  • ys(t) contains not only the spectrum of the underlying continuous-time signal but also its replicas at multiples of the sampling frequency.
  • To recover yc(t), we need to remove the high-frequency components using a reconstruction filter.
  • For a given Yc(jΩ), if we increase the sampling frequency, the replicas would go to higher frequencies, and the reconstruction filter could have a smoother transition from passband to stopband.
  • To increase the sampling rate of a discrete-time sequence, y(n), we place L1 zero-valued samples between adjacent samples and apply a low-pass filter with normalized cutoff frequency of πL to the obtained sequence.
  • In this way, the requirements for the analog filter become much less demanding because it only needs to suppress some very-high-frequency components.
  • Interpolation not only relaxes the requirements of the reconstruction filter but also makes the sin(x)x distortion less severe.

For a more detailed discussion on sin(x)x distortion and a review of methods of reducing it, see CMOS Integrated Analog-to-Digital and Digital-to-Analog Converters and Discrete-Time Signal Processing.