⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 train.m

📁 speaker recognition matlab code
💻 M
字号:
function code = train(traindir, n)% Speaker Recognition: Training Stage%% Input:%       traindir : string name of directory contains all train sound files%       n        : number of train files in traindir%% Output:%       code     : trained VQ codebooks, code{i} for i-th speaker%% Note:%       Sound files in traindir is supposed to be: %                       s1.wav, s2.wav, ..., sn.wav% Example:%       >> code = train('C:\data\amintrain\', 8);%%%%%%%%%%%%%%%%%%k = 16;                         % number of centroids requiredfor i = 1:n                     % train a VQ codebook for each speaker    file = sprintf('%ss%d.wav', traindir, i);               disp(file);       [s, fs] = wavread(file);        v = mfcc(s, fs);            % Compute MFCC's       code{i} = vqlbg(v, k);      % Train VQ codebookend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -