def max_p(fft_ordinate, rate):
""" Find an argmax of fft result
"""
upper_thresh_freq = 4100
lower_thresh_freq = 800
upper_thresh = int(len(fft_ordinate) / (rate / 2) * upper_thresh_freq)
lower_thresh = int(len(fft_ordinate) / (rate / 2) * lower_thresh_freq)
# return max(fft_ordinate)
return max(fft_ordinate[lower_thresh:upper_thresh])
评论列表
文章目录