We help IT Professionals succeed at work.

Find peaks in sine curve

allelopath asked
Last Modified: 2012-05-11
What is the best way to find the peak points on a sine or sine-like curve?
Attached is some example data.
I'm not looking for code that reads in data, assume the data is in an array.

Watch Question

Awarded 2011
Awarded 2011


I think you need to have some condition - say you want to find certain number of highest maxima or you want
to find all maxima higher than some value

Then you can scan all the pioints and find all locations where
 (value[j-1]<value[j] && value[j+1]<value[j])
then you storea all such values (both x and values for each point)  say in the ArrayList
and after you collected all of them analyze all these points
using the condition specified - and end up with the list of peaks you need.

Awarded 2011
Awarded 2011
Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.