intvert.mp_idft

mp_idft(signal)

Compute the 1D inverse discrete Fourier transform of a signal.

This function computes the inverse of the 1D discrete Fourier transform along the last axis of signal, at the precision specified by the current gmpy2 context.

Parameters:

signal (array_like) – Input signal, can be complex.

Returns:

The 1D inverse DFT of signal along the last axis.

Return type:

mpc ndarray

See also

mp_dft

inverse of mp_idft

mp_idft2

analogous 2D function

Notes

This function is implemented with mp_dft. For conventions and algorithm notes, see mp_dft.

Examples

When more than 53 bits of precision are used, mp_dft and mp_idft yield higher numerical accuracy than numpy.fft.fft() and numpy.fft.ifft():

>>> signal = np.arange(19)
>>> max(abs(np.fft.ifft(np.fft.fft(signal)) - signal))
np.float64(3.552713678800501e-15)
>>> with gmpy2.context() as c:
...     c.precision = 200
...     max(abs(intvert.mp_idft(intvert.mp_dft(signal)) - signal))
...
mpfr('2.994393295486490319393192740125243605675578124979580666244333e-59',200)