interpolate#

class diffsptk.Interpolation(period: int, start: int = 0, dim: int = -1)[source]#

See this page for details.

Parameters:
periodint >= 1

The interpolation period, \(P\).

startint >= 0

The start point, \(S\).

dimint

The dimension along which to interpolate the tensors.

forward(x: Tensor) Tensor[source]#

Interpolate the input signal.

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

The input signal.

Returns:
outTensor [shape=(…, TxP+S, …)]

The interpolated signal.

Examples

>>> x = diffsptk.ramp(1, 3)
>>> interpolate = diffsptk.Interpolation(3, start=1)
>>> y = interpolate(x)
>>> y
tensor([0., 1., 0., 0., 2., 0., 0., 3., 0., 0.])
diffsptk.functional.interpolate(x: Tensor, period: int = 1, start: int = 0, dim: int = -1) Tensor[source]#

Interpolate the input signal.

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

The input signal.

periodint >= 1

The interpolation period, \(P\).

startint >= 0

The start point, \(S\).

dimint

The dimension along which to interpolate the tensors.

Returns:
outTensor [shape=(…, TxP+S, …)]

The interpolated signal.

See also

decimate