Changing Sampling Rates in Discrete Time

This module describes the cases in which the sampling rate applied to a signal can be modified without resorting to reconstruction. This includes downsampling, upsampling, and rational scaling.

Up to this point, we have discussed the connection between continuous-time and discrete-time signals that are captured by the concepts of sampling and reconstruction. In particular cases, we might be interested in observing a signal under a variety of sampling rates. For example, the amount of memory or communication bandwidth available for transmission or storage of a discrete-time signal might fluctuate in time, which may require increasing or decreasing the sampling rate (or sampling period) accordingly.

Naively, if we have sampled the signal sufficiently often to be able to recover it (according to the Nyquist criterion), then we can always return from the discrete-time signal to a continuous-time signal using reconstruction and then sample the signal at the new desired sampling rate.However, there are specific cases where it is possible to modify the sampling rate of the signal without having to switch back to a continuous-time representation. In other words, certain changes of sampling rate can be performed directly on the discrete-time signal. We discuss three specific cases: downsampling, upsampling, and rational scaling.

Consider the case where we start with a sampling frequency ${f}_{s}$ and are asked to reduce the sampling frequency by an integer factor to a new value ${f}_{s}^{\text{'}}=\frac{{f}_{s}}{k}$. When this change is translated to the sampling period $T$ (as ${f}_{s}=1/T$), it is easy to see that the new sampling period ${T}^{\text{'}}=kT$ will be $k$ times larger than its original value. Therefore, the change in sampling frequency can be accounted for by taking the existing discrete signal $x\left[n\right]$ (sampled at frequency ${f}_{s}$) and decimating it by a factor of $k$ to obtain the new signal ${x}^{\text{'}}\left[n\right]=x\left[kn\right]$ “re-sampled” with sampling frequency ${f}_{s}^{\text{'}}$.

We know that for both the old and new sampling frequencies the discrete-time Fourier transform of the sampled signal will correspond to a periodized, frequency-scaled version of the continuous-time signal's Fourier transform ${X}_{CT}\left(f\right)$ where the respective periods/sampling frequencies ${f}_{s}$ and ${f}_{s}^{\text{'}}$ each gets mapped to $\Omega =2\pi $. We now compare how these two discrete-time transforms match to one another:

$$\begin{array}{cc}\hfill X\left(\Omega \right)& =\sum _{n=-\infty}^{\infty}x\left[n\right]{e}^{j\Omega n}={X}_{CT}\left(\frac{\Omega {f}_{s}}{2\pi}\right),\hfill \\ \hfill {X}^{\text{'}}\left(\Omega \right)& =\sum _{n=-\infty}^{\infty}{x}^{\text{'}}\left[n\right]{e}^{j\Omega n}=\sum _{n=-\infty}^{\infty}x\left[kn\right]{e}^{j\Omega n}={X}_{CT}\left(\frac{\Omega {f}_{s}}{k2\pi}\right).\hfill \end{array}$$

By connecting the two equations through the right-most terms, it is easy to see that ${X}^{\text{'}}\left(\Omega \right)=X(\Omega /k)$, i.e., that the downsampling performed “expands” the DTFT of the original signal $x\left[n\right]$. Note, however, that since we are still working with a discrete-time signal ${x}^{\text{'}}\left[n\right]$, the new transform must remain $2\pi $-periodic, and so this expansion occurs for each copy of the spectrum around its “center”, but the copies stay stationary at multiples of $2\pi $.

Note also that this result effectively provides us with a new property for the DTFT: decimation in the time domain corresponds to a “qualified” expansion in the frequency domain, where the expansion is around the center of each copy of the CT spectrum ($\Omega =0,\pm 2\pi ,\pm 4\pi ,...$).

Finally, notice that in downsampling there is the risk that aliasing may occur when the new frequency ${f}_{s}^{\text{'}}$ does not hold the Nyquist frequency criterion (${f}_{s}^{\text{'}}\ge 2{f}_{0}$, where ${f}_{0}$ is the bandwidth of the CT signal). Noticeably, this is the first time that we observe the possibility of aliasing directly in the discrete-time domain. Since aliasing may occur, it is good engineering practice to apply a (discrete-time) anti-aliasing filter to the signal before decimation so that aliasing is prevented. Such a filter will ideally be a perfect low-pass filter with cutoff frequency ${\Omega}_{c}=2\pi /k$. The combination of an anti-aliasing filter and a decimator is known in the community as a donwsampler, as shown below.

