Fourier transform with python

旧城冷巷雨未停 提交于 2019-12-08 18:14:30

It's a problem of data analysis.

  • FFT works with complex number so the spectrum is symmetric on real data input : restrict on xlim(0,max(freqs)) .
  • The sampling period is not good : increasing period while keeping the same total number of input points will lead to a best quality spectrum on this exemple.

EDIT. with :

 dataset = numpy.genfromtxt(fname='data.txt',skip_header=1)[::30];
 t,signal = dataset.T
 (...)
 plot(freqs,FFT)
 xlim(0,1)
 ylim(0,30)    

the spectrum is

For best quality spectrum , just reacquire the signal for a long long time (for beautiful peaks), with sampling frequency of 1 Hz, which will give you a [0, 0.5 Hz] frequency scale (See Nyquist criterium).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!