LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak detection with automatic threshold handling

Hi

 

for my experiment I need to find out multiple peaks  and valleys but every time data changes so setting up threshold manually is difficult. Please help me in finding threshold automatically.

Thanks

 

Prashant Soni
LabVIEW Engineer
0 Kudos
Message 1 of 8
(3,178 Views)

Consult a terrain map to locate multiple peaks and valleys.  If this is a LabVIEW question, maybe you could elaborate some and upload any code you are having trouble with.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 8
(3,150 Views)

You could try to normalise the data before detecting peaks. For instance, scale the data to 0 to 1 (subtract min, divide by max-min) or -1 to 1 (as before but X2-1). Or scale so the mean is 0 (get mean and subtract it) and divide by spread or stddev.

 

This might not work, good peak detection is an art. It's very dependant on the exact situation.

Message 3 of 8
(3,120 Views)

Or make a histogram. The highest peak in the histogram is often (it depends) the noise level. Base the threshold on that.

Message 4 of 8
(3,117 Views)

Read the help on the peak detection vi.

It will fit a square function on your data over point length. So depending on what you are looking for you migth need some interations .. 

 

If you post some example data and a more detailed description of the points you are looking for more detailed help is possible.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 5 of 8
(3,112 Views)

wiebe@CARYA wrote:

You could try to normalise the data before detecting peaks. For instance, scale the data to 0 to 1 (subtract min, divide by max-min) or -1 to 1 (as before but X2-1). Or scale so the mean is 0 (get mean and subtract it) and divide by spread or stddev.

 

This might not work, good peak detection is an art. It's very dependant on the exact situation.


I agree. There is no "one size fits all" way to find the peaks in data. It all depends what your data looks like.

 

Here is some typical data that I run into quite often. I can't think of an "easy" way to detect the 10 peaks that are above the noise floor in this spectrum. By setting the threshold too high, you risk missing the lower peaks. Set it too low and you get a lot of false positives from the noise floor.

 

As Henrik said, we can't help you unless you post some typical data.

 

threshold.JPG

0 Kudos
Message 6 of 8
(3,098 Views)

A high pass ? 🙂

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 7 of 8
(3,081 Views)

I agree, a highpass filter would work. But I think jamiva was just making a point, not asking a question. Point would be: this needs a high pass filter, other situations need other solutions... So we need details to make specific recommendations.

0 Kudos
Message 8 of 8
(3,073 Views)