Admin Production ni-theme
Current Publication

Pulse

LabWindows/CVI

Pulse

Advanced Analysis Library Only

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

Purpose

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

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

The value of delay + width cannot exceed the numberOfElements.

Example Code

/* 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 ssize_t Number of elements to generate in the pulse pattern.
amplitude double Amplitude of the pulse to generate.

Default Value: 1.0.
delay ssize_t 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 ssize_t 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 [] The 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.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 3.1 and later

Examples

Refer to the following examples that use the Pulse function:

  • analysis\2dfft.cws

    Open example
  • analysis\transmit.cws

    Open example
  • OpenMP\2dfft_omp.cws

    Open example