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
Notes
This function is implemented with
mp_dft. For conventions and algorithm notes, seemp_dft.Examples
When more than 53 bits of precision are used,
mp_dftandmp_idftyield higher numerical accuracy thannumpy.fft.fft()andnumpy.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)