与MFCC一起训练SVM

时间:2018-03-15 13:09:32

标签: python speech-recognition svm

我已经实现了一些代码,我为10个不同的wav文件提取mfcc,每个文件都有一个数字的话语多次。

我设法创建了一个GMM,但我也想尝试SVM。测试是单独的wav文件。

我的问题是 - 我有10个不同的wav文件的MFCC功能。如何将它们提供给SVM分类器?

这是我用来提取每个wav文件的功能的代码:

def extract_feat(audio, rate):
    mfcc_feat = mfcc(audio, rate)
    #standardizing the features
    mfcc_feat = preprocessing.scale(mfcc_feat)
    #calculating the delta and double delta
    delta_one = delta(mfcc_feat,2)
    delta_two = delta(delta_one,2)
    combined = np.hstack([mfcc_feat,delta_one, delta_two]) 
    return combined

def createTrainingGMM(path):    
#iterating through the training file and getting all wav files to train GMM
for filename in glob.glob(path):
    #getting the sample rate value: 16000hz and the data read from wav file
    sr_value, x_value = wav.read(filename)
    #calling extract_feat which returns 39 mfcc features for each value in the vector
    vector = extract_feat(x_value, sr_value)#default values

如何为SVM做类似的事情?

0 个答案:

没有答案