idct#
- diffsptk.IDCT#
alias of
InverseDiscreteCosineTransform
- class diffsptk.InverseDiscreteCosineTransform(dct_length, dct_type=2)[source]#
See this page for details.
- Parameters:
- dct_lengthint >= 1
DCT length, \(L\).
- dct_typeint in [1, 4]
DCT type.
- forward(y)[source]#
Apply inverse DCT to input.
- Parameters:
- yTensor [shape=(…, L)]
Input.
- Returns:
- outTensor [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])
- diffsptk.functional.idct(y, dct_type=2)[source]#
Compute inverse DCT.
- Parameters:
- yTensor [shape=(…, L)]
Input.
- dct_typeint in [1, 4]
DCT type.
- Returns:
- outTensor [shape=(…, L)]
Inverse DCT output.
See also