本文簡要介紹python語言中 torchaudio.transforms.SpectralCentroid
的用法。
用法:
class torchaudio.transforms.SpectralCentroid(sample_rate: int, n_fft: int = 400, win_length: Optional[int] = None, hop_length: Optional[int] = None, pad: int = 0, window_fn: Callable[[...], torch.Tensor] = <built-in method hann_window of type object>, wkwargs: Optional[dict] = None)
沿時間軸計算每個通道的頻譜質心。
頻譜質心定義為頻率值的加權平均值,按其幅度加權。
- 示例
>>> waveform, sample_rate = torchaudio.load('test.wav', normalize=True) >>> transform = transforms.SpectralCentroid(sample_rate) >>> spectral_centroid = transform(waveform) # (channel, time)
參數:
相關用法
- Python PyTorch Spectrogram用法及代碼示例
- Python PyTorch SparseArch用法及代碼示例
- Python PyTorch SparseFeaturesAllToAll用法及代碼示例
- Python PyTorch ScaledDotProduct.__init__用法及代碼示例
- Python PyTorch Sigmoid用法及代碼示例
- Python PyTorch ShardedEmbeddingBagCollection.named_parameters用法及代碼示例
- Python PyTorch SummaryWriter.add_histogram用法及代碼示例
- Python PyTorch ScriptModule.state_dict用法及代碼示例
- Python PyTorch Softmin用法及代碼示例
- Python PyTorch SummaryWriter.add_pr_curve用法及代碼示例
- Python PyTorch Softmax2d用法及代碼示例
- Python PyTorch ShardedEmbeddingBag.named_parameters用法及代碼示例
- Python PyTorch ScriptModule.register_full_backward_hook用法及代碼示例
- Python PyTorch SummaryWriter.add_custom_scalars用法及代碼示例
- Python PyTorch ScriptModule.parameters用法及代碼示例
- Python PyTorch ShardedEmbeddingBag.state_dict用法及代碼示例
- Python PyTorch SummaryWriter.add_image用法及代碼示例
- Python PyTorch Store.num_keys用法及代碼示例
- Python PyTorch ShardedEmbeddingBagCollection.named_modules用法及代碼示例
- Python PyTorch SummaryWriter.add_hparams用法及代碼示例
- Python PyTorch ScriptModule.register_forward_hook用法及代碼示例
- Python PyTorch ShardedEmbeddingBagCollection.state_dict用法及代碼示例
- Python PyTorch ScriptModule.modules用法及代碼示例
- Python PyTorch SummaryWriter.__init__用法及代碼示例
- Python PyTorch SequentialLR用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torchaudio.transforms.SpectralCentroid。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。