Fourier Transform of 2d
Show older comments
Good Morning All,
I am trying to find the coefficients of the fourier transform of a closed 2d shape (namely a small distorted circle). I have been given the coordinates of the shape so in essence the boundary and want to apply the centroid distance shape descriptor. Namely that
s(k)=[(x(t)-xc)^2+(y(t)-yc)^2]^1/2
and the coefficients for the transform is: c(u)=1/N sum(s(k)exp(-2uk*pi/N)) for discrete
Now in order to get x(t) and y(t) I would plot the points and then use interpft. How would I apply this in the matlab FFT2 function? Also if I made any mistakes in my thought process please advise me.
One more thing: should I convert the cartesian points to polar coordinates before applying any of this or leave them.
here is sample data of what I am trying to do but I am receiving error and want to use x(t) not just xt.
X=[100.0000 167.3203 359.0253 410.6382 585.7535 716.6290 712.9424 476.9977 364.5553 185.7535 100.9608 86.2143];
Y=[150.0000 59.9470 107.8733 242.4355 100.5000 235.0622 441.5138 423.0806 529.9931 533.6797 364.0945 170.5461];
t = 10;
Xt = interpft(X,numel(X)*t); %I think this uses fourier basis Yt = interpft(Y,numel(Y)*t);
xc=(1/12)*sum(Xt); yc=(1/12)*sum(Yt);%centroid center but I want X(t)
st=[(Xt-xc)^2+(Yt-yc)^2]^1/2 %centroid distance formula but again I need X(t)
ft=fft2(st) %should give the coefficients?
1 Comment
Andrew Newell
on 17 Jul 2011
Please see http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question for how to format your question.
Accepted Answer
More Answers (0)
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!