Gridded evaluation of samples from the real ensemble of Gaussian random plane waves in two and three dimensions. MATLAB code driving NUFFT library.
These codes evaluates on a regular square (d=2) or cubical (d=3) grid of points a real-valued function u drawn at random from a certain Gaussian random field with zero mean, unit variance, and an isotropic (radially symmetric) autocorrelation function. There are two cases:
- alpha=1: "monochromatic" random plane waves. u is the real part of the Fourier transform of Gaussian white noise living on the unit circle or sphere. This is M. V. Berry's 1977 model for chaotic eigenfunctions. In other words,
where for each j, aj is iid random from a complex Gaussian (ie real and imaginary parts are iid Gaussian with zero mean and unit variance), and nj is iid uniformly randomly drawn from the unit circle or sphere with the usual Haar measure. In terms of distance r, the autocorrelation function of u is the J0(r) Bessel function in 2D, or the spherical Bessel j0(r) = sin(r)/r in 3D. For some pictures in 2D see https://math.dartmouth.edu/~ahb/rpws/
- alpha=0: "Fubini-Study ensemble". u is the real part of the Fourier transform of Gaussian white noise uniformly filling the unit disc or ball. This is locally the same as a random homogeneous polynomial evaluated on the unit sphere Sd, in the limit of large degree (zooming in to a patch of the sphere it becomes Euclidean space). Its autocorrelation function has faster decay than for alpha=1, although it is still oscillatory.
From either MATLAB or octave:
-
[u x] = rpw2dnufft(M, ppw, alpha);
outputs a 2DM
-by-M
grid of function valuesu
at the coordinates given byx
along both axes, withppw
grid points per wavelength.alpha
is 0 or 1 as described above. -
[u x] = rpw3dnufft(M, ppw, alpha);
outputs a 3DM
-by-M
-by-M
grid of function valuesu
at the coordinates given byx
along all three axes, withppw
grid points per wavelength.alpha
is 0 or 1 as described above.
See the MATLAB help documentation for these two functions for more options, and timing information.