Effacer les filtres
Effacer les filtres

Fast Fourier Transform on multiple .csv files in one plot

5 vues (au cours des 30 derniers jours)
Robert Evans
Robert Evans le 10 Avr 2016
Commenté : Star Strider le 11 Avr 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

Réponse acceptée

Star Strider
Star Strider le 10 Avr 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 commentaires
Robert Evans
Robert Evans le 11 Avr 2016
Modifié(e) : Robert Evans le 11 Avr 2016
Great, thanks very much for your help.
Star Strider
Star Strider le 11 Avr 2016
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by