%mfccfunctionmfc=mfcc(x)%%%%%%%%%%%%%%%%%%%%%%%%%%对输入的语音序列x进行mfcc参数提取,返回mfcc参数和一阶差分mfcc参数,mel滤波器的阶数为24?t变换长度为256,采样频率为8000HZ,对x256点分为一帧%%%%%%%%%%%%%%%%%%%%%%%%%%%%bank=melbankm(24,256,8000,0,0.5,'m');%归一化mel滤波器组参数bank=full(bank);bank=bank/max(bank((:));?T系数,12*24fork=1:12n=0:23;dctcoef(:,k)=cos((2*n1)*k*pi/(2*24));end%归一化倒谱提升窗口w=16*sin(pi*[1:12]./12);w=w/max(w);%预加重滤波器xx=double(x);xx=filter([1-0.9375],1,xx);%语音信号分帧xx=enframe(xx,256,80);%计算每帧的mfcc参数fori=1:size(xx,1)%y=xx(i,:);s=y'.*hamming(256);t=abs(fft(s));t=t.^2;%计算能量c1=dctcoef*log(bank*t(1:129));?tcoef为dct系数,bank归一化mel滤波器组系数c2=c1.*w';%w为归一化倒谱提升窗口m(i,:)=c2';end%差分系数dtm=zeros(size(m));fori=3:size(m,1)-2;dtm(i,:)=-2*(i-2,:)-m(i-1,1)2*m(i2,:);enddtm=dtm/3;%合并mfcc参数和一阶差分mfcc参数mfc=[mdtm];%去除首尾两帧,因为这两帧的一阶差分参数为0mfc=mfc(3:size(m,1)-2,:);