Skip to content

Commit

Permalink
add padding_value for kaldifeat features
Browse files Browse the repository at this point in the history
  • Loading branch information
desh2608 committed Apr 6, 2023
1 parent 1b88cfa commit 14b51f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lhotse/features/kaldifeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def __init__(self, config: Optional[KaldifeatFbankConfig] = None) -> None:
def feature_dim(self, sampling_rate: int) -> int:
return self.config.mel_opts.num_bins

@property
def padding_value(self) -> float:
return -1000.0 if self.config.use_log_fbank else EPSILON

@staticmethod
def mix(
features_a: np.ndarray, features_b: np.ndarray, energy_scaling_factor_b: float
Expand Down Expand Up @@ -259,3 +263,7 @@ def __init__(self, config: Optional[KaldifeatMfccConfig] = None) -> None:

def feature_dim(self, sampling_rate: int) -> int:
return self.config.num_ceps

@property
def padding_value(self) -> float:
return -1000.0

0 comments on commit 14b51f6

Please sign in to comment.