DMelt:DSP/5 Fast Wavelet Transform

From jWork.ORG
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents

Fast Wavelet Transform (FWT)

Here is FWT for 1D array using Haar method. We use Transform class for this task:

from math.jwave import Transform
from math.jwave.transforms import *
from math.jwave.transforms.wavelets import *

t=Transform(  FastWaveletTransform( Haar02( ) ))
arrTime = [1, 10, 12, 8, 1, 1, 1, 1. ]
arrFreq = t.forward( arrTime ) # 1-D FWT Haar forward
print arrFreq.tolist()
arrReco = t.reverse( arrFreq ) # 1-D FWT Haar reverse
print arrReco.tolist()

The output of this code is:

[12.374368670764577, 9.545941546018389, -4.499, 0.0, -6.363, 2.8284, 0.0, 0.0]
[1, 10, 12, 8, 1, 1, 1, 1. ]

FWT in 2D

Now let us consider a FWT transformation of 2D array. This is an extension of the above script:

More information on this topic is in DMelt books