You are on page 1of 18

13.

1
ECE 410 DIGITAL SIGNAL PROCESSING D. Munson
University of Illinois Chapter 13



Digital Interpolation

Suppose have y
n
= y
a
(nT
1
) as pictured:

y
a
(t)
T
1
y
n



and want y
n
= y
a
nT
2
( ) where T
2
=
T
1
L
, and L is integer :

ya(t)
T2
yn
~


Thus, {
y
n
} are denser samples of y
a
(t). How do we get {
y
n
} from {y
n
}? Could use

y
a
(t) = y
k
k=

sinc

T
1
t kT
1
( )



(

(


to get



y
n
= y
a
(nT
2
) = y
k
sinc

1
n
2
k
1
( )



(

(
k=



But, this involves an infinite sum (which must be truncated in practice) and evaluation of the
sinc function. Alternatively, we might try something simpler, such as a piecewise linear or
polynomial approximation to y
a
(t), but these methods are not particularly accurate.

Alternative Digital Approach


L
y
n G
d
()
~
y
n
w
n



where the first box is an up-sampler that inserts L-1 zeros between each pair of inputs:

13.2
w
n
= {0, 0, , 0, y
1
, 0, 0, , 0, y
0
, 0, 0, , 0, y
1
, 0 }

L-1 zeros

and G
d
() is an ideal LPF with cutoff /L and passband gain L:

-

G
d
()

L
L



Why does this work??

Analyze the problem in the Fourier domain.

First, note that if

B

1
Y
a
()


then sampling y
a
(t) at times nT
1
with T
1
<

B
|
\
|
.
would give {y
n
} with

2

BT
1

+ 2n
T
1
Y
d
() =
1
T
1
1
T
1
Y
a

13.3
Sampling y
a
(t) on the denser grid nT
2
would give y
n
{ }
with

2

1
T
2

Y
d
() =
1
T
2
Y
a
+ 2n
T
2

BT
2
=
BT
1
L


(Sampling at a higher frequency shrinks the DTFT of the A/D output).

Now, show that the above digital interpolation approach gives

Y
d
from Y
d
(and therefore

y
n

from y
n
).

We have

W
d
() = w
n
n

e
jn
= y
n
n

e
jLn




W
d
() = Y
d
(L)



So,

Y
d
()

BT
1
1
T
1




13.4

1
T
1
W
d
() = Y
d
(L)

L
2
L
BT
2
=
BT
1
L



Now, since
G
d
()
L = T
1
/T
2


we have



Y
d
() = G
d
() W
d
() given by

BT
2

Y
d
()
1
T
2
2


as desired. Thus, in principle, the digital interpolator will compute y
n
{ }
from y
n
{ } exactly. In
practice, the quality of the interpolator depends on the quality of G
d
()), i.e., on how close
G
d
() is to the ideal low-pass shape.

Comments:
1) L-1 out of every L inputs to G
d
() are zero. This saves many multiplications for L large!
This is readily apparent for nonrecursive G
d
(), but is also true for some recursive G
d
().

2) There exist efficient digital interpolation schemes for T
2
= T
1
, where is any real number
(doesnt have to be
1
L
).
13.5

A Further Look at Up-Sampler

A digital interpolator uses an up-sampler as one of its components.


x
n
y
n
L


We have shown that Y
d
() is a squashed version of X
d
(), namely

Y
d
() = X
d
(L).

Notice that the amplitude of Y
d
is the same as the amplitude of X
d
. This makes intuitive sense
since the energy in the y
n
sequence is the same as that of the x
n
sequence, because the up-
sampler inserts just zeros between the x
n
elements.

Example (Up-Sampler)

Suppose L = 3. Sketch Y
d
(), assuming

1
2 2
X
d
()

2


The entire axis is squashed by a factor of 3 to give

Y
d
()
1
2
3

6
2
3


13.6
Oversampling D/A

Used in C-D players, for example. Idea is to simplify analog filter in D/A by using interpolation
prior to the D/A. Interpolating {y
n
} prior to the D/A permits the use of a ZOH with a smaller
step-size. This ZOH puts out a finer staircase approximation to y
a
(t), which relaxes the
requirements on F
a
(). So, instead of this:

y
n
ZOH
y
a
(t)
F
a
()
y
a
(t)


do this:


y
n
Interpolator

L
L
~
y
n
ZOH
F
a
() y
a
(t)
y
a
(t)



As you can imagine, a far simpler filter F
a
() can be used in the second system to produce y
a
(t)
from y
a
(t), since y
a
(t) is much smoother in the second system than in the first system. We gain
considerable insight into this via the following analysis.

Our analysis of the oversampling D/A is facilitated by first, considering a usual D/A, assuming
sampling period of T
1
. The standard way to reconstruct y
a
(t) from y
n
= y
a
(nT
1
) is:


ZOH
y
a
(t)
F
a
() y
a
(nT
1
) = y
n
ya
(t)


where

y
a
(t) = y
n
n

p
a
(t nT
1
)

13.7
with

p
a
(t)

1
t
1


and

Y
a
() = P
a
() Y
d
(T
1
)

from analysis of general D/A

so that
Y
a
() = T
1
sinc
T
1
2
e
j
T
1
2

Y
d
(T
1
) ()

As a specific example, assume


c


Y
d
()


Then Y
a
() is the product of the following two curves:


Y
d
(T
1
)

2
T
1

c
T
1

T
1
2
T
1
sinc
T
1
2

T
1

giving



13.8
2
T
1

c
T
1

T
1
2
c
T
1
Y
a
()

T
1


Now, as we know, F
a
() should be a LPF with a


1
sinc
T
1
2


shape in its passband. For the situation above, with
c
< , there is room for a transition band of
F
a
() on the interval

c
T
1
< || <
2
c
T
1
. A finite-order (realizable) F
a
() needs room for a
transition band (transition cannot be infinitely sharp). A wider transition band permits a lower
order (less complicated) F
a
().

A realizable F
a
() might look like:

F
a
()

c
T
1

c
T
1
2
c
T
1

Transition
Band


This filter is permitted a transition bandwidth of


2
c
T
1

c
T
1
=
2
c
( )
T
1


13.9
Now, consider oversampling D/A:

y
a
(nT
1
) = y
n L G
d
() ZOH F
a
()
y
a
(t)
y
a
(t)
Digital Interpolator
y
n
= y
a
(nT
2
)
~
oversampling factor =
T
1
T
2
uses period T
2


Due to the interpolation, the above ZOH puts out a finer staircase approximation with narrow
steps (width T
2
). Thus, we expect that F
a
() can be simpler in this scheme. Lets analyze this
in the frequency domain:

The interpolator squashes the DTFT of y
n
:

2
Y
d
()
~

c
L


So, Y
a
() now looks like the curve below (use eqn. () except with T
2
instead of T
1
and

Y
d

instead of Y
d
):


Y

c
L T
2
=

c
T
1

T
2
2
T
2
2
T
2


c
T
1
a
()


Thus, the transition band of F
a
() can now be much wider.

13.10
Transition BW =
2
T
2

c
T
1

c
T
1


=
2(L
c
)
T
1
>>
2(
c
)
T
1

from before for regular D/A

so that implementation of F
a
() can be far simpler.

Also, from the picture above we see that the center pulse of Y
a
() is almost flat and that the
artifact centered at
2
T
2
is nearly zero, so even a fairly crude F
a
() will do a good job. F
a
()
should have a nearly flat response in its passband, can have a huge transition band, and needs
only moderate attenuation in its stopband.


F
a
() in an oversampling D/A can look like:


Transition Band
F
a
()

c
T
1

T
2
2
T
2
2
T
2


c
T
1




13.11
Oversampling A/D

A different type of oversampling is sometimes used to limit aliasing in the A/D. We will
examine this as the second method, described below, for preventing aliasing at the A/D.

Prevention of Aliasing at A/D

Suppose x
a
(t) is nearly (not exactly) BL to B rad/sec.

B B
X
a
()


Here, B is an effective band limit, but sampling with T =

B
will still cause measurable
aliasing.

How do we prevent aliasing at the sampler? Two possibilities:

1) Precede the A/D with an analog antialiasing LPF with cutoff B rad/sec. Then sample using
T <

