Polyphase FIlters Revised
Polyphase FIlters Revised
1/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.
2/39
Efficient FIR Filtering for Decimation
Filtering : xˆ[n] = ∑ x[i ] h[n − i ]
i
= ∑ x[i] h[nM − i]
i
i=0 1 2 3 4 5 6 7 8 9 10 11
M=3
x[i]
Outputs
are the
Same
Efficient Polyphase Form of FIR Decimation
0 x[1] x[4] x[7] … h[2] h[6]
xˆ (↓3) [0] xˆ (↓3) [1] …
0 0 x[0] x[1] x[2] … 0 x[2] x[5] x[8] … h[1] h[4]
Σ
x[0] x[3] x[6] x[9] … h[0] h[3]
5/39
Example of Polyphase Filters for Decimation
Consider Length-10 Filter w/ M=4
i: 0 1 2 3 4 5 6 7 8 9 10 11 12
h[i]: h[0] h[1] h[2] h[3] h[4] h[5] h[6] h[7] h[8] h[9] 0 0 0 ….
i′: 0 1 2
p0[i′]: h[0] h[4] h[8]
p1[i′]: h[1] h[5] h[9]
p2[i′]: h[2] h[6] 0
p3[i′]: h[3] h[7] 0
i=0 1 2 3 4 5 6 7 8 9 10 11
L=3
x(↑3)[i] x[0] 0 0 x[1] 0 0 x[2] 0 0 x[3] 0 0
8/39
Efficient FIR Filtering for Interpolation
Interpolation : xˆ( ↑ L ) [n] = ∑ x[i ] h[n − Li ]
i
i=0 1 2 3
L=3
x[i] x[0] x[1] x[2] x[3]
xˆ(↑3) [6]
xˆ(↑3) [7]
xˆ(↑3) [8]
xˆ(↑3) [9]
xˆ(↑ 3) [10]
xˆ(↑3) [11]
9/39
Efficient FIR Filtering for Interpolation
Original Filter…
h[0] h[1] h[2] h[3] h[4] h[5] L=3
x[n] y[n]
↓M = Hz(z)
x[n] y[n]
Hz(zM) ↓M
Then…
y[n ] = v[nM ]
= ∑ h[k ]x[(n − k ) M ]
k
13/39
ZD Proof of Decimation Identity
For the second system:
Xz(z) Vz(z) Yz(z)
Gz(z) = Hz(zM) ↓M
Which is clearly the same thing that the first system gives:
{Xz(z)}(↓M)
Xz(z) Yz(z)=Hz(z){Xz(z)}(↓M)
↓M Hz(z)
15/39
Expansion Identity
This identity asserts equality between the following 2 systems:
w[n]
x[n] y[n]
Hz(z) ↑L
=
x[n] v[n] y[n]
↑L Hz(zL)
16/39
ZD Proof of Expansion Identity
First system gives: w[n]
x[n] y[n]
Hz(z) ↑L
W z ( z) = X z ( z)H z ( z)
Then… Y z ( z ) = W(z↑ L ) ( z ) = W z ( z L )
= X z ( z L )H z ( z L )
Then… Y z ( z) = V z ( z)H z ( z L )
= X z ( z L )H z ( z L )
17/39
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:
x[n] y[n]
Recall Decimation: Hz(z) ↓M
i ′ = integer
i = i ′M + m
0 ≤ m ≤ M − 1 M = Block Size
19/39
12.4.2 Polyphase Rep of Dec (cont.)
∑ h[i ]x[nM − i ]
each block
y[ n ] = • Sum up all
i Block Results
M −1
= ∑ ∑ h[i ′M + m]x[nM
#&& i ′M
−" &−&
!m]
i ′ m =0 ( n − i ′) M − m
M −1
= ∑∑ h[i ′M + m]x[(n − i ′) M − m] (!!!!)
m =0 i ′
20/39
12.4.2 Polyphase Rep of Dec (cont.)
Now, let’s interpret this:
Define for each m, 0 ≤ m ≤ M-1
pm [i ′] = h[i ′M + m ] mth Polyphase
Component of h[n]
Example n: 0 1 2 3 4 5 6
h[n]: 1.2 4 0.5 7 1 1.7 2 0 0…
M=3
p0 [i ′] = {1.2, 7, 2}
p1[i ′] = {4, 1, 0} Each one is a decimated version of h[n]
p2 [i ′] = {0.5, 1.7, 0} & the versions are staggered
22/39
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]
h[n + m] ↔ e jθm H f (θ )
" “Polyphase”
23/39
12.4.2 Polyphase Rep of Dec (cont.)
Now… let’s chop up the input similarly:
um [n ] = x[nM − m ]
m Backward
0 1 2 % M −1 Indexing
n
$ $ $ $ $ $
Differs From Before:
−1 − M − M −1 % − 2M + 1 Each row is indexed
backward
0 0 −1 −2 % − M +1
1 M M −1 M −2 % 1
2 2M % M +2 M +1
$ $ $ $ $ $
24/39
12.4.2 Polyphase Rep of Dec (cont.)
Now… back to the mathematical development.
Putting these re-indexed versions into (!!!!):
M −1
y[ n ] = ∑∑ h[i ′M + m]x[(n − i ′) M − m]
m =0 i′
pm [i ′] = h[i ′M + m ]
um [n ] = x[nM − m ]
M −1
y[n ] = ∑ ∑ pm [i ′]um [n − i ′]
To Implement Polyphase Decimation
m =0 i ′ • Chop up filter into M sub-filters
M −1 • Chop up signal into M sub-signals
= ∑{pm * um }[n] • Filter each sub-signal w/ a sub-filter
• Add outputs point-by-point
m =0
25/39
12.4.2 Polyphase Rep of Dec (cont.)
Two equivalent ways to think of this:
First Way (shown for M=3):
Note that
Decimation occurs
Before Filtering –
Efficient!!!
26/39
12.4.2 Polyphase Rep of Dec (cont.)
Second Way to View It (shown for M=3):
28/39
12.4.2 Polyphase Rep of Dec (cont.)
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
3. Add them up Expansion!
Recall Example:
p0 [i ′] = {1.2, 7, 2} {1.2, 0, 0, 7, 0, 0, 2, 0, 0}
p1[i ′] = {4, 1, 0} { 4, 0, 0, 1, 0, 0, 0, 0, 0}
p0 [i ′] = {0.5, 1.7, 0} {0.5, 0, 0, 1.7, 0, 0, 0, 0, 0}
{1.2, 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}
h[n ] = {1.2, 4, 0.5, 7, 1, 1.7, 2, 0, 0}
29/39
12.4.2 Polyphase Rep of Dec (cont.)
Thus…. M −1
h[n ] = ∑{ p m (↑M )
}[n − m ]
m =0
V z ( z) = X z ( z)H z ( z)
M −1
= ∑ m
z −m z M
P ( z ) X z
( z)
m =0
30/39
12.4.2 Polyphase Rep of Dec (cont.)
… and after ↓M we get: Xz(z) Vz(z) Yz(z)
z z Hz(z) ↓M
Y ( z ) = {V ( z )}( ↓ M )
M −1
= ∑ #&&m&&"&&
{ z −m z M
P ( z ) X z
( z )}( ↓ M )
&&!
By the
“Decimation
m =0
= Pmz ( z ){z − m X z ( z )}( ↓ M ) Identity”
M −1
= ∑ m #&&
P z
( z ){ z −m z
X ( z )}( ↓ M )
&"&&& !
By Definition
Signal’s
m =0
U mz ( z ) Polyphase
M −1 Components
= ∑ m m ( z)
P z
( z )U z
m =0
n ′ integer
Re-Index using: n = n ′L + ( L − 1) − l
#&"& !
"backwards" 0 ≤ l ≤ L − 1
n’ = Block Index
l = In-Block Index (indexes backward through block)
32/39
12.4.3 Polyphase Rep of Exp (cont.)
n ′ integer
n = n ′L + ( L − 1) − l
#&"& !
"backwards" 0 ≤ l ≤ L − 1
l
0 1 2 % L −1
n′ Expansion
$ $ $ $ $ $ Re-Index
Table
−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
$ $ $ $ $ $
33/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 ]
&&!
n i n
= ∑ x[i ]h[(n′ − i ) L + ( L − 1) − l ]
i
v0 [n ′] v1[n ′] v2 [n ′]
l
0 1 2
n′
$ $ $ $
− 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]
$ $ $ $
35/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 %
Note: Expansion
Occurs After
Filtering – Efficient!!
37/39
12.4.3 Polyphase Rep of Exp (cont.)
An equivalent alternate form of this processing is…
38/39
Skip 12.4.4 Shows how to do polyphase method for
rational rate change of L/M
x[n] y[n]
↑L h[n] ↓M