MFCC¶
- class torchaudio.transforms.MFCC(sample_rate: int = 16000, n_mfcc: int = 40, dct_type: int = 2, norm: str = 'ortho', log_mels: bool = False, melkwargs: Optional[dict] = None)[原始碼]¶
從音訊訊號建立梅爾頻率倒譜系數。
預設情況下,這會在 DB 縮放的梅爾譜圖上計算 MFCC。這並非教科書上的實現,但在此實現是為了與 librosa 保持一致性。
該輸出取決於輸入譜圖中的最大值,因此對於分割成片段的音訊剪輯與完整的音訊剪輯,可能會返回不同的值。
- 引數:
- 示例
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True) >>> transform = transforms.MFCC( >>> sample_rate=sample_rate, >>> n_mfcc=13, >>> melkwargs={"n_fft": 400, "hop_length": 160, "n_mels": 23, "center": False}, >>> ) >>> mfcc = transform(waveform)
另請參閱
torchaudio.functional.melscale_fbanks()- 用於生成濾波器組的函式。- 使用
MFCC的教程