SawtoothWave
Advanced Analysis Library Only
AnalysisLibErrType SawtoothWave (ssize_t numberOfElements, double amplitude, double frequency, double *phase, double sawtoothWave[]);
Purpose
Generates an array that contains a sawtooth wave. SawtoothWave generates the output array x according to the following formula:
xi = amplitude × sawtooth(phase + f × 360.0 × i)
where

and where f = frequency, in cycles/sample
You can use SawtoothWave to simulate a continuous acquisition from a sawtooth wave function generator. The unit of the input phase is in degrees, and SawtoothWave sets phase to (phase + f × 360.0 × n) mod 360.0 before it returns.
Parameters
Input | ||
Name | Type | Description |
numberOfElements | ssize_t | Number of elements to generate in the sawtooth wave signal. |
amplitude | double | Amplitude of the resulting sawtooth wave signal. Default Value: 1.0. |
frequency | double | Frequency of the resulting sawtooth wave signal in normalized units of cycles/sample. Default Value: 7.8125E-3 (1 cycle/128 samples). |
Output | ||
Name | Type | Description |
phase | double | Pointer to the initial phase, in degrees, of the generated sawtooth wave signal. Upon completion of SawtoothWave, phase points to the phase of the next portion of the signal. Use this parameter in the next call to SawtoothWave to simulate a continuous acquisition. |
sawtoothWave | double [] | The generated sawtooth wave signal. |
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