allelopath
asked on
Find peaks in sine curve
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.
sinedata.txt
Attached is some example data.
I'm not looking for code that reads in data, assume the data is in an array.
sinedata.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.