Skip to content

Processing Blocks

MFCC

A compact summary of the sound's overall shape, popular for speech and keywords.

Try it in Studio
On this page

What is this block?

MFCC (Mel-frequency cepstral coefficients) describes each short moment of sound with a few numbers (13 by default). These numbers capture the overall shape of the sound, such as the difference between an "ee" and an "oo", rather than every pitch in detail.

Why do we use it?

Speech recognition has used MFCCs for decades because they keep the information that tells words apart and throw away a lot of detail that does not matter. The result is a smaller input than MFE.

How does it work?

  1. Cut the window into short, overlapping frames (256 samples long, every 128 samples by default).
  2. Measure each frame's frequencies with an FFT.
  3. Group them into mel bands (40 by default) and take the logarithm, like MFE.
  4. Apply a DCT (discrete cosine transform), which turns the 40 band values into a short list of coefficients.
  5. Keep the first Number of coefficients values for each frame.

What input does it receive?

One audio window from the impulse, for example 1000 ms of sound at 16 000 Hz (16 000 samples).

What output does it produce?

Frames × coefficients, laid out as one long list. For a 1-second window at 16 kHz with the defaults: 124 frames × 13 coefficients = 1,612 numbers.

What do its settings mean?

Settings are on the block's Parameters tab.

SettingDefaultWhat changing it does
Number of coefficients13How many numbers to keep per frame (1–40). More keeps more detail.
Frame length256Length of each frame in samples (256 samples = 16 ms at 16 kHz).
Frame stride128Samples between frame starts. Smaller gives more frames.
Filter number40Number of mel bands before the DCT.
FFT length256Points in each FFT. Use a power of 2, at least the frame length.
Low frequency300Lowest pitch included, in Hz.
High frequency8000Highest pitch included, in Hz (never above half the sample rate).

Simple example

You train a keyword model for on and off. With MFCC each 1-second window becomes 1,612 numbers instead of 16 000 raw samples. The vowel sounds "o" and the ending "n" or "ff" change the coefficients enough for the model to tell the words apart.

When should I use it?

  • Use it for speech and keywords, when you want a smaller input.
  • Try MFE first with the Classification learning block: Classification works on 2-D grids, and MFE keeps its grid shape while MFCC is laid out as one long list.
  • Compare MFE and MFCC on your own data: train both and check the results on Model testing.