Skip to content

Commit

Permalink
Use high_freq -400 in computing fbank features.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Jan 4, 2024
1 parent a96bbea commit 0783dd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sherpa-ncnn/csrc/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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-ncnn/csrc/generate-int8-scale-table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,12 @@ int QuantNet::quantize_KL(const std::vector<std::string> &wave_filenames) {
fbank_opts.frame_opts.samp_freq = expected_sampling_rate;
fbank_opts.mel_opts.num_bins = 80;

// 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
fbank_opts.mel_opts.high_freq = -400;

int32_t segment = model->Segment();
int32_t offset = model->Offset();

Expand Down

0 comments on commit 0783dd2

Please sign in to comment.