Use high_freq -400 in computing fbank features. (#515)

Fixes #514
This commit is contained in:
Fangjun Kuang
2024-01-04 12:39:06 +08:00
committed by GitHub
parent 547a22f7d9
commit 0be71a31f5
2 changed files with 12 additions and 0 deletions

View File

@@ -46,6 +46,12 @@ class FeatureExtractor::Impl {
opts_.mel_opts.num_bins = config.feature_dim; 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_); fbank_ = std::make_unique<knf::OnlineFbank>(opts_);
} }

View File

@@ -83,6 +83,12 @@ class OfflineStream::Impl {
opts_.frame_opts.samp_freq = config.sampling_rate; opts_.frame_opts.samp_freq = config.sampling_rate;
opts_.mel_opts.num_bins = config.feature_dim; 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_); fbank_ = std::make_unique<knf::OnlineFbank>(opts_);
} }