Anda di halaman 1dari 40

MULTIRATE DIGITAL SIGNAL PROCESSING

Signal processing can be enhanced by changing sampling rate:

• Up-sampling before D/A conversion in order to relax


requirements of analog antialiasing filter. Cf. audio CD,
where the sampling frequency 44.1 kHz is increased fourfold
to 176.4 kHz.

• Need to connect systems in digital (audio) signal processing


which operate at different sampling rates.

• Decomposition of a signal into M components corresponding


to various frequency bands. If original signal is sampled at
the sampling frequency fs (with frequency band of width
45
fs/2), the components then contain a frequency band of
width 12 fs/M , and can be represented using the sampling
rate fs/M . This allows for:
- parallel signal processing with processors operating at lower
sampling rates.
- data compression in subband coding, by representing
different frequency band components with different word
lengths (e.g., in speech processing).
- implementation of high-performance filtering operations
with a very narrow transition band. Decomposing
the signal into passband, stopband and transition band
components, each component can be processed at a lower
rate, and the transition band will be less narrow. This
results in significant simpler filter complexity.

46
Basic multirate signal processing operations
Sampling rate conversion
Decimation

x(n) -
↓M -
y(m)

y(m) = x(mM ) (every M th element of x)

Matlab routines:
y=downsample(x,M)
[ y=decimate(x,M) applies antialiasing lowpass filtering followed by
downsampling ]

47
Spectrum of decimated signal:

For example, for M = 2,

- spectrum of {x(n)} consists of frequencies in [0, π],

- spectrum of {y(m)} consists of frequencies in [0, π/2], given


by
1
Y (ω) = (X(ω/2) + X(π − ω/2)∗)
2
The second term is due to frequency folding, factor 1/2 is due to sampling
rate conversion

This implies that if x is bandlimited; X(ω) = 0, π/2 ≤ ω ≤ π,


then
1
Y (ω) = X(ω/2)
2

48
Expansion

x(n) -
↑L -
y(m)

{
x(m/L), for m = 0, L, 2L, . . .
y(m) =
0, otherwise

Expansion followed by interpolation is equivalent to sampling


rate increase by factor L.

Matlab routine:

y=upsample(x,L)

49
Spectrum of expanded signal:

For example, for M = 2,

- spectrum of {x(n)} consists of frequencies in [0, π]

- spectrum of {y(m)} consists of frequencies in [0, π], given by


{
X(2ω), for 0 ≤ ω ≤ π/2
Y (ω) =
X(2(π − ω))∗ [= Y (π − ω)∗], for π/2 ≤ ω ≤ π

It is seen that Y (ω) is uniquely defined by its value in frequency


band [0, π/2]

Correct interpolation is achieved by a low-pass filter which


eliminates the frequencies in the band π/2 ≤ ω ≤ π.

50
Sampling rate conversion by non-integer factors

Sampling rate conversion with factor F = L/M can be


performed by applying:

- expansion by factor L

- low-pass filtering (corresponding to interpolation)

- decimation by factor M

Matlab routine:

y=resample(x,L,M)

51
Analysis and synthesis filter banks

Simple Analysis filter bank:

x xD1 -
-
H1(z) -
↓2

xD2 -
-
H2(z) -
↓2

- H1(z): low-pass filter to extract subband [0, π/2]

- H2(z): high-pass filter to extract subband [π/2, π]

- subbands components can be processed using


half the sampling rate

52
Analysis filter bank with three subbands:

x xD1
-
H1(z) -
↓2 -

xD2 xD21
-
H2(z) -
↓2 -
H1(z) -
↓2 -

xD22
-
H2(z) -
↓2 -

- xD1: subband component [0, π/2]


- xD2: subband component [π/2, π]
- xD21: subband component [π/2, 3π/4]
- xD22: subband component [3π/4, π]
53
Simple multirate signal processing system
Analysis filter bank Synthesis filter bank

x x-D1 xE1+ y
-
H1(z) -
↓2 sss -
↑2 -
G1(z) - k -
+6

x-D2 xE2
-
H2(z) -
↓2 sss -
↑2 -
G2(z)

- subband components xD1, xD2 are processed independently at


lower sampling frequency
- processed components are upsampled to original sampling
frequency
- synthesis filters G1(z), G2(z) remove alias components
- filtered components are combined back to give the processed
signal y
54
Subband decomposition

Decomposition into low-frequency component and high-


frequency component

x xD1 -
-
H1(z) -
↓2

xD2 -
-
H2(z) -
↓2

- H1(z): low-pass filter to extract subband [0, π/2]

- H2(z): high-pass filter to extract subband [π/2, π]

55
Brickwall filters:

- H1 ideal low-pass filter

- H2 ideal high-pass filter

6
Frequency H1(ejω ) H2(ejω )
response

-
0 π/2 π ω

56
Real filters: frequency bands cannot be exactly separated

- H1 real low-pass filter

- H2 real high-pass filter

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:

Construct H1, H2, G1, G2 so that perfect reconstruction is


achieved (up to a constant and time delay):

y(n) = Kx(n − P )

Analysis filter bank Synthesis filter bank

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

{v1(n)} = {xD1(0), 0, xD1(1), 0, xD1(2), 0, . . .}


= {x1(0), 0, x1(2), 0, x1(4), 0, . . .}

But as

x̂1(±z) = x1(0) ± x1(1)z −1 + x1(2)z −2 ± x1(3)z −3 + · · ·

we have

v̂1(z) = v1(0) + v1(1)z −1 + v1(2)z −2 + v1(3)z −3 + · · ·


= x1(0) + x1(2)z −2 + x1(3)z −4 + · · ·
1
= (x̂1(z) + x̂1(−z))
2

Similarly: v̂2(z) = 12 (x̂2(z) + x̂2(−z))

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(ω−π)))

