intvert.mp_idft2
- mp_idft2(signal)
Compute the 2D inverse discrete Fourier transform of a signal.
This function computes the inverse of the 2D discrete Fourier transform along the last two axes of signal, at the precision specified by the current gmpy2 context.
- Parameters:
signal (array_like) – Input signal, can be complex.
- Returns:
The 2D inverse DFT of signal along the last two axes.
- Return type:
mpc ndarray
Notes
This function is implemented with
mp_dft2. For conventions and algorithm notes, seemp_dft2.Examples
When more than 53 bits of precision are used,
mp_dft2andmp_idft2yield higher numerical accuracy thannumpy.fft.fft2()andnumpy.fft.ifft2():>>> signal = np.arange(30).reshape(5, 6) >>> np.max(abs(np.fft.ifft2(np.fft.fft2(signal)) - signal)) np.float64(7.401486830834377e-17) >>> with gmpy2.get_context() as c: ... c.precision = 200 ... np.max(abs(intvert.mp_idft2(intvert.mp_dft2(signal)) - signal)) ... mpfr('1.9957852381702224870373111645968013799923440139299733596839611e-59',200)