fft2d: Compute spatial Fourier power spectrum

Description Usage Arguments Value Author(s) Examples

View source: R/fft2d.R

Description

The Fourier power spectrum of the input field is computed and averaged over shells (bins with width 1) of the modulus of the wavenumber.

Usage

1
fft2d(z)

Arguments

z

matrix or array of input data with spatial dimensions c(N, N). If z is an array the power spectra are averaged over the third dimension. The first two dimensions must be the same (the input fields must be square).

Value

Spectral power (average square of absolute value of spectral amplitudes) for wavenumbers k=1:(N/2).

Author(s)

Jost von Hardenberg, j.vonhardenberg@isac.cnr.it

Examples

1
2
3
4
5
6
7
# Make a synthetic rainfall field with prescribed logarithmic spectral slope
f = initmetagauss(1.7, 64)
r = metagauss(f)
# Check slope of the resulting field
fx <- fft2d(r)
fitslope(fx)
# 1.640373

rainfarmr documentation built on May 1, 2019, 8:02 p.m.