快速鍵

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

更多資訊請參閱 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[原始碼]
參數:

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

傳回值:

編碼後的訊號。

傳回類型:

Tensor

文件

存取 PyTorch 的完整開發人員文件

檢視文件

教學

取得初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源