idct#

diffsptk.IDCT#

alias of InverseDiscreteCosineTransform

class diffsptk.InverseDiscreteCosineTransform(dct_length)[source]#

See this page for details.

Parameters:
dct_lengthint >= 1 [scalar]

DCT length, \(L\).

forward(y)[source]#

Apply inverse DCT to input.

Parameters:
yTensor [shape=(…, L)]

Input.

Returns:
xTensor [shape=(…, L)]

Inverse DCT output.

Examples

>>> x = diffsptk.ramp(3)
>>> dct = diffsptk.DCT(4)
>>> idct = diffsptk.IDCT(4)
>>> x2 = idct(dct(x))
>>> x2
tensor([-4.4703e-08,  1.0000e+00,  2.0000e+00,  3.0000e+00])

See also

dct