B
. This approach is very common.

2) Alternatively, sample at a high rate with T =

B D
where D is an integer and is large enough
to virtually prevent aliasing (choose D so that X
a
() is virtually limited to D B rad/sec).
Then digitally LPF with cutoff
c
=

D
. Then decimate by a factor of D (discard D1 of
every D samples). This is called an oversampling A/D:


13.12
x
a
(t)
sample at
high rate
T =
Decimator
v
n
G
d
()
w
n
D
LPF
stretches
DTFT by
factor of D
x
n
= w
nD

DB

c =

D



Ordinarily, sampling at such a high rate would be an expensive proposition, since this could
create a very high data rate. The decimator, however, reduces the sampling rate back down by a
factor of D. Note that implementation of G
d
() is not nearly so complicated as you might
expect. Since D-1 of every D outputs of G
d
() will be discarded, only every Dth output need be
computed!

Choosing between 1) and 2) is simply an issue of whether you put the complexity in the analog
or digital part of your system.




Analysis of Oversampling A/D

We will show that Option 2 (oversampling approach) produces exactly the same output {x
n
} as
does Option 1. Suppose:

B B
X
a
()



If T =

D B
then
13.13



V
d
()
1
T
=
DB

BT =

D



We have

G
d
()

D D



So:

D
DB

