intvert.mp_dft
- mp_dft(signal)
Compute the 1D discrete Fourier transform of a signal.
This function computes the 1D discrete Fourier transform (DFT) along the last axis signal at the precision specified by the current gmpy2 context.
- Parameters:
signal (array_like) – Input signal, can be complex.
- Returns:
The 1D DFT of signal along the last axis.
- Return type:
mpc ndarray
Notes
The algorithm used by this procedure depends on the current precision of the gmpy2 context. If the current precision is at most double, the input is cast to numpy floats and the Fast Fourier transform is computed with the
numpy.fft.fft()procedure. If the precision of the current context is greater than 53 bits, the DFT is computed with standard matrix-vector multiplication.The DFT convention used in this implementation is
\[\tilde{x}_k = \sum_{n = 0}^{N - 1}x_n e^{-2\pi{\rm i}nk/N},\]where \({\bf x}\) is an array of length N. The inverse DFT is given by
\[x_n = \frac{1}{N}\sum_{k = 0}^{N - 1}\tilde{x}_k e^{2\pi{\rm i}nk/N}.\]