mfcc.m

来自「this code is in Matlab.and this code od 」· M 代码 · 共 8 行

M
8
字号
function  v= mfcc(s,fs)

%    s:    No of points
%    fs:   Sampling rate

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


N=256;                      % size of each frame
M=156;                      % overlap size
nof=40;                     % number of filters
len=80;
sel=30;
a(1:N,1:len)=0;             % framing the signal with overlap
a(:,1)=s(1:N);
for j=2:len
    a(:,j)=s((N-M)*j+1:(N-M)*j+N);
end;


h= hamming(N);             % windowing 

for j=1:len;
   b(:,j)= a(:,j).* h;
  
end;

 m=melfilterbank(nof,N,fs);         % normailising to mel freq

 for j=1:len
  y(:,j)=fft(b(:,j));            % calculating fft
  n2 = 1 + floor(N/2);
  ms = m * abs(y(1:n2,j)).^2;
  v(:,j)=dct(log(ms));                  % converting back to time domain
  
end;

v(1,:)=[];

 

    

⌨️ 快捷键说明

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