# DAC and sample and hold effect

I am having some trouble understanding how a digital signal gets converted back to an analog signal.

Why is the "sample and hold" effect a problem?

• Have you looked at some DAC hardware architectures? What is it exactly that you don't understand? The sample and hold effect is a problem because it gives a signal with high frequency harmonics that one might not want to be there... – pichenettes Dec 14 '13 at 18:56

so the sampling theorem says basically:

let $\ x[n] \triangleq x(nT) \$ where $\ f_s = 1/T \$ is the sampling frequency.

then $x(t)$ can be reconstructed from the samples $x[n]$ using

$$x(t) \ = \ \sum_{n=-\infty}^{\infty} x[n] \cdot \mathrm{sinc} \left(\frac{t-nT}{T} \right) \$$

which is what you get when you pass this ideally sampled signal

$$T \sum_{n=-\infty}^{\infty} x[n] \cdot \delta(t-nT) \$$

through an ideal brickwall low-pass filter with cutoff at $f_s/2$ and a passband gain of 1.

but what comes out of a DAC is not that, but is this:

$$\sum_{n=-\infty}^{\infty} x[n] \cdot \mathrm{rect} \left(\frac{t-T/2 -nT}{T} \right) \$$

so it's like the DAC has a hypothetical filter with impulse response of

$$h(t) \ = \ \frac{1}{T} \mathrm{rect} \left(\frac{t}{T}-\frac{1}{2} \right) = \begin{cases} \frac{1}{T} & \mbox{if } 0 \le t < T \\ 0 & \mbox{otherwise} \end{cases} \$$

so the "sample-and-hold effect" really should be called the "zero-order hold effect" and what the effect is, is to pass your signal through a filter with the above impulse response and this transfer function:

$$H(s) \ = \ \frac{1 - e^{-sT}}{sT} \$$

and this frequency response:

$$H(j 2 \pi f) \ = \ e^{-j \pi f T} \mathrm{sinc}(f T) \$$

now, these equations came out of the wikipedia references, which is why i suggested to look there first.