cupyx.scipy.fft.idct#

cupyx.scipy.fft.idct(x, type=2, n=None, axis=-1, norm=None, overwrite_x=False)[source]#

Return the Inverse Discrete Cosine Transform of an array, x.

Parameters
  • x (cupy.ndarray) – The input array.

  • type ({1, 2, 3, 4}, optional) – Type of the DCT (see Notes). Default type is 2.

  • n (int, optional) – Length of the transform. If n < x.shape[axis], x is truncated. If n > x.shape[axis], x is zero-padded. The default results in n = x.shape[axis].

  • axis (int, optional) – Axis along which the idct is computed; the default is over the last axis (i.e., axis=-1).

  • norm ({"backward", "ortho", "forward"}, optional) – Normalization mode (see Notes). Default is “backward”.

  • overwrite_x (bool, optional) – If True, the contents of x can be destroyed; the default is False.

Returns

idct – The transformed input array.

Return type

cupy.ndarray of real

See also

scipy.fft.idct()

Notes

For a single dimension array x, idct(x, norm='ortho') is equal to MATLAB idct(x).

For norm="ortho" both the dct and idct are scaled by the same overall factor in both directions. By default, the transform is also orthogonalized which for types 1, 2 and 3 means the transform definition is modified to give orthogonality of the IDCT matrix (see dct for the full definitions).

‘The’ IDCT is the IDCT-II, which is the same as the normalized DCT-III 1. See the scipy.fft.dct() documentation for a full description of each type. CuPy currently only supports DCT types 2 and 3.

References

1

Wikipedia, “Discrete sine transform”, https://en.wikipedia.org/wiki/Discrete_sine_transform