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

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -