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 creates a new sequence where every Lth sample is taken from with all others zero. The embedded zeros create aliases in the normalized frequency region (cycles/sample). To remove the aliases (and replace the embedded zeros), the upsampler should be followed by a low-pass filter with cutoff frequency . 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:
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.
Upsampling by rational fraction
Let L/M denote the upsampling factor.
- Upsample by a factor of L
- 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):
When T has units of seconds, has units of hertz. Sampling L times faster (at interval T/L) increases the periodicity by a factor of L:
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 hertz at sample-rate L/T, or (equivalently) a cutoff 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:
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.
The z-transform of the original x[n] sequence is defined by:
- where z is a complex variable.[note 1]
The z-transform of the upsampled sequence is:
The periodicity of is which means the unit circle contains L cycles of the Fourier series.
For comparison with the DTFT (Eq.1), ω = 2π corresponds to And it corresponds to 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 at frequency 1.0 cycles/sample.
- 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 or
- Z transform is denoted by
- DTFT is denoted by or but sometimes or
- Multi-rate digital signal processing
- Sampling (information theory)
- Signal (information theory)
- Data conversion
- Poisson summation formula
- Oppenheim, Alan V.; Ronald W. Schafer, John R. Buck (1999). Discrete-Time Signal Processing (2nd Edition ed.). Prentice Hall. ISBN 0-13-754920-2.
- Digital Audio Resampling Home Page (discusses a technique for bandlimited interpolation)
- Matlab example of using polyphase filters for interpolation