You are on page 1of 7

EE518 Digital Signal Processing University of Washington

Autumn 2001 Dept. of Electrical Engineering

Lecture 9: Upsampling and Downsampling


Oct 29, 2001

Prof: J. Bilmes <bilmes@ee.washington.edu> TA: Mingzhou Song <msong@u.washington.edu>

9.1 Review

F
xc (t) ←→ Xc ( jΩ)
∞ ∞
1 1 2π
∑ ∑
F
xs (t) = xc (nT )δ(t − nT ) ←→ Xs ( jΩ) = Xc ( jΩ) ∗ S( jΩ) = Xc ( j(Ω − kΩs )) (Ωs = )
n=−∞ 2π T k=−∞ T

xc (t) is recoverable from xs (t) if 2ΩN < Ωs , otherwise aliasing occurs. Also
Z ∞
Xs ( jΩ) = xs (t)e− jΩt dt
−∞

= ∑ xc (nT )e− jΩT n
n=−∞

= ∑ x[n]e− jΩT n
n=−∞
− jω
= X(e )|ω=ΩT =Ω/ fs fs = sampling frequency
so ω is a sampling frequency normalized frequency variable.
Also n = t/T is “like” a time normalized variable.
Therefore

1
X(e− jω ) =
T ∑ Xc ( j(ω/T − 2πk/T ))
k=−∞
No aliasing if 2ΩN < Ωs or 2 fN < fs .

Time Domain View of Aliasing

Consider the set of frequencies


π
AΩ0 = {Ω : cos(Ω0 nT ) = cos(ΩnT ), ∀n, 0 ≤ Ω0 ≤ }
T
where AΩ0 is the set of all frequencies of sinusoids that will be an alias with cos(Ω0 nT ) when sampled with sampling
period T .
Theorem 9.1.
π
Ω ∈ AΩ0 but |Ω| 6∈ {0 ≤ Ω0 ≤ }
T
unless
|Ω| = Ω0

Proof. See text for frequency domain proof.

9-1
9-2

Continuous-Time Processing of Discrete-Time Signals

This is not often done and is included here for completeness.


Basic idea as shown in Fig. 9.1

D/C Continuous−Time System C/D


x[n] xc(t) yc(t) y[n]

T T

Figure 9.1: Continuous-time processing of discrete-time signals.

∞ ∞
sin[π(t − nT )/T ]
xc (t) = ∑ x[n]hr (t − nT ) = ∑ x[n]
π(t − nT )/T
n=−∞ n=−∞
sin(πt/T ) F
(hr (t) = ←→ Hr ( jΩ) is lowpass filter with cutoff frequency at π/T )
πt/T

sin[π(t − nT )/T ]
yc (t) = ∑ y[n]
n=−∞ π(t − nT )/T

So
π
Xc ( jΩ) = T X(e jω ) |Ω| <
T
π
Yc ( jΩ) = Hc ( jΩ)Xc ( jΩ) |Ω| <
T
1 ω 1
Y (e jω ) = Yc ( j ) = Hc ( jω/T )T X(e jω ) = Hc ( jω/T )X(e jω ) |ω| < π
T T T

i.e.,
H(e jω ) = Hc ( jω/T ) |ω| < π
or
π
Hc ( jΩ) = H(e jΩT ) |Ω| < (9.1)
T
Ex Non-integer delay.
H(e jω ) = e− jω∆
When ∆ is an integer, y[n] = x[n − ∆], which is an ideal integer delay.
When ∆ is not an integer, this should shift by a non-integer delay (i.e., just a linear phase adjustment.)
Changing the sampling rate in discrete time
x[n] = xc (nT )
to
x0 [n] = xc (nT 0 )
Note, if Ωs > 2ΩN , then this should be doable. All information is contained in x[n], this is just re-sampling that same
information.
9-3

9.2 Reduction (Downsampling)

xd [n] = x[nM] = xc (nMT )

Notation:

M
x[n], period T xd [n]=x[nM]
period MT

Figure 9.2: Downsampling notation.

T 0 = MT
If Xc ( jΩ) is bandlimited, i.e., Xc ( jΩ) = 0 for Ω ≥ ΩN , xd [n] is exact if


Ω0s = > 2ΩN
T0
So the original sampling rate must be

Ωs = > M · 2ΩN
T
Note

1 ω 2πk
X(e jω ) =
T ∑ Xc ( j(
T

T
)) (9.2)
k=−∞

So

1 ω 2πk
Xd (e jω ) = ∑
T M k=−∞
Xc ( j( −
MT MT
))

Change the above to two sum using


r = i + kM 0 ≤ i ≤ M − 1 ∀k
then

