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: 

How perform an FFTon non-regular interval recorded data?

I have data that is recorded sporadically.  I need to perform an FFT on it.  The FFT requires a waveform input.  I can't create a waveform because I don't have a static dT.  I know that I can create a 2D array with data points evenly spaced b y using for loops and the linear interpolation VI, but I was wondering if there is a better way? The computer will be very slow if it needs to create an array for millions of data points (example points. 10mm at 0 seconds, 10,5mm at 3500 seconds, 12mm at 123000 seconds, 10mm at 150000 seconds ....)  This can go on for up to 2 months i.e. 5000000 seconds, that's alot of data to step through point for point.  I have the data displayed in an XY graph today, this graph has already interpolated the data according the Y (mm data) and the X (seconds data).  Is there any way to get the interpolated data from this graph?
 
David Beaudry
0 Kudos
Message 1 of 5
(2,355 Views)
There is a body of literature on analysis of non-uniformly sampled data, but it is full of heavy-duty mathematics. I like that kind of stuff, but gave up after a couple of weeks of reading.

What is the minimum dt you will see in you data? From the example you cited, it seems as though it may be 1 second or more. If so, resampling to create an array of 5 megasamples should not be too taxing for modern computers. If you are going to use the FFT algorithm, make your array size a power of 2, as the algorithm is more efficient. The next larger size would be 2^23 = 8388608.

Initialize the array outside the resampling loop and use Replace Array Element (Subset?) to avaoid frequent memory reallocations during the process.

Lynn
Message 2 of 5
(2,346 Views)
Apparantly I've picked a poor method of resampling with loops. Could you send a simple code example that shows what you mean in your message?  Thanks for your help. 
0 Kudos
Message 3 of 5
(2,337 Views)
David,

I have attached a VI which shows two things. One is the Resample Waveforms Vi in the Waveform Conditioning palette. The other is and example of using a preallocated array and Replace Array Subset. I set it up with a small array size for the demo. If you set it to 2^23, the data will occupy a bit over 200 MB. Eight bytes per double and three array buffers allocated, including one for the FFT result. Actaully it will be larger than that because the FFT result is complex, I think. Make sure the computer you try to do the analyis with has enough RAM that you are not paging through virtual memory or things slow way down.

Lynn
Message 4 of 5
(2,330 Views)
Thanks again!  This solution was what I was trying to get done.  I misunderstood how to get the waveforms into the resampler from the aperiodic data.  The other thing was that my computer was low on RAM and the pagefile swapping that you mentioned was what was 'killing' my computer.
0 Kudos
Message 5 of 5
(2,326 Views)