# Confusion regarding wav to MFCC conversion

I have to compare two .wav files.

I am converting the wav file to an MFCC file. Why am I getting different MFCC matrices when using different Matlab toolboxes (one of them is giving a matrix having 20 rows while the other two are giving matrices having 13 rows, and even those two matrices are not same)?

Why are the two matrices different? I have heard that there are 13 MFC coefficients. Does it have something to do with the number of rows?

## 1 Answer

There are many variations in the ways MFCCs can be extracted. The most common ones are:

• STFT parameters like frame rate, FFT size, FFT window.
• Filter bank parameters like number of bands, whether filter normalization is used, and whether the filters are applied to the magnitude or power spectra.
• Subtle variants in the definition of the discrete cosine transform.

And it is actually not correct to say that there are 13 MFCC - it is indeed very common to keep the 13 first coefficients, but you could very well use a larger cosine transform matrix and get more coefficients. The farther you go, the less information the coefficients will capture (since they will correspond to dimensions of decreasing variance - assuming the discrete cosine transform is a good approximation of a PCA on the mel coefficients data, which it is).

Check this to learn more about all the subtle differences between several "famous" MFCC extraction toolboxes.

In the end, such or such combination of MFCC extraction parameters might give you a difference of at most one or two percentage points at whatever task you are using the MFCC for (for example speech recognition), but there are more interesting things to try to tweak and improve than these parameters.

• thanks for the response.Please help me get out of a problem i am stuck with. I was given samples MFCC's of two (audio) wav files. I had to find how many times the smaller audio appeared in the bigger one. I was given an algorithm for the same. I developed the code and the output was fine. But the problem is that the sample MFCCs given to me had 13 colums rather than rows. When i created my own MFCCs for other audio files i got completely different matrices(13 rows rather than columns).I do not know how to work with these matrices, do i have to rotate or transpose them? – Ironclad Oct 7 '13 at 19:29
• Whether the data is presented as an Nx13 matrix or 13xN might be implementation dependent. Just transpose if necessary; but make sure first that the two implementations have similar parameters and return comparable results. – pichenettes Oct 8 '13 at 7:02
• Thanks for the reply, i found that rotating clockwise by 90 degrees was required. Thanks anyways. – Ironclad Oct 8 '13 at 19:01