如何对MFCC系数数组执行DTW? [英] How to perform DTW on an array of MFCC coefficients?

查看:287
本文介绍了如何对MFCC系数数组执行DTW?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在MATLAB中进行语音识别项目. 我已经采集了两个语音信号,并提取了相同的MFCC系数. 据我所知,我现在应该计算两者之间的欧几里得距离,然后应用DTW算法.这就是为什么我计算出两者之间的距离并得到距离的数组的原因. 所以我的问题是如何在结果数组上实现DTW?

Currently I'm working on speech recognition project in MATLAB. I've taken two voice signals and have extracted the MFCC coefficients of the same. As far as I know, I should now calculate the Euclidean distance between the two and then apply the DTW algorithm. That's why I calculated the distnace between the two and got an array of the distances. So my question is how to implement DTW on resultant array?

这是我的MATLAB代码:

Here's my MATLAB code:

清除所有;关闭所有; clc;

clear all; close all; clc;

% Define variables
Tw = 25;                % analysis frame duration (ms)
Ts = 10;                % analysis frame shift (ms)
alpha = 0.97;           % preemphasis coefficient
M = 20;                 % number of filterbank channels 
C = 12;                 % number of cepstral coefficients
L = 22;                 % cepstral sine lifter parameter
LF = 300;               % lower frequency limit (Hz)
HF = 3700;              % upper frequency limit (Hz)
wav_file = 'Play.wav';  % input audio filename
wav_file1 = 'Next.wav';


% Read speech samples, sampling rate and precision from file
[ speech, fs, nbits ] = wavread( wav_file );
[ speech1, fs, nbits ] = wavread( wav_file1 );

% Feature extraction (feature vectors as columns)
[ MFCCs, FBEs, frames ] = ...
                mfcc( speech, fs, Tw, Ts, alpha, @hamming, [LF HF], M, C+1, L );
[ MFCC1s, FBEs, frames ] = ...
                mfcc( speech1, fs, Tw, Ts, alpha, @hamming, [LF HF], M, C+1, L );

L = pdist2(MFCCs, MFCC1s, 'euclidean');

推荐答案

我建议使用标准欧几里得距离而不是欧几里得距离,因为MFCC系数在每个维度上都有不同的范围.

I suggest using Standard Euclidean distance instead of Euclidean, because de MFCC coefficients have different ranges on each dimension.

例如,如果您具有以下2维向量A(500,4),B(504,4)和C(502,3),则使用欧几里得距离将得出dist(A,C)dist(A ,B),因为每个尺寸距离均以其均值归一化.因此,您将(504-500)/502< (4-3)/3.5

For examples if you have the following 2 dimension vectors A(500, 4), B(504,4) and C(502,3), using the euclidean distance would results that dist(A,C)dist(A,B), because each dimension distance is normalized to it's mean. Thus, you will (504-500)/502 < (4-3)/3.5

因此,对于MFCC,最好使用此标准化步骤来改善结果.

So, for MFCC it will be better to use this normalization step for improved results.

这篇关于如何对MFCC系数数组执行DTW?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