Shortcuts

torchaudio.functional.dcshift

torchaudio.functional.dcshift(waveform: Tensor, shift: float, limiter_gain: Optional[float] = None) Tensor[source]

Apply a DC shift to the audio. Similar to SoX implementation.

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

This can be useful to remove a DC offset (caused perhaps by a hardware problem in the recording chain) from the audio

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

  • shift (float) – indicates the amount to shift the audio Allowed range of values for shift : -2.0 to +2.0

  • limiter_gain (python:float of None, optional) – It is used only on peaks to prevent clipping It should have a value much less than 1 (e.g. 0.05 or 0.02)

Returns:

Waveform of dimension of (…, time)

Return type:

Tensor

Reference:

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