thatguy2048

thatguy2048 / HaarWavelet / 0.1.2

README.md
This algorithm performs the Daubechies D4 Wavelet Transform (or inverse transform) on a one dimensional signal.

This algorithm expects a signal which whose length is divisible by 2, and will perform the transform for as long as the length can be divided by 2, while still being evenly divisible.  Unless a max number of iterations is specified by an int before the input signal.

Example Input
[1,[1,2,3,1,2,3,4,0]]

Example Output
{"transform":[2.1213203435596424,2.82842712474619,3.5355339059327373,2.82842712474619,-0.7071067811865475,1.414213562373095,-0.7071067811865475,2.82842712474619],"i":1}

Inverse Input
[[5.656854249492379,-0.7071067811865481,-0.49999999999999994,0.49999999999999994,-0.7071067811865475,1.414213562373095,-0.7071067811865475,2.82842712474619],3]

Inverse Output
[0.9999999999999992,1.9999999999999991,2.999999999999999,0.9999999999999992,1.9999999999999993,2.999999999999999,3.9999999999999996,-3.14018491736755e-16]
(rounded)
[1,2,3,1,2,3,4,0]