# finding fourier coefficient of a parametric curve [closed]

There is a function in mathematica FourierCoefficient for finding fourier coefficients of a periodic function, but it requires the mathematical expression as input. What if I don't have such mathematica expression, but I have the coordinate points of the curve for one period?

Suppose I have the following coordinate points for a curve that looks approximately like a sine curve:

xCoord={{t1,x1},{t2,x2},{t3,x3}...}
yCoord={{t1,y1},{t2,y2},{t3,y3}...}


t is the parameter for the parametric curves, and x,y are the corresponding coordinates, so the coordinates are actually (x1,y1),(x1,y1),(x1,y1). It is also periodic in the y-direction, so the x-coordinates will vary between two values. How do I find the fourier coefficients for such a periodic curve?

thanks

Edit:

So after doing some rotation and translation to my curve, I get the following. I then follow the online tutorial on DFT in Mathematica: .

The plot makes sense to me, but how do I extract various fourier coefficients from the second plot? Basically what I want to do is to compare the magnitude of various fourier coefficients to determine how closely it resembles a sine/cosine curve, so I really need to the fourier coefficients.

## closed as off-topic by Daniel Lichtblau, Feyre, Young, Michael E2, WjxAug 27 '16 at 9:53

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Daniel Lichtblau, Feyre, Young, Michael E2, Wjx
If this question can be reworded to fit the rules in the help center, please edit the question.

• Can you please generate a minimal data set for experimentation. – yarchik Aug 26 '16 at 10:35

One thing you can do is to generate the complex-number sequence {{x1+Iy1}, {x2+Iy2}...} and then use Fourier. This is sometimes called the "Fourier Descriptor" and there is a demonstration at demonstrations.wolfram.com/FourierDescriptors

Here's a simple example. First, make up some data that form a parametric plot

x = Table[Sin[t], {t, -10, 10, 0.1}];
y = Table[t^2, {t, -3, 3, 0.03}];


Now take the DFT of the sequence:

Fourier[x + I y]


You will probably want to look at the help file for Fourier to get the best set of options.

You can get your original curve back using the inverse DFT... InverseFourier. This gives you a list of complex numbers which you then interpret as the x and y coordinates for your parametric plot. Continuing the above example:

invz = InverseFourier[z];

returns exactly the same plot. If you leave out some of the higher frequency values in invz, you get a low pass filtering (smoothing) of the parametrized curve.