This Demonstration shows the effect of upsampling followed by filtering on a discrete-time sequence and its discrete-time Fourier transform (DTFT) spectrum. Upsampling by a factor of inserts zeros between every two samples of a discrete-time sequence. This expansion in time causes a contraction in frequency and the appearance of spurious spectral components, necessitating filtering after upsampling.
The three sets of controls let you vary the path of the input sequence. If you choose neither the upsampler nor the filter, the sequence goes through the system unchanged. You can also choose to show the effect of filtering alone on the input sequence. Likewise, the effect of upsampling alone on the input sequence can be shown. Choosing both the upsampler and the filter shows the effect of filtering an upsampled input sequence (this is done only for ). Input sequence/spectrum are shown in black, and the output sequence/spectrum in red. The top two graphics show the chosen half-band filter in purple (lowpass/highpass and the choice of Haar, Daubechies 4, Daubechies 6, and a simple symmetric pair) and its magnitude response. You can also choose to show the envelopes of the sequences.
The bottom-left graphic shows the input sequence (black stems) and the output sequence (red stems). Changing the period or support changes the sequence. As the upsampling factor increases, the length of the upsampled sequence increases as well.
The bottom-right graphic shows the magnitudes of the DTFT spectra of the input (black plot) and output (red plot) sequences. As the upsampling factor increases, the support of the upsampled sequence spectrum decreases, and more spurious spectral components (called images) appear.
Multirate signal processing is at the heart of most modern compression systems and standards, including JPEG, MPEG, and so on. Multirate refers to the fact that different sequences may have different time scales. One of the basic operations in multirate signal processing is upsampling.
Given a sequence , its upsampled-by- version is
Upsampling is only periodically shift invariant, since shifting the sequence by will not necessarily lead to the upsampled output being shifted by .
If is the DTFT spectrum of , then
is the DTFT spectrum of . The contracted versions of present in the output spectrum are called images. The contraction of frequencies can create frequency content not present in the original spectrum. Filtering after upsampling ensures that only the original spectrum is preserved after upsampling.
 M. Vetterli, J. Kovačević, and V. K. Goyal, Foundations of Signal Processing, Cambridge: Cambridge University Press, 2014. www.fourierandwavelets.org.