Upsampling
In digital signal processing, upsampling, expansion, and interpolation are terms associated with the process of resampling in a multirate 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 samplerate is 55,125.
Upsampling by an integer factor
Rate increase by an integer factor L can be explained as a 2step process, with an equivalent implementation that is more efficient:^{[4]}
 Expansion: Create a sequence, [math]\displaystyle{ x_L[n], }[/math], comprising the original samples, [math]\displaystyle{ x[n], }[/math] separated by L − 1 zeros. A notation for this operation is: [math]\displaystyle{ x_L[n] = x[n]_{\uparrow L}. }[/math]
 Interpolation: Smooth out the discontinuities with 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:^{[loweralpha 1]}^{[upperalpha 1]}

[math]\displaystyle{ y[j+nL] = \sum_{k=0}^K x[nk]\cdot h[j+kL],\ \ j = 0,1,\ldots,L1, }[/math] and for any [math]\displaystyle{ n }[/math]
(
)
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 nonzero. In the case L = 2, h[•] can be designed as a halfband 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 multiprocessor 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 [math]\displaystyle{ \scriptstyle x_L[n] }[/math] 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
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 discretetime Fourier transform (DTFT) of the x[n] sequence is the Fourier series representation of a periodic summation of X(f):^{[loweralpha 2]}

[math]\displaystyle{ \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\Bigl(f  \frac{k}{T}\Bigr). }[/math]
(
)
When T has units of seconds, [math]\displaystyle{ f }[/math] has units of hertz (Hz). Sampling L times faster (at interval T/L) increases the periodicity by a factor of L:^{[loweralpha 3]}

[math]\displaystyle{ \frac{L}{T}\sum_{k=\infty}^\infty X\left(fk\cdot \frac{L}{T}\right), }[/math]
(
)
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.
When the additional samples are inserted zeros, they increase the data rate, but they have no effect on the frequency distribution until the zeros are replaced by the interpolation filter, depicted in the second graph. Its application makes the first two graphs resemble the third one. Its bandwidth is the Nyquist frequency of the original x[n] sequence.^{[upperalpha 2]} In units of Hz that value is [math]\displaystyle{ \tfrac{0.5}{T}, }[/math] 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.
 Upsample by a factor of L
 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, [math]\displaystyle{ \tfrac{0.5}{L} }[/math] cycles per intermediate sample, is the lower frequency.
See also
 Downsampling
 Multirate digital signal processing
 Halfband filter
 Oversampling
 Sampling (information theory)
 Signal (information theory)
 Data conversion
 Interpolation
 Poisson summation formula
Notes
 ↑ The interpolation filter output sequence is defined by a convolution:
 [math]\displaystyle{ y[m] = \sum_{r=\infty}^\infty x_L[mr]\cdot h[r] }[/math]
 [math]\displaystyle{ \begin{align} y[m] &= \sum_{k=\infty}^{\infty} x_L\left[\bigl\lfloor\tfrac{m}{L}\bigr\rfloor L  kL\right]\cdot h\Bigl[\overbrace{m  \bigl\lfloor\tfrac{m}{L}\bigr\rfloor L + kL}^{r}\Bigr]\\ &= \sum_{k=\infty}^{\infty} x\left[\bigl\lfloor\tfrac{m}{L}\bigr\rfloor  k\right]\cdot h\left[m  \bigl\lfloor\tfrac{m}{L}\bigr\rfloor L + kL\right]\quad \stackrel{m\ \triangleq\ j + nL}{\longrightarrow}\quad y[j+nL] = \sum_{k=0}^K x[nk]\cdot h[j+kL],\ \ j = 0,1,\ldots,L1\quad \mathsf{(Eq.1)} \end{align} }[/math]
 ↑ Realizable lowpass filters have a "skirt", where the response diminishes from near unity to near zero. So in practice the cutoff frequency is placed far enough below the theoretical cutoff that the filter's skirt is contained below the theoretical cutoff.
Page citations
 ↑ Crochiere and Rabiner "2.3". p 38. eq 2.80, where [math]\displaystyle{ m \triangleq j+nL, }[/math] which also requires [math]\displaystyle{ n = \bigl\lfloor \tfrac{m}{L} \bigr\rfloor, }[/math] and [math]\displaystyle{ j = m  nL. }[/math]
 ↑ f.harris 2004. "2.2". p 23. fig 2.12 (top).
 ↑ f.harris 2004. "2.2". p 23. fig 2.12 (bottom).
References
 ↑ Oppenheim, Alan V.; Schafer, Ronald W.; Buck, John R. (1999). "4.6.2". DiscreteTime Signal Processing (2nd ed.). Upper Saddle River, N.J.: Prentice Hall. p. 172. ISBN 0137549202. https://archive.org/details/discretetimesign00alan/page/172. Also available at https://d1.amobbs.com/bbs_upload782111/files_24/ourdev_523225.pdf
 ↑ Crochiere, R.E.; Rabiner, L.R. (1983). "2.3". Multirate Digital Signal Processing. Englewood Cliffs, NJ: PrenticeHall. pp. 35–36. ISBN 0136051626. https://kupdf.net/download/multiratedigitalsignalprocessingcrochiererabiner_58a7065b6454a7e80bb1e993_pdf.
 ↑ Poularikas, Alexander D. (September 1998). Handbook of Formulas and Tables for Signal Processing (1 ed.). CRC Press. pp. 42–48. ISBN 0849385792.
 ↑ Harris, Frederic J. (20040524). "2.2". Multirate Signal Processing for Communication Systems. Upper Saddle River, NJ: Prentice Hall PTR. pp. 20–21. ISBN 0131465112. "The process of up sampling can be visualized as a twostep progression. The process starts by increasing the samplerate of an input series x(n) by resamping [expansion]. The zeropacked time series is processed by a filter h(n). In reality the processes of samplerate increase and bandwidth reduction are merged in a single process called a multirate filter."
 ↑ Strang, Gilbert; Nguyen, Truong (19961001). Wavelets and Filter Banks (2 ed.). Wellesley,MA: WellesleyCambridge Press. p. 101. ISBN 0961408871. https://archive.org/details/waveletsfilterba00stra. "the Noble Identies apply to each polyphase component ... they don't apply to the whole filter."
Further reading
 Tan, Li (20080421). "Upsampling and downsampling". EE Times. http://www.eetimes.com/document.asp?doc_id=1275556&page_number=3.
 "Digital Audio Resampling Home Page". http://ccrma.stanford.edu/~jos/resample/resample.html. (discusses a technique for bandlimited interpolation)
 "Matlab example of using polyphase filters for interpolation". http://www.dsplog.com/2007/05/12/polyphasefiltersforinterpolation/.
Original source: https://en.wikipedia.org/wiki/Upsampling.
Read more 