# Determine the time length of audio training samples?

Currently I am trying to use MFCC feature for audio training in order to do human voice classification (can later distinguish the person who speaks).

I have problems to determine the proper time length of audio training samples? To be clear, say I have computed 12d-MFCC features over 20ms window (10ms overlapping), if the length of the audio training samples is 1s, this will result in a 12 x 100 feature vector (as there are 100 frames during the 1s time given 10ms shifting time step). In practice, what's the proper time length of audio training samples? Of course, long time length will results in long MFCC feature vector.

It's a very bad idea to stack together consecutive frames in a single vector. By doing so, you are training a classifier to recognize the exact same sound as the one in your training database, pronounced at the exact same speed.

For your application (which appears to be speaker identification), you should consider each individual frame as a training instance (aka "bag-of-frames" models). That is to say, each training sample will give many 12-dimension feature vectors.

• Thanks for the suggestion. For your last sentence, shouldn't it be "each training sample will give a 12-dimension feature vector" instead? – herohuyongtao Oct 17 '14 at 16:20
• No. For example if you have 10 clips, 5 second each, 10ms overlapping windows, you'll have 5000 training samples. – pichenettes Oct 17 '14 at 18:49
• As a followup, how long would you suggest to compute MFCC on? Is 20ms a good choice? – herohuyongtao Oct 18 '14 at 0:54
• Your window size of 20ms is a good choice. – pichenettes Oct 18 '14 at 8:41

I would think the time length isn't so much the question as having enough varied training samples to get a good model of the speaker's voice. Rather than being concerned with the length of each sample, you should be concerned with getting samples of the person speaking various words with various typical intonations for that person. The length of each training sample would be more a question of how much time it takes for your test person to speak each representative sample rather than being some arbitrary time length.

Perhaps the most important question you should be asking is: How many training samples (and vectors from them) will my model need to be representative?

The answer to this question will depend on the accuracy you need and the particulars of the method you will use to match new samples to the training samples. Since you don't say which method of modeling you will use, there's no way any one with more knowledge of those methods could help you find the needed number of training samples.

This is a link to a similar project. It deals with recognizing singing voices rather than speaking, so they use LPC rather than MFCC. Still, some of the methods and considerations will be similar.