Compute the 2-dimensional inverse discrete Fourier Transform. This function computes the inverse of the 2-dimensional discrete Fourier Transform over any number of axes in an M-dimensional array by means of the Fast Fourier Transform (FFT). In other words, ``ifft2(fft2(a)) == a``
(a, s=None, axes=(-2, -1), norm=None)
| 1016 | |
| 1017 | @array_function_dispatch(_fftn_dispatcher) |
| 1018 | def ifft2(a, s=None, axes=(-2, -1), norm=None): |
| 1019 | """ |
| 1020 | Compute the 2-dimensional inverse discrete Fourier Transform. |
| 1021 | |
| 1022 | This function computes the inverse of the 2-dimensional discrete Fourier |
| 1023 | Transform over any number of axes in an M-dimensional array by means of |
| 1024 | the Fast Fourier Transform (FFT). In other words, ``ifft2(fft2(a)) == a`` |
| 1025 | to within numerical accuracy. By default, the inverse transform is |
| 1026 | computed over the last two axes of the input array. |
| 1027 | |
| 1028 | The input, analogously to `ifft`, should be ordered in the same way as is |
| 1029 | returned by `fft2`, i.e. it should have the term for zero frequency |
| 1030 | in the low-order corner of the two axes, the positive frequency terms in |
| 1031 | the first half of these axes, the term for the Nyquist frequency in the |
| 1032 | middle of the axes and the negative frequency terms in the second half of |
| 1033 | both axes, in order of decreasingly negative frequency. |
| 1034 | |
| 1035 | Parameters |
| 1036 | ---------- |
| 1037 | a : array_like |
| 1038 | Input array, can be complex. |
| 1039 | s : sequence of ints, optional |
| 1040 | Shape (length of each axis) of the output (``s[0]`` refers to axis 0, |
| 1041 | ``s[1]`` to axis 1, etc.). This corresponds to `n` for ``ifft(x, n)``. |
| 1042 | Along each axis, if the given shape is smaller than that of the input, |
| 1043 | the input is cropped. If it is larger, the input is padded with zeros. |
| 1044 | if `s` is not given, the shape of the input along the axes specified |
| 1045 | by `axes` is used. See notes for issue on `ifft` zero padding. |
| 1046 | axes : sequence of ints, optional |
| 1047 | Axes over which to compute the FFT. If not given, the last two |
| 1048 | axes are used. A repeated index in `axes` means the transform over |
| 1049 | that axis is performed multiple times. A one-element sequence means |
| 1050 | that a one-dimensional FFT is performed. |
| 1051 | norm : {"backward", "ortho", "forward"}, optional |
| 1052 | .. versionadded:: 1.10.0 |
| 1053 | |
| 1054 | Normalization mode (see `numpy.fft`). Default is "backward". |
| 1055 | Indicates which direction of the forward/backward pair of transforms |
| 1056 | is scaled and with what normalization factor. |
| 1057 | |
| 1058 | .. versionadded:: 1.20.0 |
| 1059 | |
| 1060 | The "backward", "forward" values were added. |
| 1061 | |
| 1062 | Returns |
| 1063 | ------- |
| 1064 | out : complex ndarray |
| 1065 | The truncated or zero-padded input, transformed along the axes |
| 1066 | indicated by `axes`, or the last two axes if `axes` is not given. |
| 1067 | |
| 1068 | Raises |
| 1069 | ------ |
| 1070 | ValueError |
| 1071 | If `s` and `axes` have different length, or `axes` not given and |
| 1072 | ``len(s) != 2``. |
| 1073 | IndexError |
| 1074 | If an element of `axes` is larger than than the number of axes of `a`. |
| 1075 |
nothing calls this directly
no test coverage detected