torchaudio.functional.dither¶
- torchaudio.functional.dither(waveform: Tensor, density_function: str = 'TPDF', noise_shaping: bool = False) Tensor [source]¶
Apply dither
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