本文簡要介紹python語言中 torchaudio.transforms.PitchShift 的用法。
- 用法:- class torchaudio.transforms.PitchShift(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_fn: Callable[[...], torch.Tensor] = <built-in method hann_window of type object>, wkwargs: Optional[dict] = None)
- waveform(Tensor) -形狀為 - (…, time)的輸入波形。
- sample_rate(int) - - waveform的采樣率。
- n_steps(int) -轉移 - waveform的(小數)步驟。
- bins_per_octave(int,可選的) -每個八度音階的步數(默認值: - 12)。
- n_fft(int,可選的) -FFT 的大小,創建 - n_fft // 2 + 1bin(默認值:- 512)。
- hop_length(int或者None,可選的) -STFT 窗口之間的跳躍長度。如果無,則使用 - win_length // 4(默認值:- None)。
- window(Tensor或者None,可選的) -應用於/乘以每個幀/窗口的窗口張量。如果無,則使用 - torch.hann_window(win_length)(默認值:- None)。
 
- 以 - n_steps步長移動波形的音高。- 示例
- >>> waveform, sample_rate = torchaudio.load('test.wav', normalize=True) >>> transform = transforms.PitchShift(sample_rate, 4) >>> waveform_shift = transform(waveform) # (channel, time)
 
參數:
相關用法
- Python PyTorch PixelShuffle用法及代碼示例
- Python PyTorch Pipe用法及代碼示例
- Python PyTorch PixelUnshuffle用法及代碼示例
- Python PyTorch PackageImporter.id用法及代碼示例
- Python PyTorch Proxy用法及代碼示例
- Python PyTorch PoissonNLLLoss用法及代碼示例
- Python PyTorch ParagraphAggregator用法及代碼示例
- Python PyTorch PooledEmbeddingsAllToAll用法及代碼示例
- Python PyTorch PackageExporter.register_extern_hook用法及代碼示例
- Python PyTorch Poisson用法及代碼示例
- Python PyTorch Perceptron用法及代碼示例
- Python PyTorch ParallelReadConcat用法及代碼示例
- Python PyTorch ParameterList用法及代碼示例
- Python PyTorch PairwiseDistance用法及代碼示例
- Python PyTorch ParquetDataFrameLoader用法及代碼示例
- Python PyTorch PackageExporter.register_intern_hook用法及代碼示例
- Python PyTorch ParameterDict用法及代碼示例
- Python PyTorch Pareto用法及代碼示例
- Python PyTorch PackageExporter.close用法及代碼示例
- Python PyTorch PooledEmbeddingsReduceScatter用法及代碼示例
- Python PyTorch PackageExporter.register_mock_hook用法及代碼示例
- Python PyTorch PReLU用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
- Python PyTorch cholesky用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torchaudio.transforms.PitchShift。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
