def cut_norm(full_y, dt, area=1.0):
"""Cut out an FFT spectrum from scipy.fftpack.fft() (or numpy.fft.fft())
result and normalize the integral `int(f) y(f) df = area`.
full_y : 1d array
Result of fft(...)
dt : time step
area : integral area
"""
full_faxis = np.fft.fftfreq(full_y.shape[0], dt)
split_idx = full_faxis.shape[0]/2
y_out = full_y[:split_idx]
faxis = full_faxis[:split_idx]
return faxis, num.norm_int(y_out, faxis, area=area)
###############################################################################
# common settings for 1d and 3d case
###############################################################################
评论列表
文章目录