|
|
@ -27,33 +27,34 @@ __all__ = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@module_utils.requires_kaldi()
|
|
|
|
@module_utils.requires_kaldi()
|
|
|
|
def fbank(wav,
|
|
|
|
def fbank(
|
|
|
|
samp_freq: int=16000,
|
|
|
|
wav,
|
|
|
|
frame_shift_ms: float=10.0,
|
|
|
|
samp_freq: int=16000,
|
|
|
|
frame_length_ms: float=25.0,
|
|
|
|
frame_shift_ms: float=10.0,
|
|
|
|
dither: float=0.0,
|
|
|
|
frame_length_ms: float=25.0,
|
|
|
|
preemph_coeff: float=0.97,
|
|
|
|
dither: float=0.0,
|
|
|
|
remove_dc_offset: bool=True,
|
|
|
|
preemph_coeff: float=0.97,
|
|
|
|
window_type: str='povey',
|
|
|
|
remove_dc_offset: bool=True,
|
|
|
|
round_to_power_of_two: bool=True,
|
|
|
|
window_type: str='povey',
|
|
|
|
blackman_coeff: float=0.42,
|
|
|
|
round_to_power_of_two: bool=True,
|
|
|
|
snip_edges: bool=True,
|
|
|
|
blackman_coeff: float=0.42,
|
|
|
|
allow_downsample: bool=False,
|
|
|
|
snip_edges: bool=True,
|
|
|
|
allow_upsample: bool=False,
|
|
|
|
allow_downsample: bool=False,
|
|
|
|
max_feature_vectors: int=-1,
|
|
|
|
allow_upsample: bool=False,
|
|
|
|
num_bins: int=23,
|
|
|
|
max_feature_vectors: int=-1,
|
|
|
|
low_freq: float=20,
|
|
|
|
num_bins: int=23,
|
|
|
|
high_freq: float=0,
|
|
|
|
low_freq: float=20,
|
|
|
|
vtln_low: float=100,
|
|
|
|
high_freq: float=0,
|
|
|
|
vtln_high: float=-500,
|
|
|
|
vtln_low: float=100,
|
|
|
|
debug_mel: bool=False,
|
|
|
|
vtln_high: float=-500,
|
|
|
|
htk_mode: bool=False,
|
|
|
|
debug_mel: bool=False,
|
|
|
|
use_energy: bool=False, # fbank opts
|
|
|
|
htk_mode: bool=False,
|
|
|
|
energy_floor: float=0.0,
|
|
|
|
use_energy: bool=False, # fbank opts
|
|
|
|
raw_energy: bool=True,
|
|
|
|
energy_floor: float=0.0,
|
|
|
|
htk_compat: bool=False,
|
|
|
|
raw_energy: bool=True,
|
|
|
|
use_log_fbank: bool=True,
|
|
|
|
htk_compat: bool=False,
|
|
|
|
use_power: bool=True):
|
|
|
|
use_log_fbank: bool=True,
|
|
|
|
|
|
|
|
use_power: bool=True):
|
|
|
|
frame_opts = FrameExtractionOptions()
|
|
|
|
frame_opts = FrameExtractionOptions()
|
|
|
|
mel_opts = MelBanksOptions()
|
|
|
|
mel_opts = MelBanksOptions()
|
|
|
|
fbank_opts = FbankOptions()
|
|
|
|
fbank_opts = FbankOptions()
|
|
|
@ -88,6 +89,7 @@ def fbank(wav,
|
|
|
|
feat = ComputeFbank(frame_opts, mel_opts, fbank_opts, wav)
|
|
|
|
feat = ComputeFbank(frame_opts, mel_opts, fbank_opts, wav)
|
|
|
|
return feat
|
|
|
|
return feat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@module_utils.requires_kaldi()
|
|
|
|
@module_utils.requires_kaldi()
|
|
|
|
def pitch(wav,
|
|
|
|
def pitch(wav,
|
|
|
|
samp_freq: int=16000,
|
|
|
|
samp_freq: int=16000,
|
|
|
|