- #1
Ben Wilson
- 90
- 16
I have a function of 2 variables [f(x,y)] where if there was an ellipse in the x-y plane, all values of the function are 1 inside the ellipse and 0 outside. I can plot this function as a surface in 3d where it looks like an elevated ellipse hovering over an elliptical hole in a sheet.
My problem is this, the Fourier transform of this shape [F(x,y)] can be found analytically by using a new coordinate (e.g. chi = sqrt( ax ^2 + by ^2)), resulting in a bessel function divided by chi [ proportional to J(chi)/chi].
I would like to find F numerically in MATLAB but I have no idea how to do this. Previously I could do FT's of single variable functions ( for instance a boxcar function) by creating a vector x and k and then doing something like this:
for length k
F = 0
for length x
F = F + f*exp(-i k x)
end
end
For two variables however, I created a meshgrid for x and y and defined f using that. Should I do something else?
My problem is this, the Fourier transform of this shape [F(x,y)] can be found analytically by using a new coordinate (e.g. chi = sqrt( ax ^2 + by ^2)), resulting in a bessel function divided by chi [ proportional to J(chi)/chi].
I would like to find F numerically in MATLAB but I have no idea how to do this. Previously I could do FT's of single variable functions ( for instance a boxcar function) by creating a vector x and k and then doing something like this:
for length k
F = 0
for length x
F = F + f*exp(-i k x)
end
end
For two variables however, I created a meshgrid for x and y and defined f using that. Should I do something else?