mirror of
https://github.com/csukuangfj/kaldifeat.git
synced 2025-08-09 18:12:17 +00:00
Allow all zero rows in mel computation matrix. (#107)
This commit is contained in:
parent
5f9602afab
commit
e05540cfad
@ -7,7 +7,7 @@ project(kaldifeat)
|
||||
# remember to change the version in
|
||||
# scripts/conda/kaldifeat/meta.yaml
|
||||
# scripts/conda-cpu/kaldifeat/meta.yaml
|
||||
set(kaldifeat_VERSION "1.25.4")
|
||||
set(kaldifeat_VERSION "1.25.5")
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
|
@ -138,7 +138,7 @@ MelBanks::MelBanks(const MelBanksOptions &opts,
|
||||
<< " and vtln-high " << vtln_high << ", versus "
|
||||
<< "low-freq " << low_freq << " and high-freq " << high_freq;
|
||||
|
||||
// we will transpose bins_mat_ at the end of this funciton
|
||||
// we will transpose bins_mat_ at the end of this function
|
||||
bins_mat_ = torch::zeros({num_bins, num_fft_bins}, torch::kFloat);
|
||||
|
||||
int32_t stride = bins_mat_.strides()[0];
|
||||
@ -179,12 +179,14 @@ MelBanks::MelBanks(const MelBanksOptions &opts,
|
||||
last_index = i;
|
||||
}
|
||||
}
|
||||
KALDIFEAT_ASSERT(first_index != -1 && last_index >= first_index &&
|
||||
"You may have set num_mel_bins too large.");
|
||||
|
||||
// Note: It is possible that first_index == last_index == -1 at this line.
|
||||
|
||||
// Replicate a bug in HTK, for testing purposes.
|
||||
if (opts.htk_mode && bin == 0 && mel_low_freq != 0.0f)
|
||||
if (opts.htk_mode && bin == 0 && mel_low_freq != 0.0f &&
|
||||
first_index != -1) {
|
||||
this_bin[first_index] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug_) KALDIFEAT_LOG << bins_mat_;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package:
|
||||
name: kaldifeat
|
||||
version: "1.25.4"
|
||||
version: "1.25.5"
|
||||
|
||||
source:
|
||||
path: "{{ environ.get('KALDIFEAT_ROOT_DIR') }}"
|
||||
|
@ -1,6 +1,6 @@
|
||||
package:
|
||||
name: kaldifeat
|
||||
version: "1.25.4"
|
||||
version: "1.25.5"
|
||||
|
||||
source:
|
||||
path: "{{ environ.get('KALDIFEAT_ROOT_DIR') }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user