linear_intpl#
- class diffsptk.LinearInterpolation(upsampling_factor)[source]#
Perform linear interpolation.
Note that this is not related to linear_intpl in the C/C++ version of SPTK, but is instead intended for interpolation of filter coefficients in digital filtering.
- Parameters:
- upsampling_factorint >= 1
The upsampling factor, \(P\).
- forward(x)[source]#
Interpolate filter coefficients.
- Parameters:
- xTensor [shape=(B, N, D) or (N, D) or (N,)]
The filter coefficients.
- Returns:
- outTensor [shape=(B, NxP, D) or (NxP, D) or (NxP,)]
The upsampled filter coefficients.
Examples
>>> x = diffsptk.ramp(2) >>> x tensor([0., 1., 2.]) >>> linear_intpl = diffsptk.LinearInterpolation(2) >>> y = linear_intpl(x) >>> y tensor([0.0000, 0.5000, 1.0000, 1.5000, 2.0000, 2.0000])
- diffsptk.functional.linear_intpl(x, upsampling_factor=80)[source]#
Interpolate filter coefficients.
- Parameters:
- xTensor [shape=(B, N, D) or (N, D) or (N,)]
The filter coefficients.
- upsampling_factorint >= 1
The upsampling factor, \(P\).
- Returns:
- yTensor [shape=(B, NxP, D) or (NxP, D) or (NxP,)]
The upsampled filter coefficients.