Digital to Analog Conversion
The digital-to-analog converter (DAC) does the reverse of the ADC: it takes a binary number and produces a corresponding analog voltage. Every time your transceiver plays received audio through a speaker, a DAC converts the stream of digital samples from the DSP chip back into an analog audio signal. Every software-defined radio that can transmit generates its RF signal (or baseband IQ signal) using a DAC. Understanding how DACs work explains the limitations you will encounter in SDR transmitters and audio systems.
A 4-bit R-2R ladder DAC. Only two resistor values (R and 2R) are needed regardless of bit count. Each binary input switches its 2R resistor between Vref and ground.
View LargerThe DAC Concept
A DAC takes an N-bit binary input code and produces an analog output voltage proportional to that code. The output voltage ranges from 0 V (or −Vref for bipolar designs) when the input code is all zeros, to Vref (or +Vref) when the input code is all ones.
The relationship is linear: if the input code doubles, so does the output voltage. The step size is the same as the ADC: Vref / 2N. An N-bit DAC with reference voltage Vref produces one of 2N possible output voltages, each separated by one step size.
Vout = (D / 2N) × Vref
Where D is the decimal value of the binary input code, N is the bit depth, and Vref is the full-scale reference voltage.
Binary-Weighted DAC
The simplest DAC concept is the binary-weighted (or weighted resistor) DAC. Each bit in the binary input controls a switch that connects a resistor to a summing amplifier. The resistors are weighted so that each one contributes a current proportional to the bit's binary weight: the LSB resistor is the largest (contributing the least current), and the MSB resistor is the smallest (contributing the most).
For a 4-bit binary-weighted DAC with Vref = 5 V and a base resistor of R:
- Bit 3 (MSB, weight 8): resistor = R → current contribution = Vref/R
- Bit 2 (weight 4): resistor = 2R
- Bit 1 (weight 2): resistor = 4R
- Bit 0 (LSB, weight 1): resistor = 8R → smallest current contribution
The problem with binary-weighted DACs is that they require a wide range of precisely matched resistors. For a 12-bit DAC, the MSB resistor and LSB resistor must differ by a factor of 2,048. Manufacturing resistors to high accuracy across such a wide range is impractical, so binary-weighted DACs are only used for low-resolution applications (4–6 bits). The R-2R ladder solves this problem.
The R-2R Ladder DAC
The R-2R ladder is an elegant solution that requires only two resistor values — R and 2R — regardless of the number of bits. The circuit forms a ladder-shaped network: 2R resistors connect each bit's switch node to the ladder, and R resistors connect the nodes horizontally in series.
The clever property of the R-2R ladder is that looking into any node of the ladder, the Thevenin equivalent resistance is always exactly R. This means each bit's 2R switch resistor sees the same load, and the contribution of each bit is proportional to its binary weight, just like a binary-weighted DAC but using only 2R and R values. You can extend the ladder to any number of bits simply by adding another R-2R rung at the LSB end.
Because only two resistor values are needed, they can be matched to high precision on a single integrated circuit substrate. This is why virtually every precision DAC chip — from the PCM5102 audio DAC in a Raspberry Pi to the AD9744 RF DAC in an SDR transmitter — uses an R-2R ladder internally.
Calculating DAC Output Voltage
Vout = (170 / 256) × 5 V = 0.664 × 5 V = 3.32 V
Step size = 5 / 256 = 19.5 mV per step
The output voltage for code 170 is 3.32 V.
Vout = (2048 / 4096) × 3.3 V = 0.5 × 3.3 V = 1.65 V
Step size = 3.3 / 4096 = 0.806 mV per step
A 12-bit DAC with 3.3 V reference produces steps of about 0.8 mV — fine enough for high-quality audio.
Settling Time and Glitches
When the input code changes, the DAC output does not instantly jump to the new voltage. The output takes a finite time to settle to within a specified accuracy of the final value. This is called the settling time. Typical DAC settling times range from a few nanoseconds for fast video DACs to several microseconds for precision audio DACs. For audio applications, settling time is rarely a problem because the output is sampled at audio frequencies (44 kHz) and the DAC is fast enough to settle between samples. For RF DACs operating at hundreds of MSPS, settling time directly limits the output frequency.
Glitches are brief voltage spikes that occur as the input code transitions. The worst glitch happens at the code midpoint (0111...1 to 1000...0), where many bits change simultaneously. Because the bits do not all switch at exactly the same instant, there is a brief moment when the code is neither the old value nor the new value — this produces a transient spike at the output. Glitch energy is measured in nV·s (nanovolt-seconds). Glitch energy is important in audio DACs because glitches create distortion and intermodulation products. Modern IC DACs include deglitching circuits (sample-and-hold stages between the DAC core and output) to minimize this problem.
Reconstruction Filtering
A DAC's output is inherently a staircase waveform — it holds each value until the next code is loaded. This staircase shape contains the desired signal plus high-frequency image components at multiples of the sample rate. A low-pass filter at the DAC output — called the reconstruction filter or anti-imaging filter — removes these high-frequency images and smooths the staircase into a clean continuous waveform.
Without a reconstruction filter, the high-frequency images would appear in the output spectrum. This is the output-side equivalent of the aliasing problem in ADCs. The reconstruction filter in an audio DAC typically rolls off steeply above 20 kHz (for audio at 44.1 kHz sample rate). In SDR transmitters, the reconstruction filter must pass the desired signal band while rejecting images at sample_rate ± signal_frequency.
DACs in Ham Radio
Audio output. The received audio in every digital transceiver and SDR flows through a DAC. After the DSP chain processes the demodulated audio (noise reduction, AGC, bandpass filtering), the audio samples are loaded into an audio DAC (typically 16-bit or 24-bit delta-sigma type). The DAC output is filtered and amplified to drive a speaker or headphones.
SDR transmitters. An SDR transmitter generates its baseband IQ signal using two DACs (one for the I channel, one for the Q channel). The DAC output is then mixed with a local oscillator to produce the desired RF carrier. The sample rate of the DAC and its reconstruction filter set the maximum transmittable bandwidth. High-end SDR transmit systems like the PlutoSDR use 12-bit RF DACs operating at hundreds of MSPS, allowing direct synthesis of signals up to several hundred MHz.
CW waveform shaping. A sudden on/off CW keying waveform has a hard edge that creates wide bandwidth sidebands (key clicks). Modern transceivers use a DAC to shape the rise and fall envelope of the CW waveform with a cosine taper, reducing key click bandwidth and improving spectral purity. The shaping waveform is stored as a lookup table of digital values; the DAC converts these into the analog envelope signal that modulates the transmitter.
AGC voltage generation. Some AGC circuits use a DAC to generate a precise DC voltage to control an analog variable-gain amplifier. The DSP measures the received signal strength, calculates the correct gain setting, and programs the DAC to output the corresponding control voltage. This gives much more precise gain control than an analog AGC circuit because the DAC's output is directly programmable to any value in its range.
Frequently Asked Questions
Why do some DACs have poor sound at low volume levels?
At low volume levels the audio signal uses only the lower-order bits of the DAC. Imperfections in those lower bits — non-linearity, noise, unequal step sizes — become more audible relative to the signal level. High-quality audio DACs maintain linearity down to very low bit levels through careful design and calibration. Applying a small amount of random noise (dither) before the DAC can actually improve perceived audio quality at low levels by decorrelating the quantization error from the signal — this is why many recording engineers apply dither before saving a 16-bit audio file.
What is the difference between a DAC and a PWM output?
A true DAC produces a direct voltage proportional to the digital code. A PWM (Pulse Width Modulation) output rapidly switches between 0 V and Vref with a duty cycle proportional to the desired output value. After low-pass filtering the PWM output, you get an average DC voltage that approximates the DAC function. PWM DACs are cheap (any microcontroller can generate PWM) but have limited bandwidth and substantial ripple. They are used for LED brightness control and coarse analog output, not for audio or RF signal generation.
Test Your Knowledge
Answer the questions below to check your understanding. Every answer can be found in the lesson above.