01-07-2014 09:16 PM - edited 01-07-2014 09:17 PM
Hi all,
I have a while loop which currently performs a calculation and gives a value for capacitance (C) each loop. The waveform chart when I graph C shows a 1Hz sine with high frequencies on top. I want to be able to perform an FFT to see what the high frequencies are however I have run into a problem...I've tried inserting the C points into an array in the while loop and using 100 points at a time to build a waveform so that I can use the fft power spectrum and psd vi, however my dt would be different because it is dependent on how long it takes the spit out a C value so I've tried using the t0 parameter instead by using get date/time but that doesn't seem to give me the result I want.
Any ideas?
Thanks in advance!
Daniel
01-08-2014 10:30 AM
Daniel,
you have to provide the sampling rate into the dt parameter of the waveform. The t0 parameter has to be 0.
Cheers
Edgar
01-08-2014 05:05 PM
Hi Edgar,
The problem I'm having is that C is not sampled, it merely outputed once each while loop, therefore dt would be changing depending on how long it took to loop each time? Therefore I've gone with using the timestamp, however it doesn't seem to be working properly when I use the get date/time as shown in the code.
Daniel
01-10-2014 06:44 AM
Daniel,
of course it doesn't work this way. An FFT needs a constant sample rate. You can try to resample the waveform to get that. And I would recommend some reading about FFT, seems you have quite a lack of basic understanding of it.
Cheers
Edgar