Upsampling

From testwiki
Revision as of 22:55, 27 June 2024 by imported>Bob K (References: add some author-links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description In digital signal processing, upsampling, expansion, and interpolation are terms associated with the process of resampling in a multi-rate digital signal processing system. Upsampling can be synonymous with expansion, or it can describe an entire process of expansion and filtering (interpolation).[1][2][3] When upsampling is performed on a sequence of samples of a signal or other continuous function, it produces an approximation of the sequence that would have been obtained by sampling the signal at a higher rate (or density, as in the case of a photograph). For example, if compact disc audio at 44,100 samples/second is upsampled by a factor of 5/4, the resulting sample-rate is 55,125.

Fig 1: Depiction of one dot product, resulting in one output sample (in green), for the case L=4, n=9, j=3. Three conceptual "inserted zeros" are depicted between each pair of input samples. Omitting them from the calculation is what distinguishes a multirate filter from a monorate filter.

Upsampling by an integer factor

Rate increase by an integer factor L can be explained as a 2-step process, with an equivalent implementation that is more efficient:[4]

  1. Expansion: Create a sequence, xL[n], comprising the original samples, x[n], separated by L1 zeros.  A notation for this operation is:  xL[n]=x[n]L.
  2. Interpolation: Smooth out the discontinuities using a lowpass filter, which replaces the zeros.

In this application, the filter is called an interpolation filter, and its design is discussed below. 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 a multirate interpolating FIR filter for each output sample is a dot product:Template:Efn-la

where the h sequence is the impulse response of the interpolation filter, and K is the largest value of k for which h[j+kL] is non-zero. Template:Collapse top The interpolation filter output sequence is defined by a convolution:

y[m]=r=xL[mr]h[r]

The only terms for which xL[mr] can be non-zero are those for which mr is an integer multiple of L.  Thus: mr=mLLkL  for integer values of k,  and the convolution can be rewritten as:

y[m]=k=xL[mLLkL]h[mmLL+kLr]=k=x[mLk]h[mmLL+kL]m  j+nLy[j+nL]=k=0Kx[nk]h[j+kL],  j=0,1,,L1

Template:Collapse bottom


In the case L=2,  function h can be designed as a half-band filter, where almost half of the coefficients are zero and need not be included in the dot products. 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, but unlikely, 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 xL[n]  sequence at L times faster than the original input rate. Then L1 of every L outputs are zero. The desired y sequence is the sum of the phases, where L1 terms of the each sum are identically zero.  Computing L1 zeros between the useful outputs of a phase and adding them to a sum is effectively decimation. It's the same result as not computing them at all. That equivalence is known as the second Noble identity.[5] It is sometimes used in derivations of the polyphase method.

Interpolation filter design

Fig 2: The first triangle of the first graph represents the Fourier transform X(f) of a continuous function x(t). The entirety of the first graph depicts the discrete-time Fourier transform of a sequence x[n] formed by sampling the continuous function x(t) at a low-rate of 1/T. The second graph depicts the application of a lowpass filter at a higher data-rate, implemented by inserting zero-valued samples between the original ones. And the third graph is the DTFT of the filter output. The bottom table expresses the maximum filter bandwidth in various frequency units used by filter design tools.

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 discrete-time Fourier transform (DTFT) of the x[n] sequence is the Fourier series representation of a periodic summation of X(f):Template:Efn-la

When T has units of seconds, f has units of hertz (Hz). Sampling L times faster (at interval T/L) increases the periodicity by a factor of L:Template:Efn-la

which is also the desired result of interpolation. An example of both these distributions is depicted in the first and third graphs of Fig 2.[6] 

When the additional samples are inserted zeros, they decrease the sample-interval to T/L. Omitting the zero-valued terms of the Fourier series, it can be written as:

n=0,±L,±2L,...,±x(nT/L) ei2πfnT/Lm  n/Lm=0,±1,±2,...,±x(mT) ei2πfmT,

which is equivalent to Template:EquationNote regardless of the value of L. That equivalence is depicted in the second graph of Fig.2. The only difference is that the available digital bandwidth is expanded to L/T, which increases the number of periodic spectral images within the new bandwidth. Some authors describe that as new frequency components.[7]  The second graph also depicts a lowpass filter and L=3, resulting in the desired spectral distribution (third graph). The filter's bandwidth is the Nyquist frequency of the original x[n] sequence.Template:Efn-ua  In units of Hz that value is 0.5T,  but filter design applications usually require normalized units. (see Fig 2, table)

Upsampling by a fractional factor

Let L/M denote the upsampling factor, where L > M.

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

Upsampling requires a lowpass filter after increasing the data rate, and downsampling requires a lowpass filter before decimation. Therefore, both operations can be accomplished by a single filter with the lower of the two cutoff frequencies. For the L > M case, the interpolation filter cutoff,  0.5L cycles per intermediate sample, is the lower frequency.

See also

Notes

Template:Notelist-ua

Page citations

Template:Notelist-la

References

Template:Reflist

Further reading

Template:DSP

  1. Cite error: Invalid <ref> tag; no text was provided for refs named Oppenheim
  2. Cite error: Invalid <ref> tag; no text was provided for refs named Crochiere
  3. Cite error: Invalid <ref> tag; no text was provided for refs named Poularikas
  4. Cite error: Invalid <ref> tag; no text was provided for refs named f.harris
  5. Cite error: Invalid <ref> tag; no text was provided for refs named Strang
  6. Cite error: Invalid <ref> tag; no text was provided for refs named LiTan
  7. Cite error: Invalid <ref> tag; no text was provided for refs named Lyons