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.

Changing the sampling frequency by reconstructing and sampling always works, but sometimes it may be possible to do so working only in the discrete-time domain.

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.

Downsampling

Consider the case where we start with a sampling frequency fsfs and are asked to reduce the sampling frequency by an integer factor to a new value fs'=fskfs'=fsk. When this change is translated to the sampling period TT (as fs=1/Tfs=1/T), it is easy to see that the new sampling period T'=kTT'=kT will be kk times larger than its original value. Therefore, the change in sampling frequency can be accounted for by taking the existing discrete signal x[n]x[n] (sampled at frequency fsfs) and decimating it by a factor of kk to obtain the new signal x'[n]=x[kn]x'[n]=x[kn] “re-sampled” with sampling frequency fs'fs'.

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 XCT(f)XCT(f) where the respective periods/sampling frequencies fsfs and fs'fs' each gets mapped to Ω=2πΩ=2π. We now compare how these two discrete-time transforms match to one another:

X ( Ω ) = n = - x [ n ] e j Ω n = X C T Ω f s 2 π , X ' ( Ω ) = n = - x ' [ n ] e j Ω n = n = - x [ k n ] e j Ω n = X C T Ω f s k 2 π . X ( Ω ) = n = - x [ n ] e j Ω n = X C T Ω f s 2 π , X ' ( Ω ) = n = - x ' [ n ] e j Ω n = n = - x [ k n ] e j Ω n = X C T Ω f s k 2 π .

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

The downsampling operation in time, continuous frequency, and discrete frequency.

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 (Ω=0,±2π,±4π,...Ω=0,±2π,±4π,...).

Finally, notice that in downsampling there is the risk that aliasing may occur when the new frequency fs'fs' does not hold the Nyquist frequency criterion (fs'2f0fs'2f0, where f0f0 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 Ωc=2π/kΩc=2π/k. The combination of an anti-aliasing filter and a decimator is known in the community as a donwsampler, as shown below.

A downsampler consists of an anti-aliasing filter and a decimator.

Upsampling

Now, consider the case where we start with a sampling frequency fsfs and are asked to increase the sampling frequency by an integer factor to a new value fs'=k·fsfs'=k·fs. When this change is translated to the sampling period TT (as fs=1/Tfs=1/T), it is easy to see that the new sampling period T'=T/kT'=T/k will be a fraction (1/k1/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:

x k [ n ] = x [ n / k ] if n / k Z , 0 otherwise . x k [ n ] = x [ n / k ] if n / k Z , 0 otherwise .

Notice that this signal xk[n]xk[n] should match the upsampled signal x'[n]x'[n] for indices that are multiples of kk, and our goal is to “fill in” the missing samples in xk[n]xk[n] 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 Xk(Ω)=X(kΩ)Xk(Ω)=X(kΩ), which in practice “compresses” the DTFT in frequency by a factor of kk and makes it 2π/k2π/k-periodic. In contrast, the DTFT of the upsampled signal would remain 2π2π-periodic, while simultaneously compressing each copy of the signal's spectrum by a factor of kk.

The upsampling operation in time, continuous frequency, and discrete frequency.

This comparison illuminates a method to retrieve the upsampled signal x'[n]x'[n] from the expanded signal xk[n]xk[n]: to apply a low-pass filter on the expanded signal xk[n]xk[n] so that one of the kk copies that appear over each 2π2π-length region of the DTFT is preserved. Such a filter will need a cutoff frequency of fc=π/kfc=π/k. The combination of an expander and a low-pass filter is known as an upsampler, as shown below.

An upsampler consists of an expander and a low-pass filter.

Rational Sampling Frequency Scaling

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, fs'=abfsfs'=abfs. Intuitively, one can see that such a change can be obtained by combining an upsampling by a factor of aa with a downsampling by a factor of bb. 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 fs=15 kHz fs=15 kHz , the signal's bandwidth is f0=5 kHz f0=5 kHz (so that the DTFT bandwidth is Ω=2π(5 kHz /15 kHz )=2π/3Ω=2π(5 kHz /15 kHz )=2π/3, and we are interested in resampling to fs=10 kHz fs=10 kHz (i.e., the minimum allowed sampling frequency under the Nyquist criterion). In this case, applying downsampling before upsampling results in the following:

Changing the sampling frequency by downsampling followed by upsampling. The downsampling anti-aliasing filter cut off part of the original spectrum.

and so only the portion of the signal's spectrum below 2.5 kHz 2.5 kHz (π/3π/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.

Changing the sampling frequency by upsampling followed by downsampling. The entire spectrum is preserved through the process, and one of the lowpass filters is redundant.