Skip navigation


Currently Being Moderated

Calculate Frequency of Signal Displayed on Waveform Graph

VERSION 3  Click to view document history
Created on: Sep 23, 2009 10:34 AM by John_P1 - Last Modified:  Sep 24, 2009 9:01 PM by John_P1



This function will output the frequency of a signal displayed on a waveform graph.  If the user is zoomed into a specific portion of the signal, the function will only take into account the visible portion of the signal.





The function looks at all zero crossings in the visible region of the waveform graph.  It calculates the average distance between zero crossings (rising and falling) to obtain the average semi-period of the signal.  It then multiplies this number by two (average period) and inverts to obtain the frequency of the signal.



Example Use Case:




In the above use case, we acquire a finite amount of data into a waveform graph.  The loop in the end allows the Meas Freq of Visible Waveform sub-vi to continuously compute frequency based on the region of the graph that we are zoomed in on:


Use Case FP.png


To obtain a reference to a waveform graph, simply right-click on the Waveform Graph icon (from the block diagram) then select Create >> Reference.  The waveform graph should have accurate timestamp information (waveform input) for the function to be able to calculate frequency.  The sub-VI will only work on a single waveform (an Array of Waveforms will cause an error within the sub VI).


Comments (6)