def mfcc(signal, samplerate, conf):
'''
Compute MFCC features from an audio signal.
Args:
signal: the audio signal from which to compute features. Should be an
N*1 array
samplerate: the samplerate of the signal we are working with.
conf: feature configuration
Returns:
A numpy array of size (NUMFRAMES by numcep) containing features. Each
row holds 1 feature vector, a numpy vector containing the signal
log-energy
'''
feat, energy = fbank(signal, samplerate, conf)
feat = numpy.log(feat)
feat = dct(feat, type=2, axis=1, norm='ortho')[:, :int(conf['numcep'])]
feat = lifter(feat, float(conf['ceplifter']))
return feat, numpy.log(energy)
评论列表
文章目录