Skip to content

Commit

Permalink
Use high_freq -400 in computing fbank features. (#515)
Browse files Browse the repository at this point in the history
Fixes #514
  • Loading branch information
csukuangfj authored Jan 4, 2024
1 parent 547a22f commit 0be71a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sherpa-onnx/csrc/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<knf::OnlineFbank>(opts_);
}

Expand Down
6 changes: 6 additions & 0 deletions sherpa-onnx/csrc/offline-stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<knf::OnlineFbank>(opts_);
}

Expand Down

0 comments on commit 0be71a3

Please sign in to comment.