Expand description
Audio & TinyML feature extraction: the Goertzel single-frequency detector, peak/RMS envelope followers, a Mel filterbank, and MFCC feature extraction — the standard preprocessing pipeline for embedded speech/audio keyword-spotting and TinyML models.
Structs§
- Goertzel
Detector - A Goertzel single-frequency detector: computes the DFT magnitude at one target frequency via a simple two-pole recursive filter, without a full FFT. Ideal for detecting a known tone (e.g. DTMF, a pilot tone) from a stream of samples on constrained hardware.
- Peak
Envelope Follower - Peak envelope follower with independent attack/release time constants, as used for audio dynamics processing (compressors, limiters, VU-style level meters).
- RmsEnvelope
Follower - RMS envelope follower: a single-pole exponential moving average of instantaneous power, reported as an RMS level.
Functions§
- hz_
to_ mel - Converts a frequency in Hz to the Mel scale:
2595 * log10(1 + hz / 700). - mel_
filterbank_ f32 - Applies a triangular Mel filterbank to a one-sided power (or magnitude-squared) spectrum, producing one energy value per Mel band — the standard first step of MFCC / speech feature extraction.
- mel_
to_ hz - Converts a Mel-scale value back to Hz:
700 * (10^(mel / 2595) - 1). - mfcc_
f32 - Computes MFCC (Mel-Frequency Cepstral Coefficient) features from a single real-valued audio frame: FFT power spectrum, Mel filterbank, log compression, and a DCT-II to decorrelate the log-Mel-energies into cepstral coefficients. This is the standard speech/audio TinyML feature-extraction pipeline.