pandas - How do I plot the output of numpy.fft in bins? -


i wrote python code plots fast fourier transform of pandas dataframe called res, contains 2 columns of data ("data" , "filtered"):

fft = pd.dataframe(np.abs(np.fft.rfft(res["data"]))) fft.columns = ["data"] fft["filtered"] = pd.dataframe(np.abs(np.fft.rfft(res["filtered"])))  fft.index=np.fft.fftfreq(len(res))[0:len(fft)] fft.plot(logy=true, logx=true) 

the res dataset contains original randomised datapoints in "data" column along same data after passing through filter. output looks reasonable me;

enter image description here

while plot correct, it's not useful at. how can organise data smaller number of discrete frequency bins make easier understand?


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -