wt function

Wavelet transformation, and a simulation algorithm