1 M−1 1 ω 2πk 2πi
Xd (e jω ) = ∑T
M i=0 ∑ Xc ( j( − −
MT MT MT
))
k=−∞
(9.3)
M−1
1 ω − 2πi )
=
M ∑ X(e j( M M )
i=0

Compare with Eq. (9.3) and Eq. (9.2)

I. shifted copies of both version

Eq. (9.2): infinite copies

Eq. (9.3): only M shifted copies

II. scale factor 1/T versus 1/M

III.
Eq. (9.2): normalized frequency Ω = ω/T
Eq. (9.3): re-normalized frequency ω0 = ω/M (so stretches out the ω-axis)
9-4

Xc(j Ω)
1

−Ω N 0 ΩN Ω

X(e )
1/Τ

−2π −π 0 π 2π ω

j ω/2
X(e )

−2π −π 0 π 2π ω


X d(e )

−2π −π 0 π 2π ω

π Ω π ω
Figure 9.3: Samples at frequency Ωs = 2π
T = 4ΩN . T = 2ΩN ω = ΩT = 2 ΩN . X(e ) = T
jω 1
∑∞ 2πk
k=−∞ Xc ( j( T − T )).Ω =
ΩN when ω = π/2. Now downsample at M = 2. jω 1
Xd (e ) = 2 X(e jω/2 1
) + 2 X(e j(ω−2π)/2 )


X(e )
1/Τ

−2π −π 0 π 2π ω


X d(e )

−2π −π 0 π 2π ω

Aliasing

ω
Figure 9.4: X(e jω ) = 1
T ∑∞ 2πk
k=−∞ Xc ( j( T − T )). Now downsample at M = 2. Aliasing occurs.
9-5

Ex As illustrated in Fig. 9.3 and Fig. 9.4. In Fig. 9.4, aliasing occurred.
What if aliasing occurs? Suppose Ωs = 2π
T = 3ΩN , Ω = ΩN occurs when ω = 2π/3.
So to avoid aliasing, need

Ω0s = > 2ΩN (9.4)
T0
or
π
M< (9.5)
T ΩN
or
ωN M < π (9.6)
where ωN is discrete time analog of Nyquist frequency.
We can lowpass filter the signal at first to assume no aliasing, as shown in Fig. 9.5. This is called a decimator system.

LPF
Gain = 1 ~ M ~ ~
x[n]
Cutoff = π /T x[n], period T xd [n]=x[nM]
period MT

Figure 9.5: A decimator system: lowpass filtering before downsampling

Note x̃[n] is bandlimited within π/M.

9.3 Upsampling

Obtain xi [n] = xc (nT 0 ) from x[n] = xc (nT ) when T 0 < T , i.e. T 0 = T /L.
Question: Is this possible?
Note:
xi [n] = x[n/L] = xc (nT /L)
when n = kL and k is an integer. How to do this in discrete time?
 ∞
x[n/L] n = kL
xe [n] = = ∑ x[k]δ[n − kL] (9.7)
0 else k=−in f ty

Notation for upsampling is shown in Fig. 9.6 Note there are L − 1 zeros between each sample.

L
x[n] xe [n]

Figure 9.6: Upsampling

∞ ∞ ∞
!

Xe (e ) = ∑ ∑ x[k]δ[n − kL] e− jωn = ∑ x[k]e− jωkL = X(e jωL ) (9.8)
n=−∞ k=−in f ty k=−in f ty

So this scales (shrinking here) frequency axis by a factor of L, since ω0 = ωL, or ω = ΩT 0 or T 0 = T /L.
If we then lowpass filter the output xe [n], we get general expander, as shown in Fig. 9.7. Note: need gain L in the
9-6

LPF
L Gain L
x[n] xe [n] xi [n]
Cutoff π /L
period T period T/L

Figure 9.7: An expander.


X(e )
1/Τ

−2π −π 0 π 2π ω

j 2ω
X(e )

−2π −π 0 π 2π ω


H LPF (e )

−2π −π 0 π 2π ω


X i (e )

−2π −π 0 π 2π ω

Figure 9.8: Upsampling of x[n] at L = 2.


9-7

lowpass filter if sampling period had been T 0 = T /L. Originally, gain would be L/T so need to “correct” for this to be
consistent.
Ex (frequency domain) Shown in Fig. 9.8 Note: using more samples to encode the same amount of information, we
would expect the spectrum to have some “gapa” where we could place other signals. Note the spectrum of Hi (e jω ).
We are using a system with more capacity than necessary to encode X(e jω ).
Also if T 0 = T /L, and T matches Nyquist criterion, then Ωs > L · 2ΩN , again higher than necessary.
Why might we do this? This allows simpler LPF design “oversampling”. We only need a “cheap” LPF to get back to
continuous time.

9.4 Rational Sample Rate Change

Consider the system shown in Fig. 9.9 versus the system shown in Fig. 9.10, the output signal both have a sampling

LPF LPF
L Gain L Gain 1 M
x[n] xe [n] xi [n] ~
xi [n] ~
xd [n]
Cutoff π /L Cutoff π /M
period T period T/L period T/L period TM/L

Figure 9.9: Rational sample rate change 1.

LPF
L Gain L M
x[n] xe [n] ~
xi [n] ~
xd [n]
Cutoff min(π /L,π /M)
period T period T/L period TM/L

Figure 9.10: Rational sample rate change 2.

period of T 0 = T M/L. Hence the sampling rate can have any rational change.
Ex: M = 22 and L = 7 produces a change in rate by about 2π.
Note: we might want to reduce sample rate to data storage, etc.

You might also like