17
Wavelet Transform Wavelet Transform Group 820 Group 820

Wavelet Transform.ppt

Embed Size (px)

DESCRIPTION

wavelet transform description

Citation preview

Page 1: Wavelet Transform.ppt

Wavelet TransformWavelet TransformGroup 820Group 820

Page 2: Wavelet Transform.ppt

System ArchitectureSystem Architecture

Haar Transform

EZW

Arithmetic Coding

Page 3: Wavelet Transform.ppt

Haar Wavelet TransformHaar Wavelet Transform

To calculate the Haar transform of an array of samples: 1. Find the average of each pair of samples. 2. Find the difference between the average and the samples. 3. Fill the first half of the array with averages. 4. Normalize 5. Fill the second half of the array with differences. 6. Recurse - repeat the process on the first half of the array.

(Note: The array length should be a power of two)

11 33 55 77

1. Iteration

2. Iteration

1. 1+3 / 2 = 22. 1 - 2 = -13. Insert4. Normalize5. Insert6. Recurse

Signal

-1

-1-1

-1

6

-2

2

4

Haar Transform

EZW

Arithmetic Coding

Page 4: Wavelet Transform.ppt

Haar Wavelet TransformHaar Wavelet Transform

Signal 1

3

5

7

4

-2

-1

-1

2. Iteration

Signal

[ 1 3 5 7 ]

Signal recreated from 2 coefficients

[ 2 2 6 6 ]

Haar Transform

EZW

Arithmetic Coding

Page 5: Wavelet Transform.ppt

Haar BasisHaar Basis

Lisa Haar Basis

Haar Transform

EZW

Arithmetic Coding

Page 6: Wavelet Transform.ppt

System ArchitectureSystem Architecture

Haar Transform

EZW

Arithmetic Coding

Page 7: Wavelet Transform.ppt

Encoding the CoefficientsEncoding the CoefficientsHaar Transform

EZW

Arithmetic Coding

• How do you encode the coefficients effectively?

•Various ad hoc methods

•Store 0 if coefficient is below some threshold

•Store coefficient if > threshold as (x,y,c)

•Suboptimal approach. Bad compression.

Page 8: Wavelet Transform.ppt

EZW – Embedded Zerotree of Wavelet CoefficientsEZW – Embedded Zerotree of Wavelet Coefficients

Haar Transform

EZW

Arithmetic Coding

• Developed by Shapiro in 93

• Enabled wavelet compression to compete with JPEG

• Builds on two observations:

1. Large coefficients are most important (contains most information) and should be stored first.

2. Magnitude of coefficients decrease as one moves from lower frequency subbands to higher frequencies.

• E: Embedded. Progressive algorithm

• Z: Zerotree. Quadtree data structure central to algorithm

• W: Wavelet. Designet specifically for wavelet compression

Page 9: Wavelet Transform.ppt

Why it worksWhy it worksHaar Transform

EZW

Arithmetic Coding

Page 10: Wavelet Transform.ppt

How it worksHow it worksHaar Transform

EZW

Arithmetic Coding

threshold = 2^(floor(lg(max(c)))

do {

dominant pass (encode PS,NS,ZT,IZ)

subordinate pass (refinement of PS and NS)

t /= 2

} while (PSNR < T1 && BITRATE < T2);

•Decode algorithm similar

•EBCOT used in JPEG2000 uses similar algorithm

Page 11: Wavelet Transform.ppt

System ArchitectureSystem Architecture

Haar Transform

EZW

Arithmetic Coding

Page 12: Wavelet Transform.ppt

Arithmetic CodingArithmetic CodingHaar Transform

EZW

Arithmetic Coding

• A symbol with the probability of 0.4 should ideally be encoded with 1.32 bits.

• Arithmetic Coding assigns one long code to entire stream!

Page 13: Wavelet Transform.ppt

Arithmetic Coding – Arithmetic Coding – Encoding stepEncoding step Haar Transform

EZW

Arithmetic Coding

• Divide the interval of [0;1) into subintervals based on the probabilities of the individual symbols

•Based on the symbol read from the input stream, select the corresponding interval

•Divide this interval further into subinterval still based on probabilities of the symbols

• Repeat the last two steps until the end of input stream

Page 14: Wavelet Transform.ppt

Arithmetic Coding – Arithmetic Coding – Example of the encodingExample of the encoding Haar Transform

EZW

Arithmetic Coding

• Input: ABAABB

•p(A)=0.5 and p(B) = 0.5

•A’s interval [0;0.5)

•B’s interval [0.5;1)

•Upper and lower determines current interval

•A1: lower = 0, upper = 0.5

•B1: lower = 0.25, upper = 0.5

•…..

•B3: lower = 0.34375, upper = 0.375

Page 15: Wavelet Transform.ppt

Arithmetic Coding – Arithmetic Coding – Example of the encodingExample of the encoding Haar Transform

EZW

Arithmetic Coding

•Final interval: [0.34375;0.375)

•We choose 0.36 and throw away 0. -> 36 is a code for the string ABAABB

• =6 bit

Page 16: Wavelet Transform.ppt

Arithmetic Coding – Arithmetic Coding – DecodingDecoding Haar Transform

EZW

Arithmetic Coding

• From the code the initial interval is determined

• For next symbol (Repeat until done):

• Subtract lower limit of previous

• Divide by width of subinterval

Page 17: Wavelet Transform.ppt

ResultResult

5 13 48