Sawtooth Waveform VI

Generates a waveform containing a sawtooth wave.


icon

Inputs/Outputs

  • cdbl.png offset

    offset is the DC offset of the signal. The default is 0.0.

  • cbool.png reset signal

    reset signal, if TRUE, resets the phase to the phase control value and the time stamp to zero. The default is FALSE.

  • cdbl.png frequency

    frequency is the frequency of the waveform in units of hertz. The default is 10.

  • cdbl.png amplitude

    amplitude is the amplitude of the waveform. The amplitude is also the peak voltage. The default is 1.0.

  • cdbl.png phase

    phase is the initial phase, in degrees, of the waveform. The default is 0. The VI ignores phase if reset signal is FALSE.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cnclst.png sampling info

    sampling info contains sampling information.

  • cdbl.png Fs

    Fs is the sampling rate in samples per second. The default is 1000.

  • cdbl.png #s

    #s is the number of samples in the waveform. The default is 1000.

  • imsdt.png signal out

    signal out is the generated waveform.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • If Sawtooth Wave is represented by the sequence Y, the VI generates the pattern according to the following equation.

    y[i] = amp × sawtooth(phase[i]), for i = 0, 1, 2, …, n – 1,

    where amp = amplitude, n = number of samples (#s), and sawtooth (phase[i]) is:

    (pmod/180.0) if 0 ≤ pmod < 180.0

    or

    (pmod/180.0 - 2.0) if 180.0 ≤ pmod < 360.0

    where pmod = p modulo 360.0 and phase[i] is:

    initial_phase + frequency × 360.0 × i/Fs

    where initial_phase = phase if reset signal is TRUE, or last output phase if reset signal is FALSE.

    This VI is reentrant so that it can be used to simulate a continuous acquisition from a sawtooth wave function generator. If the input control reset signal is FALSE, subsequent calls to this VI produce the output Sawtooth Wave waveform containing the next n samples of a sawtooth wave. This VI remembers the phase and time stamp of the current waveform and uses this to continuously generate and time stamp the subsequent waveforms, as long as the reset signal input is FALSE.