Sine Wave VI

Owning Palette: Signal Generation VIs

Requires: Full Development System

Generates an array containing a sine wave.

Details  Example

 Add to the block diagram  Find on the palette
reset phase determines the initial phase of sine wave. The default is TRUE. If reset phase is TRUE, LabVIEW sets the initial phase to phase in. If reset phase is FALSE, LabVIEW uses the value of phase out from when the VI last executed as the initial phase of sine wave.
samples is the number of samples of the sine wave. The default is 128.
amplitude is the amplitude of sine wave. The default is 1.0.
frequency is the frequency of sine 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 sine wave when reset phase is TRUE.
sine wave is the output sine wave.
phase out is the phase, in degrees, of the next sample of sine wave.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Sine Wave Details

If the sequence Y represents sine wave, the Sine Wave VI generates the pattern according to the following equation.

yi = a*sin(phase[i])

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

a is amplitude,

phase[i] = initial_phase + f*360*i,

frequency is the frequency in normalized units of cycles/sample,

initial_phase is phase in if reset phase is TRUE,

initial_phase is the phase out from the previous execution of this instance of the VI if reset phase is FALSE.

The Sine Wave VI is reentrant, so you can use it to simulate a continuous acquisition from a sine wave function generator. If the input control reset phase is FALSE, subsequent calls to a specific instance of the Sine Wave VI produce the output sine wave array containing the next samples of a sine wave. The VI uses the phase out value as the new phase in the next time the VI executes.

Example

Refer to the Function Generator with FM VI in the labview\examples\Signal Processing\Signal Generation directory for an example of using the Sine Wave VI.

 Open example  Find related examples