快捷鍵

InverseBarkScale

class 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')[source]

從 Bark 頻域估計正常頻域中的 STFT。

This feature supports the following devices: CPU, CUDA

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

參數:
  • n_stft (int) – STFT 中的 bin 數量。請參閱 Spectrogram 中的 n_fft

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

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

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

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

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

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

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

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

  • bark_scale (str, optional) – 要使用的尺度: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[source]
參數:

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

返回:

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

返回類型:

torch.Tensor

文件

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

檢視文件

教學

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

檢視教學

資源

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

檢視資源