11-16-2015 02:27 PM
I am trying to generate a FFT frequency response given an input signal from a CSV file.
The file contains time and measurements data. The first column is time (100 µs increments, sampling rate was 10 kHz). The second column is an accelerometer reading.
I'm able to read the CSV and have generated FFT data with both the generic FFT function and the Spectral Measurement function but in both cases I have not entered sampling rate and am unsure how to generate an accurate frequency response. I was originally using these instructions to generate an FFT in Excel: http://www.stem2.org/je/Excel_FFT_Instructions.pdf but I believe there is an error, as it states sampling frequency is total data divided by time interval between data points.
I was calculating a FFT magnitude column by multiplying FFT results by multiplying 2 divided by number of samples by absolute value of the imaginary component of the FFT:
2/n * IMABS(fft result)
Then I was calculating the FFT frequency using by setting the first row (array value) to 0 and incrementing by sampling frequency / total number of samples.
I started to do this with LabVIEW but am unsure how to create the array mentioned in the last step and also figured that this must be a common enough task that there is a way to do it with the build-in tools.
Any advice would be appreciated.
Thanks!
11-16-2015 02:34 PM - edited 11-16-2015 02:34 PM
This is the broken mess of a VI and a screenshot of data format that I am currently working with. My end goal is to have a chart showing frequency vs. magnitude.
11-16-2015 02:36 PM
11-16-2015 02:38 PM
Thanks for the quick response. I'll give this a try.
11-16-2015 02:54 PM
Attached looks like it is working well. The graph wouldn't automatically switch from time to frequency, would it (I changed the title manually).
11-16-2015 03:22 PM
11-17-2015 09:16 AM
I presume it looks like it was written by someone with next to no experience since, well it was. Thanks for the tips.
I'm still struggling along with this. Have been using simulated waveforms and seeing how the different functions look in an attemt to learn more.
I converted this http://www.stem2.org/je/Excel_FFT_Instructions.pdf to LabVIEW and the spectral response looked correct. I feel more comfortable with this than simply using the Auto Power Spectrum VI w/o understanding how it works (I'm using the trial version, waiting for a PO to clear).
Not sure what you meant by "you should use a function that accepts a waveform." I was trying to build the data that I had into a waveform for use with the FFT function. I understand the dt calculation, plan to do this for the final program - was just in a hurry to test and see if what I was doing worked at all.
11-17-2015 09:53 AM