functional_compute_deltas: Delta Coefficients (functional)

Description Usage Arguments Details Value Examples

Description

Compute delta coefficients of a tensor, usually a spectrogram.

Usage

1
functional_compute_deltas(specgram, win_length = 5, mode = "replicate")

Arguments

specgram

(Tensor): Tensor of audio of dimension (..., freq, time)

win_length

(int, optional): The window length used for computing delta (Default: 5)

mode

(str, optional): Mode parameter passed to padding (Default: "replicate")

Details

math:

d_t = \frac{∑_{n=1}^{N} n (c_{t+n} - c_{t-n})}{2 ∑_{n=1}^{N} n^2}

where d_t is the deltas at time t, c_t is the spectrogram coeffcients at time t, N is (win_length-1) %/% 2.

Value

tensor: Tensor of deltas of dimension (..., freq, time)

Examples

1
2
3
4
5
6
7
if(torch::torch_is_installed()) {
library(torch)
library(torchaudio)
specgram = torch_randn(1, 40, 1000)
delta = functional_compute_deltas(specgram)
delta2 = functional_compute_deltas(delta)
}

torchaudio documentation built on May 5, 2021, 5:06 p.m.