Skip to content

Commit d615bff

Browse files
authored
Use high_freq -400 in computing fbank features. (#294)
* Use high_freq -400 in computing fbank features. See also k2-fsa/sherpa-onnx#514 * Release v2.1.5
1 parent a96bbea commit d615bff

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
22
project(sherpa-ncnn)
33

4-
set(SHERPA_NCNN_VERSION "2.1.4")
4+
set(SHERPA_NCNN_VERSION "2.1.5")
55

66
# Disable warning about
77
#

sherpa-ncnn/csrc/features.cc

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ class FeatureExtractor::Impl {
4848

4949
opts_.mel_opts.num_bins = config.feature_dim;
5050

51+
// Please see
52+
// https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/fbank.py#L27
53+
// and
54+
// https://github.com/k2-fsa/sherpa-onnx/issues/514
55+
opts_.mel_opts.high_freq = -400;
56+
5157
fbank_ = std::make_unique<knf::OnlineFbank>(opts_);
5258
}
5359

sherpa-ncnn/csrc/generate-int8-scale-table.cc

+6
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,12 @@ int QuantNet::quantize_KL(const std::vector<std::string> &wave_filenames) {
560560
fbank_opts.frame_opts.samp_freq = expected_sampling_rate;
561561
fbank_opts.mel_opts.num_bins = 80;
562562

563+
// Please see
564+
// https://github.com/lhotse-speech/lhotse/blob/master/lhotse/features/fbank.py#L27
565+
// and
566+
// https://github.com/k2-fsa/sherpa-onnx/issues/514
567+
fbank_opts.mel_opts.high_freq = -400;
568+
563569
int32_t segment = model->Segment();
564570
int32_t offset = model->Offset();
565571

0 commit comments

Comments
 (0)