idct#
- diffsptk.IDCT#
alias of
InverseDiscreteCosineTransform
- class diffsptk.InverseDiscreteCosineTransform(dct_length: int, dct_type: int = 2, device: device | None = None, dtype: dtype | None = None)[source]#
See this page for details.
- Parameters:
- dct_lengthint >= 1
The DCT length, \(L\).
- dct_typeint in [1, 4]
The DCT type.
- devicetorch.device or None
The device of this module.
- dtypetorch.dtype or None
The data type of this module.
- 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
>>> import diffsptk >>> dct = diffsptk.DCT(4) >>> idct = diffsptk.IDCT(4) >>> x = diffsptk.ramp(1, 4) >>> x2 = idct(dct(x)) >>> x2 tensor([1.0000, 2.0000, 3.0000, 4.0000])
- 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