LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW peak detection algorithm

How does the LabVIEW peak detection algorithm work ?

SP
0 Kudos
Message 1 of 5
(7,029 Views)
You specify a width, a threshold and whether you want to detect peaks or valleys...and then you get an array out with the index of the peaks/valleys.

How it works internally?
As it has a width input and a threshold input I would guess that the algorithm just checks whether a point is above the threshold and if it is higher (peaks) / lower (valleys) than all neighbouring points within the specified width...if it is, then that point is added to the list of peaks/valleys and the algoritm can jump to the first point outside the range just checked and continue the search...There's probably a number of ways they have optimized it. I may be wrong ...but at least that's how you can imagine it to work.
0 Kudos
Message 2 of 5
(7,029 Views)
Way too fast and too late at night...My theory about the inner workings is obviously wrong if you look at the output; one of the outputs is the 2nd derivative...so it's obviously using the 2nd derivative to find the peaks and valleys, just like you probably learn at school...The index of the peaks/valleys are fractional ("locations"), they can specify the peak to be between the given points...
0 Kudos
Message 3 of 5
(7,029 Views)
If you view the VI help you can find the following explanation:

threshold rejects peaks and valleys that are too small. For peaks, the VI ignores any peak found with a fitted amplitude that is less than threshold. The VI ignores valleys if the fitted trough is greater than threshold.

width specifies the number of consecutive data points to use in the quadratic least squares fit. width is coerced to a value greater than or equal to 3. The value should be no more than about 1/2 of the half-width of the peaks/valleys and can be much smaller (but >2) for noise-free data. Large widths can reduce the apparent amplitude of peaks and shift the apparent location. For noisy data, this modification is unimportant since the noise obscures the actual peak.
0 Kudos
Message 4 of 5
(7,030 Views)
Hi..
Do you have any vi to share with us other than examples of vi (peak detection)part in labview 7.0?
0 Kudos
Message 5 of 5
(6,699 Views)