Peak Detector (Not in Base Package)

Finds the location, amplitude, and second derivative of peaks or valleys in the input array. Details

X is the input that holds the data to be processed. The data can be a single array or consecutive blocks of data. Consecutive blocks of data are useful for large data arrays or for real time processing. Notice that in real time processing, peaks/valleys are not detected until approximately width/2 data points past the peak or valley.
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.
peaks/valleys specifies whether the VI looks for peaks (positive-going bumps) or valleys (negative-going bumps). The settings for this control are 0 (peaks) and 1 (valleys).
initialize, when set to TRUE, specifies processing the first block of data. The VI requires some internal setup at the beginning for proper operation. If you only want to process one block of data, leave initialize unwired, or set its default state to TRUE. If you want to process consecutive blocks of data, set initialize to TRUE for the first block and FALSE for all other blocks of data.
end of data, when set to TRUE, specifies processing the last block of data. After processing the last block of data, the VI manages internal data. If you only want to process one block of data, leave end of data unwired, or set its default state to TRUE. If you want to process consecutive blocks of data, set end of data to FALSE for all but the last block of data.
# found is the number of peaks/valleys found in the current block of data. # found is the size of the arrays Locations, Amplitudes, and 2nd Derivatives.
Locations contains the locations of peaks/valleys found in the current block of data. Locations are reported in indices from the start of processing.
Amplitudes contains the amplitudes of peaks/valleys found in the current block of data.
2nd Derivatives contains the second derivatives of the peaks/valleys found in the current block of data.
error returns any error or warning from the VI. Refer to Signal Processing Error Codes for more information about these conditions.

Peak Detector Details

The data set can be passed to the Peak Detector VI as a single array or as consecutive blocks of data.

This Peak Detector VI is based on an algorithm that fits a quadratic polynomial to sequential groups of data points. The number of data points used in the fit is specified by width.

For each peak or valley, the quadratic fit is tested against the threshold level. Peaks with heights lower than the threshold level or valleys with troughs higher than the threshold level are ignored. peaks/valleys are detected only after approximately width/2 data points have been processed beyond peaks/valleys locations. This delay has implications only for real-time processing.

The Peak Detector VI must be notified when the first and last blocks are passed into the VI, so that the VI can initialize and then release data internal to the peak detection algorithm.