espnet2.layers.augmentation.speed_perturb
Less than 1 minute
espnet2.layers.augmentation.speed_perturb
espnet2.layers.augmentation.speed_perturb(waveform, sample_rate: int, factor: float)
Speed perturbation which also changes the pitch.
Note: This function should be used with caution as it changes the signal duration.
- Parameters:
- waveform (torch.Tensor) – audio signal (…, time)
- sample_rate (int) – sampling rate in Hz
- factor (float) – speed factor (e.g., 0.9 for 90% speed)
- lengths (torch.Tensor) – lengths of the input signals
- Returns: perturbed signal (…, time)
- Return type: ret (torch.Tensor)