Arbitrary Wave (Not in Base Package)

Generates an array containing an arbitrary wave. Details

Wave Table is one cycle of the waveform used in creating the output Arbitrary Wave.
samples is the number of samples of the Arbitrary Wave. The default is 128. samples must be greater than or equal to 0. If samples is less than zero, the VI sets Arbitrary Wave to an empty array and returns an error.
amplitude is the amplitude of Arbitrary Wave. The default is 1.
f is the frequency of Arbitrary Wave in normalized units of cycles/sample. The default is 1 cycle/128 samples or 7.8125E-3 cycles/sample.
phase in is the initial phase, in degrees, of Arbitrary Wave when reset phase is 0.
reset phase determines the initial phase of Arbitrary Wave. The default is TRUE. If reset phase is TRUE, the initial phase is set to phase in. If reset phase is FALSE, the initial phase is set to the value of phase out when the VI last executed.
interpolation determines the type of interpolation the VI uses to generate Arbitrary Wave from the Wave Table array. The default is 0 (no interpolation). If interpolation is 0, the VI does not use interpolation. If interpolation is 1, the VI uses linear interpolation
Arbitrary Wave is the output arbitrary wave.
phase out is the phase of the waveform in degrees.
error returns any error or warning from the VI. Refer to Signal Processing Error Codes for more information about these conditions.

Arbitrary Wave Details

If the sequence Y represents Arbitrary Wave, the Arbitrary Wave VI generates the pattern according to the following formula

y[i] = a * arb(phase[i]),

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

where a is the amplitude, n is the number of samples,

arb(phase[i]) = WT(phase[i] modulo 360)*m/360),

where m is the size of the Wave Table array.

If interpolation = 0 (no interpolation), then WT(x) = Wave Table[int(x)].

If interpolation = 1 (linear interpolation), then WT(x) is equal to the linearly interpolated value of Wave Table[int(x)] and Wave Table[(int(x)+1) modulo m].

phase[i] = initial_phase + f*360.0*i, where f is the frequency in normalized units of cycles/sample, initial_phase is phase in if reset phase is TRUE, or initial_phase is the phase out from the previous execution of this instance of the VI if reset phase is FALSE.

The Arbitrary Wave VI is reentrant, so you can use it to simulate a continuous acquisition from an arbitrary wave function generator. If the input control reset phase is FALSE, subsequent calls to a specific instance of this VI produce the output Arbitrary Wave array containing the next samples of the arbitrary wave.

phase out is set to phase[n], and this reentrant VI uses this value as its new phase in if reset phase is FALSE the next time the VI executes.