Wavelet routine for multiple correlation