Alias avoided if:

G1(z)H1(−z) + G2(z)H2(−z) = 0

=⇒
G1(z) = 2H2(−z)
G2(z) = −2H1(−z)

Scaling factor 2 introduced to compensate factor 1/2 in


expression for ŷ(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

G1(z) = 2H2(−z) = 2H1(z)


G2(z) = −2H1(−z) = −2H2(z)

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

Only quadrature mirror FIR filters which satisfy perfect signal


recovery:
1( −1
)
H1(z) = 1+z , G1(z) = 1 + z −1
2
1( −1
)
H2(z) = 1−z , G2(z) = −1 + z −1
2
giving ŷ(z) = z −1x̂(z), or y(n) = x(n − 1)
Alternatively, when noncausal filters can be used,
1
H1(z) = (z + 1) , G1(z) = 1 + z −1
2
1
H2(z) = (z − 1) , G2(z) = −1 + z −1
2
giving ŷ(z) = x̂(z), i.e., y(n) = x(n)
64
Subband coding and multiresolution analysis

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

- x: frequency band 0, π], length N

- xH : frequency band [π/2, π], length N/2

- xLH : frequency band [π/4, π/2], length N/4

- xLLH : frequency band [π/8, π/4], length N/8

- xLLL frequency band [0, π/8], length N/8

65
Example (N = 8):

Frequency
6

π
xH
π/2
xLH
π/4 xLLH
xLLL -
0
0 N Time

Time-frequency resolution

Low-frequency components xLLL, xLLH have high frequency


resolution and low time resolution

High-frequency component xH has low frequency resolution


and high time resolution
66
The pyramid algorithm generates a transform of input signal
{x(n)} = {x(0), x(1), . . . , x(N − 1)} to the signal transform
(when using three stages as above)

xHaar = [xLLL, xLLH , xLH , xH ]

where

xLLL = {xLLL(0), . . . , xLLL(N/8 − 1)}

xLLH = {xLLH (0), . . . , xLLL(N/8 − 1)}

xLH = {xLH (0), . . . , xLH (N/4 − 1)}

xH = {xH (0), . . . , xH (N/2 − 1)}

67
Note: sequences x and xHaar have both length N

Inverse transform:

Use filters G1, G2 to reconstruct

- xLL from xLLH and xLLL

- xL from xLH and xLL

- x from xH and xL

68
Signal compression using multiresolution

Signal can be compressed by discarding small elements of xHaar:


{
xHaar(m), if |xHaar(m)| > d
x̃Haar(m) =
0, if |xHaar(m)| ≤ d

where d > 0 is a specified threshold.

- Resolution in both time and frequency domain


- Fourier transform gives only frequency domain resolution

69
EXAMPLE
{x(n)} = {37, 35, 28, 28, 58, 18, 21, 15}

{xHaar(m)} = {30, −2, −4, −10, −1, 0, −20, −3}


60
50
40
30
20
1 2 3 4 5 6 7 8
(a)

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)

