I am currently working on a peak detection algorithm for edge detection but I am having 2 problems detecting the peaks. The main idea is to use a second-degree polynomial fitting function using 5 points and if the value is higher than the threshold, it is considered a peak. However, I am detecting multiple peaks in the same area because after detect a peak, the next local area is using 4 of the 5 points used in the previous local area, and most of the time, it will have a value valid to be consider as a peak. Also, I cannot pick the first value and discard the others because sometimes the data is not uniformly distributed and there may exist hidden peaks caused by the noise.
My latest approach tried was the Savitzky-Golay smoothing but results still the same. Do I need to use other kind of filter, smoothing that I dont know or do I have to set a group of rules to select the desired peaks from the candidates.
I am looking for ideas or suggestions of filters or smoothing techniques or anything that can give me a light to follow.Some of the typical problematic cases are illustrated in this picture. The red horizontal line is the threshold and the green lines are the peaks found. Thanks in advance.
Reference: http://originlab.com/doc/Origin-Help/PA-Algorithm