Fourier Transform

Two-dimensional Fourier transform can be accessed using Data ProcessIntegral Transforms2D FFT which implements the Fast Fourier Transform (FFT). Fourier transform decomposes signal into its harmonic components, it is therefore useful while studying spectral frequencies present in the SPM data.

The 2D FFT module provides several types of output:

and some of their combinations for convenience.

Radial sections of the two-dimensional PSDF can be conveniently obtained with 2D PSDF. Several other functions producing spectral densities are described in section Statistical Analysis. It is also possible to filter images in the frequency domain using one-dimensional and two-dimensional FFT filters or simple frequency splitting.

For scale and rotation-independent texture comparison it is useful to transform the PSDF from Cartesian frequency coordinates to coordinates consisting of logarithm of the spatial frequency and its direction. Scaling and rotation then become mere shifts in the new coordinates. The function Data ProcessStatisticsLog-Phi PSDF calculates directly the transformed PSDF. The dimensionless horizontal coordinate is the angle (from 0 to 2π) the vertical is the frequency logarithm. It is possible to smooth the PSDF using a Gaussian filter of given width before the transformation.

Note that the Fourier transform treats data as being infinite, thus implying some cyclic boundary conditions. As the real data do not have these properties, it is necessary to use some windowing function to suppress the data at the edgest of the image. If you do not do this, FFT treats data as being windowed by rectangular windowing function which has really bad Fourier image thus leading to corruption of the Fourier spectrum.

Gwyddion offers several windowing functions. Most of them are formed by some sine and cosine functions that damp data correctly at the edges. In the following windowing formula table the independent variable x is from interval [0, 1] which corresponds to the normalized abscissa; for simplicity variable ξ = 2πx is used in some formulas. The available windowing types include:

Rect0.5 at edge points, 1 everywhere else
Kaiser α , where I0 is the modified Bessel function of zeroth order and α is a parameter

Windowing functions: Hann, Hamming, Blackmann, Lanczos, Welch, Nutall, Flat-top, Kaiser 2.5.

Envelopes of windowing functions frequency responses: Hann, Hamming, Blackmann, Lanczos, Welch, Nutall, Flat-top, Kaiser 2.5.

Fourier transforms of data with sizes that are not factorable into small prime factors can be very slow – and many programs only implement FFT of arrays with dimensions that are powers of two.

In Gwyddion, however, the Fourier transform can be applied to data fields and lines of arbitrary dimensions, with no data resampling involved (at least since version 2.8). Fourier transforms are calculated either using the famous FFTW library or, if it is not available, using Gwyddion built-in routines that are slower but can also handle transforms of arbitrary size.

Nevertheless, if the data size is not factorable into small prime factors the transform is still considerably slower. Hence it is preferable to transform data fields of nice sizes.