04-11-2014 10:57 AM
Goodmorning everyone,
I'm taking vibration measurement of a machining process, with sampling frequency of 51,2 kHz for 10 seconds. My problem is that I sample the whole process but i'd need just the a part of the seady state phase, appoximately 3 s, from 5 to 8.
I need to perform a FFT analysis on this sample and i'm wondering if ther is a method to perform FFT online on the interval of interest, without recurring to the post processing.
Since i'm not sure the thing I want can be done i've started building a post process programm that import data from an excel file and perform FFT. Since i'm really new with labview I used an example programm found on this website ( attached file).
But it looks like it doesn't work properly bacause it doesn't "see" the commas in the value ( for example 0,4 bacomes 4) and the minus sign ( -0,12 bacomes 12 ). Which is the problem in this programm?
Thank you for your help
04-11-2014 12:36 PM
It is easy to extract a portion of a data set. For data in an array use Array Subset. If the data is a waveform, use Get Waveform Subset.vi.
Since you did not post a data file, this is a guess. I think you misunderstand the purpose of the Delimiter input to Read from Spreadsheet File.vi. That delimiter is the character which separates fields in the file. So 0,4 does not become 4. It becomes a two element array with 0 as the first elemetn and 4 as the second element. Some functions do not accept comma as a decimal separator. Search the help for "Format Specifier Syntax". It indicates (in the fine print) that Spreadsheet String to Array (which is used internally in Read from Spreadsheet File.vi) only accepts format strings of % [Width] Conversion Code. So it will not handle the localization code to specify a comma decimal separator.
If your data is saved in a text file with comma decimal separator (and some other character as a field separator), do a two step process. First read the file as a string and use string functions to change comma to period. Then use Spreadsheet String to Array to convert to a numerical array.
Lynn
04-11-2014 02:10 PM
Thanks,
I think Get Waveform Subset.vi is perfect for my purposes.
You guessed very well, in the excel file the decimal separator is a comma, the problem is the one you have hypotized. I will try to do what you have suggested!
Lorenzo