快捷方式

InverseBarkScale

torchaudio.prototype.transforms.InverseBarkScale(n_stft: int, n_barks: int = 128, sample_rate: int = 16000, f_min: float = 0.0, f_max: Optional[float] = None, max_iter: int = 100000, tolerance_loss: float = 1e-05, tolerance_change: float = 1e-08, sgdargs: Optional[dict] = None, bark_scale: str = traunmuller)[原始碼]

從 bark 頻率域估計正常頻率域的 STFT。

This feature supports the following devices: CPU, CUDA

它使用 SGD 最小化輸入 bark 譜圖與估計譜圖和濾波器組乘積之間的歐幾里得範數。

引數:
  • n_stft (int) – STFT 中的 bin 數。參見 Spectrogram 中的 n_fft

  • n_barks (int, 可選) – bark 濾波器組的數量。(預設值: 128)

  • sample_rate (int, 可選) – 音訊訊號的取樣率。(預設值: 16000)

  • f_min (float, 可選) – 最小頻率。(預設值: 0.)

  • f_max (floatNone, 可選) – 最大頻率。(預設值: sample_rate // 2)

  • max_iter (int, 可選) – 最大最佳化迭代次數。(預設值: 100000)

  • tolerance_loss (float, 可選) – 停止最佳化時的損失值。(預設值: 1e-5)

  • tolerance_change (float, 可選) – 停止最佳化時的損失差異。(預設值: 1e-8)

  • sgdargs (dictNone, 可選) – SGD 最佳化器的引數。(預設值: None)

  • bark_scale (str, 可選) – 要使用的尺度: traunmullerschroederwang。(預設值: traunmuller)

示例
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> mel_spectrogram_transform = transforms.BarkSpectrogram(sample_rate, n_fft=1024)
>>> mel_spectrogram = bark_spectrogram_transform(waveform)
>>> inverse_barkscale_transform = transforms.InverseBarkScale(n_stft=1024 // 2 + 1)
>>> spectrogram = inverse_barkscale_transform(mel_spectrogram)
forward(barkspec: Tensor) Tensor[原始碼]
引數:

barkspec (torch.Tensor) – 維度為 (…, n_barks, time) 的 Bark 頻率譜圖

返回值:

線性尺度譜圖,大小為 (…, 頻率, time)

返回型別:

torch.Tensor

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

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

檢視教程

資源

查詢開發資源並獲得解答

檢視資源