MCPcopy Index your code
hub / github.com/numpy/numpy / fft2

Function fft2

numpy/fft/_pocketfft.py:1020–1141  ·  view source on GitHub ↗

Compute the 2-dimensional discrete Fourier Transform. This function computes the *n*-dimensional discrete Fourier Transform over any axes in an *M*-dimensional array by means of the Fast Fourier Transform (FFT). By default, the transform is computed over the last two axes of t

(a, s=None, axes=(-2, -1), norm=None, out=None)

Source from the content-addressed store, hash-verified

1018
1019@array_function_dispatch(_fftn_dispatcher)
1020def fft2(a, s=None, axes=(-2, -1), norm=None, out=None):
1021 """
1022 Compute the 2-dimensional discrete Fourier Transform.
1023
1024 This function computes the *n*-dimensional discrete Fourier Transform
1025 over any axes in an *M*-dimensional array by means of the
1026 Fast Fourier Transform (FFT). By default, the transform is computed over
1027 the last two axes of the input array, i.e., a 2-dimensional FFT.
1028
1029 Parameters
1030 ----------
1031 a : array_like
1032 Input array, can be complex
1033 s : sequence of ints, optional
1034 Shape (length of each transformed axis) of the output
1035 (``s[0]`` refers to axis 0, ``s[1]`` to axis 1, etc.).
1036 This corresponds to ``n`` for ``fft(x, n)``.
1037 Along each axis, if the given shape is smaller than that of the input,
1038 the input is cropped. If it is larger, the input is padded with zeros.
1039
1040 .. versionchanged:: 2.0
1041
1042 If it is ``-1``, the whole input is used (no padding/trimming).
1043
1044 If `s` is not given, the shape of the input along the axes specified
1045 by `axes` is used.
1046
1047 .. deprecated:: 2.0
1048
1049 If `s` is not ``None``, `axes` must not be ``None`` either.
1050
1051 .. deprecated:: 2.0
1052
1053 `s` must contain only ``int`` s, not ``None`` values. ``None``
1054 values currently mean that the default value for ``n`` is used
1055 in the corresponding 1-D transform, but this behaviour is
1056 deprecated.
1057
1058 axes : sequence of ints, optional
1059 Axes over which to compute the FFT. If not given, the last two
1060 axes are used. A repeated index in `axes` means the transform over
1061 that axis is performed multiple times. A one-element sequence means
1062 that a one-dimensional FFT is performed. Default: ``(-2, -1)``.
1063
1064 .. deprecated:: 2.0
1065
1066 If `s` is specified, the corresponding `axes` to be transformed
1067 must not be ``None``.
1068
1069 norm : {"backward", "ortho", "forward"}, optional
1070 Normalization mode (see `numpy.fft`). Default is "backward".
1071 Indicates which direction of the forward/backward pair of transforms
1072 is scaled and with what normalization factor.
1073
1074 .. versionadded:: 1.20.0
1075
1076 The "backward", "forward" values were added.
1077

Callers

nothing calls this directly

Calls 1

_raw_fftndFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…