harmonica.filters.fft

Contents

harmonica.filters.fft#

harmonica.filters.fft(grid, *, prefix='freq_')[source]#

Compute Fast Fourier Transform of a 2D regular grid.

Parameters:
gridxarray.DataArray

A two dimensional xarray.DataArray whose coordinates are evenly spaced (regular grid). Its dimensions should be in the following order: northing, easting. Its coordinates should be defined in the same units.

prefixstr, optional

Prefix used for the name of the frequency coordinates and dimensions.

Returns:
fourier_transformxarray.DataArray

Array with the Fourier transform of the original grid.

Notes

This function implements the discrete Fourier Transform of 2D regular grids. It’s based on the following definition of the Fourier Transform of a \(g:\mathbb{R}^2 \rightarrow \mathbb{R}\) function in the spatial domain:

\[\mathcal{F}[g](f_x, f_y) = \int\limits_{-\infty}^{\infty} \int\limits_{-\infty}^{\infty} g(x, y) e^{-2 \pi i f_x x} e^{-2 \pi i f_y y} \text{d}x \text{d}y\]

If we consider two discretized spaces for \(x\) and \(y\), both evenly spaced with steps equal to \(\Delta x\) and \(\Delta y\), respectively, then the \((k, j)\) element of the discrete Fourier Transform of \(g\) can be defined as follows:

\[\mathcal{F}[g]_{(j, k)} = \sum\limits_{n=0}^{N-1} \sum\limits_{m=0}^{M-1} g(x_n, y_m) e^{-2 \pi i f_x_j x_n} e^{-2 \pi i f_y_k y_m} \Delta x \Delta y\]

This function differs from the plain numpy.fft.fftn function since it implements the true amplitude and the true phase corrections.