快捷方式

MuLawEncoding

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

基於 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[源]
引數:

x (Tensor) – 待編碼的訊號。

返回值:

編碼後的訊號。

返回型別:

Tensor

文件

訪問 PyTorch 的完整開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源