espnet2.layers.augmentation.corrupt_phase
Less than 1 minute
espnet2.layers.augmentation.corrupt_phase
espnet2.layers.augmentation.corrupt_phase(waveform, sample_rate, scale: float = 0.5, n_fft: float = 0.032, win_length: float | None = None, hop_length: float = 0.008, window: str | None = 'hann')
Adding random noise to the phase of input waveform.
- Parameters:
- waveform (torch.Tensor) – audio signal (…, time)
- sample_rate (int) – sampling rate in Hz
- scale (float) – scale factor for the phase noise
- n_fft (float) – length of FFT (in second)
- win_length (float or None) – The window length (in second) used for STFT If None, it is treated as equal to n_fft
- hop_length (float) – The hop size (in second) used for STFT
- window (str or None) – The windowing function applied to the signal after padding with zeros
- Returns: phase-corrupted signal (…, time)
- Return type: ret (torch.Tensor)