Signal Generator by Duration VI

Generates a signal with a shape given by the signal type.


icon

Inputs/Outputs

  • cbool.png reset phase

    reset phase determines the initial phase of output signal. 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 this VI was last executed.

  • cdbl.png duration

    duration is the time, in seconds, of the duration of the generated output signal. The default is 1.0.

  • cenum.png signal type

    signal type is the type of signal to generate.

    0
    Sine
    (default)
    1
    Cosine
    2
    Triangle
    3
    Square
    4
    Sawtooth
    5
    Increasing ramp
    6
    Decreasing ramp
  • ci32.png # of samples

    # of samples is the number of samples of the output signal. The default is 100.

  • cdbl.png frequency

    frequency is the frequency of the output signal in Hz. The default is 10.

    The unit of frequency is Hz, or cycles/sec, and so represents the number of cycles of one period of the waveform type that is generated in 1 second of the output signal.

  • cdbl.png amplitude

    amplitude is the amplitude of the output signal. The default is 1.0.

  • cdbl.png dc offset

    dc offset is the constant offset, or dc value, of the generated output signal. The default is 0.

  • cdbl.png phase in

    phase in is the initial phase, in degrees, of output signal when reset phase is TRUE. The default is 0.

  • cdbl.png square wave duty cycle (%)

    square wave duty cycle is the percentage of time a square wave remains high versus low over one period. The VI uses this parameter only if the signal type is a square wave. The default is 50.

  • i1ddbl.png signal

    signal is the generated array of signal samples.

  • idbl.png sample rate

    sample rate is the output signal sample rate and is equal to # of samples/duration.

  • ii32.png error

    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.

  • idbl.png phase out

    phase out is the phase, in degrees, of the next sample of output signal.

  • The frequency of the signal is given in Hz (cycles/sec) and the duration is given in seconds.

    # of samples and duration completely define a sample rate, which must be greater than 2 times the appropriate signal frequency to meet the Nyquist criterion

    • sample rate > 2*frequency
    • (samples/duration) > 2*frequency

    If the Nyquist criterion is not met, you must adjust # of samples, duration, or frequency in one of the following ways:

    • Increasing # of samples
    • Decreasing duration
    • Decreasing frequency

    The Signal Generator by Duration VI is reentrant, so you can use it to simulate a continuous acquisition from a function generator. If the input control reset phase is FALSE, subsequent calls to the Signal Generator by Duration VI produce an array containing the next n samples of the selected waveform.

    When reset phase is FALSE, the Signal Generator by Duration VI uses the phase out value as its new phase in the next time the VI executes.