‎04-20-2006 08:13 AM
‎04-20-2006 09:03 AM
Hi,
The Harmonic Distortion Analyser vi you're using has to have the data input to it in waveform format, as it needs to know how evenly spaced the samples are (this information isn't available in the array of doubles).
You can put the array into the waveform format using the build waveform function (I've shown you how to do this in the attached VI). You need to supply a starting 'time' (which if you're just doing analysis can be '0', but if you want the samples to be logged against time you should feed it with the proper starting time). You also need to feed it with the delta T between samples, which you can find by doing the reciprocal of the sampling frequency.
Remember that the fundamental frequency will only be accurate up to 1/2 of the sampling frequency (due to the Nyquist theorem), above that the frequencies recognised will be aliased (as not enough samples are available to reliably reconstruct the waveform), and the wrong fundamental frequency will be returned by the function anyway. I've tested this setup on my desk with a sampling frequency of 10kHz up to 5kHz, and it accurately returns the fundamental frequency.
Best wishes,
Mark
‎04-20-2006 09:35 AM
‎04-20-2006 10:01 AM