Shortcuts

AddNoise

class torchaudio.transforms.AddNoise(*args, **kwargs)[source]

Scales and adds noise to waveform per signal-to-noise ratio. See torchaudio.functional.add_noise() for more details.

This feature supports the following devices: CPU, CUDA This API supports the following properties: Autograd, TorchScript
forward(waveform: Tensor, noise: Tensor, snr: Tensor, lengths: Optional[Tensor] = None) Tensor[source]
Parameters:
  • waveform (torch.Tensor) – Input waveform, with shape (…, L).

  • noise (torch.Tensor) – Noise, with shape (…, L) (same shape as waveform).

  • snr (torch.Tensor) – Signal-to-noise ratios in dB, with shape (…,).

  • lengths (torch.Tensor or None, optional) – Valid lengths of signals in waveform and noise,

  • ` (with shape) –

  • (Default (elements in waveform and noise are treated as valid.) – None)

Returns:

Result of scaling and adding noise to waveform, with shape (…, L) (same shape as waveform).

Return type:

torch.Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources