espnet2.layers.stft.Stft
Less than 1 minute
espnet2.layers.stft.Stft
class espnet2.layers.stft.Stft(n_fft: int = 512, win_length: int | None = None, hop_length: int = 128, window: str | None = 'hann', center: bool = True, normalized: bool = False, onesided: bool = True)
Bases: Module
, InversibleInterface
Initializes internal Module state, shared by both nn.Module and ScriptModule.
extra_repr()
Set the extra representation of the module
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
forward(input: Tensor, ilens: Tensor | None = None) → Tuple[Tensor, Tensor | None]
STFT forward function.
- Parameters:
- input – (Batch, Nsamples) or (Batch, Nsample, Channels)
- ilens – (Batch)
- Returns: (Batch, Frames, Freq, 2) or (Batch, Frames, Channels, Freq, 2)
- Return type: output
inverse(input: Tensor | ComplexTensor, ilens: Tensor | None = None) → Tuple[Tensor, Tensor | None]
Inverse STFT.
- Parameters:
- input – Tensor(batch, T, F, 2) or ComplexTensor(batch, T, F)
- ilens – (batch,)
- Returns: (batch, samples) ilens: (batch,)
- Return type: wavs