LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know why the waveform peak detect function provides accurately the position of the peaks but not the value?

Does anyone know why the waveform peak detect function provides accurately the position of the peaks but not the value?

 

I have been looking at my data at the position indicated by the function as a peak, and it is correct at that place the wave has its peak, but the value provided by the function is higher than the actual value at that point.

 

 

0 Kudos
Message 1 of 3
(2,625 Views)

The help makes it clear that the VI will make a quadratic fit to the data, so the locations are not integers (i.e. not aligned with you exact data). From that analysis, the peak is between two of your points, and slightly above the neighboring data.

 

See the coercion dot. Make the "locations" array DBL (Why did you change it to I64, that makes no sense at all!)

 

Quote from the help:

"Locations contains the index locations of all peaks or valleys detected in the current block of data. Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array."

 

All clear? 😄

0 Kudos
Message 2 of 3
(2,618 Views)
Thanks. I read through but apparently not thorough enough as I missed that...
0 Kudos
Message 3 of 3
(2,604 Views)