# Pulse

Advanced Analysis Library Only

AnalysisLibErrType Pulse (int numberOfElements, double amplitude[], int delay, int width, double pulse[]);

## Purpose

Generates an array that represents the pattern of a pulse waveform. Pulse obtains the element of the output array using the formula:

for i = 0, 1, 2, . . ., n – 1

The value of delay + width cannot exceed the numberOfElements.

### Example

/* The following code generates the following pulse pattern pulsePattern = {0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 2.0, 2.0, 0.0, 0.0}. */
double pulsePattern[10], amp;
n, delay, width;
n = 10;
delay = 3;
width = 5;
amp = 2.0;
Pulse (n, amp, delay, width, pulsePattern);

## Parameters

Input
Name | Type | Description
numberOfElements | integer | Number of elements to generate in the pulse pattern.
amplitude | double-precision | Amplitude of the pulse to generate. Default Value: 1.0.
delay | integer | Number of elements before the pulse pattern begins. For example, if the delay is 5, the pulse pattern begins at the sixth location of the array. If delay + width is greater than or equal to numberOfElements, Pulse returns an error code and does not generate the pattern. Default Value: 0.
width | integer | Number of elements over which the pulse amplitude remains valid. If delay + width is greater than or equal to numberOfElements, Pulse returns an error code and does not generate the pattern. Default Value: 1.
Output
Name | Type | Description
pulse | double-precision array | Generated pulse pattern array.

## 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.