錯誤提示位置
freqs = np.linspace(0, sample_rate/2, nfft/2 + 1)
可能原因
1、numpy版本問題
2、Python版本問題:在python2,/只留下了整數部分,去掉了小數,是int型。而在python3里,/的結果是真正意義上的除法,結果是float型。所以便出現了Error Message: 'float' object cannot be interpreted as an integer。
解決方法
1、numpy 1.18.2 -> numpy 1.17.0
2、修改符號:freqs = np.linspace(0, sample_rate/2, nfft//2 + 1)
本次采用2解決
