Course 18.327 and 1.130 Wavelets and Filter Banks Maxflat Filters:

advertisement
Course 18.327 and 1.130
Wavelets and Filter Banks
Maxflat Filters: Daubechies and
Meyer Formulas.
Spectral Factorization
Formulas for the Product Filter
Halfband condition:
P(ω) + P( ω + π) = 2
Also want P(ω) to be lowpass
and p[n] to be symmetric.
P (ω + π)
P (ω )
2
ω
π
0
Daubechies’ Approach
~
Design
a polynomial, P(y), of degree 2p - 1, such that
~
P(0) = 2
~
~
P(l)(0) = 0; l = 1, 2, …, p - 1
~(l)(1) = 0; l = 0, 1, …, p - 1
P
P(y)
2
0
1
y
2
Can achieve required flatness at y = 1 by including a
term of the form (1 – y)p i.e.
∼
P(y) = 2(1 – y)p Bp(y)
Where Bp(y) is a polynomial of degree p – 1.
How to choose Bp(y)?
Let Bp(y) be the binomial series expansion for
(1 – y)-p, truncated after p terms:
p(p + 1) 2
Bp(y) = 1 + py +
y + … + 2p - 2 yp-1
2
p–1
= (1 – y)-p + O(yp)
(
)
< Higher order terms
3
∞
(1 – y)-1 = ∑ yk
k=0
(1 –
y)-p
∞
=∑
k=0
(p + k –1 ) y
k
k
| y| < 1
Then
∼
P(y) = 2(1 – y)p[(1-y)-p + O (yp)]
= 2 + O(yp)
4
Thus
P(l)(0) = 0 ; l = 1, 2, … , p-1
So we have
p-1
∼
P(y) = 2 (1-y)p ∑ p + k - 1
k
k=0
(
Now let
y=
Thus
1 - eiω
2
1 – cos ω
=
2
(
)(
1 – e-iω
2
)y
)
k
maintains symmetry
∼
P(ω) = P
ω
(1 – cos
)
2
1 + cos ω
p + k + 1 1 – cos ω
= 2(
∑
)
(
)
)
(
k
2
2
p p-1
k
k=0
5
z domain:
(
P(z) = 2 1 + z
2
p
)(
1 + z-1
2
p p-1
)
∑
k=0
(
k
)( ) (
p+k-1
k
1-z
2
1 – z-1
2
k
)
6
Meyer’s Approach
∼
Work with derivative of P(y):
∼
P´(y) = - C´ yp-1 (1 –y)p-1
So
y
∼
P(y) = 2 - C´∫ yp-1 (1-y)p-1 d y
∼
(P(0) = 2)
0
Then
ω
1 – cos ω
P(ω) = 2 - C´∫
2
0
(
ω
(
1–
= 2 - C ´∫
0
cos2
2
ω
0
1 + cos ω
(
)
)
2
ω
p-1
)
2p2p-1
i.e. P(ω) = 2 – C ∫ sin
p-1
p-1
sin ω dω
2
sin ω dω
2
ωdω
7
Spectral Factorization
Recall the halfband condition for orthogonal filters:
z domain:
H0(z) H0(z-1) + H0(-z) H0(-z-1) = 2
Frequency domain:
2
2
H0(ω)  + H0(ω + π) 
= 2
The product filter for the orthogonal case is
P(z) = H0(z) H0(z-1)
2
P(ω) = H0(ω)
⇒ P(ω) ≥ 0
p[n] = h0[n] ∗ h0[-n]
⇒ p[n] = p[-n]
The spectral factorization problem is the problem
of finding H0(z) once P(z) is known.
8
Consider the distribution of the zeros (roots) of P(z).
•
•
Symmetry of p[n] ⇒ P(z) = P(z-1)
If z0 is a root then so is z0-1.
If p[n] are real, then the roots appear in complex,
conjugate pairs.
(1 – z0 z-1)(1 – z0*z-1) = 1 – (z0 + z0*) z-1 + (z0z0*)z-2
123
123
real
real
9
Im
O1
z0*
Im
z0
1 Re
z0*
z0
1 1/z Re
0
1
Oz
0
Complex zeros
Real zeros
If the zero z0 is grouped into the spectral factor H0(z),
then the zero 1/z0 must be grouped into H0(z-1).
⇒ h0[n] cannot be symmetric.
10
Daubechies’ choice: Choose H0(z) such that
(i) all its zeros are inside or on the unit circle.
(ii) it is causal.
i.e. H0(z) is a minimum phase filter.
Example:
6
=
3
.
3
0
P(z)
H0(z)
H0(z-1)
(Minimum phase) (Maximum phase)
11
Practical Algorithms:
1. Direct Method: compute the roots of P(z)
numerically.
2. Cepstral Method:
First factor out the zeros which lie on the unit
circle
P(z) = [(1 + z-1)(1 + z)]p Q(z)
Now we need to factor Q(z) into R(z) R(z -1) such that
i. R(z) has all its zeros inside the unit circle.
ii. R(z) is causal.
12
Then use logarithms to change multiplication into
addition:
Q(z) =
ln Q(z) =
123
^
Q(z)
R(z)
ln R(z)
123
^
R(z)
•
+
R(z-1)
ln R(z-1)
123
^ -1)
R(z
Take inverse z transforms:
^
q[n]
=
Complex cepstrum
of q[n]
^r[n]
+ ^r[-n]
13
Example:
5
5X
X
X
X
R(z)
^
R(z) = ln R(z)
R(z) has all its zeros and all its poles inside the unit
^
circle, so R(z) has all its singularities inside the unit
circle. (ln0 = - ∞ , ln ∞ = ∞ .)
14
All singularities inside the unit circle leads to a causal
sequence, e.g.
1
X(z) =
1 - zk z-1
Pole at z = zk
1
X(ω) =
1 - zk ?-iω
If |zk| < 1, we can write
∞
X(ω) = ∑ (zk)n e-iωn
n=0
678
678
⇒x[n] is causal
^
So ^r[n] is the causal part of q[n]:
½^
q[0] ; n = 0
^
^
q[n]
; n > 0
r[n] =
0
; n < 0
15
Algorithm:
Given the coefficients q[n] of the polynomial Q(z):
i. Compute the M-point DFT of q[n] for a
sufficiently large M.
-i 2Mπkn
Q[k] = ∑ q[n]e
n
;
0≤k<M
ii. Take the logarithm.
^
Q[k] = ln (Q[k])
iii. Determine the complex cepstrum of q[n] by
computing the IDFT.
M - 1^
i 2Mπ nk
1
^
q[n] =
∑ Q[k] e
M
k=0
16
½^
q[0]
^
q[n]
0
; n = 0
; n > 0
; n < 0
678
^r[n] =
678
^
iv. Find the causal part of q[n].
v. Determine the DFT of r[n] by computing the
exponent of the DFT of ^r[n].
M-1
^
–i 2π kn
^
R[k] = exp (R[k]) = exp ( ∑ r[n]e M ) ; 0 ≤ k < M
k=0
17
vi. Determine the DFT of h0[n], by including half the
zeros at z = -1.
2π k p
–
i
H0[k] = R[k] (1 + e M )
vii. Compute the IDFT to get h0[n].
h0[n] =
1 M-1
M k∑= 0H0[k]
2π
ei M nk
18
Download