Admin Production ni-theme
Current Publication

StateLevels

LabWindows/CVI

StateLevels

Advanced Analysis Library Only

AnalysisLibErrType StateLevels (double waveform[], ssize_t waveformSize, int method, ssize_t histogramBins, double *highStateLevel, double *lowStateLevel, double *amplitude);

Purpose

Calculates the high state level, low state level, and amplitude of a waveform.

Parameters

Input
Name Type Description
waveform double [] The waveform to measure.
waveformSize ssize_t The size of waveform x.
method int The method used to determine the high and low state levels of a waveform.
  • Histogram method - Returns the levels of the histogram bins with the maximum number of hits in the upper and lower regions of the waveform. The upper and lower regions of the waveform include the upper and lower 40%, respectively, of the peak-to-peak range of the waveform.
  • Peak method - Searches the entire waveform for its maximum and minimum levels.
  • Auto Select method - Determines whether the histogram bins that correspond to the high and low state levels each have over 5% of the total hits. If so, LabWindows/CVI returns those results. Otherwise, LabWindows/CVI uses the Peak method. This ensures a reasonable answer for either a square wave (ignoring the overshoot and preshoot) or a triangle wave (where a histogram fails).
histogramBins ssize_t The number of bins in the Histogram method that LabWindows/CVI uses to determine the high and low state levels of the waveform.
LabWindows/CVI ignores histogramBins if you select Peak method as method.
Output
Name Type Description
highStateLevel double The high state level of the waveform according to the method.
lowStateLevel double The low state level of the waveform according to the method.
amplitude double The amplitude of the waveform according to the method.

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.5 and later