PulseParam

Advanced Analysis Library Only

AnalysisLibErrType PulseParam (double inputArray[], int numberOfElements, double *amp, double *amp90, double *amp50, double *amp10, double *topValue, double *baseValue, double *overshoot, double *undershoot, int *delay, int *width, int *riseTime, int *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-precision array The values that represent the input pulse signal.
numberOfElements integer Number of elements used to perform the pulse analysis.
Output
Name Type Description
amp double-precision Amplitude of the pulse.

amp = top — base
amp90 double-precision The 90% value of the pulse amplitude.

base + 0.9*amp.
amp50 double-precision The 50% value of the pulse amplitude.

base + 0.5*amp.
amp10 double-precision The 10% value of the pulse amplitude.

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

overshoot = maximum value — top
undershoot double-precision The value of the base undershoot.

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

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

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

riseTime = 90% amplitude index — 10% amplitude index of rising edge
fallTime integer Pulse fall time.

fallTime = 10% amplitude index — 90% amplitude index on falling edge
slewRate double-precision 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.