So far we have discussed continuous-time signals and their spectral characterization & discrete-time signals and their characterizations. But what connects the two?
Before analyzing this let us re-iterate a key result that affects the analysis.
The Fourier transform of a periodic continuous time impulse train is also a impulse train!
Let our continutous-time impulse train be: \[s(t) = \sum_{n = -\infty}^{\infty} \delta(t - nT)\]
Since this is periodic it has a Foruier series representation
\[s(t) = \sum_{k = -\infty}^{\infty} a_k e^{\frac{j2 \pi k t}{T}}\] where \[a_k = \frac{1}{2 \pi} \int_{-\frac{T}{2}}^{\frac{T}{2}} s(t) e^{-\frac{j2 \pi k t}{T}}dt\] Since there's only one impulse between $-\frac{T}{2}$ & $\frac{T}{2}$ we can write: \[ \begin{align*} a_k &= \frac{1}{T} \int_{-\frac{T}{2}}^{\frac{T}{2}} s(t) e^{-\frac{j2 \pi k t}{T}}dt \\ &= \frac{1}{T} e^{-\frac{j2 \pi k 0}{T}} \\ &=\frac{1}{T} \end{align*} \]So the Fourier series representation of the impulse train is: \[s(t) = \sum_{n = -\infty}^{\infty} \delta(t - nT) = \frac{1}{T} \sum_{k = -\infty}^{\infty} e^{\frac{j 2 \pi k t}{T}}\] \[ \begin{align*} S(\omega) &= FT \cdot \sum_{n = -\infty}^{\infty} \delta(t - nT) \\ &= FT \cdot \sum_{k = -\infty}^{\infty} e^{\frac{j 2 ]pi k t}{T}} \\ &= \frac{1}{T} \sum_{k = -\infty}^{\infty} FT \cdot e^{\frac{j 2 \pi k t}{T}} \\ &= \frac{1}{T} \sum_{k = -\infty}^{\infty}2 \pi \delta(\omega - \frac{2 \pi k}{T}) \end{align*} \] \[\sum_{n = -\infty}^{\infty} \delta(t - nT) \leftrightarrow \frac{2 \pi}{T} \sum_{k = -\infty}^{\infty} \delta(\omega - \frac{2 \pi k}{T})\]
Let us now consider how we can convert a continuous time signal $x(t)$ to a discrete time sginal $x[n]$ \[x(t) \leftrightarrow x[n]\]
Ideally our conversion process should be such that:
The simplest way to derive an $x[n]$ from an $x(t)$ is for the DT signal $x[n]$ to simply be a series of uniformly spaced snapshots of $x(t)$
However naively taking snapshots is insufficient. The reason for this is that the series $x[n]$ does not carry any information about what happens between the snapshots.
For us to be able to recover $x(t)$ uniquely from $x[n]$, there are conditions on $x(t)$ & the spacing "T" between snapshots.
So now we shall:
Lets begin
Thus, $x(t)$ can be recovered from $x[n]$ if it can be recovered from $x_T(t)$
The FT of $x_T(t)$ is given by: \[ \begin{align*} X_T(\omega) &= FT \cdot x(t) \sum_{n = -\infty}^{\infty} \delta(t - nT) \\ &= X(\omega) \ast \frac{2 \pi}{T} \sum_{k = -\infty}^{\infty} \delta(\omega - \frac{2 \pi k}{T}) \\ \end{align*} \] \[X_T(\omega) = \frac{1}{T} \sum_{k = -\infty}^{\infty} X(\omega - \frac{2 \pi k}{T})\]
$X_T(\omega)$ is simply the superpsotion of copies of $X(\omega)$ shifted by multiple of $\frac{2 \pi}{T}$
For this to work, however the condition is that the frequency shifted versions of $X(\omega)$ should not have overlaps.
In the overlap areas $X_T(\omega)$ cannot be resolved into the individual shifted copies of $X(\omega)$. So $X(\omega)$ can never be recovered.
So the criterion to recover $X(\omega)$ from $X_T(\omega)$ (and thereby $x(t)$ from $x_T(t)$, & as a consequence from $x[n]$) is that copies of X(\omega) that are shifted by $\frac{2 \pi}{T}$ must not overlap.
This has two implications:
In other words, it $\omega_{max}$ is the highest frequency in $x(t)$,
$\frac{2 \pi}{T} > 2 \omega_{max}$
Sampling frequency $\frac{1}{T} > 2 f_{max}$
The sampling frequency must be greater than twice the largest frequency in the signal.
This leads us to the famous "Nyquist sampling theorem" named after Nyquist who discover it in 1928.
*Note* Let $x(t)$ be a bandlimited signals with $X(\omega) = 0$ for $|\omega| \geq \omega_max$ Then $x(t)$ is uniquely determined by its sample $x[n] = x(nT), n = 0, \pm 1, \pm 2, ...$ if $\frac{2 \pi}{T} \geq \omega_{max}$ or alternately if the sampling frequency is greater than the highest frequency in the singal x(t).
So to get $x(t)$ from $x[n]$
Note that $h(t)$ is non-causal. We cannot practically get $x(t)$ from $x[n]$ in this manner. We will revist practical implementations shortly.
For $X_T(\omega)$:
\[ \begin{align*} X_T(\omega) &= \frac{1}{2 \pi} \int_{-\infty}^{\infty} x_T(t) e^{- \omega t}dt \\ &= \frac{1}{2 \pi} \int_{-\infty}^{\infty} \sum_n x(nT) \delta(t - nT) e^{-j \omega t}dt \\ &= \frac{1}{2 \pi} \sum_n x(nT) \int_{-\infty}^{\infty} \delta(n - nT) e^{-j \omega t}dt \\ Since x(nT) = x[n] &= \frac{1}{2 \pi} \sum_{n = -\infty}^{\infty}x[n] \int_{-\infty}^{\infty} \delta(t - nT)e^{-j \omega t}dt \end{align*} \] \[X_T(\omega) = \frac{1}{2 \pi} \sum_{n = -\infty}^{\infty}x[n]e^{-j \omega nT}\]For $X(\Omega)$:
\[X(\Omega) = \sum_{n = -\infty}^{\infty} x[n] e^{-j \Omega n}\] Comparing $X_T(\omega)$ & $X(\Omega)$ we note that:$X(\Omega) = X_T(\omega T)$
So the correspondence btween the discrete time frequency $\Omega$ and the continuous time frequency $\omega$ is given by: \[\omega T = \Omega\] The relation between teh DTFT of $x[n]$ & teh CTFT of $x_T(t)$ (and thereby $x(t)$) is given by: \[X(\Omega) = X_T(\omega T) = \sum_{k = -\infty}^{\infty}X (\omega T - \frac{2 \pi k}{T})\] Both sides are periodic - $X(\Omega)$ is periodic with $2 \pi$, $X_T(\omega T)$ is periodic with $\frac{2 \pi}{T}$
Note that $\omega T$ has dimension radians, which is the same as the dimension of $\Omega$
What if $x(t)$ is not bandlimited?
What is $T > \frac{\pi}{\omega_{max}}$
To understand this we must consider the recovery process first.
The recovered signal is obtained by creating $x_T(t)$ from $x[n]$ & then low-pass filtering $x_T(t)$
Let us represent a lowpass filter as $LPF_{\omega_c}(\omega)$ or $LPF_{\omega_c}(t)$
$LPF_{\omega_c}(\omega)$ = 1 $|\omega| \leq \omega_c$, 0 otherwise.
The recovered signal $x_r(t)$ is obtained as: \[x_r(t) = X_T(t) \ast LPF_{\omega_c}(t) \] \[ \begin{align*} X_r(\omega) &= X_T(\omega) \cdot LPF_{\frac{\pi}{T}}(\omega) \\ &=(\sum_{k = -\infty}^{\infty} X(\omega - \frac{2 \pi k}{T})) \cdot LPF_{\frac{\pi}{T}}(\omega) \end{align*} \] Ideally $x_r(t) = x(t)$, i.e. the recovery is perfect. or $X_r(\omega) = X(\omega)$ \[X(\omega - \frac{2 \pi k}{T}) \cdot LPF_{\frac{\pi}{T}}(\omega) = 0 for k \neq 0\] If this condition is not satisifed, "alaising happens.
Instead of getting $x_r(t) = x(t)$ we get: \[x_r(t) = IDFT \sum_{k = -\infty}^{\infty}X(\omega - \frac{2 \pi k}{T}) LPF_{\frac{\pi}{T}}(\omega)\] Since $X(\omega - \frac{2 \pi k}{T}) \leftrightarrow x(t)e^{j \frac{2 \pi k t}{T}}$ \[ \begin{align*} x_r(t) &= \sum_{k = -\infty}^{\infty} IDFT (X(\omega - \frac{2 \pi k}{T}) LPF_{\frac{\pi}{T}}(\omega)) \\ &= x(t)LPF_{\frac{\pi}{T}}(t) + \sum_{k = 1}^{\infty}x(t)e^{\frac{j 2 \pi k t}{T}} \ast LPF_{\frac{\pi}{T}}(\omega) + \sum_{k = 1}^{\infty}x(t)e^{-\frac{j 2 \pi k t}{T}} \ast LPF_{\frac{\pi}{T}}(\omega) \\ &= x(t)LPF_{\frac{\pi}{T}}(t) \sum_{k = 1}^{\infty} (x(t) (e^{\frac{j 2 \pi k t}{T}} + e^{-\frac{j2 \pi k t}{T}})) \ast LPF_{\frac{\pi}{T}}(\omega) \\ &= x(t)LPF_{\frac{\pi}{T}}(t) + 2 \sum_{k = -\infty}^{\infty} (x(t)cos \frac{2 \pi k t}{T}) \ast LPF_{\frac{\pi}{T}}(\omega) \end{align*} \]
The recovered signal is the original signal LPFed PLUS a lot of junk.
The equation unfortunately doesn't explain what really happens.
Consider the following example: \[x(t) = cos (\omega_o t)\] Let sample period T b such that $\frac{\pi}{T} < \omega_o$. For illustration we will assume $\frac{\pi}{T} < \omega_o \leq \frac{2 \pi}{T}$
The cosine is "undersampled" -- the sampling frequencing $\frac{2 \pi}{T}$ is less than the minimum $2 \omega_o$ prescribed by Nyquist's theorem.
For \[x(t) = cos(\omega_o)t\] \[X(\omega) = \frac{1}{2} (\delta(\omega - \omega_o) + \delta(\omega + \omega_o))\] \[ \begin{align*} X_T(\omega) &= \frac{1}{T} \sum_k X(\omega - \frac{2 \pi k}{T}) \\ &=\frac{1}{T} (\delta(\omega - \omega_o - \frac{2 \pi k}{T}) + \delta(\omega + \omega_o - \frac{2 \pi k}{T})) \end{align*} \] \[X_r(\omega) = frac{1}{T} (\delta(\omega - (\frac{2 \pi}{T} - \omega_o)) + \delta(\omega + (\frac{2 \pi}{T}) - \omega_o))\] \[x_r(t) = cos(\frac{2 \pi}{T} - \omega_o)\] So $x(t) \neq x_r(t)$
More importantly a frequency component $\omega_o$ reappears in the reconstructed signal as a frequency component $\frac{2 \pi}{T} - \omega_o$
Now lets consider the practical issues of sampling.
We have been speaking so far in terms of impulse trains: \[x(t) \rightarrow x_T(t) \rightarrow x[n]\] \[x[n] \rightarrow x_T(t) \rightarrow x(t)\]
For smapling, our model was that the CT signal $x(t)$ was multiplied by an impulse train, and then measured.
For resynthesis, we assume $x[n]$ can modulate an impulse train which is then filtered.
In practice impulse trains are only a theoretical concept. We will implement things a bit differently, and this has some implications.
SamplingSampling is done by an analogy-to-digital (or continuous to discrete) convertor.
For a 1-D signal this is performed using a circuit that can sample & hold a value
$x_h(t)$ -- the "held" signal can then be measured. The measured value is the $x[n]$ associated with the instant of the step.
Various variants of the above exist. But all of them can give an accurate measurement of $x[n].$
RecoveryLet us now consider the recovery process. The theoretical model: has two problems
A more practical mechanism is the zero-order hold.
Instead of modulating an impulse train $x[n]$ modulates a rectangular pulse train. The rectangular pulse has the form: \[ rect_T(t) = \begin{cases} 1, & 0 \leq t < T \\ 0, & else \end{cases} \]
The reconstructed signal: \[ \begin{align*} x_{ZOH}(t) &= \sum_n x[n]rect_T(t - nT) \\ &= \sum_n x(nT) rect_T(t - nT) \end{align*} \] Like $x_T(t)$, $x_{ZOH}(t)$ must be filtered to recover $x(t)$. To find out what the filter must be we must analyze $x_{ZOH}(t)$.
We can model $x_{ZOH}(t)$ as the output of a linear shift-invariant filter with impulse response $rect_T(t)$
Proof
\[ \begin{align*} x_{ZOH}(t) &= x_2(t) \ast rect_T(t) \\ &= \sum_n x(nT) \delta(t - nT) \ast rect_T(t) \\ &= \sum_n x(nT) rect_T(t - nT) \end{align*} \] \[ \begin{align*} \therefore X_{ZOH}(\omega) &= X_T(\omega) Rect_T(\omega) \\ &= \sum_k X(\omega - \frac{2 \pi k}{T}) Rect_T(\omega) \end{align*} \] \[ \begin{align*} Rect_T(\omega) &= FT \cdot rect_T(t) \\ &= e^{-\frac{j \omega T}{2}} \frac{sin(\omega \frac{T}{2})}{\pi \omega} \end{align*} \] \[X_{ZOH}(\omega) = \sum_k X(\omega - \frac{2 \pi k}{T}) \frac{sin(\frac{\omega T}{2})}{\pi \omega}e^{-\frac{j \omega k}{T}}\]$x_{ZOH}(\omega)$ has extraneous frequency components and the "main lobe" is distorted
To fix this we need a "de-distorting" filter that also filters out extraneous frequencies.
The filter must have the characteristics $Filt(\omega) - 0, |\omega| > \frac{\pi}{T}$ That way: \[ \begin{align*} x_{ZOH}(\omega) Filt(\omega) &= \\ &= \sum_k X(\omega - \frac{2 \pi k}{T})Rect(\omega)Filt(\omega) \\ &= X(\omega) Rect(\omega) Filt(\omega) \end{align*} \] Because $Filt(\omega) = 0, |\omega| > \frac{\pi}{T}$
To eliminate $Rect(\omega)$ we want: \[Filt(\omega) = \frac{1}{Rect_T(\omega)}, |\omega| < \frac{\pi}{T}\] So if we set \[ Filt(\omega) = \begin{cases} \frac{1}{Rect_t(\omega)}, & |\omega| < \frac{2 \pi}{T} \\ 0, & else \end{cases} \] I.e. \[Filt(\omega) = \begin{cases} \frac{e^{\frac{j \omega T}{2}}}{|\frac{sin(\frac{\omega T}{2})}{\pi \omega}|} , & |\omega| < \frac{\pi}{T} \\ 0, & else \end{cases} \]
\[X_r(\omega) = X_{ZOH}(\omega) Filt(\omega) = X(\omega)\]However the exact impulse response of $filt(t)$ will be non-causal and must be approximated with a causal filter. We will see how later.
The ZOH reconstruction is pretty crude, needing a fance filter to "correct" its errors.
A better system is teh "first order hold". The FOH is a linear interoplation.
The FOH is not perfect either and must be filtered als. As it turns out, the first order hold canbe modelled exactly as filtering $x_T(t)$ by a linear filter with impulse response $h_{FOH}(t)$
So we find: \[X_{FOH}(\omega) = X_T(\omega) H_{FOH(\omega)}\] \[\text{But } h_{FOH}(t) = \frac{1}{T} rect_T(t) \ast rect_T(t)\] \[H_rect(\omega) = \frac{1}{T} [Rect_T(\omega)]^2\]
Note that the lobes beyond $\frac{2 \pi}{T}$ are much suppressed with respect to $rect_T(\omega)$ & even between $\frac{\pi}{T}$ and $\frac{2 \pi}{T}$ there is more attenuation.
So $X_{FOH}(\omega) = \frac{1}{T} X_T(\omega) Rect_T^2 (\omega)$
We still need to correct this by filtering out high frequency components and cancelling out the shaping introduced by the FOH
And now we want: \[Filt(\omega) = \begin{cases} \frac{T}{rect_T^2(\omega)}, & |\omega| \leq \frac{\pi}{T} \\ 0, & else \end{cases} \]
This too is a non-causal filter, but as you may imagine causual approximation will introduce less error.