The function is based on a method described in Chapter 4 of the book 'Systems Bioinformatics: An Engineering Case-Based Approach' on page 112.
Monchamp, P., Andrade-Cetto, L., Zhang, J.Y., and Henson, R. (2007) Signal Processing Methods for Mass Spectrometry. In Systems Bioinformatics: An Engineering Case-Based Approach, G. Alterovitz and M.F. Ramoni, eds. Artech House Publishers).