Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

finding the prominent peaks in a line graph

Hello everyone.

I have a vector of magnitudes or simply an array of numbers. I displayed it as a line graph/histogram as shown below.

original image

What I am trying to achieve is to obtain the coordinates of the two prominent peaks in the image as marked by the green marker

marked image

How can I find the locations of the two prominent peaks as displayed in the image. As you can see the line graph actually has multiple peaks but most of them are actually noise and irrelevant. What algorithm can I use to achieve this.

Thank you

Note: I developed this using c++. Answers in python or pseudo code are appreciated as well.