There is a variety of things you can try:
- Use a running average to smoothen your data. Find the peaks in the smoothed data, then go back to your original data and find just one peak close to a peak in the smoothed data
- Make a mathematical model of your data, and do a least squares fit, or maybe a fit on a piece of the data
- Another option to smoothen your data is to do a fourier transform, cut off high frequencies, and then transform back (though that's quite costly in terms of computation
- You could try to re-use an existing audio codec that's based on a wavelet decomposition to do the hard work for you, it solves similar problems. You just have to find a clever way to interface such a codec.
Perl 6 - links to (nearly) everything that is Perl 6.