tf.signal.dct
Stay organized with collections
Save and categorize content based on your preferences.
Computes the 1D Discrete Cosine Transform (DCT) of input
.
tf.signal.dct(
input, type=2, n=None, axis=-1, norm=None, name=None
)
Types I, II, III and IV are supported.
Type I is implemented using a length 2N
padded tf.signal.rfft
.
Type II is implemented using a length 2N
padded tf.signal.rfft
, as
described here: Type 2 DCT using 2N FFT padded (Makhoul).
Type III is a fairly straightforward inverse of Type II
(i.e. using a length 2N
padded tf.signal.irfft
).
Type IV is calculated through 2N length DCT2 of padded signal and
picking the odd indices.
Args |
input
|
A [..., samples] float32 /float64 Tensor containing the
signals to take the DCT of.
|
type
|
The DCT type to perform. Must be 1, 2, 3 or 4.
|
n
|
The length of the transform. If length is less than sequence length,
only the first n elements of the sequence are considered for the DCT.
If n is greater than the sequence length, zeros are padded and then
the DCT is computed as usual.
|
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 /float64 Tensor containing the DCT of
input .
|
Raises |
ValueError
|
If type is not 1 , 2 , 3 or 4 , axis is
not -1 , n is not None or greater than 0,
or norm is not None or 'ortho' .
|
ValueError
|
If type is 1 and norm is ortho .
|
Equivalent to scipy.fftpack.dct
for Type-I, Type-II, Type-III and Type-IV DCT.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[],[]]