# Upsampling

Upsampling is the process of increasing the sampling rate of a signal. For instance, upsampling images such as photographs means increasing the resolution of the image.

The upsampling factor (commonly denoted by L) is usually an integer or a rational fraction greater than unity. This factor multiplies the sampling rate or, equivalently, divides the sampling period. For example, if compact disc audio is upsampled by a factor of 5/4 then the resulting sampling rate goes from 44,100 Hz to 55,125 Hz.

## Upsampling by integer factor

Upsampling a sequence $\scriptstyle x[n]$ creates a new sequence where every Lth sample is taken from $\scriptstyle x[n]$ with all others zero. The embedded zeros create $\scriptstyle L-1$ aliases in the normalized frequency region $\scriptstyle [0.5/L,\ 1-0.5/L]$ (cycles/sample). To remove the aliases (and replace the embedded zeros), the upsampler should be followed by a low-pass filter with cutoff frequency $\scriptstyle 0.5/L$. In this application, such an anti-aliasing filter is referred to as an interpolation filter and the combined process of upsampling and filtering is called interpolation. Depending on the frequency content, a realizable filter may not be able to attenuate the first alias to an imperceptable level, and the result will be some perceptible distortion.

The process described above, includes the embedded zeros in its calculations. When the interpolation filter is an FIR type, its efficiency can be improved, because the zeros contribute nothing to its dot product calculations. It is an easy matter to omit them from both the data stream and the calculations. The calculation performed by an efficient interpolating FIR filter for each output sample is a dot product:

$y[j+nL] = \sum_{k=0}^{K/L-1} x[n-k]\cdot h[j+kL],\ \ j = 0,1,...L-1,$

where the h[•] sequence is the impulse response, and K is its length. Impulse response coefficients taken at intervals of L form a subsequence, and there are L such subsequences (called phases) multiplexed together. Each of L phases of the impulse response is filtering the same sequential values of the x[•] data stream and producing one of L sequential output values. In some multi-processor architectures, these dot products are performed simultaneously, in which case it is called a polyphase filter.

For completeness, we now mention that a possible implementation of each phase is to replace the coefficients of the other phases with zeros in a copy of the h[•] array, and process the upsampled x[•] sequence at L times faster than the original input rate. L-1 of every L outputs are zero, and the real values are supplied by the other phases. Adding them all together produces the desired y[•] sequence. Adding a zero is equivalent to discarding it. The equivalence of computing and discarding L-1 zeros to computing just every Lth output is known as the second Noble identity.[1]

## Upsampling by rational fraction

Let L/M denote the upsampling factor.

1. Upsample by a factor of L
2. Downsample by a factor of M

Note that upsampling requires an interpolation filter after increasing the data rate and that downsampling requires a filter before decimation. These two filters can be combined into a single filter. Since both interpolation and anti-aliasing filters are low-pass filters, the filter with the smallest bandwidth is more restrictive and, thus, can be used in place of both filters. Since the rational fraction L/M is greater than unity when M < L, the single low-pass filter should have cutoff at 0.5/L cycles per intermediate sample, the Nyquist frequency of the input sample rate.

## Discrete-time Fourier transform (DTFT)

Let X(f) be the Fourier transform of any function, x(t), whose samples at some interval, T, equal the x[n] sequence. Then the DTFT of the x[n] sequence is the Fourier series representation of a periodic summation of X(f):

$\underbrace{ \sum_{n=-\infty}^{\infty} \overbrace{x(nT)}^{x[n]}\ e^{-i 2\pi f nT} }_{\text{DTFT}} = \frac{1}{T}\sum_{k=-\infty}^{\infty} X(f-k/T).$

(Eq.1)

When T has units of seconds, $\scriptstyle f$ has units of hertz. Sampling L times faster (at interval T/L) increases the periodicity by a factor of L:

$\frac{L}{T}\sum_{k=-\infty}^{\infty} X\left(f-k\cdot \frac{L}{T}\right),$

(Eq.2)

which is also the desired result of interpolation. But when the additional samples are inserted zeros, the DTFT is still Eq.1. Converting Eq.1 into an approximation of Eq.2 requires a lowpass filter with cutoff frequency  $< \tfrac{0.5}{T}$  hertz at sample-rate L/T, or (equivalently) a cutoff  $< \tfrac{0.5}{L}$  at normalized frequency 1.0 cycles/sample.

Alternatively, the sample-rate can be presumed to be held constant, meaning that the zeros are inserted at intervals of T, and the interval between original samples is LT. The resulting Fourier series is:

$\sum_{n=-\infty}^{\infty} x(nT)\ e^{-i 2\pi f nLT} = \frac{1}{T}\sum_{k=-\infty}^{\infty} X(fL-k/T) = \frac{1}{T}\sum_{k=-\infty}^{\infty} X\left(\tfrac{f-k/LT}{1/L}\right) ,$

(Eq.3)

where the first equivalence follows by comparison to Eq.1. Both the periodicity and bandwidth are reduced by the same factor (1/L). But at sample-rate 1/T, the desired periodicity is 1/T. Only the terms corresponding to integer values of k/L are desired. So again, the purpose of the interpolation filter is to reduce the terms, 1 ≤ k < L to an acceptable level of distortion. The 1/L factor doesn't change the ratio of cutoff frequency and periodicity, so the required interpolation filter does not change.

## Z-Transform

The z-transform of the original x[n] sequence is defined by:

$X(z)\ \stackrel{\mathrm{def}}{=} \sum_{n=-\infty}^{\infty} x[n]\ z^{-n},$   where z is a complex variable.[note 1]

On the unit circle, z is constrained to values of the form  $e^{i \omega}.$  Then one cycle of  $X(e^{i \omega}), \ \scriptstyle -\pi \ \le \ \omega \ \le \ \pi$  is identical to one period  $\left(\scriptstyle -\frac{0.5}{T} \ \le \ f \ \le \ \frac{0.5}{T}\right)$  of Eq.1.

The z-transform of the upsampled sequence is:

$X_L(z) = \sum_{n=-\infty}^{\infty} x[n]\ z^{-nL} = X(z^L) = X(e^{i\omega L}).$

The periodicity of  $e^{i \omega L}$  is  $\scriptstyle 2\pi/L,$  which means the unit circle  $\scriptstyle (-\pi \ \le \ \omega \ \le \ \pi)$  contains L cycles of the Fourier series.

For comparison with the DTFT (Eq.1),  ω = 2π corresponds to $\scriptstyle f=L/T.$  And it corresponds to $\scriptstyle f=1/T$  in the other Fourier series (Eq.3). As in those cases, an interpolation filter is needed to preserve one cycle and reduce the others. In z-transform units, the required filter has a cutoff frequency < π/L at frequency 2π (radians/sample), which is equivalent to a cutoff  $< \tfrac{0.5}{L}$  at frequency 1.0 cycles/sample.

## Notes

1. ^ In a discussion involving multiple types of transforms, it is a common practice to distinguish them on the basis of their arguments, rather than the function name.
• Fourier transform is denoted by  $X(f)$  or  $X(\omega).$
• Z transform is denoted by  $X(z).$
• DTFT is denoted by  $X(e^{i \omega})$  or  $X(e^{i 2\pi fT}),$  but sometimes  $X_{2\pi}(\omega)$  or  $X_{1/T}(f).$

## Citations

1. ^ [Gilbert]; Nguyen, Truong (1996-10-01). Wavelets and Filter Banks (2 ed.). Wellesley,MA: Wellesley-Cambridge Press. pp. 100–101. ISBN 0961408871.