Shortcuts

torchaudio.functional.dither

torchaudio.functional.dither(waveform: Tensor, density_function: str = 'TPDF', noise_shaping: bool = False) Tensor[source]

Apply dither

This feature supports the following devices: CPU, CUDA This API supports the following properties: TorchScript

Dither increases the perceived dynamic range of audio stored at a particular bit-depth by eliminating nonlinear truncation distortion (i.e. adding minimally perceived noise to mask distortion caused by quantization).

Parameters:
  • waveform (Tensor) – Tensor of audio of dimension (…, time)

  • density_function (str, optional) – The density function of a continuous random variable. One of "TPDF" (Triangular Probability Density Function), "RPDF" (Rectangular Probability Density Function) or "GPDF" (Gaussian Probability Density Function) (Default: "TPDF").

  • noise_shaping (bool, optional) – a filtering process that shapes the spectral energy of quantisation error (Default: False)

Returns:

waveform dithered

Return type:

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