Skip to main content

Module mel

Module mel 

Source
Expand description

Mel / MFCC / DCT / Bark / ERB psychoacoustic features.

The real triangular filterbanks (this module) replace the fake linear-band “log_mel” averaging in stft_stream.rs. Banks are precomputed once into a caller-owned weight table (build_mel_bank / build_bark_bank / build_erb_bank) and applied allocation-free per frame (mel_bands(), mfcc(), bfcc(), gfcc()). Re-exports only.

Re-exports§

pub use bark_bank::build_bark_bank;
pub use bfcc::bfcc;
pub use dct::dct2;
pub use erb_bank::build_erb_bank;
pub use gfcc::gfcc;
pub use hz_mel::hz_to_mel;
pub use mel_bands::mel_bands;
pub use mel_bank::build_mel_bank;
pub use mel_to_hz::mel_to_hz;
pub use mfcc::mfcc;

Modules§

bark_bank
build_bark_bank — triangular filterbank on the Bark critical-band scale (Traunmüller 1990), with Bark scale conversions delegated to [etalon_signal::loudness].
bfcc
bfcc — Bark-Frequency Cepstral Coefficients: Bark bank → log → DCT-II.
dct
dct2 — orthonormal Discrete Cosine Transform, type II (the cepstral kernel), delegated to [etalon_signal::loudness::dct_ii_into].
erb_bank
build_erb_bank — triangular filterbank on the ERB-rate scale (Glasberg & Moore 1990), with ERB conversions delegated to [etalon_signal::loudness].
gfcc
gfcc — Gammatone-Frequency Cepstral Coefficients: ERB/gammatone bank → log → DCT-II.
hz_mel
hz_to_mel — Hertz → mel using the HTK convention 2595 * log10(1 + hz/700).
mel_bands
mel_bands — apply a precomputed triangular bank to one power (or magnitude) spectrum frame, allocation-free (the zero-heap hot path).
mel_bank
build_mel_bank — precompute a triangular mel filterbank into a caller-owned table. This REPLACES the fake linear-band “log_mel” averaging that lived in stft_stream.rs: the bank spaces filters on the perceptual HTK mel scale and places true triangular responses (peak 1.0 at each centre), overlapping into their neighbours — the standard Slaney/HTK filterbank geometry.
mel_to_hz
mel_to_hz — mel → Hertz, the inverse of super::hz_mel::hz_to_mel (HTK).
mfcc
mfcc — Mel-Frequency Cepstral Coefficients: mel bank → log → DCT-II → first n_coeffs. This is the cepstral core reused by super::bfcc() and super::gfcc() with Bark / gammatone banks.