0

I have 10M orbits which I know that I would be able to categorize them if I use correctly the FFT algorithm, some examples of my data:

enter image description here

And another type of orbit:

enter image description here

And I want to use FFT in order to get some insights (frequencies, chaos, ...) about these kind of orbits and then categorize them. The code that I have is the following, where df1 is a dataset where the 1,2,3 columns are the x,y and z data. I focus, in the beginning, just in the x component to make everything more simple, and then extrapolate the method to 3D.

FourierTransform = 
np.fft.fftn(np.array([df1[1].to_numpy(),df1[2].to_numpy(),df1[3].to_numpy()]))

N = len(FourierTransform[0])
fig_T = plt.figure()
plt.plot(2.0/N * np.abs(FourierTransform[0][:int(N/2)]), 'k')
plt.plot()
plt.show()

And what I get from the orbits above the following plots of the fft respectively:

enter image description here

enter image description here

I saw in older questions that people use the period of the signal (in my case a orbit) in order to give the x-axis but since some of mine orbits are not periodic, I would like to know what can I use to have a usefull plot of the FFT.

The problem here is I am not specifying to matplotlib the x-axis since I dont have the period, and all the frequency that appears in my plots stay in the left part of the x-axis and I believe that this is not the real values , it is just a problem that I didnt specify the x-axis.

Does anyone know how can I use fft where and signal is not periodic? I read some literature about applying a window but I don't really understand how to calculate this window and what this does.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • I am not really sure what you are up to. Maybe some histogram of all orbits where you see which frequencies were there? Basically something like a sum (or call it a stack) of many FFT plots? – Joe May 06 '20 at 16:07
  • You can calculate the x axis (you call it the period, do you mean the frequencies?) using [fft.fftfreq](https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftfreq.html#numpy.fft.fftfreq). There are many many examples online on how to use it. – Joe May 06 '20 at 16:10
  • https://stackoverflow.com/questions/52730753/how-to-get-frequency-axis-from-an-fft-function – Joe May 06 '20 at 16:12

0 Answers0