Nathan Ku

Skip the zeros. Watch the output.

Click the wasted gray region of the filter matrix or scrub the live speech clip.

Click or drag anywhere on the sound wave (0.01 s)

Work done per audio frame

Blue pixels contribute to the answer. Gray area multiplies by zero.

97.6% skipped (501 active) · Click to restore all

Mel filter ops

501

Mel zeros skipped

97.6%

Feature output

0 diff

Live sound fingerprint (80 pitch bands)

What the speech recognizer receives for this 25 ms moment

Difference: 0.000000
-14-8-24Log energyLow pitch (20 Hz)80 pitch bandsHigh pitch (8 kHz)

In native C++17 benchmarks (1 core), skipping zeros speeds up the Mel stage 57.6× (21.87 → 0.38 µs) and the whole feature pass 7.95× (24.48 → 3.08 µs/frame, 0 steady-state allocations).

My decision · Why optimize the filterbank instead of the FFT?

Profiling the dense C++ pipeline showed Mel projection consumed 93.8% of profiled stage time (21.87 µs), while FFTW took only 2.9% (0.69 µs). Hand-tuning the FFT first would have saved less than 1 µs; exploiting filterbank sparsity cut Mel to 0.38 µs and shifted the bottleneck to FFTW (0.65 µs). Feature parity does not automatically guarantee identical downstream transcripts — matching native framing parameters in sherpa-onnx still changed 9 of 30 decoded utterances.

How it works · Inside one pitch band

Each pitch band only reads a handful of frequency buckets.

Click any row in the 80 × 257 table below or press Step +1 weight to watch the calculation jump over empty zeros.

3 active weights · 254 zeros skipped

Operations on this band

3

Band log-energy

-12.0676

Active frequency buckets on band #29

bucket #33 (1031 Hz)weight 0.519
bucket #34 (1063 Hz)weight 0.899
bucket #35 (1094 Hz)weight 0.328

Takeaway

Profiling showed Mel filter projection took 93.8% of profiled stage time while FFT took 2.9%. Exploiting 97.6% filterbank sparsity sped up the Mel stage 57.6× and the whole C++17 feature pass 7.95× (0 heap allocations) with 0 measured bit mismatches.