Skip to content

Instantly share code, notes, and snippets.

@verus verus/wavelet.hs
Created Feb 1, 2012

Embed
What would you like to do?
Wavelet transform in Haskell
import System.Environment
haar:: [Int] -> [Int]
haar l = aux l [] []
where aux [s] [] d = s : d
aux [] s d = aux s [] d
aux (h1:h2:t) s d = aux t ((h1 + h2) : s) ((h1 - h2) : d)
aux _ _ _ = []
array = [2, -3]
main::IO ()
main = putStrLn $ show $ haar(array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.