{ } Raw JSON

bundles / scipy 1.17.1 / scipy / fft / _realtransforms / idstn

_Function

scipy.fft._realtransforms:idstn

source: /scipy/fft/_realtransforms.py :207

Signature

def   idstn ( x type = 2 s = None axes = None norm = None overwrite_x = False workers = None orthogonalize = None )

Summary

Return multidimensional Inverse Discrete Sine Transform along the specified axes.

Parameters

x : array_like

The input array.

type : {1, 2, 3, 4}, optional

Type of the DST (see Notes). Default type is 2.

s : int or array_like of ints or None, optional

The shape of the result. If both s and axes (see below) are None, s is x.shape; if s is None but axes is not None, then s is numpy.take(x.shape, axes, axis=0). If s[i] > x.shape[i], the ith dimension of the input is padded with zeros. If s[i] < x.shape[i], the ith dimension of the input is truncated to length s[i]. If any element of s is -1, the size of the corresponding dimension of x is used.

axes : int or array_like of ints or None, optional

Axes over which the IDST is computed. If not given, the last len(s) axes are used, or all axes if s is also not specified.

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.

workers : int, optional

Maximum number of workers to use for parallel computation. If negative, the value wraps around from os.cpu_count(). See fft for more details.

orthogonalize : bool, optional

Whether to use the orthogonalized IDST variant (see Notes). Defaults to True when norm="ortho" and False otherwise.

Returns

y : ndarray of real

The transformed input array.

Notes

For full details of the IDST types and normalization modes, as well as references, see idst.

Array API Standard Support

idstn has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

====================  ====================  ====================
Library               CPU                   GPU
====================  ====================  ====================
NumPy                 ✅                     n/a                 
CuPy                  n/a                   ⛔                   
PyTorch               ✅                     ⛔                   
JAX                   ✅                     ⛔                   
Dask                  ⚠️ computes graph     n/a                 
====================  ====================  ====================

See dev-arrayapi for more information.

Examples

import numpy as np
from scipy.fft import dstn, idstn
rng = np.random.default_rng()
y = rng.standard_normal((16, 16))
np.allclose(y, idstn(dstn(y)))

See also

dstn

multidimensional DST

Aliases

  • scipy.fft.idstn