Multirate Signal Processing: I. Selesnick EL 713 Lecture Notes
Multirate Signal Processing: I. Selesnick EL 713 Lecture Notes
1. APPLICATIONS
2. THE UP-SAMPLER
3. THE DOWN-SAMPLER
4. RATE-CHANGING
5. INTERPOLATION
6. HALF-BAND FILTERS
7. NYQUIST FILTERS
8. THE NOBLE IDENTITIES
9. POLYPHASE DECOMPOSITION
10. EFFICIENT IMPLEMENTATION
11. POLYNOMIALS AND MULTIRATE FILTERING
12. INTERPOLATION OF POLYNOMIALS
I. Selesnick
APPLICATIONS
I. Selesnick
THE UP-SAMPLER
The up-sampler, represented by the diagram,
x(n)
y(n)
for n even
for n odd.
(1)
(2)
(3)
Y (z) = + 3 z 2 + 5 + 2 z 2 + 9 z 4 + 6 z 6 +
(4)
and
I. Selesnick
It is clear that
Y (z) = Z {[2] x(n)} = X(z 2 ).
(5)
(6)
x(n/2) z n
(7)
n even
x(n) z 2 n
(8)
= X(z 2 ).
(9)
(10)
= X((ej )2 )
(11)
Y (ej ) = X(ej2 ).
(12)
so we have
(13)
Xf()
1
0.5
Yf() = Xf(2)
Xf(2) WRONG!
0
1
0.5
0
/
0.5
0.5
0
/
0.5
0.5
0
/
0.5
1
0.5
0
1
1
0.5
0
1
x(n)
y(n)
is defined as
(
y(n) = [L] x(n) =
I. Selesnick
x(n/L),
when n is a multiple of L
0,
otherwise.
(14)
The L-fold up-sampler simply inserts L 1 zeros between samples.
For example, if the sequence x(n)
x(n) = {. . . , 3, 5, 2, 9, 6, . . . }
is up-sampled by a factor L = 4, the result is the following sequence
y(n) = [4] x(n)
= {. . . , 0, 3, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, 0, 9, 0, 0, 0, 6, 0, . . . }.
Similarly, we have
Y (z) = Z {[L] x(n)} = X(z L ),
(15)
Y (ej ) = X(ejL ),
(16)
(17)
The L-fold up-sampler will create L 1 spectral images. For example, when a signal is up-sampled by 4, there are 3 spectral images
as shown in the following figure.
Xf()
1
0.5
Yf() = Xf(L)
0
1
0
/
0.5
0.5
0
/
0.5
1
0.5
0
1
I. Selesnick
0.5
Remarks
1. No information is lost when a signal is up-sampled.
2. The up-sampler is a linear but not a time-invariant system.
3. The up-sampler introduces spectral images.
I. Selesnick
THE DOWN-SAMPLER
The down-sampler, represented by the following diagram,
x(n)
y(n)
is defined as
y(n) = x(2 n).
(18)
(19)
(21)
(23)
or
X(z) + X(z) = 2 Y (z 2 )
(24)
or
1
X(z 2 ) + X(z 2 )
Y (z) = Z {[2] x(n)} =
2
(25)
1
= X(ej 2 ) + X(ej 2 )
2
1
= X(ej 2 ) + X(ej ej 2 )
2
1
j 2
j( 2 )
)
= X(e ) + X(e
2
1
f
f 2
= X ( )+X (
)
2
2
2
(26)
(27)
(28)
(29)
(30)
1
2
Y f () = DTFT {[2] x(n)} = X f ( ) + X f (
)
2
2
2
(31)
where we have used the notation Y f () = Y (ej ), X f () =
X(ej ).
Note that because X f () is periodic with a period of 2, the functions X f ( 2 ) and X f ( 2
2 ) are each periodic with a period of 4.
I. Selesnick
But as Y f () is the Fourier transform of a signal, it must be 2periodic. What does Y f () look like? It is best illustrated with an
example.
1.2
1
Xf()
0.8
0.6
0.4
0.2
0
3
0
/
0
/
0
/
0
/
1.2
0.5 * Xf(/2)
1
0.8
0.6
0.4
0.2
0
3
0.5 * Xf((2)/2)
1.2
1
0.8
0.6
0.4
0.2
0
3
1.2
1
Yf()
0.8
0.6
0.4
0.2
0
3
10
is down-sampled. In this case, information is lost by the downsampling. If the spectrum X f () were zero for /2 || ,
then no overlapping would occur, and it would be possible to recover
x(n) after it is down-sampled.
General case: An M -fold down-sampler, represented by the diagram,
x(n)
y(n)
is defined as
y(n) = x(M n).
(32)
The M -fold down-sampler keeps only every M th sample. For example, if the sequence x(n)
x(n) = {. . . , 8, 7, 3, 5, 2, 9, 6, 4, 2, 1, . . . }
is down-sampled by a factor M = 3, the result is the following
sequence
y(n) = [3] x(n) = {. . . , 8, 5, 6, 1, . . . }.
Similarly, we have
M 1
1
1 X
Y (z) = Z {[M ] x(n)} =
X(W k z M )
M
(33)
k=0
where
2
W = ej M ,
I. Selesnick
(34)
EL 713 Lecture Notes
11
and
M
1
X
1
2
k
Y f () = DTFT {[M ] x(n)} =
Xf
.
M
M
(35)
k=0
Remarks
1. In general, information is lost when a signal is down-sampled.
2. The down-sampler is a linear but not a time-invariant system.
3. In general, the down-sampler causes aliasing.
I. Selesnick
12
RATE-CHANGING
The up-sampler and down-sampler are usually used in combination
with filters, not by themselves. For example, to change the rate of
a signal, it is necessary to employ low-pass filters in addition to the
up-sampler and down-sampler.
The following system is used for interpolation.
x(n)
H(z)
y(n)
(36)
The filter fills in the zeros that are introduced by the up-sampler.
Equivalently, it is designed to remove the spectral images. It should
be a low-pass filter with a cut-off frequency o = /L. In this
context, the low-pass filter is often called an interpolation filter.
The following system is used for decimation.
x(n)
H(z)
y(n)
13
x(n)
H(z)
y(n)
I. Selesnick
(38)
14
INTERPOLATION EXAMPLE 1
In this example, we interpolate a signal x(n) by a factor of 4,
using the interpolation system described above. We use a linearphase Type I FIR lowpass filter of length 21 to follow the 4-fold upsampler. Note that because the filter is causal, a delay in introduced
by the interpolation system. y(n) could be aligned with x(n) by
shifting it.
5
1
0.6
|Hf()|
h(n)
0.8
0.4
0.2
0
3
2
1
0.2
0
10
n
15
20
0.2
0.4
0.6
0.8
1.2
1
x(n)
0.8
0.6
0.4
0.2
0
10
12
14
16
18
20
n
1.2
1
x2(n)
0.8
0.6
0.4
0.2
0
10
20
30
40
n
50
60
70
80
1.2
1
y(n)
0.8
0.6
0.4
0.2
0
I. Selesnick
10
20
30
40
50
n
60
70
80
90
100
15
INTERPOLATION EXAMPLE 2
This time we use a filter of length 7,
1
h(n) = {1, 2, 3, 4, 3, 2, 1}.
(39)
4
Note that this filter has the effect of implementing linear interpolation between the existing samples x(n). The result is rather poor
the signal y(n) is not very smooth. Similarly, quadratic interpolation can be implemented by using an appropriate filter h(n).
5
1
0.6
|Hf()|
h(n)
0.8
0.4
0.2
0
3
2
1
0.2
0
0.2
0.4
0.6
0.8
1.2
1
x(n)
0.8
0.6
0.4
0.2
0
10
12
14
16
18
20
n
1.2
1
x2(n)
0.8
0.6
0.4
0.2
0
10
20
30
40
n
50
60
70
80
1.2
1
y(n)
0.8
0.6
0.4
0.2
0
10
20
30
40
50
60
70
80
I. Selesnick
16
HALF-BAND FILTERS
When interpolating a signal x(n), the interpolation filter h(n) will
in general change the samples of x(n) in addition to filling in the
zeros. It is natural to ask if the interpolation filter can be designed
so as to preserve the original samples x(n).
To be precise, if
y(n) = h(n) [2] x(n)
then can we design h(n) so that y(2n) = x(n), or more generally,
so that y(2n + no ) = x(n) ?
It turns out that this is possible. When interpolating by a factor of
2, if h(n) is a half-band, then it will not change the samples x(n).
A no -centered half-band filter h(n) is a filter that satisfies
(
1,
for n = no
h(n) =
0,
for n = no 2, 4, 6, . . .
(40)
That means, every second value of h(n) is zero, except for one such
value, as shown in the figure.
A HALFBAND FILTER
1.2
1
h(n)
0.8
0.6
0.4
0.2
0
0.2
10
n
12
14
16
18
20
(41)
17
(42)
(43)
NYQUIST FILTERS
(44)
h(n)
0.8
0.6
0.4
0.2
0
0.2
0
I. Selesnick
10
15
n
20
25
30
18
x(n)
H(z)
y(n)
m
x(n)
H(z L )
y(n)
Equivalently:
[L] (h(n) x(n)) = [L] h(n) [L] x(n)
I. Selesnick
19
v(n)
H(z)
-
y(n)
Y (z) = V (z L )
and
and therefore,
Y (z) = H(z L ) X(z L ).
Now consider the system that we claim to be equivalent. In the
following figure the intermediate signal w(n) is shown.
x(n)
w(n)
H(z L )
y(n)
and
and therefore,
Y (z) = H(z L ) X(z L ).
This shows that the systems are equivalent.
I. Selesnick
20
x(n)
H(z)
y(n)
m
x(n)
H(z )
y(n)
Equivalently:
h(n) [M ] x(n) = [M ] ([M ] h(n) x(n))
I. Selesnick
21
x(n)
v(n)
H(z)
y(n)
and
and therefore,
1
1
1
1
Y (z) = H(z) X(z 2 ) + H(z) X(z 2 )
2
2
H(z 2 )
w(n)
-
y(n)
and
1
1
1
1
Y (z) = W (z 2 ) + W (z 2 )
2
2
and therefore,
1
1
1
1
Y (z) = H(z) X(z 2 ) + H(z) X(z 2 ).
2
2
22
POLYPHASE DECOMPOSITION
The polyphase decomposition of a signal is simply the even and odd
samples,
x0 (n) = x(2 n)
(45)
(46)
(47)
where X0 (z) and X1 (z) are the Z-transforms of x0 (n) and x1 (n).
For example, if x(n) is:
x(n) = {3, 1, 5, 6, 2, 4, 3, 7}
then the polyphase components are
x0 (n) = {3, 5, 2, 3}
(48)
(49)
23
x(n)
2
x0 (n)
2
x1 (n)
(52)
x1 (n) = x(M n + 1)
..
.
(53)
(54)
(55)
(57)
k=0
where
2
W = ej M .
I. Selesnick
(58)
24
EFFICIENT IMPLEMENTATION
The noble identities and the polyphase decomposition can be used
together to obtain efficient structures. Consider again the system
for interpolation: an up-sampler is followed by a filter. In this
system, the up-sampler inserts zeros between the samples x(n).
There are two disadvantages.
1. Half the samples of the input to the filter are zero. That means
the filter is doing unnecessary computations (multiplications by
zero, adding zeros).
2. The filter operates at the higher rate.
A more efficient implementation can be obtained by writing the
filter in polyphase form, and then using the noble identities. This
is done through the following transformation of the block diagram.
x(n)
x(n)
2
2 - H0 (z 2 )
x(n)
y(n)
+ z 1 H1 (z 2 )
H0 (z 2 )
-+
l-
y(n)
y(n)
I. Selesnick
H(z)
z 1 H1 (z 2 )
25
EFFICIENT IMPLEMENTATION
x(n)
x(n)
2
H0 (z 2 )
2
z 1 H1 (z 2 )
-+
l-
y(n)
2
H0 (z 2 )
-+
l-
y(n)
z 1
- 2
x(n)
H0 (z)
6
2
H1 (z )
2 - +l
6
y(n)
z 1
6
-
H1 (z)
Note that in the last block diagram, the filters operate at the slower
rate, and the filter inputs are not zero. Also note that the filters
h0 (n), h1 (n) are each half the length of the original filter h(n). The
adding node in the last diagram does not incur any actual additions
it implements an interleaving of the two branches.
I. Selesnick
26
HALF-BAND CASE
x(n)
2 - +l
6
y(n)
z 1
6
-
I. Selesnick
H1 (z)
27
POLYNOMIAL SIGNALS
A (discrete-time) polynomial signal x(n) is a signal of the form
x(n) = c0 + c1 n + c2 n2 + + cd nd .
The degree is d. The set of polynomial signals of degree d or less
is denoted by Pd .
Consider a system described by the rule
y(n) = x(n) x(n 1).
This system gives the first difference of the signal x(n). It has the
impulse response
h(n) = (n) (n 1),
and the transfer function
H(z) = 1 z 1
and so we can write
y(n) = h(n) x(n)
or
Y (z) = 1 z 1 X(z).
Clearly if x(n) is a constant signal (x(n) = c, so we can write
x(n) P0 ), then the first difference of x(n) is identically zero,
Y (z) = 1 z 1 X(z) = 0 for x(n) P0 .
Moreover, the first difference Y (z) is identically zero only if x(n)
is a constant signal.
I. Selesnick
28
POLYNOMIAL SIGNALS
Similarly, if x(n) is a ramp signal (x(n) = c0 + c1 n, so we can
write x(n) P1 ), then the first difference is a constant signal.
Therefore the second difference, (defined as the first difference of
the first difference), must be identically zero. Writing this using
the Z-transform gives
1 z 1
2
d+1
or equivalently,
y(n) = h(n) h(n) h(n) x(n) = 0 for x(n) Pd .
{z
}
|
d + 1 terms
I. Selesnick
1 z 1
d+1
X(z) = 0
29
INTERPOLATION OF POLYNOMIALS
We saw before that the interpolation of discrete-time signals can
be carried out by using an upsampler together with a filter. For
interpolation by a factor of two (2X interpolation) we have the
following diagram.
x(n)
2
H(z)
y(n)
x(n)
I. Selesnick
- 2
Q(z) (1 + z 1 )d+1
y(n)
- (1 z 1 )d+1
v(n)
30
We can rearrange the order of the filters to get the following diagram
which is an equivalent structure (end-to-end).
- 2
x(n)
(1 z 1 )d+1 (1 + z 1 )d+1
Q(z)
v(n)
x(n)
Q(z)
v(n)
x(n)
w(n) 2
Q(z)
v(n)
It should be said that in the interpolation structure above, even if H(z) is chosen
so that y(n) is ensured to be a polynomial signal of degree d like x(n) is, it does
not mean that y(2n) = x(n). That is only true when the filter H(z) is in addition
a half-band filter, as discussed above.
I. Selesnick
31
POLYNOMIAL INTERPOLATION BY L
How should the condition above be modified if we are interpolating
by a factor L rather than just by a factor of 2? If we guess that
H(z) should be of the form H(z) = Q(z) R(z) and follow the same
procedure used above, we will see that we will want the product
R(z) (1 z 1 )d+1 to be equal to (1 z L )d+1 . For in that case,
we could again exchange the order of the (L-fold) upsampler and
this term. This gives
R(z) (1 z 1 )d+1 = (1 z L )d+1
or
id+1
(1 z L )d+1 h
1
2
(L1)
= 1 + z + z + + z
R(z) =
(1 z 1 )d+1
where we have used
(1 z) (1 + z + z 2 + + z L1 ) = 1 z L .
H(z) = Q(z) 1 + z
+z
+ + z
(L1)
id+1
I. Selesnick
32