PeakFinder
by Nathanael Yoder
06 Oct 2009
(Updated 14 Jun 2011)
Quickly finds local maxima (peaks) or minima (valleys) in a noisy signal.
|
Watch this File
|
| File Information |
| Description |
This function quickly finds local peaks or valleys (local extrema) in a noisy vector using a user defined magnitude threshold to determine if each peak is significantly larger (or smaller) than the data around it. The problem with the strictly derivative based peak finding algorithms is that if the signal is noisy many spurious peaks are found. However, more complex methods often take much longer for large data sets, require a large amount of user interaction, and still give highly variable results. This function attempts to use the alternating nature of the derivatives along with the user defined threshold to identify local maxima or minima in a vector quickly and robustly. The function is able to correctly identify the major peaks on a 1.5 million data point noisy sum of sinusoids in under a second as is shown in the example in the code comments.
Please don't hesitate to comment or contact me if you have suggestions about improvements that could be made to this function. |
| MATLAB release |
MATLAB 7.8 (R2009a)
|
| Other requirements |
None |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 06 Nov 2009 |
Updated code to make it slightly faster. |
| 06 Nov 2009 |
Updated algorithm to make it slightly faster. |
| 11 Nov 2009 |
Fixed example and error checking code. Thanks to Jiro Doke for catching my mistakes. |
| 01 Dec 2009 |
Fixed problems with repeated initial values, repeated final values, and other directional issues. Thanks to Andres for his help finding and debugging these problems. |
| 08 Dec 2009 |
Added support for monotone increase/decreasing functions and empty inputs. Thanks again to Andres for the debugging help. |
| 08 Oct 2010 |
Updated the error checking on the threshold level. |
| 14 Jun 2011 |
Removed redundancy (thanks Tim) and added thresholding option (thanks Femi). |
|
Contact us