title: Feature extraction speech (Mel Frequency cepstral coefficient) in python
body: <p>I'm currently trying to classify emotions (7 classes) based on audio files. The first thing I did was to extract the features using the mfcc function in the python_speech_features library (<a href="https://python-speech-features.readthedocs.io/en/latest/#functions-provided-in-python-speech-features-module" rel="nofollow noreferrer">https://python-speech-features.readthedocs.io/en/latest/#functions-provided-in-python-speech-features-module</a>).</p>
  <p>In the documentation, it says that each row contains one feature vector. The problem is that each audio file returns a different number of rows (features) as the audio length is different. For example, for audio_1 the shape of the output is (155,13), for audio_2 the output's shape is (258,13). Any advice about how to make them the same shape? I am currently using PCA to force the data to have the same dimensionality, is this a correct approach?</p>
  <p>This is how I extract the features:</p>
  <pre><code>sample_rate, data = wavfile.read(path)
  mfccExtract = features.mfcc(data, sample_rate, winfunc=np.hamming)
  </code></pre>