(a): d = 2, (b): d = 3, (c): d = 4


70
Wavelets

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

- ψH (2−in) is defined for 0 ≤ n < 2i (dilated, or stretched,


version of ψH (n))

- ψH (2−in − m) is defined for m2i ≤ n < (m + 1)2i (dilated


and translated version of ψH (n))

72
Examples

(a): ψH (t); (b): ψH (2−2t); (c): ψH (2−2t − 1)

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

ϕH (t) and ψH (t): Haar wavelets

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

- ψ(2−in) is defined for 0 ≤ n < 2i (dilated, or stretched,


version of ψ(n))

- ψ(2−in − m) is defined for m2i ≤ n < (m + 1)2i (dilated


and translated version of ψ(n))

ϕ(t): father wavelet


ψ(t): mother wavelet
ψ(2in − m): daughter wavelets
75
Daubechies wavelets

Main restriction of Haar wavelets: Haar filter does not provide


good separation of frequency bands.

For more powerful wavelet transforms, we should require that:

• H1(z), H2(z) are FIR filters, which give good frequency


separation

• H1(z), H2(z) give a filter bank which corresponds to a


wavelet expansion for some wavelet functions ϕ(t) and ψ(t).

• filter bank should have the perfect reconstruction property

76
In 1988 Ingrid Daubechies found a class of filters satisfying the
conditions:

Instead of using quadrature mirror filters, H1, H2 should be


related according to

H2(z) = −z M H1(−z −1)

where M = order of H1(z)

Elimination of alias components gives condition for synthesis


filters G1, G2 :

G1(z) = z −M H2(−z)
G2(z) = −z −M H1(−z)

77
Daubechies filters are defined only for odd values of M .

Perfect reconstruction requirement gives condition:

1( )
G1(z)H1(z) + G2(z)H2(z) = 1
2

Solution of order M = 2m − 1, m = 1, 2, . . . is given by


( )
√ 1+z m
H1(z) = 2 S(z)
2

where S(z) should satisfy

∑(
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.

Daubechies wavelets form are an example of orthogonal


wavelets, because the associated filters H1, H2, G1, G2 have a
certain orthogonality property. Other orthogonal filter families
are the symlets and the Coiflets.

Another important type of wavelets are the biorthogonal


wavelets, for which the associated filters satisfy a
biorthogonality condition.

An important family of biorthogonal wavelets are the CDF


(Cohen-Daubechies-Feauveau) wavelets, which are used in the
JPEG 2000 standard.

80
Wavelet transform of 2-dimensional signal {x(n, m)}

- first perform 1-dimensional wavelet transform of each row to


give XDWT,row (n, k) (=DWT of nth row of x(n, m))

- then perform 1-dimensional wavelet transform of each column


to give the result XDWT(l, k) (=DWT of kth column of
XDWT,row (n, k))

Application: image compression and denoising

81
Signal processing with wavelets

Time-frequency resolution makes wavelets powerful for data


denoising and compression. A standard approach is to use
threshold-based methods:

Hard thresholds:

Given a wavelet transform XDWT(i, m), define:


{
XDWT(i, m), if |XDWT(i, m)| ≥ d(i)
X̃DWT(i, m) =
0, if |XDWT(i, m)| < d(i)

Threshold d(i) ≥ 0 may be different for different resolution


levels i. Optimal value of d(i) which depend of signal variance
and length have been presented in the literature.

82
Soft thresholds:

Given a wavelet transform XDWT(i, m), define:

X̃DWT(i, m) = sgn(XDWT(i, m))|XDWT(i, m) − d(i)|

if |XDWT(i, m)| ≥ d(i),

and

X̃DWT(i, m) = 0, if |XDWT(i, m)| < d(i)

Threshold d(i) ≥ 0 may be different for different resolution


levels i. Optimal value of d(i) which depend of signal variance
and length have been presented in the literature.

83
Hard and soft thresholds can be applied to both data
compression and denoising.

JPEG 2000 image compression standard uses biorthogonal


CDF wavelets (cf. above) and quantization of the wavelet
components to achieve data compression

84

Anda mungkin juga menyukai