Você está na página 1de 33

Haar Wavelets

A first look
Ref: Walker (ch1)
Jyun-Ming Chen, Spring 2001
Introduction
• Simplest; hand calculation suffice
• A prototype for studying more sophisticated
wavelets
• Related to Haar transform, a mathematical o
peration
Haar Transform
• Assume discrete signal • Decompose the signal
(analog function into two sub-signals of
occurring at discrete half its length
instants) – Running average (trend)
• Assume equally spaced – Running difference
samples (number of (fluctuation)
samples 2n)
Haar transform, 1-level
• Running average • Running difference
cm

• Multiplication by 2 i • Denoted by:


s needed to ensure ene 2 2
rgy conservation (see l
c d
– Meaning of superscript
ater) explained later
Example

c2

d2
Inverse Transform
c c c c

c 22
d
Small
Fluctuation Feature
• Magnitudes of the fluctuation subsignal (d) are often signif
icantly smaller than those of the original signal
• Logical: samples are from continuous analog signal with v
ery short time increment
• Has application to signal compression

c2 d2
Energy Concerns
• Energy of signals

• The 1-level Haar transform conserves energy


c2 d 2

c2

d2
Proof of Energy Conservation
c

c c
Haar Transform, multi-level
c2

c1

c2

d1

c1 d1 d 2
1
c0 d 0 d d 2

f c2 c1 c0
d2 d1 d0
Compaction of Energy
• Compare with 1-level
c1
c0
• Can be seen more clearly by cumulative
energy profile
Cumulative Energy Profile
• Definition
Algebraic Operations
• Addition & subtraction
• Constant multiple
• Scalar product
Haar Wavelets
• 1-level Haar wavelets 2

– “wavelet”: plus/minus 2

wavy nature
– Translated copy of mot
her wavelet 2

– support of wavelet =2
• The interval where func 2

tion is nonzero
2

Property 1. If a signal f is (approximately) constant over the support of a Haar w


avelet, then the fluctuation value is (approximately) zero.
Haar Scaling Functions
• 1-level scaling 2

functions
2

• Graph: translated copy


of father scaling
function 2

• Support = 2
c 2
Haar Wavelets (cont)
• 2-level Haar scaling fu • 2-level Haar wavelets
nctions • support = 4
• support = 4
1
1

1
1

1
1

1 1 1 1 1
c1 1 1
Multiresolution Analysis (MRA)

Natural basis:
3

Therefore:
3 3 3
MRA
c c c c c c

c c c c c c
f  c ( x)  d ( x)
2 2 c 2 ( x)
c 2 ( x) c 2
c 2
c 2

Note:
the coefficient vectors
d 2 ( x)
c  (c1 , c2 , , c N / 2 )
2 d 2 ( x) 2 2 2

d 2  (d1 , d 2 , , d N / 2 ) c 2 ( x) 2 2 2 2 2 2

d 2 ( x) 2 2 2 2 2 2
MRA

f  c 2 ( x)  d 2 ( x)
c 2 ( x)  c1 ( x)  d1 ( x)

c1 ( x) 1 1 1 1 1 1

d1 ( x ) 1 1 1 1 1 1

f  c 0 ( x)  d 0 ( x)    d n-1 ( x) where N  2 n
If do it all the way through, c 0  ( f  V10 ) V10
representing the average of all data
Example

c 2 ( x) c 2 (cx2) 2 2 2 2

d 2 ( x) d 2 (cdx22) 2 2 2 2

c1 d1 cd 2
2

c1 ( x)

d1 ( x )
Example (cont)
0 0 1
22
c d d d
c
f  (4, 6,10,12, 8, 6, 5, 5)
 14 2 V10  2 2 W10  6 W11  2 W21  2 W12  2 W22  2 W32  0 W42

Decomposition coefficients obtained by inner product with basis function

