I have a csv file that contains time and torque data. https://pastebin.com/MAT2rG3U This data set is truncated because size limit.
I am trying to find the FFT of the data to find the frequency of a vibration.
Here is my code (here is the example I used Fast Fourier Transform in Python ), it does not produce any results. I've researched many online resources and can not find my error
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
data = pd.read_csv('data.csv',index_col=0)
data = data['Torque'].astype(float).values
print(data)
N = data.shape[0] #number of elements
t = np.linspace(0, 300, N)
#t=np.arange(N)
s = data
fft = np.fft.fft(s)
fftfreq = np.fft.fftfreq(len(s))
T = t[1] - t[0]
print(T)
f = np.linspace(0, 1 / T, N)
plt.ylabel("Amplitude")
plt.xlabel("Frequency [Hz]")
plt.plot(fftfreq,fft)
#plt.xlim(0,100)
plt.show()


np.absolute(fft)just to make sure this isn't a complex number problem? Something like this, to get the magnitude of the fft, should almost always be done anyway.