[BUG] OnlineRecognizerCtcImpl builds kaldi-style fbank for nemo_ctc models — WER degrades ~40%→~11.6% with librosa-style features

Author: aliTorabi-GoudarziCreated Sep 29, 2026Updated Sep 29, 2026

Summary

OnlineRecognizerCtcImpl::PostInit() special-cases feature setup only for wenet_ctc (and t_one). NeMo CTC models trained on librosa-style log-mel features silently get kaldi-style features on the streaming path: povey window, preemphasis 0.97, DC-offset removal, default 20–7600 Hz band.

The same class of bug was already fixed for offline CTC (offline-recognizer-ctc-impl.h sets is_librosa=true, low_freq=0, high_freq=0, remove_dc_offset=false, window_type="hann") and for the streaming NeMo transducer (online-recognizer-transducer-nemo-impl.h) — but not for streaming CTC, verified at master and at tag v1.13.8 (2026-09-27).

Measured impact (Persian, NeMo FastConformer-Hybrid CTC 114M, FLEURS-fa corpus)

  • kaldi-style fbank (unpatched): WER ≈ 40.2%
  • librosa-style fbank (patched): WER ≈ 11.6%

Proposed fix

Mirror the offline-CTC branch in OnlineRecognizerCtcImpl::PostInit():

cpp
if (!config_.model_config.nemo_ctc.model.empty()) {
  // NeMo CTC models are trained on librosa-style log-mel features.
  config_.feat_config.low_freq = 0;
  config_.feat_config.high_freq = 0;
  config_.feat_config.is_librosa = true;
  config_.feat_config.remove_dc_offset = false;
  config_.feat_config.window_type = "hann";
}

Our field-tested patch (applied to v1.13.6 and v1.13.8, shipping in a production Android app): tools/sherpa/patches/online-ctc-nemo-librosa-fbank.patch in https://github.com/… (available on request).

Related

  • #3714 — Persian NeMo CTC models; model author notes "exposing librosa-mel would let them match NeMo's slaney mel exactly"; normalize_type="" export metadata solves normalization but not the mel style (slaney vs HTK) — they solve different halves.
  • scripts/nemo/fast-conformer-hybrid-transducer-ctc/test-onnx-ctc.py already builds librosa-style fbank manually for testing — implicit acknowledgment of the mismatch.

Environment

sherpa-onnx v1.13.6 / v1.13.8, Android (arm64-v8a) + Linux CLI, ORT 1.29.0.