I would like to construct a surface on a 2D mesh, given a set of Fourier coefficients for the original function $V(x,y)$.
Given some $\mathbb{K}\subset \mathbb{Z}^2$ I have a partial double sum of a Fourier series for $V(x,y)$, which could be some potential, for example
$V(x,y)=\frac{1}{\sqrt{x^2+y^2}}$
then
$f(x,y)=\sum_{(j,k)\in \mathbb{K}} v_{j,k} \exp(2 \pi i \cdot (jx+ky))$.
I am going to use Matlab for this to begin with so my question:
How can I generate a finite set of Fourier coefficients given $V$ in Matlab?
Once I have these coefficients what would the best method to plot them in 3D/contour plot?
F=fft2(V);surf(F)
whereV
is evaluated on a 2d grid? $\endgroup$f = ifft2(v); surf(f)
(ifft2(fft2(V))=V
by definition of the inverse transform). This assumes that $\mathbb{K}$ is rectangular and uniformly spaced; if $\mathbb{K}$ is arbitrary, you'd need to use the nonuniform Fourier transform (e.g., NUFFT). $\endgroup$