1 1 1 1 1 1
1 1 1 1
V10  ( , , , , , ,0,0,0,0,0,0)
, , , ) W12  (
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1 1 1 1 1 1 1 1 1 1
W10  ( , , , , , , , ) W22  (0,0, , ,0,0,0,0)
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
1 1 1 1 1 1
W11  ( , , , ,0,0,0,0) W32  (0,0,0,0, , ,0,0)
2 2 2 2 2 2
1 1 1 1 1 1
W21  (0,0,0,0, , , , ) W42  (0,0,0,0,0,0, , )
2 2 2 2 2 2
Haar MRA

c 0 c5
c 1 c6
c 2 c7
c8
c3
4 f (x)
c
More on Scaling Functions (Haar)
2

• They are in fact relate


2
d
j 1
2
V V P j j

1 • Pj is called the synthes


is filter (more later)
1

1 1 1 1 1 1 1 1
VN0 / 8  ( , , , , , , , ) for N  8 case
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Ex: Haar Scaling Functions

1 2  1  1 
     
1 2   1   1 
 1 2   1   1 
     
 1 2  1  1  1 
 1 2   1  2 1 
     
 1 2   1   1 
   
 1 2  1   1 
  
 1 2   1  1 

Synthesis
Filter P3
Ex: Haar Scaling Functions
1 2  1 2  1

2 2  1
 
2 

   
1 2   1 2 1 2 2  1 2 
  
1 2    1  1 2 2 
1 2 

   1 2
   1 2 2  1 2  1 1
1 2   1 2  1 1      
   1 2 2  1 2  2 1


1 2 1 2  2  1
     1 2 2  1 2
 1 2      
1 2   1 1 2 2  1 2
  Synthesis
 1 2  1 2
 1 2 2

  1 2
  
Filter P1
 
1 2  
 1 2 
Synthesis
Filter P2
More on Wavelets (Haar)
2
• They are in fact relate
2 d
W j 1  V j Q j
2

• Qj is called the synthe


1
sis filter (more later)
1

1 1 1 1 1 1
1 1
WN0 / 8  ( , , , ,, , ) for N  8 case
,
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Ex: Haar Wavelets

1 2  1  1 
     
 1 2   1    1 
 1 2   1   1 
     
 1 2  1  1   1 
 1 2   1  2 1 
     
 1 2   1   1 
   
 1 2   1   1 
  
  1 2   1   1

Synthesis
Filter Q3
Ex: Haar Wavelets
12  1 2  12 2  1 2 
       
12  1 2  12 2  1 2 
 
 1 2   1 2   1   12 2  1 2 

     
 1 2   1 2  1  1   1 2 2  1 2  1 1
 
       
12  1 2  2 1  1 2 2  1 2  2   1
     
 12   1 2    1   1 2 2  1 2
  
 
 1 2   1 2
  1 2 2  1 2
Synthesis
   1 2  
  2   1 2
  1 2   1 2  Synthesis  Filter Q 1

Filter Q2
Analysis Filters
• There is another set of mat
rices that are related to the
computation of analysis/d
ecomposition coefficient
• In the Haar case, they are t
he transpose of each other
• Later we’ll show that this i
s a property unique to orth
ogonal wavelets
Analysis/Decomposition (Haar)
A2
5 2
 
4
A3   16  1 1 1
  
11 2 
6 12 

2 1 1 7 2 
5 2 1 1 10  5 2
   12   
11 2  1 

1 1  
2
B 5 2

7 2

2  1 1  8   
       6  1 1  1 11 2 
5 2 1 1  6    
    1  1 7 2 
  Analysis  2  2
5 5 2
 
5
  Filter Aj

B3 4 Analysis
 
6 Filter Bj A1
10 
 2 
 
1  1
 12  14 2   1
1 1 
16
 2  1  1 1  
2 12 

     8 
 2
 0 
 2

1 1
 
1  1 6 
 
2 2 
1
1  1 
16
   2 12 
 
5
1
B
5
 
Synthesis Filters
• On the other hand,
synthesis filters have
to do with
reconstructing the
signal from MRA
results
Synthesis/Reconstruction (Haar)
16  1 1 5 2 1  1 
1 1  
     14 2    2 2     6
12  2 1 2  1 11 2  1 1 16  1  1  
     
7 2 2  112  2 1  2 
P1 Q1 5 5 

 1



  1



P 2 Q2

4 1 P
3
 1 Q 3
 Synthesis
  1   1 
6     Filter Pj
10   1  5 2  1   2 
        Synthesis
12  1  1 11 2 1  1   2 
8 
2  1  7 
2

2 1  2  Filter Qj
      
6 1  5 
5 1 
   0 
  
5 1  1
5    
   1    1
Conclusion/Exercise
In general
Haar (N=8) j=3 j=2 j=1 j=0
N=2n

support 1 2 4 8 2n-j

translation 1 2 4 8 2n-j

Você também pode gostar