Impulse
Advanced Analysis Library Only
AnalysisLibErrType Impulse (ssize_t numberOfElements, double amplitude, ssize_t delay, double impulse[]);
Purpose
Generates an array that has the pattern of an impulse waveform. Impulse obtains the ith 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 Code
/* 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 | ssize_t | Number of elements to generate in the impulse pattern. |
amplitude | double | Peak amplitude of the impulse. Default Value: 1.0. |
delay | ssize_t | 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 [] | 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. |
Additional Information
Library: Advanced Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later
Example
Refer to analysis\iirfiltr.cws for an example of using the Impulse function.