delay#

class diffsptk.Delay(start: int, keeplen: bool = False, dim: int = -1)[source]#

See this page for details.

Parameters:
startint

The start point, \(S\). If negative, advance the signal.

keeplenbool

If True, the output has the same length of the input.

dimint

The dimension along which to delay the tensors.

forward(x: Tensor) Tensor[source]#

Delay the input signal.

Parameters:
xTensor [shape=(…, T, …)]

The input signal.

Returns:
outTensor [shape=(…, T-S, …)] or [shape=(…, T, …)]

The delayed signal.

Examples

>>> x = diffsptk.ramp(1, 3)
>>> delay = diffsptk.Delay(2)
>>> y = delay(x)
>>> y
tensor([0., 0., 1., 2., 3.])
diffsptk.functional.delay(x: Tensor, start: int = 0, keeplen: bool = False, dim: int = -1) Tensor[source]#

Delay the input signal.

Parameters:
xTensor [shape=(…, T, …)]

The input signal.

startint

The start point, \(S\). If negative, advance the signal.

keeplenbool

If True, the output has the same length of the input.

dimint

The dimension along which to delay the tensors.

Returns:
outTensor [shape=(…, T-S, …)] or [shape=(…, T, …)]

The delayed signal.