finding the prominent peaks in a line graph

asked 2015-04-06 09:53:10 -0600

jeck_slist gravatar image

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.

edit retag flag offensive close merge delete

Comments

1

have you checked this threads here and here. Moreover, if you want to further filter the peaks you will need to play with the scale variable if you decide to go with these solutions.

theodore gravatar imagetheodore ( 2015-04-06 10:46:50 -0600 )edit

thanks. ill check those links

jeck_slist gravatar imagejeck_slist ( 2015-04-09 01:44:36 -0600 )edit