← Back to the chapter · Previous detail · Next detail →
Technical detail · Audio Feature Extraction for IoT
Normalized spectrum and mel filter bank
For each windowed frame, compute an -point discrete Fourier transform
One common normalized power-spectrum convention is
Libraries also use , one-sided energy doubling, or window-energy normalization. Those conventions change feature magnitudes even when the waveform is identical, so record the FFT length, one- or two-sided spectrum, and normalization rule with the model.
The mel mapping compresses high physical frequencies:
For example, 1,000 Hz maps to about 1,000 mel, while 8,000 Hz maps to about 2,835 mel. Equal spacing in mel therefore puts filter centers close together at low frequency and farther apart in hertz at high frequency.
Build triangular filters step by step:
- Choose and , map both to mel, and place equally spaced points between them.
- Convert those points back to hertz and then to FFT-bin locations, for example .
- For filter , rise linearly from zero at to one at , then fall to zero at .
- Sum the power under each triangle:
- Apply to turn multiplicative spectral changes into additive differences and prevent a zero-energy logarithm.