# How to organize MFCC features?

I have computed 12d-MFCC features on 3 consecutive audio frames, say:

For 1st frame: a1 a2 a3 ... a12
For 2nd frame: b1 b2 b3 ... b12
For 3rd frame: c1 c2 c3 ... c12


How to organize these MFCC features, in a1 a2 ... a12 b1 b2 ... b12 c1 c2 ... c12 or a1 b1 c1 ... a12 b12 c12? Is there any difference between these two organization styles (for audio processing)?

Natural order would be to save it on frame by frame basis - that's the way you calculate them, otherwise you would need some gymnastics to do so. What's more, each 12 coefficients will be one vector in your 12D space - frame after frame.

Also it is easier to manage that in memory. In MATLAB like environments you simply use the matrices to store each vector in separate column. For C++, you can use array and array of pointers:

float **frames;
float  *data;
frames = new float*[num_frames];
data   = new float*[12 * num_frames];
memset(..)


After that you just set all frames pointers to first coefficient in each frame and you have easy way to access your features by using frames.

With interleaved features it wouldn't be so easy.

• Please don't promote heavily outdated C++ style. We use std::vector<std::array<float,3>> nowadays. And between 1998 and 2011 we'd have used std::vector<std::vector<float> >. This form hasn't been appropriate for almost 2 decades. – MSalters Oct 17 '14 at 18:28
• @MSalters: I believe it is not a place to argue about programming details, isn't it? This code is an example of usage - instead of any pseudo-code. – jojek Oct 18 '14 at 10:26

If you interleave your data you will have hard time adding new entries. Otherwise it make no differences.

## protected by jojek♦Nov 22 '15 at 16:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).