def ifft(x, n=None, axis=-<NUM_LIT:1>, overwrite_x=False):
tmp = _asfarray(x)<EOL>try:<EOL><INDENT>work_function = _DTYPE_TO_FFT[tmp.dtype]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError("<STR_LIT>" % tmp.dtype)<EOL><DEDENT>if not (istype(tmp, numpy.complex64) or istype(tmp, numpy.complex128)):<EOL><INDENT>overwrite_x = <NUM_LIT:1><EOL><DEDENT>overwrite_x = overwrite_x or _datacopied(tmp, x)<EOL>if n is None:<EOL><INDENT>n = tmp.shape[axis]<EOL><DEDENT>elif n != tmp.shape[axis]:<EOL><INDENT>tmp, copy_made = _fix_shape(tmp,n,axis)<EOL>overwrite_x = overwrite_x or copy_made<EOL><DEDENT>if n < <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % n)<EOL><DEDENT>if axis == -<NUM_LIT:1> or axis == len(tmp.shape) - <NUM_LIT:1>:<EOL><INDENT>return work_function(tmp,n,-<NUM_LIT:1>,<NUM_LIT:1>,overwrite_x)<EOL><DEDENT>tmp = swapaxes(tmp, axis, -<NUM_LIT:1>)<EOL>tmp = work_function(tmp,n,-<NUM_LIT:1>,<NUM_LIT:1>,overwrite_x)<EOL>return swapaxes(tmp, axis, -<NUM_LIT:1>)<EOL>
Return discrete inverse Fourier transform of real or complex sequence.

The returned complex array contains ``y(0), y(1),..., y(n-1)`` where

``y(j) = (x * exp(2*pi*sqrt(-1)*j*np.arange(n)/n)).mean()``.

Parameters
----------
x : array_like
    Transformed data to invert.
n : int, optional
    Length of the inverse Fourier transform.  If ``n < x.shape[axis]``,
    `x` is truncated.  If ``n > x.shape[axis]``, `x` is zero-padded.
    The default results in ``n = x.shape[axis]``.
axis : int, optional
    Axis along which the ifft's are computed; the default is over the
    last axis (i.e., ``axis=-1``).
overwrite_x : bool, optional
    If True, the contents of `x` can be destroyed; the default is False.

Returns
-------
ifft : ndarray of floats
    The inverse discrete Fourier transform.

See Also
--------
fft : Forward FFT

Notes
-----
This function is most efficient when `n` is a power of two, and least
efficient when `n` is prime.

If the data type of `x` is real, a "real IFFT" algorithm is automatically
used, which roughly halves the computation time.