0% found this document useful (0 votes)
244 views39 pages

Polyphase FIlters Revised

Polyphase filters provide an efficient implementation of sampling rate conversion using filtering and decimation/interpolation. The polyphase form splits the original filter into multiple subfilters that are applied in parallel to different polyphase components of the input signal before being combined. This is more efficient than direct implementation of filtering followed by decimation/interpolation. Multirate identities allow analyzing systems by interchanging the order of filtering and decimation/interpolation operations, such as proving equivalence between filtering before and after decimation.

Uploaded by

Canbruce Luwang
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
244 views39 pages

Polyphase FIlters Revised

Polyphase filters provide an efficient implementation of sampling rate conversion using filtering and decimation/interpolation. The polyphase form splits the original filter into multiple subfilters that are applied in parallel to different polyphase components of the input signal before being combined. This is more efficient than direct implementation of filtering followed by decimation/interpolation. Multirate identities allow analyzing systems by interchanging the order of filtering and decimation/interpolation operations, such as proving equivalence between filtering before and after decimation.

Uploaded by

Canbruce Luwang
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Polyphase Filters

Section 12.4 Porat

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

Decimation : xˆ(↓ M ) [n] = xˆ[nM ]

= ∑ x[i] h[nM − i]
i

i=0 1 2 3 4 5 6 7 8 9 10 11
M=3
x[i]

h[3 – i] x̂[3] xˆ(↓ 3) [1]


h[4 – i] x̂[4]
Don’t
h[5 – i] x̂[5] Compute
h[6 – i]
x̂[6] xˆ(↓ 3) [2]
h[7 – i] x̂[7]
Don’t
h[8 – i] x̂[8] Compute
3/39
Efficient FIR Filtering for Decimation M=3
i=0 1 2 3 4 5 6 7 8 9 10 11 12
x[i] x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7] x[8] x[9] x[10] x[11] x[12]
h[6 – i] xˆ(↓3) [2]
h[9 – i] xˆ(↓ 3) [3]
h[12 – i] xˆ (↓3) [4]

h[0] h[1] h[2] h[3] h[4] h[5]


Original Filter… …gets split into M=3 subfilters:
Polyphase Form of FIR Decimation
… x[1] x[4] x[7] x[10] … h[2] h[6]

… xˆ(↓3) [2] xˆ(↓3) [3] …


… x[2] x[5] x[8] x[11] … h[1] h[4]
Σ
… x[3] x[6] x[9] x[12] … h[0] h[3]

Advantage: “Decimate” then Filter 4/39


Inefficient Direct Form of FIR Decimation

x[0] x[1] x[2] …


xˆ (↓3) [0] xˆ (↓3) [1] …
h[0] h[1] h[2] h[3] h[4] h[5]
↓3

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 ….

Length of Polyphase Filters: ceil{length/M} = ceil{10/4} = 3

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

x0[n]: x[0] x[4] x[8] x[12] x[16] ….


x1[n]: x[-1] x[3] x[7] x[11] x[15] ….
x2[n]: x[-2] x[2] x[6] x[10] x[14] ….
x3[n]: x[-3] x[1] x[5] x[9] x[13] ….
6/39
Example of Polyphase Filters for Decimation (pt. 2)
Matlab Code
% Create input signal and filter Pad zeros to make length equal to
x=1:21; integer multiple of M
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 Put a zero in front to provide the
x0=x(1:4:end) x[-3], x[-2], and x[-1] terms
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) 7/39
Efficient FIR Filtering for Interpolation

Interpolation : xˆ( ↑ L ) [n] = ∑x i


(↑ L )
[i ] h[n − i ]

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

h[6 – i] xˆ(↑3) [6]


h[7 – i] xˆ(↑3) [7]
h[8 – i] xˆ(↑3) [8]
h[9 – i] xˆ(↑3) [9]

h[10 – i] xˆ(↑ 3) [10]


h[10 – i] xˆ (↑3) [11]

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

… gets split into L = 3 subfilters:

Polyphase Form of FIR Interpolation


… xˆ(↑3) [6] xˆ(↑3) [9] …
h[0] h[3]

x[0] x[1] x[2] x[3] …


h[1] h[4] …xˆ(↑3) [7] xˆ(↑3) [10] …
The input goes h[2] h[5] … xˆ(↑3) [8] xˆ(↑3) [11] …
into each subfilter
The output comes from
Advantage alternating between the
Filter then subfilter outputs
Interpolate
10/39
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:

x[n] y[n]
↓M = Hz(z)

x[n] y[n]
Hz(zM) ↓M

Can prove this either in the Time-Domain or Z-Domain


11/39
TD Proof of Decimation Identity
For the first system:
w[n] = x[nM]
x[n] y[n]
↓M Hz(z)

y[n ] = w[n ] * h[n ] = ∑ h[k ]w[n − k ]


k
= ∑ h[k ]x[(n − k ) M ]
k
For the second system:
v[n]
x[n] y[n]
Gz(z) = Hz(zM) ↓M
g [n ] = h( ↑ M ) [n ] By Eq. (12.15)

h[n / M ], if n / M = integer (!)


