\section{Discrete-Time Processing of Analog Signals (and vice-versa)}
\label{sec:is:dtctproc}
Sampling and interpolation (or, more precisely, the A/D and D/A conversions strategies which we will see in the next chapter) represent the entry and exit points of the powerful processing paradigm for which DSP is ``famous''. Samplers and interpolators represent the only interfaces with the physical world, while all the processing and the analysis are performed in the abstract, a-dimensional world of a general purpose microprocessor. In this section we will see how to use digital filters to process continuous-time signals and then we will study how the continuous-time world can help us shed some light on the inner workings of some of the more ``esoteric'' digital filters in current use.
\subsection{Impulse Invariance}
Consider the hypothetical machine shown in Figure~\ref{fig:is:ctproc}; it reflect the general structure of a device designed to accept and output real-world (i,e. continuous-time) signals while performing the processing digitally. In most cases, the sampler's and the interpolator's frequencies are the same, and they are chosen as a function of the bandwidth of the class of signals for which the device is intended; let us assume that the input is $F_s$-bandlimited and that the sampling period is $T_s$. For the case in which the processing block is a linear filter $H(z)$, the overall processing chain implements the equivalent of a continuous-time filter. Indeed, from~(\ref{eq:is:noAliasingSpecEq}) and~(\ref{eq:is:interpSpec}) we obtain the chain of relations
which corresponds to device acting as a continuous-time filter with frequency response
\begin{equation}\label{eq:is:dtpcts}
H_c(f) = H(e^{j2\pi f/ F_s}).
\end{equation}
So, for instance, if $H(z)$ is a lowpass filter with cutoff frequency $\pi/3$, the processing chain in Figure~\ref{fig:is:ctproc} would implement an
analog lowpass filter with cutoff frequency $F_s /6$. By adjusting the design of the filter (and/or the sampling rate) we can implement any desired characteristic purely in the digital domain.
Consider now the processing chain in Figure~\ref{fig:is:dtproc}; as opposed to the previous case, this is a purely virtual setup that we can use to understand how to perform certain operations that are simple in the continuous-time domain but not straightforward in discrete time. In the processing chain, the interpolator converts a discrete-time input to a continuous-time signal, a filter is applied and finally the result is sampled again. Linear filters cannot increase the bandwidth of a signal, so the rates at interpolator and sampler can safely be the same. Since the timebase $T_s$ can be arbitrary, let's pick $T_s =1$ . With this we can use~(\ref{eq:is:interpSpec}) and~(\ref{eq:is:noAliasingSpecEq}) to write
In other words, the relationship between the discrete-time input and output is the same as the relationship between their continuous-time counterparts, and determined by the characteristics of the continuous-time filter; the overall effect is that of a digital filter with frequency response
We know that a discrete-time delay of $d$ samples is a linear system with transfer function $H(z)= z^{-d}$ (or, alternatively, $H(e^{j\omega})= e^{-j\omega d}$). If $d$ is {\em not} an integer, the transfer function is still formally valid and we have stated in the past that it implements a so-called {\em fractional delay,} i.e.\ a delay which lies ``in between'' two integer delays. The duality framework will allow us to understand exactly how this works.
Remember that in continuous time we can delay a signal by any amount and that the Fourier transform of a delayed signal is
\[
\mbox{FT}\left(x_c(t-d)\right)= e^{-j2\pi d f}X_c(f)
\]
that is, the delay operator can be seen as the result of a continuous-time filter with frequency response $H_c(f)= e^{-j2\pi d f}$. If we use this filter in
Figure~\ref{fig:is:dtproc}, we have that $y_c(t)= x_c(t - d)$ and the same relationship is valid for the associated discrete-time signals. Indeed, the overall transfer function implemented by the system is, according to~\ref{eq:is:dtpcts}
The implicit action of a fractional delay is therefore to ``resample'' the signal at intermediated point between the original sampling instants. We can appreciate this also by considering the impulse response
\[
h[n]=\sinc(n - d);
\]
if we write out the convolution explicitly, we have
which is the original signal, sinc-interpolated with $T_s =1$, and computed in $nT_s-d$.
\itempar{A Digital Differentiator}\index{differentiator!exact}
In Section~\ref{elopsSec} we introduced an approximation to the differentiator operator in discrete time as the first-order difference between neighboring samples. To obtain a better approximation, consider differentiation in continuous time; a classical result in Fourier analysis states that, under very broad conditions, if $x(t)$ is a differentiable function with Fourier transform $X(f)$, then\footnote{This is relatively easy to prove by applying integration by
part to the expression for the Fourier transform of $x'(t)$.}
\[
\textrm{FT}\left(x'(t)\right)= j2\pi f X(f)
\]
The differentiation operation in continuous time acts therefore as a filter with frequency response $H(f)= j2\pi f$. If we use this filter in Figure~\ref{fig:is:dtproc} we obtain the equivalent discrete-time transfer function
\begin{equation}\label{eq:is:diffFR}
H(e^{j\omega}) = j\omega
\end{equation}
which implements a true differentiator in discrete time: this should be interpreted in the sense that the digital differentiator computed the first derivative of the underlying interpolated continuous-time signal, but \textit{without an explicit computation of the latter!} Of course there is no free lunch: the impulse response, which we can compute via an inverse DTFT, is
\begin{equation}\label{eq:is:diffIR}
h[n] = \begin{cases}
0 &\mbox{ for $n=0$}\\
\displaystyle\frac{(-1)^n}{n}&\mbox{ otherwise;}
\end{cases}
\end{equation}
this is an infinite, two-sided sequence, which places the digital differentiator in the category of ideal filters; nevertheless, good FIR approximations can be obtained using the Parks-McClellan algorithm. The filter's characteristics are illustrated in Figure~\ref{fig:is:diffint}.