jdaltonnal wrote in news:5065000000080000001B250000-
993342863000@exchange.ni.com:
> I'm reading in an analog signal from a DAQ. It is essentially a sine
> wave. I need to detect the frequency of the sine wave. Is there an
> easy way to just read in the data from the analog signal and calculate
> the freqency? The program will be running constantly when a loop is
> enabled to be constantly finding the frequency of this changing
> signal. I'll need to read in the data as long as the "run" loop is
> still enabled, so reading in the frequency has to be relatively fast.
Dennis Knutson's suggestion to use the Extract Single Tone Information VI
is a good one.
Some care should be taken when performing this measurement, though, because
what you a
re doing is dynamic signal measurement. Problems can come up if
you don't sample at an adequate rate and apply appropriate front-end low-
pass filtering for anti-aliasing. Sampling should be done using buffered
acquisition (as opposed to single point, as for temperature) using a
sampling rate of at least twice the maximum frequency of interest. Low-pass
filtering should block frequencies above 1/2 your sampling rate.
Without such provisions, you'll likely see aliasing--frequencies that
aren't actually in your signal and result from sampling.
For more information, you might take a look at the National Instruments
developer's zone. Take a look at application note 41, Fundamentals of FFT-
based spectral analysis.
Hope this helps,
--Sam
Sam Shearman
Product Manager, Signal Processing and Analysis Software
National Instruments