def argmax_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)
argmax = fft_ordinate[lower_thresh:upper_thresh].argmax()
argmax += lower_thresh
return argmax
评论列表
文章目录