Fast Fourier Transform on multiple .csv files in one plot
5 views (last 30 days)
Show older comments
Robert Evans
on 10 Apr 2016
Commented: Star Strider
on 11 Apr 2016
Hello, I have 26 CSV files with 1001 time domain data points in each.I'm trying to perform an FFT on the data to view the frequency spectrum.
I have been able create an FFT of each file individually, but was hoping to do an FFT on all of the files in one go so that they all show up on the same plot.
I don't know how I would go about doing this, so I was hoping someone might be able to help me with this problem.
Best Regards
Robert
0 Comments
Accepted Answer
Star Strider
on 10 Apr 2016
I would read them all in, each as its own cell array element (one for each file), then, since they are all the same lengths, concatenate them (most likely horizontally since I suspect they’re column vectors), using cell2mat or simple cell addressing to convert them from cells to a double matrix, then save all of them as the double matrix in a .mat file. For helpful details, see FAQ: How can I process a sequence of files?
Then load the .mat file and do the fft. It operates on columns by default. The code between the top two plot figures in this documentation for fft is everyting you need to know about analysing and plotting them.
6 Comments
More Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!