nitorch_fastmath.realtransforms
dct
Return the Discrete Cosine Transform
Warning
Type IV not implemented
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
int
|
Dimensions over which the DCT is computed. Default is the last one. |
-1
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
idct
Return the Inverse Discrete Cosine Transform
Warning
Type IV not implemented
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
int
|
Dimensions over which the DCT is computed. Default is the last one. |
-1
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
dst
Return the Discrete Sine Transform
Warning
Type IV not implemented
Warning
dst(..., norm="ortho") yields a different result than scipy
and cupy for types 2 and 3. This is because their DST is not
properly orthogonalized. Use norm="ortho_scipy" to get results
matching their implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
int
|
Dimensions over which the DCT is computed. Default is the last one. |
-1
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
idst
Return the Inverse Discrete Sine Transform
Warning
Type IV not implemented
Warning
idst(..., norm="ortho") yields a different result than scipy
and cupy for types 2 and 3. This is because their DST is not
properly orthogonalized. Use norm="ortho_scipy" to get results
matching their implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
int
|
Dimensions over which the DCT is computed. Default is the last one. |
-1
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
dctn
Return multidimensional Discrete Cosine Transform along the specified axes.
Warning
Type IV not implemented
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
[sequence of] int
|
Dimensions over which the DCT is computed. If not given, all dimensions are used. |
None
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
idctn
Return multidimensional Inverse Discrete Cosine Transform along the specified axes.
Warning
Type IV not implemented
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
[sequence of] int
|
Dimensions over which the DCT is computed. If not given, all dimensions are used. |
None
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
dstn
Return multidimensional Discrete Sine Transform along the specified axes.
Warning
Type IV not implemented
Warning
dstn(..., norm="ortho") yields a different result than scipy
and cupy for types 2 and 3. This is because their DST is not
properly orthogonalized. Use norm="ortho_scipy" to get results
matching their implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
[sequence of] int
|
Dimensions over which the DCT is computed. If not given, all dimensions are used. |
None
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |
idstn
Return multidimensional Inverse Discrete Sine Transform along the specified axes.
Warning
Type IV not implemented
Warning
idstn(..., norm="ortho") yields a different result than scipy
and cupy for types 2 and 3. This is because their DST is not
properly orthogonalized. Use norm="ortho_scipy" to get results
matching their implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x |
tensor
|
The input tensor |
required |
dim |
[sequence of] int
|
Dimensions over which the DCT is computed. If not given, all dimensions are used. |
None
|
norm |
Literal['backward', 'ortho', 'forward']
|
Normalization mode. Default is “backward”. |
“backward”
|
type |
Literal[1, 2, 3]
|
Type of the DCT. Default type is 2. |
2
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
tensor
|
The transformed tensor. |