=
0, otherwise
12/39
TD Proof of Decimation Identity (cont.)
Thus…
v[n ] = x[n ] * g [n ] = ∑ g [l ] x[n − l ]
l
= ∑ h[k ]x[n − kM ] Use (!)
k

Then…
y[n ] = v[nM ]
= ∑ h[k ]x[(n − k ) M ]
k

Same as for System #1 " Proved!!!

13/39
ZD Proof of Decimation Identity
For the second system:
Xz(z) Vz(z) Yz(z)
Gz(z) = Hz(zM) ↓M

where… V z ( z) = X z ( z)H z ( z M ) (!!)

But… Y z ( z ) = {V z ( z )}( ↓ M ) By ZT Result


for Decimation
M −1
1
=
M
∑ ( z WM )
V z 1 / M −m
Use (!!)
m =0
M −1
1
=
M
∑ X z 1 / M −m
( z W M ) H z
(( z 1 / M −m M
WM ) )
m =0

Now… ( z1 / M WM− m ) M = zWM− mM = z


#"!
e j 2π =1 14/39
ZD Proof of Decimation Identity (cont.)
M −1
1
Y z ( z) =
M
∑ X z 1 / M −m
( z W M ) H z
( z)
m =0
1 M −1 
z
= H ( z) ∑X z
(z 1/ M
WM−m )
 M m =0 
{ }
= H z ( z ) X z ( z ) (↓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)

Will give only Z-Domain proof here.

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 )

Second system gives: v[n]


x[n] y[n]
↑L Hz(zL)
z Same!
V ( z) = X (z↑ L ) ( z ) z L
= X (z )

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

Output given by (12.17) as… y[n ] = ∑ h[i ] x[nM − i ] (!!!)


i

Write sum’s index in “block form” – a common “trick”:

i ′ = integer
i = i ′M + m 
0 ≤ m ≤ M − 1 M = Block Size

Counts Blocks Counts Samples Inside a Block


18/39
12.4.2 Polyphase Rep of Dec (cont.)
Block-Based Indexing: i ′ = integer
i = i ′M + m 
0 ≤ m ≤ M − 1
m Forward
0 1 2 % M −1 Indexing
i′
$ $ $ $ $ $
−1 − M − M +1 % −2 −1 Each row is
indexed forward
0 0 1 2 % M −1
1 M M +1 M + 2 % 2M − 1
2 2M 2M + 1 2M + 2 % 3M − 1
$ $ $ $ $ $

19/39
12.4.2 Polyphase Rep of Dec (cont.)

Use Block Indexing in (!!!): • Sum up inside

∑ 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 ′

Sum all elements in


the mth position of
each block

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

< See Fig. 12.15> 21/39


Fig. 12.15 from Porat’s Book

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]

Why the name “Polyphase”?


Recall: Time-Shift in TD ↔ Phase-Shift in FD

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!!!

<This is Fig. 12.16 from Porat’s Book>

26/39
12.4.2 Polyphase Rep of Dec (cont.)
Second Way to View It (shown for M=3):

<This is Fig. 12.17 from Porat’s Book>


27/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.

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

So…. in Z-Domain we have: Delay Expand


M −1
H z ( z) = ∑ z −m Pmz ( z M )
m =0

Now… filter/decimate looks like this:


Xz(z) Vz(z) Yz(z)
Hz(z) ↓M

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

….which is the Z-Domain Description of the polyphase decimation


structure. We have now developed two different derivations of the
polyphase structure.
31/39
12.4.3 Polyphase Rep of Expansion
Recall Expansion: x[n] y[n]
↑L Hz(z)

Output given by (12.19) as… y[n ] = ∑ x[i ]h[n − Li ]


i

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

For each l such that 0 ≤ l ≤ L – 1 we define:


ql [n ′] = h[n ′L + ( L − 1) − l ]
vl [n ′] = {x ∗ ql }[n ′]
vl [n ′] = y[n ′L + ( L − 1) − l ]

… for each l, this indexing just reads down a


column of the “Expansion Re-Index Table” 34/39
12.4.3 Polyphase Rep of Exp (cont.)
To see this indexing structure, look at an example with L = 3:

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 %

% 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 %

% 0 0 y[ −1] 0 0 y[ 2 ] 0 0 y[5] 0 0 y[8] %

% y[ −3] y[ −2] y[ −1] y [ 0] y[1] y[ 2 ] y[3] y[ 4 ] y[5] y [ 6] y[7 ] y[8] %

To get y[n]: add up the delayed, interpolated components!!


36/39
12.4.3 Polyphase Rep of Exp (cont.)
From this we see that we can write…
L −1
y[n ] = ∑{vl }( ↑ L ) [n − ( L − 1) + l ] Recall: vl [n ′] = {x ∗ ql }[n ′]
l =0

This leads to the following polyphase implementation for expansion:

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

But briefly… to change the rate by factor of L/M


Interpolate Decimate
x[n] y[n]
↑L h1[n] h2[n] ↓M

which is equivalent to…

x[n] y[n]
↑L h[n] ↓M

Q: How to implement this efficiently using polyphase ideas?


If interested: see Ch.3 of Oppenheim & Lim (on reserve)
39/39

You might also like