From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

advice on finishing touches for circuit.

Mark, need your advice on one final thing (honest!) if you have time!

when trying converting from  2-D array of double [64-bit real (~15 digit precision)] to Waveform the frquency goes all to pot! ive demonstarted this in a simple example that came with the software. you can see the detectde freq is wrong! did i convert it correct? how can this be resolved? thanks
0 Kudos
Message 41 of 44
(569 Views)

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

0 Kudos
Message 42 of 44
(564 Views)
thankyou, i promise that was the last thing i need help on sorting! i take it that the harmonics will be ok too, ye?
0 Kudos
Message 43 of 44
(561 Views)
Should be - just remember that the highest frequency you're looking for must be less that 1/2 the sampling frequency to be detected properly!
 
Good luck with the rest of the project!
 
M.
0 Kudos
Message 44 of 44
(558 Views)