Digital-to-analog conversion produces a staircase-like signal with spectral images at multiples of sampling frequency. Reconstruction filters (lowpass) remove these images, leaving only the baseband signal. Ideal reconstruction requires a sinc filter; practical filters trade transition band sharpness against attenuation of spectral images. The reconstruction filter prevents aliasing during DAC conversion, complementing the anti-aliasing filter on the input side.
Generate sampled sinusoid, convert to analog with zero-order-hold (produces staircase), then filter with lowpass. Observe spectral images are suppressed. Compare different filter orders and corner frequencies.
When your prerequisite — the Nyquist sampling theorem — tells you that a signal sampled at rate f_s can be perfectly reconstructed, it quietly assumes one thing: a perfect lowpass filter will be applied afterward. The reason is what actually comes out of a digital-to-analog converter (DAC). A DAC does not produce a smooth continuous signal. It holds each sample value for one sample period before jumping to the next, producing a staircase waveform also called a zero-order-hold (ZOH) output. While this waveform carries the right information, it is far from the smooth sine wave you started with.
The fundamental problem with the staircase is its frequency content. When you sample a signal at frequency f_s and then reconstruct it, the spectrum is periodic — copies of the original baseband signal appear at every integer multiple of f_s (at f_s, 2f_s, 3f_s, and so on). These copies are called spectral images, and they are real, measurable components in the DAC output. If you want only the original baseband signal, you must remove them. That is precisely the job of the reconstruction filter: a lowpass filter placed after the DAC whose cutoff sits below f_s/2, passing the baseband signal and attenuating all images.
The ideal reconstruction filter is a sinc function in the time domain (a brick-wall lowpass in the frequency domain), which perfectly removes all images with zero distortion to the baseband. In practice, sinc filters require infinite impulse responses and are non-causal — they cannot be built. Real reconstruction filters are approximations: Butterworth, Chebyshev, or elliptic designs that trade a finite transition band (the frequency range between the passband and stopband) for realizable hardware. A wider transition band means some image energy leaks through; a steeper rolloff requires higher filter order and more complexity.
There is a useful symmetry to notice: on the analog-to-digital side, you studied the anti-aliasing filter, which is also a lowpass filter, placed before the ADC to prevent out-of-band signals from folding into the baseband during sampling. The reconstruction filter is its mirror image on the output side. Both are lowpass; both protect the integrity of the baseband signal. The key distinction is location and purpose — the anti-aliasing filter prevents corruption on input, the reconstruction filter removes images on output. Modern DAC chips integrate reconstruction filters internally (often using oversampling to ease the analog filter requirements), which is why many designers never see the staircase explicitly — but it is always there, being filtered away before the output pin.