real.fft | R Documentation |
Fast calculation of the real Fourier transform. This is a wrapper function for a C function which uses the complex FFT function from the 'fftw3' library.
real.fft(w,n,inv=TRUE,indFFT=NULL)
w |
A spatial field in a stacked vector of length N=n^2. |
n |
Number of grid points on each axis. n x n is the total number of spatial points. |
inv |
Indicates whether the inverse Fourier transform should be calculated or not. |
indFFT |
A list of containing vectors of natural numbers representing indices used to transform between the real and the complex Fourier transform. |
A vector of length n*n containing the real (inverse) Fourier transformation of 'w'.
Fabio Sigrist
n <- 100
spec <- matern.spec(wave=spate.init(n=n,T=1)$wave,n=n,rho0=0.05,sigma2=1,norm=TRUE)
sim <- real.fft(sqrt(spec)*rnorm(n*n),n=n,inv=FALSE)
image(1:n,1:n,matrix(sim,nrow=n),main="Sample from Matern field",xlab="",ylab="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.