Admin Production ni-theme
Current Publication

PulseParam

LabWindows/CVI

PulseParam

Advanced Analysis Library Only

AnalysisLibErrType PulseParam (double inputArray[], ssize_t numberOfElements, double *amplitude, double *amp90, double *amp50, double *amp10, double *topValue, double *baseValue, double *overshoot, double *undershoot, ssize_t *delay, ssize_t *width, ssize_t *riseTime, ssize_t *fallTime, double *slewRate);

Purpose

Analyzes the input array values for a pulse pattern and determines the pulse parameters that best describe the pulse pattern. PulseParam assumes that the input array has a bimodal distribution, a distribution that contains two distinct peak values. PulseParam can accept negative values and return valid values for those.

Because the input is a discrete representation of the pulse, the delay, width, rise time, and fall time parameters are integers.

PulseParam calculates the output parameters using the following steps:

  1. Find the maximum and minimum values in inputArray.
  2. Generate the histogram of the pulse with 1% range resolution.
  3. Determine the upper and lower modes to establish the top and base values.
  4. Find the overshoot, amplitude, and undershoot from the top, base, maximum, and minimum values.
  5. Scans inputArray and determines the slew rate, rise time, fall time, duration, and delay.

PulseParam interpolates the duration and delay to obtain a more accurate result not only of the duration and delay but also of the slew rate, rise time, and fall time.

If inputArray contains a train of pulses, PulseParam uses the train to determine the overshoot, top, amplitude, base, and undershoot but uses only the first pulse in the train to establish the slew rate, rise time, fall time, duration, and delay.

Note  Because pulses commonly occur in the negative direction, PulseParam can discriminate between positive and negative pulses and can analyze the inputArray sequence correctly. It is not necessary to preprocess the sequence before analyzing it.

Example

/* Generate a noisy pulse pattern and determine its pulse parameters. */
double x[200], y[200], amp, amp90, amp50, amp10, top, base;
double topOvershoot, baseOvershoot, slewRate, noiseLevel;
int n, delay, width, riseTime, fallTime;
n = 200;
amp = 5.0;
delay = 50;
width = 100;
noiseLevel = 0.5;
Pulse (n, amp, delay, width, x); /* Generate a pulse. */
WhiteNoise (n, noiseLevel, 17, y); /* Generate noise signal. */
Add1D (x, y, n, x); /* Noisy Pulse. */

PulseParam (x, n, &amp, &amp90, &amp50, &amp10, &top, &base, &topOvershoot, &baseOvershoot, &delay, &width, &riseTime, &fallTime, &slewRate);

Parameters

Input
Name Type Description
inputArray double [] The values that represent the input pulse signal.
numberOfElements ssize_t Number of elements used to perform the pulse analysis.
Output
Name Type Description
amplitude double Amplitude of the pulse.

amp = top – base
_90Amplitude double The 90% value of the pulse amplitude.

base + 0.9*amp.
_50Amplitude double The 50% value of the pulse amplitude.

base + 0.5*amp.
_10Amplitude double The 10% value of the pulse amplitude.

base + 0.1*amp.
topValue double Top value of the input pulse.
baseValue double Base value of the input pulse.
overshoot double The value of the top overshoot.

overshoot = maximum value – top
undershoot double The value of the base undershoot.

undershoot = base – minimum value
delay ssize_t The number of elements before the pulse is detected.

delay = rising edge index (50% amplitude)
width ssize_t The number of elements representing the duration of the pulse.

width = falling edge index (50% amplitude) – delay
riseTime ssize_t The pulse rise time.

riseTime = 90% amplitude index – 10% amplitude index of rising edge
fallTime ssize_t Pulse fall time.

fallTime = 10% amplitude index – 90% amplitude index on falling edge
slewRate double Pulse slew rate.

slewRate = (90% amplitude – 10% amplitude)/riseTime

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 3.1 and later

Example

Refer to analysis\pulse.cws for an example of using the PulseParam function.