2. 2/39
12.4 Polyphase Filters
Polyphase is a way of doing sampling-rate conversion that leads
to very efficient implementations.
But more than that, it leads to very general viewpoints that
are useful in building filter banks.
Before we delve into the math we can see a lot just by looking
at the structure of the filtering….
……… Of course, we WILL need to do the math, too, though.
7. 7/39
Matlab Code
% Create input signal and filter
x=1:21;
h=[1 2 3 4 5 6 7 8 9 10 0 0];
% %%%%%% Direct Form (Inefficient) %%%%%%
y=filter(h,1,x); % Compute filter output
y_dec=y(1:4:end) % Throw away unneeded output samples
% %%%%%% Polyphase Form (Efficient) %%%%%%
% Select polyphase filters
p0=h(1:4:end)
p1=h(2:4:end)
p2=h(3:4:end)
p3=h(4:4:end)
% Select polyphase signals
x0=x(1:4:end)
x1=[0 x(4:4:end)]
x2=[0 x(3:4:end)]
x3=[0 x(2:4:end)]
% filter each polyphase component and add together
y_poly_dec=filter(p0,1,x0)+filter(p1,1,x1)+filter(p2,1,x2)+filter(p3,1,x3)
Example of Polyphase Filters for Decimation (pt. 2)
Pad zeros to make length equal to
integer multiple of M
Put a zero in front to provide the
x[-3], x[-2], and x[-1] terms
9. xˆ(L)
[n] x[i] h[n Li]
i
Interpolation :
Efficient FIR Filtering for Interpolation
i = 0 1 2 3
x[0] x[1] x[2]
x[3]
x[i]
L = 3
xˆ(3)
[6]
xˆ(3)
[7]
xˆ(3)
[8]
xˆ(3)
[9]
xˆ(3)
[10]
xˆ(3)
[11]
9/39
10. Efficient FIR Filtering for Interpolation
L = 3
Original Filter…
h[0] h[1] h[2] h[3] h[4] h[5]
The output comes from
alternating between the
subfilter outputs
Advantage
Filter then
Interpolate
10/39
… gets split into L = 3 subfilters:
Polyphase Form of FIR Interpolation
…xˆ(3)
[6]
xˆ(3)
[9] …
x[0] x[1] x[2] x[3] …
The input goes
into each subfilter
h[0] h[3]
…xˆ(3)[7] xˆ(3)
[10] …
h[1] h[4]
… xˆ(3)[8] xˆ(3)
[11]…
h[2] h[5]
11. 12.4.1 Multirate Identities
These provide analysis “tricks” useful when dealing
with mathematical analysis of multirate systems.
The question in general is: How can we interchange the order of
filtering w/ decimation/expansion?
Decimation Identity
This identity asserts equality between the following 2 systems:
Can prove this either in the Time-Domain or Z-Domain
M Hz(z)
x[n]
y[n]
Hz(zM)
M
x[n]
11/39
y[n]
=
12. TD Proof of Decimation Identity
M Hz(z)
x[n]
y[n]
For the first system:
w[n] = x[nM]
y[n] w[n]* h[n] h[k ]w[n
k ]
k
h[k ]x[(n k )M ]
k
For the second
system:
Gz(z) = Hz(zM)
M
x[n] y[n]
v[n]
0,
h[n / M ],if n / M
integer
g[n] h(M )[n] By Eq. (12.15)
12/39
()
13. TD Proof of Decimation Identity (cont.)
Then…
y[n] v[nM ]
h[k ]x[(n k )M ]
k
Same as for System #1 Proved!!!
Thus…
v[n] x[n]* g[n] g[l]x[n
l]
l
h[k ]x[n kM ]
k
Use ()
13/39
14. 14/39
ZD Proof of Decimation Identity
For the second system:
Gz(z) = Hz(zM)
M
Xz(z) Vz(z) Yz(z)
V z
(z) X z
(z)H z
(z M
) ()
where…
Now… M
(z1/ MW m )M zW mM z
# M_ ,
e j 2 1
But…
1 M 1
m0
1 M 1 z 1/ M m
M
V (z WM )
Y z
(z) {V z
(z)}
(M )
z 1/
M
m0
1/ MW m )M )
M
W m
)H z
(( z
M
M
X (z
By ZT Result
for Decimation
Use
()
15. ZD Proof of Decimation Identity (cont.)
1
z
z
z 1/
M
X
(z)
(M
)
m0
M 1
m0
X (z W m
)H z
(z)
M
H (z)
WM
)
z z 1/ M m
z
Y (z)
M
1 M
1
H (z)
X (z
M
Which is clearly the same thing that the first system
gives:
M Hz(z)
Xz(z)
15/39
{Xz(z)}(M)
Yz(z)=Hz(z){Xz(z)}(M)
16. Expansion Identity
This identity asserts equality between the following 2
systems:
L Hz(zL)
x[n] y[n]
Hz(z) L
x[n]
16/39
y[n]
Will give only Z-Domain proof here.
=
w[n]
v[n]
17. ZD Proof of Expansion Identity
Hz(z) L
x[n] y[n]
w[n]
First system gives:
W z
(z) X z
(z)H z
(z)
Then…
X z
(z L
)H z
(z
L
)
Y z
(z) W z
(z) W z
(z
L
)
(L)
v[n]
Second system gives:
L Hz(zL)
x[n] y[n]
V z
(z) X z
(z) X z
(z
L
)
(L)
Then… Y z
(z) V z
(z)H z
(z L
)
X z
(z L
)H z
(z
Same!
17/39
18. 12.4.2 Polyphase Representation of Decimation
Now we re-visit this topic and do it mathematically…
Basic Math Idea: Re-write convolution sum's index & manipulate
to get “parallel” filters:
Hz(z)
M
x[n]
y[n]
Recall Decimation:
Output given by (12.17) as…
y[n] h[i]x[nM i]
i
Write sum's index in “block form” – a
common “trick”:
()
Counts Blocks Counts Samples Inside a Block
18/39
0 m M 1
i
integer
i iM m M = Block Size
19. 12.4.2 Polyphase Rep of Dec (cont.)
Block-Based Indexing:
2
1
0
m
i
⁝ ⁝ ⁝ ⁝ ⁝ ⁝
1 M M 1 ⋯ 2 1 Each row is
0 0 1 2 ⋯ M 1 indexed forward
1 M M 1 M 2 ⋯ 2M 1
2 2M 2M 1 2M 2 ⋯ 3M 1
⁝ ⁝ ⁝ ⁝ ⁝ ⁝
⋯ M 1
0 m M 1
i
integer
i iM m
Forward
Indexing
19/39
20. 12.4.2 Polyphase Rep of Dec (cont.)
• Sum up inside
each block
• Sum up all
Block
Results
Sum all elements in
the mth position of
each block
M 1
20/39
h[iM m]x[(n i)M m]
m0 i
i m0 (ni)M m
M 1
Use Block Indexing in ():
y[n] h[i]x[nM i]
i
h[iM m]x[n#M–
–_iM–
–
,m] ()
21. 21/39
12.4.2 Polyphase Rep of Dec (cont.)
Now, let's interpret this:
Define for each m, 0 m M-1
m
p [i] h[iM m]
mth Polyphase
Component of h[n]
Each one is a decimated version of
h[n] & the versions are staggered
< See Fig. 12.15>
1.7,
0}
p0[i] {1.2, 7,
2}
p1[i] {4, 1, 0}
Example n: 0 1
h[n]: 1.2 4
2 3
0.5 7
4
1
5 6
1.7 2 0 0…
M=3
23. 12.4.2 Polyphase Rep of Dec (cont.)
What have we done?
Split up h[n] into M subsequences – where the mth
subsequence is a decimated-by-M version of h[n + m]
Why the name “Polyphase”?
Recall: Time-Shift in TD Phase-Shift in FD
h[n m] e jm
H f
( )
“Polyphase”
23/39
24. 12.4.2 Polyphase Rep of Dec (cont.)
Now… let's chop up the input similarly:
um [n] x[nM m]
⋯
2
1
0
⁝ ⁝ ⁝ ⁝ ⁝ ⁝
1 M M 1 ⋯ 2M 1
0 0 1 2 ⋯ M 1
1 M M 1 M 2 ⋯ 1
2 2M ⋯ M 2 M 1
⁝ ⁝ ⁝ ⁝ ⁝ ⁝
M 1
m
n
Differs From Before:
Each row is indexed
backward
24/39
Backward
Indexing
25. 12.4.2 Polyphase Rep of Dec (cont.)
Now… back to the mathematical development.
Putting these re-indexed versions into ():
M 1
pm * um
M 1
y[n] h[iM m]x[(n i)M m]
m0 i
pm [i] h[iM m]
um [n] x[nM m]
M 1
m0
i
m m
p [i ]u [n
i ]
y[n]
To Implement Polyphase Decimation
• Chop up filter into M sub-filters
• Chop up signal into M sub-signals
• Filter each sub-signal w/ a sub-filter
• Add outputs point-by-point
25/39
26. 12.4.2 Polyphase Rep of Dec (cont.)
Two equivalent ways to think of this:
<This is Fig. 12.16 from Porat's Book>
First Way (shown for M=3):
Note that
Decimation occurs
Before Filtering –
Efficient!!!
26/39
27. 12.4.2 Polyphase Rep of Dec (cont.)
27/39
<This is Fig. 12.17 from Porat's Book>
Second Way to View It (shown for M=3):
28. 28/39
12.4.2 Polyphase Rep of Dec (cont.)
Now we re-analyze this set-up, but in the Z-Domain….
Why? ….It provides further analysis insight.
Z-Domain results often provide insight into how to:
• Derive other results
• Design Polyphase Filters
• Etc.
29. 12.4.2 Polyphase Rep of Dec (cont.)
Recall Example:
p0 [i] {1.2, 7, 2}
p1[i] {4, 1, 0}
p0 [i] {0.5, 1.7,
0}
Expansion!
First…. some time-domain trickery:
How do we get back h[n] from the pm[n]???
1. Insert M-1 zeros between each sample
2. “Line them up” using delays
2, 0, 0}
0, 0, 0}
0, 0, 0}
{1.2, 0, 0, 7, 0, 0,
{ 4, 0, 0, 1, 0, 0,
{0.5, 0, 0, 1.7, 0, 0,
0, 0, 7, 0, 0, 2, 0, 0}
{ 0, 4, 0, 0, 1, 0, 0, 0, 0}
{ 0, 0, 0.5, 0, 0, 1.7, 0, 0, 0}
{1.2,
h[n] {1.2, 4, 0.5, 7, 1, 1.7, 2, 0,
0}
3. Add them
up
29/39
30. 12.4.2 Polyphase Rep of Dec (cont.)
Thus…. M 1
m0
h[n]
{pm
}[n m]
( M )
So…. in Z-Domain we have:
M 1
m
m z M
z
z P (z )
H (z)
Delay Expand
m0
Now… filter/decimate looks like this:
Hz(z)
M
Xz(z) Yz(z)
Vz(z)
M 1
m0
m
m z M z
V z
(z) X z
(z)H z
(z)
) X (z)
z P (z
30/39
31. 12.4.2 Polyphase Rep of Dec (cont.)
M 1
m0
M 1
m0
(M
)
m z
M 1
m0
{z m
Pz
(z M
) X z
(z)}(M
)
… and after M we
get:
Y z
(z) {V z
(z)}(M )
( M
)
Pz
( z){zm
X z
( z)}
z
z
m m
P (z)U (z)
z
m X (z)}
P (z){z
U z
( z)
m
m
# – – m
– – _ – – – – ,
# – –– _ – – –,
Hz(z)
M
Xz(z) Yz(z)
Vz(z)
By the
“Decimation
Identity”
By Definition
Signal's
Polyphase
Components
….which is the Z-Domain Description of the polyphase
decimation structure. We have now developed two different
derivations of the polyphase structure.
31/39
32. 12.4.3 Polyphase Rep of Expansion
L Hz(z)
x[n]
32/39
y[n]
Recall Expansion:
Output given by (12.19) as…
y[n] x[i]h[n Li]
i
Re-Index using:
0 l L 1
n
n nL (L 1) l
integer
# – _ –,
"backwards"
n’ = Block Index
l = In-Block Index (indexes backward through
block)
33. ⁝ ⁝ ⁝ ⁝ ⁝ ⁝
1 1 2 ⋯ L
0 L 1 L 2 L 3 ⋯ 0
1 2L 1 2L 2 2L 3 ⋯ L
2 3L 1 3L 2 3L 3 ⋯ 2L
⁝ ⁝ ⁝ ⁝ ⁝ ⁝
2 ⋯ L 1
l
n
1
0
12.4.3 Polyphase Rep of Exp (cont.)
33/39
0 l L 1
n
n nL (L 1) l
integer
# – _ –,
"backwards"
Expansion
Re-Index
Table
34. 34/39
12.4.3 Polyphase Rep of Exp (cont.)
Using this re-indexing gives…
y[n] x[i]h[n Li]
i
y[n#
L––(_L –1–) ,l] x[i]h[n#
L––(_L –1–)
,l Li]
i n
x[i]h[(n i)L (L 1) l]
i
n
… for each l, this indexing just reads down a
column of the “Expansion Re-Index Table”
For each l such that 0 l L – 1 we define:
ql [n] h[nL (L 1) l]
vl [n] y[nL (L 1) l]
vl [n] {x ql }[n]
35. 12.4.3 Polyphase Rep of Exp (cont.)
To see this indexing structure, look at an example with L = 3:
⁝ ⁝ ⁝ ⁝
1 y[1] y[2] y[3]
0 y[2] y[1] y[0]
1 y[5] y[4] y[3]
2 y[8] y[7] y[6]
⁝ ⁝ ⁝ ⁝
l
n
v0[n] v1[n] v2
[n]
0 1
2
35/39
36. 36/39
12.4.3 Polyphase Rep of Exp (cont.)
Now… how do we get y[n] from the vl's??
If we interpolate each vl sequence we get (L = 3)….
⋯
y[3]
0 0 y[0] 0 0 y[3] 0 0 y[6] 0 0 ⋯
⋯
y[2]
0 0 y[1] 0 0 y[4] 0 0 y[7] 0 0 ⋯
⋯
y[1]
0 0 y[2] 0 0 y[5] 0 0 y[8] 0 0 ⋯
Now delay these interpolated sequences…
⋯ y[3] 0 0 y[0] 0 0 y[3] 0 0 y[6] 0 0 ⋯
⋯ 0 y[2] 0 0 y[1
]
0 0 y[4] 0 0 y[7] 0 ⋯
To get y[n]: add up the delayed, interpolated components!!
37. 12.4.3 Polyphase Rep of Exp (cont.)
From this we see that we can write…
L1
y[n] {vl }(L)[n (L 1) l]
l 0
Recall: vl [n] {x ql }[n]
This leads to the following polyphase implementation for expansion:
37/39
Note: Expansion
Occurs After
Filtering – Efficient!!
38. 12.4.3 Polyphase Rep of Exp (cont.)
An equivalent alternate form of this processing is…
38/39
39. Skip 12.4.4 Shows how to do polyphase method for
rational rate change of L/M
L h1[n]
x[n] y[n]
h2[n] M
But briefly… to change the rate by factor of
L/M
Interpolate
Decimate
which is equivalent to…
L h[n]
x[n] y[n]
M
Q: How to implement this efficiently using polyphase ideas?
If interested: see Ch.3 of Oppenheim & Lim (on reserve)
39/39