Ryan Voots >
Math-Wavelet-Haar >
Math::Wavelet::Haar

Module Version: 0.06
Math::Wavelet::Haar - Perl extension for transforming data with the Haar Wavelet

use Math::Wavelet::Haar qw(:all); my @test = qw(1 2 3 4 5 6 7 8); my @result = transform1D(@test); my @test = ([0,1,2,3],[1,2,3,4],[2,3,4,5],[3,4,5,6]); my @result = transform2D(@test); my @test = qw(36 -16 -4 -4 -1 -1 -1 -1); my @result = detransform1D(@test); my @test = ([48,-16,-4,-4],[-16,0,0,0],[-4,0,0,0],[-4,0,0,0]); my @result = detransform2D(@test); my @test = ([48,-16,-4,-4],[-16,0,0,0],[-4,0,0,0],[-4,0,0,0]); @result = detransform2D(transform2D(@test)); @result == @test;

Math::Wavelet::Haar is a module for performing a discrete wavelet transform using the Haar wavelet.

**transform1D**@result = transform1D(@input); takes a single array as input, and returns the transformed result, @input MUST be a power of two in length, if it is not, then it will return undef**transform2D**@result = transform2D(@input); takes a single two dimensional array as input, and returns the transformed result, @input MUST be a power of two in length and width, if it is not, then it will return undef**detransform1D**@result = detransform1D(@input); takes a single array as input, and returns the inverse transform as the result, @input MUST be a power of two in length, if it is not, then it will return undef**detransform2D**@result = detransform2D(@input); takes a single two dimensional array as input, and returns the inverse transform as the result, @input MUST be a power of two in length and width, if it is not, then it will return undef

Wikipedia articles on the Haar Wavlet, Discrete Wavelet Transforms, and lots and lots of math

- v0.01 First release, supports only transforming
- v0.02 Second release, supports transforming and its inverse Changed API significatly
- v0.05 Third public release, fixes catastrophic bug that causes the input to the 2d transforms to be mangled
- v0.06 Added some corrected dependencies and marked the module as usable by earlier perl versions Also removed an incorrect print statement, that outputted debugging information that shouldn't have been outputted

Ryan Voots <lt>simcop2387@yahoo.com<gt>

Copyright (C) 2007 Ryan Voots

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: