%function ccc=MFCC (x)%normalized mel Filter group coefficients filename=input ('input filename:','s'); [X,fs,bits]=wavread (filename); Bank=MELBANKM (24,256,fs,0,0.5,'m'); Bank=Full (bank); Bank=bank/Max (Bank (:)); ? T coefficient,12*24 forK=1:12N=0:23; Dctcoef (k,:)=cos (2*n+1) *k*pi/(2*24)); End%normalized Inverted Spectrum lift window W=1+6*sin (Pi*[1:12]./12); W=w/Max (W); %Pre-emphasis filter xx=double (x); XX=filter ([1-0.9375],1, XX); %speech Signal sub-frame xx=enframe (xx,256,80); %calculate the MFCC parameters per frame 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)); C2=c1.*w'; m (i,:)=c2'; End%Differential parameter DTM=Zeros (Size (m)); forI=3:size (m,1)-2DTM (i,:)=-2*m (i-2,:)-M (i-1,:) +m (i+1,:) +2*m (i+2,:); End DTM=dtm/3; %combining MFCC parameters and first-order differential MFCC parameters CCC=[M DTM]; %Remove the first two frames, because the first-order differential parameter of this two-frame is 0 CCC=CCC (3:size (m,1)-2,:); subplot (211) Ccc_1=CCC (:, 1);p lot (ccc_1), title ('MFCC');% Ylabel ('Amplitude Value');% Title ('relationships between one-dimensional arrays and their amplitude values')% [h,w]=size (CCC);% a=size (CCC);% subplot (212)% Plot ([1, w],a);% Xlabel ('Number of dimensions');% Ylabel ('Amplitude Value');% Title ('the relationship between dimension number and amplitude value')return
MFCC matlab code