peakfinder(x0, sel, thresh, extrema, includeEndpoints, interpolate)
Quickly finds local maxima (peaks) or minima (valleys) in a noisy signal.
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Editor's Note: This file was selected as MATLAB Central Pick of the Week
Cite As
Nathanael Yoder (2026). peakfinder(x0, sel, thresh, extrema, includeEndpoints, interpolate) (https://uk.mathworks.com/matlabcentral/fileexchange/25500-peakfinder-x0-sel-thresh-extrema-includeendpoints-interpolate), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: voigt line shape fit
General Information
- Version 2.0.2 (4.45 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 2.0.2 | Updated checking for the input and output arguments to account of Matlab's new syntax (thanks @arnold) and removed the use of boolean because Matlab deprecated it (thanks @Carl Witthoft) |
||
| 2.0.1 | Fix a couple small bugs (Tanks Binu!) |
||
| 2.0.0 | Added ability to quickly estimate the location and magnitude of the extrema between data points for regularly spaced data using quadratic interpolation. The function continues to work for irregularly spaced data. Default is no interpolation. |
||
| 1.9.0 | Fix bug related to a missing equality comparison (thanks Nina Merkle!) and fix inconsistency when the endpoints are not treated as extrema (thanks Solomon Grant!). |
||
| 1.8.0 | Added an optional boolean to exclude the endpoints since, as pointed out by Peter Cavanagh, most definitions of local extrema do not include them. By default the endpoints are included to maintain backward compatibility. |
||
| 1.7.0 | Removed redundancy (thanks Tim) and added thresholding option (thanks Femi). |
||
| 1.6.0 | Updated the error checking on the threshold level. |
||
| 1.5.0 | Added support for monotone increase/decreasing functions and empty inputs. Thanks again to Andres for the debugging help. |
||
| 1.4.0 | Fixed problems with repeated initial values, repeated final values, and other directional issues. Thanks to Andres for his help finding and debugging these problems. |
||
| 1.3.0 | Fixed example and error checking code. Thanks to Jiro Doke for catching my mistakes. |
||
| 1.2.0 | Updated algorithm to make it slightly faster. |
||
| 1.1.0 | Updated code to make it slightly faster. |
||
| 1.0.0 |