Finding the 50% values around a maximum

This is a discussion on Finding the 50% values around a maximum within the C++ Programming forums, part of the General Programming Boards category; Hi guys (sorry there is no subject title; couldn't really think of an accurate one), This is my situation: I ...

1. Finding the 50% values around a maximum

Hi guys (sorry there is no subject title; couldn't really think of an accurate one),

This is my situation:
I have data which when I graph it gives me a peak. I want to find the resolution of my peak by finding the 50% point and dividing it by the width.
Its hard to explain in words so I drew a picture... please see attached.

Basically, I want to find the width @ 50% intensity of the peak.

Any ideas how I can do this???

Cheers :-)

2. A. Find the peak.
B. find 1/2 the peak.

Do you mean width as in how many numbers from 1/2 to 3/2 of peak, or do you mean width as in the distance from each number?

Find the peak is OK.

Find 50% is OK. But the problem is 50% of the maximum may not exist. Need to round to the nearest number. Any ideas on that???

Also, other problem is that I need 2 values @ ~50% from each end of the peak. How do I ensure that I get from both ends of the peak???

Once I have these values at 50% on both ends of the peak the rest seems pretty straigh forward for me to just read off the corresponding x values.

4. I fixed your title by the way.

> But the problem is 50% of the maximum may not exist.
But 50%+δ and 50%-δ will exist, so searching forwards/backwards for say while ( a[pos] > max/2 ) will find the 50% transition points.

5. fyi: this is generally called, among other things, the full width at half maximum (FWHM).

6. I find Chapter..1...Boost.Accumulators very useful for this kind of stuff. Not sure if it contains a solution for your exact problem.

7. You will also want to decide how you want to handle noisy data, where the data is not steadily rising or falling, but instead dips down a bit near the 50% level.

8. let's hope they wouldn't saddle him with a filtering/least squares problem at this stage of the game; that would be a little brutal for a noob.

9. It should still be a consideration though, even if you're not willing to apply smoothing. Do you work from the middle to find the first number that dips bellow 50%, or from the edges to find the first number above 50%? The results will be different for certain datasets.