bundles / scipy 1.17.1 / scipy / fftpack / _basic / fftn
function
scipy.fftpack._basic:fftn
source: /scipy/fftpack/_basic.py :277
Signature
def fftn ( x , shape = None , axes = None , overwrite_x = False ) Summary
Return multidimensional discrete Fourier transform.
Extended Summary
The returned array contains
y[j_1,..,j_d] = sum[k_1=0..n_1-1, ..., k_d=0..n_d-1] x[k_1,..,k_d] * prod[i=1..d] exp(-sqrt(-1)*2*pi/n_i * j_i * k_i)
where d = len(x.shape) and n = x.shape.
Parameters
x: array_likeThe (N-D) array to transform.
shape: int or array_like of ints or None, optionalThe shape of the result. If both
shapeandaxes(see below) are None,shapeisx.shape; ifshapeis None butaxesis not None, thenshapeisnumpy.take(x.shape, axes, axis=0). Ifshape[i] > x.shape[i], the ith dimension is padded with zeros. Ifshape[i] < x.shape[i], the ith dimension is truncated to lengthshape[i]. If any element ofshapeis -1, the size of the corresponding dimension ofxis used.axes: int or array_like of ints or None, optionalThe axes of
x(y ifshapeis not None) along which the transform is applied. The default is over all axes.overwrite_x: bool, optionalIf True, the contents of
xcan be destroyed. Default is False.
Returns
y: complex-valued N-D NumPy arrayThe (N-D) DFT of the input array.
Notes
If x is real-valued, then y[..., j_i, ...] == y[..., n_i-j_i, ...].conjugate().
Both single and double precision routines are implemented. Half precision inputs will be converted to single precision. Non-floating-point inputs will be converted to double precision. Long-double precision inputs are not supported.
Examples
import numpy as np from scipy.fftpack import fftn, ifftn y = (-np.arange(16), 8 - np.arange(16), np.arange(16)) np.allclose(y, fftn(ifftn(y)))✓
See also
- ifftn
Aliases
-
scipy.fftpack.fftn