Generating an Analog Signal with the Correct Frequency

Updated May 3, 2018

Reported In


  • NI-DAQmx


Software: LabVIEW

Issue Details

  • I tried to generate a signal, but it's frequency does not match the the waveform I used
  • I don't know how to generate a periodic signal with the specific frequency that I want


To generate a desired output frequency from a given waveform:
  • Count the number of samples per period of your waveform
  • Calculate the necessary update rate of your device based on this formula:
Update Rate = Output Frequency * # of Samples per Period
  • Note:  If the required update rate is above your device's specification, we will need to modify the waveform, use a faster device, or choose a lower frequency signal to generate.

To generate a desired output frequency with a given update rate:
  • Calculate the number of samples for each period based on this formula:
# of Samples per Period = Update Rate / Output Frequency
  • Create a waveform of the desired signal with the correct number of samples per period
  • Note: You need to have more than 2 samples per period based on Nyquist Theorum.


Additional Information

In general, this is the formula for calculating the frequency of the analog signal being output:

Output Frequency = Update Rate / # of Samples per Period

Note: Based on Nyquist Theorum, the quality of the signal is significantly improved by having at least 10 samples per period


Not Helpful