Upsampling and Downsampling
Upsampling and Downsampling
Chapter 13
edial signal processing structures discussed so far in this text belong to the class of single-rate
Thedigit
since the sampling rates at the input, at the output, and at all internal nodes are the same, There
gstuy
systems
applications where the signal at a given sampling rate needs to be converted into another signal
are ferent sampling rate. For example, in digital audio, three different sampling rates are presentl
nloved: 32 kHz in broadcasting,44.1 kHz in digital CD, and 48 kHz in digital audio tape (DAT) and
different rates
ther applications [Lag82]. Conversion of sampling rates of audio signals among these three
is necessary in many
situations. Another example pitch control of audio recordings usually performed
is
by varying tape
recorder speed. However, such approach changes the sampling frequency of the digital
an
signal and, as a result, conversion to the original sampling rate is needed [Lag82]. In video applications.
the sampling rates of NTSC (National
Television Systems Committee) and PAL (Phase Alternate Line)
14.3181818 MHz and 17.734475 MHz, whereas the sampling
composite video signals are, respectively,
13.5 MHz and 6.75 MHz for the luminance and the color-
rates of the digital component video signal
are
difference signals, respectively Lut91). There are other applications where it is convenient (and often
judicious) to have unequal rates of sampling at the filter input and output and at internal nodes. Examples
CD.
ofsuch sampling rate alterations are described in the accompanying
To change the sampling rate of a digital signal, multirate digital signal processing systems use a down-
0.5
Ogeelesleale
-0.5
-0.5
40 50 10 20 30 O
10 20 30 0
(a)
Time index n
(b)
elsine Figure 13.1: Illustration of the up-sampling process.
xn]
P length of the input sequence, the up-sampling factor, and the frequency of the sinusoid in Hz. t
Program o p l o t s the input sequence and its up-sampled version. Figure 13.l shows the result obtained for a iengu
131.m 50 sinusoidal sequence with a frequency of 0.12 Hz and with an up-sampling factor of 3.
The block diagram representation of the up-sampler, also called a sampling rate expander 0rS
741
1 3 1
Input sequence
Output sequence downsampled by 33
0.5
-0.5
20 40
10 10 30
Time index n
Time index n
(a)
(b)
Figure 13.3: Illustration of the down-sampling process.
ioilggo
xn Myn
Figure 13.4: Block diagram representation of a down-sampler.
On the other hand, a down-sampler with a down-sampling factor M, where M is a positive integer.
ates an output sequence ynl with a sampling rate that is (1/M)th of that of the input sequence xn].
The down-sampling operation is implemented by keeping every Mth sample of the input sequence and
emoving the M - 1 in-between samples to generate the output sequence according to the relation
n = x{nM]. (13.2)
As a result, all input samples with indices equal to an integer multiple of M are retained at the output and
are discarded, as illustrated in Example 13.2.
allothers
EXAMPLE 13.2 Illustration of Down-Sampling Operation
We investigate down-sampling of a sinusoidal input sequence using MATLAB. To this end, we utilize
Program 132. Its input data are the length of the input sequence, the down-sampling factor, and the
frequency of the sinusoid in Hz. It then plots the input sequence and its down-sampled version. The re-
Programn
sult obtained for a length-50 sinusoidal sequence with a frequency 0.042 Hz and with a down-sampling
132m
factor of 3 are shown in Figure 13.3.
The block diagram representation of the down-sampler or sampling rate compressor is shown in
Figure 13.4.
the The
involved have not been explicitly shown in Figures and 13.4. This is in
sampling periods
inteiest of simplicity and in view of the fact that the mathematical theory of multirate systems can
13.2
derstood without bringing the sampling period T or the sampling frequency Fr into the picture.
lt is in
in the sampling
al in the
beginning to explicitly see the time dimensions at various stages
book, however, the explicit
DDear process, as indicated in Figure 13.5. In the remainder of this values are relevant.
Th
h orthe sampling frequency Fr is not shown unless their actual
13.2 and 13.4 are often used together
um pier and the down-sampler building blocks of Figures discussed in m o e detail in this
applications involving multirate signal processing and are
chapter and Or
chapter
is to
Chapter 14. For ample, one application using both types of sampling rate alteration devices
achieve a s
rate change by rational number rather than an integer value. Example 13.3
ilustrates another application.
Sampling a
742 Chapter 13: Multirate Digital Signal Processing Fundamentals
xn]= xnT) M lnl= x,(nMT
Input sampling Output sampling
(nT/ L). n
=0,t L,t2L,...
x, iT)tL n=a 0, otherwisee
Input sampling Output sampling
frequency = F = LFy =5
frequency y7
Figure 13.5: The sampling rate alteration building blocks with sampling rates explicitly shown.
x[n]- 12 t2
12 2
Figure 13.6: A simple multirate system.
n.
12 34 5 6 7 8
property of the multirate structure of Figure 13.6 is left as an exercise (Problem 13.1).
nput sequence
A multirate structure in which the
output sequence is a delayed and scaled replica of the u Simple
is called a perfect reconstruction multirate system. Thus, the structure of Figure 15.0 15 *
example of such a system.
Iscrete-time systems (Prob-
It can be shown that the up-sampler and the down-sampler are linear disc screte-time
lem 4.2). Moreover, it has been shown in Example 4.5 that the
up-sampler is a time-vary1ng
Basic
Sampling Rate Alteration Devices 743
e
(Problem132).
Frequency-Domain Characterization
131.2
i n v e
tigate the
s t
the relation between the input and output spectra of the up-sampler and the down-
i g a t e
RenOW
SAper
the relations between the spectra of the input and the output of a factor-of-2 up-sampler.
Refirstd e r i
input-output relation of the factor-of-L up-sampler given by Eq. (13.1), we arrive at the core-
Fromthe i n
for the factor-of-2 up-sampler.
ingrelation
xu= Xxn/2). n =
0. +2, +4. (13.3)
0. otherwise.
)= un: = xn/2]
= xm=-2m=X(E). (13.4)
cquation becomes X(eJ) = X(eJo). Figure 13.7(a) shows the DTFT X(eJ®) that has been assumed
o be a real function of o for convenience. Moreover, the DTFT X(e®) shown is not an even function
has been purposely chosen to
of, implying that x{n] is a complex sequence. The asymmetric response
astrate more clearly the effect of up-sampling.
thus leads to a two-fold repetition
As shown in Figure 13.7(b), a factor-of-2 sampling rate expansion
a factor of 2. This process is called
Ae).indicating that the Fourier transform is compressed by
In the case of a factor-of-L sampling
gung because we get an additional "image" of the input spectrum. in the baseband. Thus, a
cexpansion, there will be L 1 additional images of the input spectrum
-
low-frequency spectrum
does not look like
Um &(e) band-limited to the low-frequency region
a
aterp-sampling because of the insertion of zero-valued samples between the non-zero samples of xu n].
Lowpa
hltering of xu [n] removes the L 1 images and, in effect,
"fills in" -
on the zero-valued samples
nwith
Ex:
interpolated sample values.
dnple 13.4 illustrates the frequency-domain properties of the up-sampler.
Program
13 3.m
Chapter 13: Multirate Digital Signal Processing Fundam.
744
(a)
(e
Image
AAAA 0
(b)
Figure 13.7: Effects of up-sampling in the frequeney domain: (a) input spectrum and (6) output spectrunm for l =
04
-0.220
0 0.45 0.5 1.0 30 40 S0 70
Time index
(a) (b)
esd
sFigure 13.8: (a) Desired magnitude response and (b) corresponding time sequence.
is as follows: length of the sequence is 100, the desired magnitude response vector mag = [0 1
0 01, and the vector of frequeney points freq = [0 0.45 0.5 11. The desired magnitake
response is thus as indicated in Figure 13.8(a). A plot of the middle 61 samples of the signal generatai
is shown in Figure 13.8(6).
The program determines the output of the up-sampler and then plots the input and output spevtra, as
indicated in Figure 139 for L = 5. lt can be seen from this figure that, as evpected, the output speetrm
consists of a factor-of-5 compressed version of the input spectrum followed by L-1 - 4 images.
Input spectrum
Output spectrum
0.8
0.3
0.6
.
00
0.4
0.2
02
Xint n= 0,
n=
0, +M, t2M,... (13.7)
otherwise.
Then,
Xn (1/M). (13.8)
i n k]:-k/M =
k=-oob
Now" mi]
2 can be formally related to xn] through Xint "] = cn]x{n). where cn] is defined by
+2M,..
cn] =
= 0 , tM, (13.9)
otherwise.
A
icoe n t representation of cn] is given by (Problem 13.3)
M-1 (13.10)
cn k=0
W
where WM
Se of E
=e-j27/M is the quantity defined in Eq. (5.12). Substituting Xnt ] =
cln]x|n] and making
.(13.10) in the transform of Xint ] , we obtain
k=9 (13.11)
The desired input-output relation in the transform domain for a factor-of-M down-sampler is hes
tained by substituting Eq. (13.11) in Eq. (13.8), resulting in ob
M-1
To understand the implication of the above relation, considera factor-c 2dOwn-sampler with an nput
xn] whose spectrum is as shown in Figure 13.10(a). As before, for convenience, we assume again X(eje
to be a real function with an asymmetric frequency response. From Fq. (13.12), we get
The above relation implies that Y(e/0) is a sum of M uniformly shifted and stretched versions of X(e).
scaled by a factor 1/M. Aliasing due to a factor-of-M down-sampling is absent if and only if the signal
xn] is band-limited to tn/M, as shown in Figure 13.11 for M =2.
We illustrate the aliasing effect caused by down-sampling in Example 13.5.
M =
3,shown in Figure 13.12(c), shows a severe distortion caused by the aliasing