Solved

# Locating local maxima of arbitrary curve

Posted on 2008-10-15
799 Views
Last Modified: 2013-11-13
I need to locate the local maxima across a histogram. That is, I need to locate the 'hills' in the histogram graph. Is the best way to do this to calculate the first derivative across the curve until it is under some low (near zero) threshold value? The graph can be quite noisy so I'm not sure what the best way to do this is. Also, what size window should be used to calculate the derivative across the points of the arbitrary curve?

Thanks in advance
0
Question by:corey_mcm
• 3
4 Comments

LVL 84

Expert Comment

ID: 22728342
If the function is continuously differentiable the local maxima will be where the derivative is 0 and the second derivative is negative
0

LVL 84

Expert Comment

ID: 22728356
If the function is discrete, than anywhere f(n-1) <  f(n) > f(n+1) is a local maximum
0

LVL 5

Author Comment

ID: 22728399
I'm generating a critically smoothed gaussian kernel of the histogram.. Is the safe to use the following (where 'value' is the histogram array):

To calculate the first order derivative:

dOne (int x) {
return value[i+1] - value[i];
}

To calculate the second order derivative:

dTwo (int x) {
return dOne(x+1) - dOne(x);
}
0

LVL 84

Accepted Solution

ozo earned 500 total points
ID: 22728461
That's one way to do it.
A local maximum would then be where dOne goes from positive to negative
0

## Join & Write a Comment Already a member? Login.

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

#### 757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!