linear_intpl

class diffsptk.LinearInterpolation(upsampling_factor)[source]

Perform linear interpolation.

Note that this is not for lienar_intpl in C the version of SPTK, but for filter coefficients interpolation in digital filtering.

Parameters
upsampling_factorint >= 1 [scalar]

Upsampling factor, \(P\).

forward(x)[source]

Interpolate filter coefficients.

Parameters
xTensor [shape=(B, N, D)]

Filter coefficients.

Returns
yTensor [shape=(B, NxP, D)]

Upsampled filter coefficients.

Examples

>>> x = diffsptk.ramp(2)
>>> linear_intpl = diffsptk.LinearInterpolation(2)
>>> y = linear_intpl(x.view(1, -1, 1))
>>> y.reshape(-1)
tensor([[0.0000, 0.5000, 1.0000, 1.5000, 2.0000, 2.0000]])

See also

zerodf