Pitch detection algorithm using a wavelet correlation model