Admin Production ni-theme
Current Publication

ThresholdPeakDetector

LabWindows/CVI

ThresholdPeakDetector

Advanced Analysis Library Only

AnalysisLibErrType ThresholdPeakDetector (double inputArray[], ssize_t size, double threshold, ssize_t width, ssize_t peakIndices[], ssize_t *numberOfPeakIndices);

Purpose

Analyzes the input sequence for valid peaks. This function keeps a count of the number of peaks encountered and a record of the peakIndices, which locate the points that exceed the threshold in a valid peak.

Parameters

Input
Name Type Description
inputArray double [] The input sequence.
size ssize_t The length of inputArray.
threshold double The level that all valid peaks must equal or exceed for the duration of width samples.
width ssize_t The minimum width, in number of samples, for which the input sequence inputArray must remain at or above the threshold value for the candidate peak to be considered valid.
Output
Name Type Description
peakIndices ssize_t [] The indices of all valid peaks. On input, you must allocate enough space for peakIndices. To be safe, allocate (n/width+1)*sizeof(ssize_t) bytes for peakIndices. On output, numberOfPeakIndices specifies the actual number of peaks found.
numberOfPeakIndices ssize_t The number of valid peaks found.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later