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

Function ifft

numpy/fft/_pocketfft.py:220–321  ·  view source on GitHub ↗

Compute the one-dimensional inverse discrete Fourier Transform. This function computes the inverse of the one-dimensional *n*-point discrete Fourier transform computed by `fft`. In other words, ``ifft(fft(a)) == a`` to within numerical accuracy. For a general description of th

(a, n=None, axis=-1, norm=None, out=None)

Source from the content-addressed store, hash-verified

218
219@array_function_dispatch(_fft_dispatcher)
220def ifft(a, n=None, axis=-1, norm=None, out=None):
221 """
222 Compute the one-dimensional inverse discrete Fourier Transform.
223
224 This function computes the inverse of the one-dimensional *n*-point
225 discrete Fourier transform computed by `fft`. In other words,
226 ``ifft(fft(a)) == a`` to within numerical accuracy.
227 For a general description of the algorithm and definitions,
228 see `numpy.fft`.
229
230 The input should be ordered in the same way as is returned by `fft`,
231 i.e.,
232
233 * ``a[0]`` should contain the zero frequency term,
234 * ``a[1:n//2]`` should contain the positive-frequency terms,
235 * ``a[n//2 + 1:]`` should contain the negative-frequency terms, in
236 increasing order starting from the most negative frequency.
237
238 For an even number of input points, ``A[n//2]`` represents the sum of
239 the values at the positive and negative Nyquist frequencies, as the two
240 are aliased together. See `numpy.fft` for details.
241
242 Parameters
243 ----------
244 a : array_like
245 Input array, can be complex.
246 n : int, optional
247 Length of the transformed axis of the output.
248 If `n` is smaller than the length of the input, the input is cropped.
249 If it is larger, the input is padded with zeros. If `n` is not given,
250 the length of the input along the axis specified by `axis` is used.
251 See notes about padding issues.
252 axis : int, optional
253 Axis over which to compute the inverse DFT. If not given, the last
254 axis is used.
255 norm : {"backward", "ortho", "forward"}, optional
256 Normalization mode (see `numpy.fft`). Default is "backward".
257 Indicates which direction of the forward/backward pair of transforms
258 is scaled and with what normalization factor.
259
260 .. versionadded:: 1.20.0
261
262 The "backward", "forward" values were added.
263
264 out : complex ndarray, optional
265 If provided, the result will be placed in this array. It should be
266 of the appropriate shape and dtype.
267
268 .. versionadded:: 2.0.0
269
270 Returns
271 -------
272 out : complex ndarray
273 The truncated or zero-padded input, transformed along the axis
274 indicated by `axis`, or the last one if `axis` is not specified.
275
276 Raises
277 ------

Callers 3

irfftnFunction · 0.85
test_fft_out_argumentMethod · 0.85

Calls 2

asarrayFunction · 0.90
_raw_fftFunction · 0.85

Tested by 2

test_fft_out_argumentMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…