快捷方式

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

更多信息请参阅 Wikipedia 条目

此算法假定信号已被缩放到 -1 到 1 之间,并返回一个编码值为 0 到 quantization_channels - 1 的信号。

参数

quantization_channels (int, optional) – 通道数。(默认值: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) – 要编码的信号。

返回

编码后的信号。

返回类型

张量

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源