@audio/ auditory-mel
Status calibrated
npm1.0.1licenseMIT
Mel-frequency triangular filter bank
import melBank from '@audio/auditory-mel'
nFilters+2 points equally spaced on the mel scale mel(f) = 2595*log10(1 + f/700) (O'Shaughnessy, "Speech Communications: Human and Machine", IEEE Press, 2000) between fmin/fmax, each band a triangle over three consecutive points — the classic MFCC front-end bank.
Design function, not a stream processor: melBank(fs, opts) → bands. Positional fs first — a deliberate divergence from the filter/eq family's fn(data, params) in-place convention. No buffer in, no buffer out — it returns triangle descriptors, not biquad coefficients; apply the triangular weights yourself against a magnitude spectrum.
melBank(44100) // 26 mel filters, defaults
melBank(16000, { nFilters: 40, fmax: 8000 }) // MFCC-style 40-filter bank
| Param | Default | |
|---|---|---|
fmin |
0 |
Lowest band edge Hz |
fmax |
fs/2 |
Highest band edge Hz |
nFilters |
26 |
Number of mel filters |
Use when: MFCC/speech-recognition feature-extraction front-ends, or any mel-scale spectral binning.
Part of @audio/auditory — the auditory family umbrella.
MIT © audiojs