I'm trying to get MFCC from speech audio data. I'm using 26 Mel Filter on 0-24kHz spectrum. My MFCCs doesn't look correct to me, cause always first bins have high values and values getting smaller through the high frequency bins, even with high frequency audio data.
Then I realized that the cos((PI/N)*(n+0.5)*k) part in the DCT Type II formula, causes this result. Here is how the value of that cos() part changes by increasing the number of mel filter bin: http://img402.imageshack.us/img402/5994/dctresult.png
When I multiply the mel filter bank energies with that cos() part, the MFCCs have only low frequencies and high frequencies are getting suppressed. MFCC result of a "s" sound has a frequency of 5khz-10khz: http://img9.imageshack.us/img9/4279/mfccresult.png
Here is my code of DCT(Discrete Cosine Transform) step:
numofMelFilters = 26;
numofMFCCs = 26; // This ll be 12..
for(int k=0; k<numofMFCC; k++){
for(int n=0; n<numofMelFilters; n++){
MFCC[k] += melEnergies[n] * cos((PI / (double)numofMelFilters) * (n + 0.5) * k);
}
}
I can't find out what I am doing wrong, any help will be appreciated. Thanks in advance..