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

📄 testing.m

📁 this code is in Matlab.and this code od for Speaker recognitoin system.
💻 M
字号:


function testing(test_dir,code)

%  test_dir : string name of directory contains all test sound files
%  code    : codebooks of all trained speakers

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Speaker Recognition System                        %
%                                                     %
%   Project mmembers: (1)  Habib ur Rehn=man          %
%                     (2)  Abdul Basit                %   
%   Date:   12-05-2003                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

k=1   % No of speakers to betested

                   
    file = sprintf('%ss%d%s.wav', test_dir,k,'t')         % read test sound file of each speaker
    [s, fs] = wavread(file);      
  
    v = mfcc(s, fs);                                      % Compute MFCC's
    distmin = inf;
    k1 = 0;
   
    for l = 1:length(code)                                 %  compute distortion
        d = euclid_dist(v, code{l}); 
        dist = sum(min(d,[],2)) / size(d,1);
      
        if dist < distmin
            distmin = dist;
            k1 = l;
        end      
    end
     dis_play(k1,distmin);                                   % call the dislpay routine to display the message
   

⌨️ 快捷键说明

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