diff --git a/sherpa-onnx/csrc/features.cc b/sherpa-onnx/csrc/features.cc index 51500e11..e81c0dfb 100644 --- a/sherpa-onnx/csrc/features.cc +++ b/sherpa-onnx/csrc/features.cc @@ -46,6 +46,12 @@ class FeatureExtractor::Impl { opts_.mel_opts.num_bins = config.feature_dim; + // Please see + // https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/fbank.py#L27 + // and + // https://github.com/k2-fsa/sherpa-onnx/issues/514 + opts_.mel_opts.high_freq = -400; + fbank_ = std::make_unique(opts_); } diff --git a/sherpa-onnx/csrc/offline-stream.cc b/sherpa-onnx/csrc/offline-stream.cc index 3cb463b4..08e60136 100644 --- a/sherpa-onnx/csrc/offline-stream.cc +++ b/sherpa-onnx/csrc/offline-stream.cc @@ -83,6 +83,12 @@ class OfflineStream::Impl { opts_.frame_opts.samp_freq = config.sampling_rate; opts_.mel_opts.num_bins = config.feature_dim; + // Please see + // https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/fbank.py#L27 + // and + // https://github.com/k2-fsa/sherpa-onnx/issues/514 + opts_.mel_opts.high_freq = -400; + fbank_ = std::make_unique(opts_); }