torchaudio.functional.compute_deltas
- torchaudio.functional.compute_deltas(specgram: Tensor, win_length: int = 5, mode: str = 'replicate') Tensor [source]
Compute delta coefficients of a tensor, usually a spectrogram:
where is the deltas at time , is the spectrogram coeffcients at time , is
(win_length-1)//2
.- Parameters:
- Returns:
Tensor of deltas of dimension (…, freq, time)
- Return type:
Tensor
- Example
>>> specgram = torch.randn(1, 40, 1000) >>> delta = compute_deltas(specgram) >>> delta2 = compute_deltas(delta)