W
d
()



Now, what is the relationship between X
d
() and W
d
()?

Digression

Note

1
D
e
j
2
D
kn
k=0
D1

=
1 n = mD
1
D
1 e
j
2
D
nD
1 e
j
2n
D
n mD







=
1 n = mD
0 n mD




13.14


Now,

X
d
() =
n=

x
n
e
jn


=
n=

w
nD
e
jn
=
n=mD
m=

w
n
e
j
n
D



=

trick from
digression


w
n
n=

1
D
e
j
2
D
kn
k=0
D1

= 0 unless n = mD

e
j
n
D


=
1
D
k=0
D1

n=

w
n
e
jn(
2k
D
)




X
d
() =
1
D
W
d
2 k
D
|
\
|
.
k=0
D1

()



Now, had

D
DB

W
d
()


13.15
Using this W
d
() in () gives

k = D 1
B

k = 1
X
d
()
k = 0 term
=
1
D
W
d



Note: This X
d
is just what we would have obtained if we had analog low-pass filtered x
a
(t) to
B rad/sec and then sampled with period T =

B
!

Thus, 2) does an equivalent job to 1).

Note:

How can () produce a periodic X
d
()? () has only a finite number of terms in its sum.
Answer: Each term is a periodic DTFT, not a FT as in Eq. ().

k=0 term in () has pulses centered at 0, 2D, 4D, etc.

k=1 term has pulses centered at 2, 2 2D, 2 4D, etc.



k = D 1 term has pulses centered at (D1)2, (D1)2 2D, (D1)2 4D, etc.


A Further Look at Down-Sampler

A decimator uses a down-sampler as one of its components:


x
n
D
y
n


The down-sampler essentially stretches X
d
. However, if X
d
() is not limited to || <

D
, then
aliasing also occurs. Specifically,

Y
d
() =
1
D
X
d
k=0
D1

2k
D
|
\
|
.
. ()

13.16
Notice the scaling in amplitude by
1
D
. This factor is not surprising, given that in the time
domain, the down-sampler discards D1 out of every D samples. By contrast, the up-sampler
does not discard any samples, and inserts only zero-valued samples, so that there is no amplitude
scaling in the Fourier domain for the up-sampler.


Example (Down-Sampler)

Suppose D = 3. Sketch Y
d
(), assuming

X
d
()
1
2 2



Then the k = 0 term in () is

1
3
7 6 5 4 3 2
3
4
2 3 4 5 6 7



The k = 1 term in () is a 2-shifted version of the above, namely


1
3

5 4 2 3 2 3 4 5 6 7 8 9


13.17
Likewise, the D 1 = 2 term in () is a 4-shifted version of the k = 0 term:

1
3

2 3 2 3 4 5 6 7 8 9 10 11


Adding the three previous plots together gives Y
d
():

Y
d
()
k = 2 term
3 2 2 3

1
3
k = 0 term k = 1 term


Note that the various terms in () interlace to produce a 2-periodic Y
d
(). In this example
there was no need to plot the k = 0, 1, 2 terms, since the k = 0 term, alone, determines the shape
of Y
d
() for || < . In the next example, the downsampler causes aliasing, so that the terms in
() overlap. This situation is more complicated than in the previous example.

Example (Down-Sampler)

Suppose D = 3 as before, but now with

1
2 2

2
X
d
()

13.18
The k = 0 term in () is:
1
3

8 7 6 5 4 3 2 0 2 3 4 5 6 7 8

Notice that the center pulse extends beyond = , which is an indication of aliasing. The k = 1
term in () is a 2-shifted version of the above plot, namely:

0 6 5 4 3 2
1
3
2 3 4 5 6 7 8 9 10

The k = 2 term in () is a 4-shifted version of the k = 0 term:

0
1
3
2 3 4 5 6 7 8 9 10 4 3 2 11 12

Adding the k = 0, 1, 2 terms gives Y
d
(), which we plot only for || :

3
2
Y
d
()
1
3
2
9

2

2
3
2


In this example, we have aliasing because X
d
() extends beyond =

D
=

3
. In a decimator,
the job of the LPF that precedes the down-sampler is to cut off X
d
() at =

D
to prevent this
aliasing.

You might also like