Page MenuHomec4science

30-processing.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 14:20

30-processing.tex

\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
\begin{align*}
X(e^{j\omega}) &= F_s\, X_c\left(\frac{\omega}{2\pi}F_s \right) \\
Y(e^{j\omega}) &= H(e^{j\omega}) \, X(e^{j\omega}) \\
Y_c(f) &= (1/F_s)\,Y(e^{j2\pi f / F_s})
\end{align*}
we have
\begin{equation}\label{eq:is:dtpcts}
Y_c(f) = H(e^{j2\pi f/ F_s})\, X_c(f)
\end{equation}
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.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t!]
\center
\begin{dspBlocks}{1.5}{0.3}
$x_c(t)$~~ & \BDsamplerFramed[0.5em] & \BDfilter{$H(z)$} & \BDsinc[0.5em] & ~~$y_c(t)$ \\
& $T_s$ & & $F_s=1/T_s$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}\taput{$x[n]$}
\ncline{->}{1,3}{1,4}\taput{$y[n]$}
\ncline{->}{1,4}{1,5}
\psset{unit=1em}%\psgrid(40,20)
\psframe[linecolor=red,framearc=.3,linestyle=dashed](4,0.5)(27,8)
\dspText(27.5,0.5){\color{red}~$H_c(f)$}
\end{dspBlocks}
\caption{Using a digital filter to process an analog signal.}\label{fig:is:ctproc}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Understanding Filters by Duality}
\label{sec:is:duality}
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
\begin{align*}
X_c(f) &= X(e^{j2\pi f}) \\
Y_c(f) &= X_c(f)H_c(f) \\
Y(e^{j\omega}) &= Y_c(\omega/(2\pi))
\end{align*}
so that
\begin{equation}\label{eq:is:dtpcts}
Y(e^{j\omega}) = H_c(\omega/(2\pi))\, X(e^{j\omega}).
\end{equation}
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
\[
H(e^{j\omega}) = H_c(\omega/(2\pi)).
\]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t!]
\center
\begin{dspBlocks}{1.5}{0.3}
$x[n]$~~ & \BDsinc[0.5em] & \BDfilter{$H_c(f)$} & \BDsamplerFramed[0.5em] & ~~$y[n]$ \\
& $T_s$ & & $T_s$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}{\taput{$x_c(t)$}}
\ncline{1,3}{1,4}{\taput{$y_c(t)$}}
\ncline{->}{1,4}{1,5}
\psset{unit=1em}%\psgrid(40,20)
\psframe[linecolor=red,framearc=.3,linestyle=dashed](4,0.0)(27,7.5)
\dspText(27.5,0.0){\color{red}~$H(e^{j\omega})$}
\end{dspBlocks}
\caption{Using analog processing to understand a digital filter.}\label{fig:is:dtproc}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\itempar{Fractional Delay.} \index{fractional delay|mie}\index{delay!fractional|mie}
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}
\[
H(e^{j\omega}) = H_c(\omega/(2\pi)) = e^{-j\omega d}.
\]
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
\begin{align*}
y[n] &= x[n] \ast h[n] \\
&= \sum_{k=-\infty}^{\infty} x[k] \,\sinc((n - d) - k)
\end{align*}
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}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[t!]
% smooth DT signal
\def\smooth{ 10 div 360 mul dup sin exch dup 2 mul sin exch dup mul 360 div sin add add 2.2 div 0.2 add }
\def\sinterpolant#1{ \dspSinc{#1}{1} #1 \smooth mul }
\center
\begin{dspPlot}[height=\dspHeightCol,xtype=freq,ylabel={$|H(e^{j\omega})|$}]{-1,1}{0, 1.2}
\dspFunc[linecolor=dspCTFColor]{x abs}
\end{dspPlot}
\begin{dspPlot}[height=\dspHeightCol,xtype=freq,xout=true,yticks=custom,ylabel={$\angle H(e^{j\omega})$}]{-1,1}{-4,4}
\dspFunc[linecolor=dspCTFColor]{x 0 ge {3.14} {-3.14} ifelse}
\dspCustomTicks[axis=y]{-3.14 $-\pi/2$ 3.14 $\pi/2$}
\end{dspPlot}
\vspace{2em}
\begin{dspPlot}[height=\dspHeightCol,xout=true]{-10,10}{-1.2,1.2}
\dspSignal[linecolor=dspDTColor]{x 0 eq {0} {x cvi 2 mod abs -1 exch exp x div} ifelse}
\end{dspPlot}
\caption{Digital differentiator: magnitude (top); phase (center); impulse response (bottom).}\label{fig:is:digdiff}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Event Timeline