harmonica.filters.ifft#
- harmonica.filters.ifft(fft_grid, *, prefix='freq_')[source]#
Compute the inverse Fast Fourier Transform of a 2D regular grid.
If the frequency coordinates have a shift attribute, it will be used to shift the coordinates in the spatial domain to such value.
Important
Assumes that the
fft_gridis shifted: it was passed tonumpy.fft.fftshift. The outputs of theharmonica.filters.fftfunction satisfy this condition.- Parameters:
- fft_grid
xarray.DataArray Array with a regular grid defined in the frequency domain. Its dimensions should be in the following order: freq_northing, freq_easting.
- prefix
str,optional Prefix used for the name of the frequency coordinates and dimensions.
- fft_grid
- Returns:
- grid
xarray.DataArray Array with the inverse Fourier transform of the passed grid.
- grid
Notes
This function implements the discrete inverse Fourier Transform of 2D regular grids. It’s based on the following definition of the inverse Fourier Transform of a \(G:\mathbb{R}^2 \rightarrow \mathbb{R}\) function in the frequency domain:
\[\mathcal{F}^{-1}[G](f_x, f_y) = \int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} G(f_x, f_y) e^{2 \pi i f_x x} e^{2 \pi i f_y y} \text{d}f_x \text{d}f_y\]If we consider two discretized spaces for the \(f_x\) and \(f_y\) frequencies, both evenly spaced with steps equal to \(\Delta f_x\) and \(\Delta f_y\), respectively, then the \((n, m)\) element of the discrete inverse Fourier Transform of \(G\) can be defined as follows:
\[\mathcal{F}^{-1}[G]_{(n, m)} = \sum\limits_{j=0}^{N-1} \sum\limits_{k=0}^{M-1} G(f_x_j, f_y_k) e^{2 \pi i f_x_j x_n} e^{2 \pi i f_y_k y_m} \Delta f_x \Delta f_y\]This function differs from the plain
numpy.fft.ifftnfunction since it implements the true amplitude and the true phase corrections.