目前我正在研究MATLAB中的語音識別項目。 我已經拍攝了兩個聲音信號,並提取了相同的MFCC係數。 據我所知,我現在應該計算兩者之間的歐幾里德距離,然後應用DTW算法。這就是爲什麼我計算了兩者之間的距離,並得到了一系列距離。 所以我的問題是如何在結果數組上實現DTW?如何在MFCC係數陣列上執行DTW?
這裏是我的MATLAB代碼:
清除所有;關閉所有; 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');