Multirate Signal Processing 1.4
Multirate Signal Processing 1.4
By:
Douglas L. Jones
Multirate Signal Processing
By:
Douglas L. Jones
Online:
< http://cnx.org/content/col10287/1.1/ >
CONNEXIONS
Digital transformation of the sampling rate of signals, or signal processing with dierent sampling rates in
the system.
1.1 Applications
1. CD to DAT format change, for example.
2. oversampling converters; which reduce performance requirements on anti-aliasing or reconstruction
lters
3. bandwidth of individual channels is much less than the overall bandwidth
4. Eyes and ears are not as sensitive to errors in higher frequency bands, so many coding schemes split
signals into dierent frequency bands and quantize higher-frequency bands with much less precision.
1
2 CHAPTER 1. OVERVIEW OF MULTIRATE SIGNAL PROCESSING
Figure 1.1
1 if || <
T1
Haa () =
0 otherwise
sin T1 t
haa (t) =
T1 t
Recall the ideal D/A:
(tnT0 )
X sin T0
x0a (t) = x0 (n) (tnT0 )
(1.1)
n= T0
The problems with this scheme are:
1. A/D, D/A, lters cost money
2. imperfections in these devices introduce errors
Digital implementation of rate-changing according to this formula has three problems:
1. Innite sum: The solution is to truncate. Consider sinc (t) ' 0 for t < t1 , t > t2 : Then mT1 nT0 < t1
and mT1 nT0 > t2 which implies
mT1 t2
N1 = d e
T0
mT1 t1
N2 = b c
T0
N2
X
x1 (m) = x0 (n) sincT 0 (mT1 nT0 )
n=N1
note: This is essentially lowpass lter design using a boxcar window: other nite-length
lter design methods could be used for this.
2. Lack of causality: The solution is to delay by max {|N |} samples. The mathematics of the analog
portions of this system can be implemented digitally.
3. Cost of computing sincT 0 (mT1 nT0 ): The solution is to precompute the table of sinc (t) values.
However, if TT01 is not a rational fraction, an innite number of samples will be needed, so some
approximation will have to be tolerated.
note: Rate transformation of any rate to any other rate can be accomplished digitally with
arbitrary precision (if some delay is acceptable). This method is used in practice in many
cases. We will examine a number of special cases and computational improvements, but in
some sense everything that follows are details; the above idea is the central idea in multirate
signal processing.
Useful references for the traditional material (everything except PRFBs) are Crochiere and Rabiner,
1981 [1] and Crochiere and Rabiner, 1983 [2]. A more recent tutorial is Vaidyanathan [4]; see also Rioul and
Vetterli [3]. References to most of the original papers can be found in these tutorials.
Figure 2.1
5
CHAPTER 2. INTERPOLATION, DECIMATION, AND RATE CHANGING
6
BY INTEGER FRACTIONS
Figure 2.2
By inserting zero samples between the samples of x0 (n), we obtain a signal with a scaled frequency
response that simply replicates X0 ( 0 ) L times over a 2 interval!
Obviously, the desired x1 (m) can be obtained simply by lowpass ltering y (m) to remove the replicas.
In practice, a nite-length lowpass lter is designed using any of the methods studied so far (Figure 2.3
(Interpolator Block Diagram)).
Figure 2.3
Figure 2.4
Figure 2.5
In frequency (DTFT):
P
Y () = m= y (m) e(im)
P
= x0 (M m) e(im)
m=
P P (i Mn
)|
= n= x0 (n) k= (n M k) e n=M m
(2.5)
0
P P (i n)
= n= x 0 (n) k= (n M k) e |
0= M
P
= DTFT [x0 (n)] DTFT [ (n M k)]
PM 1
Now DTFT [ (n M k)] = 2 k=0 X (k) 0 2k for || < as shown in homework #1 , where
P
M
X (k) is the DFT of one period of the periodic sequence. In this case, X (k) = 1 for k {0, 1, . . . , M 1}
PM 1
and DTFT [ (n M k)] = 2 k=0 0 2k M .
P
PM 1
= X0 ( 0 ) 2 k=0 0 2k
P
DTFT [x0 (n)] DTFT [ (n M k)] M
R PM 1
1
= 2
X0 (0 ) 2 k=0 0 0 2k
M d 0 (2.6)
PM 1 2k
= k=0 X0 0 M
Figure 2.6
Usually, we prefer not to have aliasing, so the downsampler is preceded by a lowpass lter to remove all
frequency components above || < M
(Figure 2.7).
Figure 2.7
Figure 2.8
The two lowpass lters can be combined into one LP lter with the lower cuto,
1 if || <
max{L,M }
H () =
0 if
||
max{L,M }
Rate-changing appears expensive computationally, since for both decimation and interpolation the lowpass
lter is implemented at the higher rate. However, this is not necessary.
3.1 Interpolation
For the interpolator, most of the samples in the upsampled signal are zero, and thus require no computation.
(Figure 3.1)
Figure 3.1
11
12 CHAPTER 3. EFFICIENT MULTIRATE FILTER STRUCTURES
For m = Lb m
L c + mmodL and p = mmodL,
PN2
x1 (m) = m=N1 hLp (m) y (m)
P NL2 (3.1)
gp (k) x0 b m
= N
k= L1 Lck
gp (n) = h (Ln + p)
Pictorially, this can be represented as in Figure 3.2.
Figure 3.2
These are called polyphase structures, and the gp (n) are called polyphase lters.
Computational cost
If h (m) is a length-N lter:
No simplication: = LN computations
N
T1
T0 sec
Polyphase structure: L N
L 1
To
computations
sec = N
T0 where L is the number of lters, N
L is the taps/lter,
0
and 1
T0 is the rate.
note: For a given precision, N is proportional to L, (why?), so the computational cost does
increase with the interpolation rate.
Figure 3.3
The decimation structures are ow-graph reversals of the interpolation structure. Although direct imple-
mentation of the full lter for every M th sample is obvious and straightforward, these polyphase structures
give some idea as to how one might evenly partition the computation over M cycles.
Figure 3.4
Figure 3.5
We can couple the lowpass lter either to the interpolator or the decimator to implement it eciently
(Figure 3.6).
Figure 3.6
Of course we only compute the polyphase lter output selected by the decimator.
Computational Cost
Every T1 = L T0 seconds,
M
compute one polyphase lter of length L,
N
or
N N
L L N multiplies
= M
=
T1 L T0
M T0 second
The lter design techniques2 learned earlier can be applied to the design of lters in multirate systems, with
a few twists.
Example 4.1
Design a factor-of-L interpolator for use in a CD player, we might wish that the out-of-band error
be below the least signicant bit, or 96dB down, and < 0.05% error in the passband, so these
specications could be used for optimal L lter design.
In a CD player, the sampling rate is 44.1kHz, corresponding to a Nyquist frequency of 22.05kHz, but
the sampled signal is bandlimited to 20kHz. This leaves a small transition band, from 20kHz to 24.1kHz.
However, note that in any case where the signal spectrum is zero over some band, this introduces other zero
bands in the scaled, replicated spectrum (Figure 4.1).
Figure 4.1
So we need only control the lter response in the stopbands over the frequency regions with nonzero
energy. (Figure 4.2)
1 This content is available online at <http://cnx.org/content/m12773/1.3/>.
2Digital Filter Design <http://cnx.org/content/col10285/latest/>
15
16 CHAPTER 4. FILTER DESIGN FOR MULTIRATE SYSTEMS
Figure 4.2
The extra "don't care" bands allow a given set of specications to be satised with a shorter-length lter.
Figure 4.3
Each gp (n) produces samples x1 (Ln + p) = x0 n + Lp , where n + Lp is not an integer. That is, gp (n) is
to produce an output signal (at a T0 rate) that is x0 (n) time-advanced by a non-integer advance Lp .
The desired response of this polyphase lter is thus
ip
HDp () = e L
for || , an all-pass lter with a linear, non-integer, phase. Each polyphase lter can be designed
independently to approximate this response according to any of the design criteria developed so far.
Exercise 4.1 (Solution on p. 18.)
What should the polyphase lter for p = 0 be?
Example 4.2: Least-squares Polyphase Filter Design
Deterministic x(n): Minimize
X 2
(|x (n) xd (n) |)
n=
Given x (n) = x (n) h (n) and xd (n) = x (n) hd (n). Using Parseval's theorem, this becomes
nP o n R o
2 1 2
min n= (|x (n) xd (n) |) = min 2
(|X () H () X () Hd () |) d
n R
2
o (4.1)
1
= min 2
|H () H d () |(|X () |) d
2
This is simply weighted least squares design, with (|X () |) as the weighting function.
stochastic X():
n h io h i
2 2
min E (|x (n) xd (n) |) = E (|x (n) (h (n) hd (n)) |)
n R
2
o (4.2)
1
= min 2
(|Hd () H () |) Sxx () d
h i
rxx (k) = E x (k + l) x (l)
Problem
Is it feasible to use IIR polyphase lters?
Solution
The recursive feedback of previous outputs means that portions of each IIR polyphase lter must
be computed for every input sample; this usually makes IIR lters more expensive than FIR im-
plementations.
Multistage multirate systems are often more ecient. Suppose oneQpwishes to decimate a signal by an integer
factor M , where M is a composite integer M = M1 M2 . . . Mp = i=1 Mi . A decimator can be implemented
in a multistage fashion by rst decimating by a factor M1 , then decimating this signal by a factor M2 , etc.
(Figure 5.1 (Multistage decimator))
Multistage decimator
Figure 5.1
Multistage implementations are of signicant practical interest only if they oer signicant computational
savings. In fact, they often do!
The computational cost of a single-stage interpolator is:
N taps
M T0 sec
The computational cost of a multistage interpolator is:
N1 N2 Np
+ + +
M1 T0 M1 M2 T0 M T0
1 This content is available online at <http://cnx.org/content/m12803/1.3/>.
19
20 CHAPTER 5. MULTISTAGE MULTIRATE SYSTEMS
The rst term is the most signicant, since the rate is highest. Since Ni Mi for a lowpass lter, it is not
immediately clear that a multistage system should require less computation. However, the multistage struc-
ture relaxes the requirements on the lters, which reduces their length and makes the overall computation
less.
Figure 5.2
Of course, we don't want gain in the transition bands, since this would need to be suppressed later,
but otherwise we don't care about the response in those regions. Since the transition bands are so large,
the required lter turns out to be quite short. The nal stage has no "don't care" regions; however, it is
operating at a low rate, so it is relatively unimportant if the nal lter turns out to be rather long!
So one could choose all lters to have equal specications and require for each-stage lter. For pov 1,
Alternatively, one can design later stages (at lower computation rates) to compensate for the passband ripple
in earlier stages to achieve exceptionally accurate passband response.
s remains essentially unchanged, since the worst-case scenario is for the error to alias into the passband
and undergo no further suppression in subsequent stages.
5.3 Interpolation
Interpolation is the ow-graph reversal of the multi-stage decimator. The rst stage has a cuto at
L
(Figure 5.3):
Figure 5.3
However, all subsequent stages have large bands without signal energy, due to the earlier stages (Fig-
ure 5.4):
Figure 5.4
The order of the lters is reversed, but otherwise the lters are identical to the decimator lters.
Figure 5.5
Figure 5.6
and in practice the inner lowpass lter can be coupled to the decimator or interpolator lters. If the dec-
imator and interpolator are implemented as multistage structures, the overall algorithm can be dramatically
more ecient than direct implementation!
DFT-Based Filterbanks 1
One common application of multirate processing arises in multirate, multi-channel lter banks (Figure 6.1).
Figure 6.1
One application is separating frequency-division-multiplexed channels. If the lters are narrowband, the
output channels can be decimated without signicant aliasing.
Such structures are especially attractive when they can be implemented eciently. For example, if
the lters are simply frequency modulated (by e(i L n) ) versions of each other, they can be eciently
2k
23
24 CHAPTER 6. DFT-BASED FILTERBANKS
from
hk (n) = h (n) e(i )
2kn
N
The output of the k th bandpass lter is simply (assume h (n) are FIR)
x (n m) h (m) e(i )
PM 1 2km
x (n) hk (n) = N
m=0
(6.1)
= yk (n)
Figure 6.2
note: Such systems are used throughout the telephone system, satellite communication links,
etc.
1. Decimate by less ("oversample" the individual channels) such as decimating by a factor of N2 . This is
eciently done by time-stepping by the appropriate factor.
2. Design better (and thus longer) lters, say of length LN . These can be eciently computed by
producing only N (every Lth) FFT outputs using simplied FFTs.
Although the DFT lterbanks are widely used, there is a problem with aliasing in the decimated channels. At
rst glance, one might think that this is an insurmountable problem and must simply be accepted. Clearly,
with FIR lters and maximal decimation, aliasing will occur. However, a simple example will show that it
is possible to exactly cancel out aliasing under certain conditions!!!
Consider the following trivial lterbank system, with two channels. (Figure 7.1)
Figure 7.1
^
Note x (n) = x (n) with no error whatsoever, although clearly aliasing occurs in both channels! Note
that the overall data rate is still the Nyquist rate, so there are clearly enough degrees of freedom available
to reconstruct the data, if the lterbank is designed carefully. However, this isn't splitting the data into
separate frequency bands, so one questions whether something other than this trivial example could work.
Let's consider a general two-channel lterbank, and try to determine conditions under which aliasing can
be cancelled, and the signal can be reconstructed perfectly (Figure 7.2).
Figure 7.2
27
28 CHAPTER 7. QUADRATURE MIRROR FILTERBANKS (QMF)
^
Let's derive x (n), using z-transforms, in terms of the components of this system. Recall (Figure 7.3) is
equivalent to
Y (z) = H (z) X (z)
Y () = H () X ()
Figure 7.3
Y () = X (L)
Figure 7.4
M 1
1 X 2k
Y () = X +
M M M
k=0
Figure 7.5
Let n = M m and m = M,
n
then
n
X X
Y (z) = x (n) (n M p) z M
n= p=
Now h i
P PM 1
x (n) p= (n M p) = IDFT x () 2
M k=0 M
2k
h P i
M 1
= IDFT 2M k=0 X 2k
M
(7.1)
1
PM 1 nk
= M k=0 X (n) WM | i2
W M=e M
so
P PM 1 nk n
Y (z) = n=
1
M x (n) WM
k=0 z M
n
(7.2)
1
PM 1 +k M 1
= M k=0 x (n) WM z
1
PM 1 1 k
= M k=0 X z WM
M
^ ^
Armed with these results, let's determine X (z) x (n). (Figure 7.6)
Figure 7.6
Note
U1 (z) = X (z) H0 (z)
1
1 X 1 i2k 1 1 1 1 1 1 1
U2 (z) = X z 2 e 2 H0 z 2 e(ik) = X z 2 H0 z 2 + X z 2 H0 z 2
2 2 2
k=0
1 1
U3 (z) = X (z) H0 (z) + X (z) H0 (z)
2 2
1 1
U4 (z) = F0 (z) H0 (z) X (z) + F0 (z) H0 (z) X (z)
2 2
and
1 1 1 1
L4 (z) = F1 (z) H1 (z) X (z) + F1 (z) H1 (z) X (z) = F1 (z) H1 (z) X (z) + F1 (z) H1 (z) X (z)
2 2 2 2
Finally then,
^
X (z) = U4 (z)+L4 (z) = 12 (H0 (z) F0 (z) X (z) + H0 (z) F0 (z) X (z) + H1 (z) F1 (z) X(7.3)
(z) + H1 (z) F1 (
1 1
2
(H0 (z) F0 (z) + H1 (z) F1 (z)) X (z) + 2 (H0 (z) F0 (z) + H1 (z) F1 (z)) X (z)
means p (n) = 0, when n is even. If we choose h0 (n) and h1 (n) to be linear phase, p (n) will also be linear
phase. Thus by choosing h0 (n) and h1 (n) to be FIR linear phase, we eliminate phase distortion and get
FIR lters as well (condition 4).
Amplitude distortion
Assuming aliasing cancellation and elimination of phase distortion, we might also desire no amplitude
distortion ( |T () | = 1). All of these conditions require
1
T (z) = (H0 (z) H1 (z) H1 (z) H0 (z)) = cz D
2
where c is some constant and D is a linear phase delay. c = 1 for |T () | = 1. It can be shown by considering
that the following can be satised!
2p (z) = 2c (n D) if n is odd
T (z) = P (z) P (z) = 2cz D
p (n) = anything if n is even
Thus we require
0
N
X
P (z) = p (2n) z (2n) + z D
n=0
Any factorization of a P (z) of this form, P (z) = A (z) B (z) can lead to a Perfect Reconstruction lter bank
of the form
H0 (z) = A (z)
H1 (z) = B (z)
[This result is attributed to Vetterli.] A well-known special case (Smith and Barnwell)
H1 (z) = z (2D)+1 H0 z 1
Design techniques exist for optimally choosing the coecients of these lters, under all of these constraints.
Quadrature Mirror Filters
H1 (z) = H0 (z) H1 () = H0 ( + ) = H0 ( ) (7.4)
for real-valued lters. The frequency response is "mirrored" around = 2 . This choice leads to T (z) =
H0 2 (z) H0 2 (z): it can be shown that this can be a perfect reconstruction system only if
which isn't a very exible choice of lters, and not a very good lowpass! The Smith and Barnwell approach
is more commonly used today.
The theory of M-band QMFBs and PRFBs has been investigated recently. Some results are available.
Figure 8.1
Thus we can recursively decompose a signal into 2p bands, each sampled at 2p th the rate of the original
signal, and reconstruct exactly! Due to the tree structure, this can be quite ecient, and in fact close to the
eciency of an FFT lter bank, which does not have perfect reconstruction.
33
34 CHAPTER 8. M-CHANNEL FILTER BANKS
Figure 8.2
This is good for image coding, because the energy tends to be distributed such that after a wavelet
decomposition, each band has roughly equal energy.
[2] R.E. Crochiere and L.R. Rabiner. Multirate Digital Signal Processing . Prentice-Hall, Englewood Clis,
NJ, 1983.
[3] O. Rioul and M. Vetterli. Wavelets and signal processing. IEEE Signal Processing Magazine , 8(4):1438,
October 1991.
[4] P.P Vaidyanathan. Multirate digital lters, lter banks, polyphase networks, and applications: A tutorial.
Proc. IEEE, 78(1):5693, January 1990.
35
36 INDEX
Attributions
Collection: Multirate Signal Processing
Edited by: Douglas L. Jones
URL: http://cnx.org/content/col10287/1.1/
License: http://creativecommons.org/licenses/by/2.0/
Module: "Overview of Multirate Signal Processing"
By: Douglas L. Jones
URL: http://cnx.org/content/m12777/1.3/
Pages: 1-3
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
Module: "Interpolation, Decimation, and Rate Changing by Integer Fractions"
By: Douglas L. Jones
URL: http://cnx.org/content/m12801/1.3/
Pages: 5-9
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
Module: "Ecient Multirate Filter Structures"
By: Douglas L. Jones
URL: http://cnx.org/content/m12800/1.3/
Pages: 11-14
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
Module: "Filter Design for Multirate Systems"
By: Douglas L. Jones
URL: http://cnx.org/content/m12773/1.3/
Pages: 15-18
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
Module: "Multistage Multirate Systems"
By: Douglas L. Jones
URL: http://cnx.org/content/m12803/1.3/
Pages: 19-22
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
Module: "DFT-Based Filterbanks"
By: Douglas L. Jones
URL: http://cnx.org/content/m12771/1.3/
Pages: 23-25
Copyright: Douglas L. Jones
License: http://creativecommons.org/licenses/by/2.0/
About Connexions
Since 1999, Connexions has been pioneering a global system where anyone can create course materials and
make them fully accessible and easily reusable free of charge. We are a Web-based authoring, teaching and
learning environment open to anyone interested in education, including students, teachers, professors and
lifelong learners. We connect ideas and facilitate educational communities.
Connexions's modular, interactive courses are in use worldwide by universities, community colleges, K-12
schools, distance learners, and lifelong learners. Connexions materials are in many languages, including
English, Spanish, Chinese, Japanese, Italian, Vietnamese, French, Portuguese, and Thai. Connexions is part
of an exciting new information distribution system that allows for Print on Demand Books. Connexions
has partnered with innovative on-demand publisher QOOP to accelerate the delivery of printed course
materials and textbooks into classrooms worldwide at lower prices than traditional academic publishers.