def group_into_bands(self, fft, fft_freq, nfreq_bands):
"""
Group the fft result by frequency bands and take the mean
of the fft values within each band
Return a list of the frequency bands' means (except the first element
which is the frequency band 0 - 0.1Hz)
"""
freq_bands = np.digitize(fft_freq, FREQUENCIES)
df = DataFrame({'fft': fft, 'band': freq_bands})
df = df.groupby('band').mean()
return df.fft[1:-1]
preprocessing.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录