-1
使用python處理基於說話人識別的項目,並在找到MFCC
時出現以下錯誤。TypeError:'模塊'對象不可調用。 MFCC
Traceback (most recent call last):
File "neh1.py", line 10, in <module>
complexSpectrum = numpy.fft(signal)
TypeError: 'module' object is not callable
這是代碼的一部分:
import numpy
from scipy.fftpack import dct
from scipy.io import wavfile
sampleRate, signal = wavfile.read("/home/neha/Audio/b6.wav")
numCoefficients = 13 # choose the sive of mfcc array
minHz = 0
maxHz = 22.000
complexSpectrum = numpy.fft(signal)
powerSpectrum = abs(complexSpectrum) ** 2
filteredSpectrum = numpy.dot(powerSpectrum, melFilterBank())
logSpectrum = numpy.log(filteredSpectrum)
dctSpectrum = dct(logSpectrum, type=2)
會是什麼問題?
'numpy.fft'是一個包含許多fft函數變體的模塊。你想'numpy.fft.fft()'。 –