Peak Detection is a challenging step in many applications. Read and learn how to accurately detect peaks and valleys in 1D vectors and 2D arrays (images).
Our human brain is excellent in peak detection in relation to its context. What seems an easy task by eye can be a challenging task to automate by machines. In general, peaks and valleys indicate (significant) events such as sudden increases or decreases in price/volume, or sharp rises in demand. One of the challenges is the definition of a peak/valley which can differ across applications and domains. Other challenges can be more technical, such as a noisy signal that can result in many false positives or a single threshold that may not accurately detect local events. In this blog, I will describe how to accurately detect peaks and valleys in a 1-dimensional vector or a 2-dimensional array (image) without making assumptions about the peak shape. In addition, I will demonstrate how to handle noise in the signal. Analyses are performed using the findpeaks library, and hands-on examples are provided for experimenting.
The detection of (sudden) changes in a signal is an important task in many applications that needs to be reported or monitored. There are roughly two types of “sudden changes”, the so called outliers and peaks of interest which are conceptually different. Outliers are data points that significantly deviate from what is normal in the data set whereas peaks of interest are specific data points or regions within a signal that have significance or relevance for the analysis or domain in question. In case you need a deep dive with hands-on examples in outlier detection, try these blogs [1, 2].