快捷方式

MuLawEncoding

class torchaudio.transforms.MuLawEncoding(quantization_channels: int = 256)[source]

基于 mu-law 压缩编码信号。

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

有关更多信息,请参阅维基百科条目

此算法假定信号已缩放到 -1 和 1 之间,并返回一个编码信号,其值从 0 到 quantization_channels - 1

参数:

quantization_channels (int, 可选) – 通道数。(默认值:256

示例
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> transform = torchaudio.transforms.MuLawEncoding(quantization_channels=512)
>>> mulawtrans = transform(waveform)
forward(x: Tensor) Tensor[source]
参数:

x (Tensor) – 要编码的信号。

返回值:

编码后的信号。

返回类型:

Tensor

文档

访问 PyTorch 的综合开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得解答

查看资源