espnet2.asr.frontend.melspec_torch.MelSpectrogramTorch
espnet2.asr.frontend.melspec_torch.MelSpectrogramTorch
class espnet2.asr.frontend.melspec_torch.MelSpectrogramTorch(preemp: bool = True, n_fft: int = 512, log: bool = False, win_length: int = 400, hop_length: int = 160, f_min: int = 20, f_max: int = 7600, n_mels: int = 80, window_fn: str = 'hamming', mel_scale: str = 'htk', normalize: str | None = None)
Bases: AbsFrontend
Mel-Spectrogram using Torchaudio Implementation.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(input: Tensor, input_length: Tensor) → Tuple[Tensor, Tensor]
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
output_size() → int
Return output length of feature dimension D.