Now, consider the case where we start with a sampling frequency ${f}_{s}$ and are asked to increase the sampling frequency by an integer factor to a new value ${f}_{s}^{\text{'}}=k\xb7{f}_{s}$. When this change is translated to the sampling period $T$ (as ${f}_{s}=1/T$), it is easy to see that the new sampling period ${T}^{\text{'}}=T/k$ will be a fraction ($1/k$) of the original sampling period. Therefore, the change in sampling frequency requires the acquisition of new samples in addition to those already available under the old sampling frequency. For this reason, this process is commonly known as up sampling.

While at first sight this may imply a demand to go back to the continuous-time signal, we must recall that samples that are obtained with a sampling frequency greater than the Nyquist frequency contain all information needed to recover the continuous-time signal, and so it should be possible to infer the new samples directly from existing ones (as long as no aliasing has occurred). For this purpose, we will retrieve the concept of an expanded discrete-time signal:

$$\begin{array}{cc}\hfill {x}_{k}\left[n\right]& =\left\{\begin{array}{cc}x[n/k]\hfill & \text{if}\phantom{\rule{5px}{0ex}}n/k\in \mathbb{Z},\hfill \\ 0\hfill & \mathrm{otherwise}.\hfill \end{array}\right.\hfill \end{array}$$

Notice that this signal ${x}_{k}\left[n\right]$ should match the upsampled signal ${x}^{\text{'}}\left[n\right]$ for indices that are multiples of $k$, and our goal is to “fill in” the missing samples in ${x}_{k}\left[n\right]$ currently having value zero. To see how this can be done, we appeal to the DTFT of the expanded signal: recall that the time expansion property of the DTFT gives us that ${X}_{k}\left(\Omega \right)=X\left(k\Omega \right)$, which in practice “compresses” the DTFT in frequency by a factor of $k$ and makes it $2\pi /k$-periodic. In contrast, the DTFT of the upsampled signal would remain $2\pi $-periodic, while simultaneously compressing each copy of the signal's spectrum by a factor of $k$.

This comparison illuminates a method to retrieve the upsampled signal ${x}^{\text{'}}\left[n\right]$ from the expanded signal ${x}_{k}\left[n\right]$: to apply a low-pass filter on the expanded signal ${x}_{k}\left[n\right]$ so that one of the $k$ copies that appear over each $2\pi $-length region of the DTFT is preserved. Such a filter will need a cutoff frequency of ${f}_{c}=\pi /k$. The combination of an expander and a low-pass filter is known as an upsampler, as shown below.

A third case where changes in the sampling frequency can be resolved in the discrete-time domain is when the ratio between the new and old sampling frequencies provides a rational number. That is, ${f}_{s}^{\text{'}}=\frac{a}{b}{f}_{s}$. Intuitively, one can see that such a change can be obtained by combining an upsampling by a factor of $a$ with a downsampling by a factor of $b$. However, the order of these two operations is crucial.

Essentially, if downsampling is applied before upsampling, there is a chance that the downsampling anti-aliasing filter will remove a portion of the signal's spectrum that would alias but would have been “shrunk” into the allowable region during the upsampling, and so the potential for unnecessary distortion is introduced. In contrast, if upsampling is performed before downsampling, the cascade of the two systems will yield a sequence of two low-pass filters, and implementing only the narrower filter would provide the same output as the original cascade. This is illustrated in an example below.

Consider the case where the original sampling frequency ${f}_{s}=15\mathrm{kHz}$, the signal's bandwidth is ${f}_{0}=5\mathrm{kHz}$ (so that the DTFT bandwidth is $\Omega =2\pi (5\mathrm{kHz}/15\mathrm{kHz})=2\pi /3$, and we are interested in resampling to ${f}_{s}=10\mathrm{kHz}$ (i.e., the minimum allowed sampling frequency under the Nyquist criterion). In this case, applying downsampling before upsampling results in the following:

and so only the portion of the signal's spectrum below $2.5\mathrm{kHz}$ ($\pi /3$ in the original spectrum) survives the process. In contrast, applying upsampling before downsampling allows the entire spectrum to go through, effectively meeting the bound given by the Nyquist criterion.