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