46
Basic multirate signal processing operations
Sampling rate conversion
Decimation
x(n) -
↓M -
y(m)
Matlab routines:
y=downsample(x,M)
[ y=decimate(x,M) applies antialiasing lowpass filtering followed by
downsampling ]
47
Spectrum of decimated signal:
48
Expansion
x(n) -
↑L -
y(m)
{
x(m/L), for m = 0, L, 2L, . . .
y(m) =
0, otherwise
Matlab routine:
y=upsample(x,L)
49
Spectrum of expanded signal:
50
Sampling rate conversion by non-integer factors
- expansion by factor L
- decimation by factor M
Matlab routine:
y=resample(x,L,M)
51
Analysis and synthesis filter banks
x xD1 -
-
H1(z) -
↓2
xD2 -
-
H2(z) -
↓2
52
Analysis filter bank with three subbands:
x xD1
-
H1(z) -
↓2 -
xD2 xD21
-
H2(z) -
↓2 -
H1(z) -
↓2 -
xD22
-
H2(z) -
↓2 -
x x-D1 xE1+ y
-
H1(z) -
↓2 sss -
↑2 -
G1(z) - k -
+6
x-D2 xE2
-
H2(z) -
↓2 sss -
↑2 -
G2(z)
x xD1 -
-
H1(z) -
↓2
xD2 -
-
H2(z) -
↓2
55
Brickwall filters:
6
Frequency H1(ejω ) H2(ejω )
response
-
0 π/2 π ω
56
Real filters: frequency bands cannot be exactly separated
6
Frequency H1(ejω ) H2(ejω )
response T
T
T
T
T
T
T
T
T
T
T
T
T
TT -
0 π/2 π ω
57
Solution:
y(n) = Kx(n − P )
x x1 - xD1 v1 - xE1+ y
-
H1(z) ↓2 -
↑2 G1(z) - k -
+6
x2 - xD2 v2 - xE2
-
H2(z) ↓2 -
↑2 G2(z)
58
Here:
{xD1(n)} = {x1(0), x1(2), x1(4), . . .}
and
But as
we have
59
We have the relations
1( )
v̂1(z) = H1(z)x̂(z) + H1(−z)x̂(−z)
2
1( )
v̂2(z) = H2(z)x̂(z) + H2(−z)x̂(−z)
2
and
ŷ(z) = x̂E1(z) + x̂E2(z)
= G1(z)v̂1(z) + G2(z)v̂2(z)
=⇒
1( )
ŷ(z) = G1(z)H1(z) + G2(z)H2(z) x̂(z)
2
1( )
+ G1(z)H1(−z) + G2(z)H2(−z) x̂(−z)
2
60
Here x̂(−z) is an alias component
(Fourier transform= x̂(−ejω ) = x̂(ej(ω−π)))
G1(z)H1(−z) + G2(z)H2(−z) = 0
=⇒
G1(z) = 2H2(−z)
G2(z) = −2H1(−z)
61
Typically low- and high-pass filters H1, H2 are selected so that
H2(z) = H1(−z)
=⇒
H2(ejω ) = H1(−ejω ) = H1(ej(π−ω))∗
=⇒
Frequency responses are mirror images about the quadrature
frequency π/2 = 2π/4 (quadrature mirror filters)
It follows that
62
Introducing G1, G2 and H2(z) = H1(−z) into
1( )
ŷ(z) = G1(z)H1(z) + G2(z)H2(z) x̂(z)
2
1( )
+ G1(z)H1(−z) + G2(z)H2(−z) x̂(−z)
2
gives ( )
ŷ(z) = H1(z) − H1(−z)
2 2
x̂(z)
=⇒ Condition for perfect signal recovery
H1(z)2 − H1(−z)2 = Kz −P
63
Haar filters
Pyramid algorithm:
xL
x -
H1(z) -
↓2 -
H1(z) -
↓ 2 xLL -
H1(z) -
↓ 2 x-LLL
x
-
H2(z) -
↓2 -H -
H2(z) -
↓ 2 x-LH -
H2(z) -
↓ 2 x-LLH
65
Example (N = 8):
Frequency
6
π
xH
π/2
xLH
π/4 xLLH
xLLL -
0
0 N Time
Time-frequency resolution
where
67
Note: sequences x and xHaar have both length N
Inverse transform:
- x from xH and xL
68
Signal compression using multiresolution
69
EXAMPLE
{x(n)} = {37, 35, 28, 28, 58, 18, 21, 15}
60
50
40
30
20
1 2 3 4 5 6 7 8
(b)
60
50
40
30
20
1 2 3 4 5 6 7 8
(c)
Haar wavelets
Recall that the Fourier transform expresses a signal {x(n)} in
terms of frequency components ej2πkn/N .
In a similar way, the Haar transform xHaar can be expressed as
an expansion of the signal x in terms of a function set.
For the cases with three stages (resolution levels), we can show
that
N/23 −1 N/23 −1
∑ ∑
−3
x(n) = xLLL(m)ϕH (2 n − m) − xLLH (m)ψH (2−3n − m)
m=0 m=0
N/22 −1
∑ ∑
N/2−1
−2
− xLH (m)ψH (2 n − m) − xH (m)ψH (2−1n − m)
m=0 m=0
71
Here:
1, 0 ≤ t < 1/2
ψH (t) = −1, 1/2 ≤ t < 1
0, otherwise
and {
1, 0≤t<1
ϕH (t) =
0, otherwise
72
Examples
−1
−2 0 2 4 6 8 10 12
(a)
−1
−2 0 2 4 6 8 10 12
(b)
−1
−2 0 2 4 6 8 10 12
(c)
73
Expansion of x in terms of ϕH (2−in − m) and ψH (2−in − m)
is a wavelet expansion.
74
Generalization
Discrete wavelet expansion of {x(n)} of length N and J
resolution levels has the form
N/2J −1 N/2i −1
∑ ∑ ∑
J
x(n) = XDW T (0, m)ϕ(2−J n−m)+ XDW T (i, m)ψ(2−in−m)
m=0 i=1 m=0
76
In 1988 Ingrid Daubechies found a class of filters satisfying the
conditions:
G1(z) = z −M H2(−z)
G2(z) = −z −M H1(−z)
77
Daubechies filters are defined only for odd values of M .
1( )
G1(z)H1(z) + G2(z)H2(z) = 1
2
∑(
m−1
m+k−1
) (ω )
|S(ejω )|2 = sin2k
k 2
k=0
78
Case m = 1:
Daubechies
√ wavelet is equivalent to the Haar wavelet (scaled
by factor 2)
Case m = 2:
√ √
1− 3 3+1
S(z) = + z
2 2
and
{ √ √ √ √ }
√ 1− 3 3− 3 3+ 3 2 1+ 3 3
H1(z) = 2 + z+ z + z
8 8 8 8
= −0.129409522551 + 0.224143868042z
+0.836516303738z 2 + 0.482962913145z 3
79
Efficient algorithms exist for calculating higher-order
Daubechies wavelets, and coefficients have been tabulated.
80
Wavelet transform of 2-dimensional signal {x(n, m)}
81
Signal processing with wavelets
Hard thresholds:
82
Soft thresholds:
and
83
Hard and soft thresholds can be applied to both data
compression and denoising.
84