MATLAB: Can I use the spectral decomposition in the fourier transform (fftn) to find function values on a different grid

fftnfourier transformgrid pointsifftninverse fourier transformMATLAB

Say I have a 2-variable function Z = f(X,Y) on some grid. For instance
x =1:3; y=1:3; [X,Y] = meshgrid(x,y);
Z = X.^2 + Y.^2;
I can take the fourier transform of this function by
Z_f = fftn(Z);
And if I now take the inverse fourier transform, I re-obtain the function on the grid that I started with.
My question is, if I define new grid points, e.g.
x = [0.5,1.5,2.5]; y=[0.5,1.5,2.5]; [Xn,Yn] = meshgrid(x,y);
is it possible, from the spectral decomposition of Z, i.e., Z_f, to obtain (an approximation) to the values of the function f on the new grid points [Xn,Yn]. I.e. something like
Zn = ifftn(Z_f,Xn,Yn)?

Best Answer

Hi,
There is no function for directly calculating functional values for a new set of grid points given the 2D Fourier transform of an old set of grid points.
As a workaround one can calculate the inverse Fourier transform on the Fourier transformed data Z_f and apply interp2 on the newly found data so that the functional values can be calculated on new set of grid points.
Hope this helps!