I vectorized the dwt function.