Shortcuts

torchaudio.functional.mu_law_encoding

torchaudio.functional.mu_law_encoding(x: Tensor, quantization_channels: int) Tensor[source]

Encode signal based on mu-law companding.

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

For more info see the Wikipedia Entry

This algorithm expects the signal has been scaled to between -1 and 1 and returns a signal encoded with values from 0 to quantization_channels - 1.

Parameters:
  • x (Tensor) – Input tensor

  • quantization_channels (int) – Number of channels

Returns:

Input after mu-law encoding

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