LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

collect data from non NI device and perform continuous frequency analysis

 

Hi, I am relatively new to Labview and would appreciate some help here. I am seeking to do frequency analysis based on continuous data streaming in from a device. I have enclosed within a while loop codes to query the signal and to perform some function to convert the signal to a data. Then, I would like to do real time fft on this data that is continuously streaming in.

So, my question is how does Labview know the time point of the data in order to do frequency analysis on it. I have tried a convert to dynamic then connect this to a spectral measurement vi within the while loop but it does not work. I have also tried to assign the dynamic data as a local variable and connect this to spectral measurement vi outside the while loop but it does not work too. the only time it work is when i connect the array of data (after while loop is finished) to the spectral measurement vi) but then again, my original question applies (how does labview know the time) and i wanted real time frequency analysis of the data.

0 Kudos
Message 1 of 5
(2,577 Views)
What sort of device and how is the data being acquired? Are you getting multiple samples at once and do you specify the sample rate of this third party device? You would take that sample rate, take the inverse, and pass it to the Create Waveform function as the dt value along with your y array.
0 Kudos
Message 2 of 5
(2,563 Views)

Thanks for replying.

I am using ISEN FBG interrogator and the VI provided by the supplier as a starting point.

I can only set the maximum sampling rate. the actual sampling will differ from this depending on the integration time on the photodiode array.

I have attached the VI with my modifications and indicated the data that i wish to do frequency analysis on.

 

0 Kudos
Message 3 of 5
(2,549 Views)
Sorry, I'm not familiar with the device and I can't look at your code right now. You have to get an actual sample rate for your frequency analysis to be correct.
0 Kudos
Message 4 of 5
(2,514 Views)

If I understand correctly, you are getting sample data at unevenly spaced intervals? The FFT algorithm required evenly sampled data so will not serve your purpose in this instance.

 

Two ways around this are to re-sample your data to get uniform samples (ie. choose a constant sample rate and interpolate the incomming samples to get the new samples - however this tends to introduce errors in the results because assumptions are made by the interpolation algorithm) or use a different method for calculating the frequency response such as a Least Squares analysis.

 

I know very little about either method so can't help much further. I think either way will involve quite a bit of number-crunching in labview code. These links might point you in the right direction...

 

http://scicomp.stackexchange.com/questions/593/how-do-i-take-the-fft-of-unevenly-spaced-data

 

http://en.wikipedia.org/wiki/Least-squares_spectral_analysis

0 Kudos
Message 5 of 5
(2,511 Views)