W3cubDocs

/TensorFlow Python

tf.spectral.dct

tf.spectral.dct(
    input,
    type=2,
    n=None,
    axis=-1,
    norm=None,
    name=None
)

Defined in tensorflow/python/ops/spectral_ops.py.

See the guide: Spectral Functions > Discrete Cosine Transforms

Computes the 1D Discrete Cosine Transform (DCT) of input.

Currently only Type II is supported. Implemented using a length 2N padded tf.spectral.rfft, as described here: https://dsp.stackexchange.com/a/10606

Args:

  • input: A [..., samples] float32 Tensor containing the signals to take the DCT of.
  • type: The DCT type to perform. Must be 2.
  • n: For future expansion. The length of the transform. Must be None.
  • axis: For future expansion. The axis to compute the DCT along. Must be -1.
  • norm: The normalization to apply. None for no normalization or 'ortho' for orthonormal normalization.
  • name: An optional name for the operation.

Returns:

A [..., samples] float32 Tensor containing the DCT of input.

Raises:

  • ValueError: If type is not 2, n is not None,axisis not-1, ornormis notNoneor'ortho'`.

Scipy Compatibility

Equivalent to scipy.fftpack.dct for the Type-II DCT. https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/spectral/dct