Impulse

Advanced Analysis Library Only

AnalysisLibErrType Impulse (int numberOfElements, double amplitude, int delay, double impulse[]);

Purpose

Generates an array that has the pattern of an impulse waveform. Impulse obtains the element of the output array using the following formula:

xdelay = amplitude

All other elements are zero. The value of delay cannot exceed the numberOfElements.

Example

/* The following code generates the impulse pattern x = {0.0, 0.0, 1.5, 0.0, 0.0}. */
double x[5], amp;
int n, i;
n = 5;
i = 2;
amp = 1.5;
Impulse (n, amp, i, x);

Parameters

Input
Name Type Description
numberOfElements integer Number of elements to generate in the impulse pattern.
amplitude double-precision Peak amplitude of the impulse.

Default Value: 1.0.
delay integer The number of elements before the spike of the impulse pattern.

For example, if the delay is 5,the spike is located in the sixth element of the array. If delay is greater than or equal to the number of elements, the pattern is not generated.

Default Value: 0.
Output
Name Type Description
impulse double-precision array Generated impulse pattern.

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.