快捷方式

torchaudio.functional.pitch_shift

torchaudio.functional.pitch_shift(waveform: Tensor, sample_rate: int, n_steps: int, bins_per_octave: int = 12, n_fft: int = 512, win_length: Optional[int] = None, hop_length: Optional[int] = None, window: Optional[Tensor] = None) Tensor[source]

將波形的音高移動 n_steps 個步長。

This feature supports the following devices: CPU, CUDA This API supports the following properties: TorchScript
引數:
  • waveform (Tensor) – 輸入波形,形狀為 (…, time)

  • sample_rate (int) – 波形的取樣率。

  • n_steps (int) – 移動波形的(分數)步長。

  • bins_per_octave (int, *可選的*) – 每個八度的步長數(預設值:12)。

  • n_fft (int, *可選的*) – FFT 大小,建立 n_fft // 2 + 1 個 bin(預設值:512)。

  • win_length (int *或* *None*, *可選的*) – 視窗大小。如果為 None,則使用 n_fft。(預設值:None)。

  • hop_length (int *或* *None*, *可選的*) – STFT 視窗之間的跳躍長度。如果為 None,則使用 win_length // 4(預設值:None)。

  • window (*Tensor* *或* *None*, *可選的*) – 應用/乘以每個幀/視窗的視窗張量。如果為 None,則使用 torch.hann_window(win_length)(預設值:None)。

返回:

音高移動後的音訊波形,形狀為 (…, time)

返回型別:

Tensor

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源