: averages ( seq -- seq )
[ first2 + 2 / ] map ;
: differences ( seq averages -- differences )
>r 0 <column> r> [ - ] 2map ;
: haar-step ( seq -- differences averages )
2 group dup averages [ differences ] keep ;
: haar ( seq -- seq )
dup length 1 <= [ haar-step haar swap append ] unless ;
Tuesday, November 14, 2006
Haar wavelet transform in Factor
Here is the Haar wavelet transform implemented in Factor. This is only the 1-dimensional version:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment