I don't understand the documentation of Fourier
. My goal is the get the coefficients of the Fourier-series (i.e. $\sum_{n\in \mathbb{Z}} c_{n,m} e^{inx+imy}$) of data points which looks like this: {{datapoint1,{x,y}},...}
However, according to its docs Fourier
only seems to handle lists of data points without any coordinates attached to them, pretending they are one unity apart. Although the "Details and Options" section of the documentation does say that it can parse nested lists to account for data in any dimensions, unfortunately no example is given to e.g. interpret the output.
Is there no built in function to get the coefficients of this series? This should be done numerically, unless the analytical approach works for arbitrary data sets. I do not have a workable expression for the generator of these points, NFourierTransform
does not work.
Should I use some fitting functions instead? If so, which one is best for Fourier transforms?
Fourier
works on regularly/uniformly sampled data. Are your{x,y}
coordinates uniform and are they sorted properly? If so you could just doFourier[data[[All, All, 1]]]
. If not, you'll need to sample it first. $\endgroup$Fourier
even know it should return to me the coefficients of a 2D fourier series? The way you write it, I again just get a list of datapoints, but I have lost all information on where they once where? I edited my question to account for another comment in the docs. $\endgroup$Fourier
on an array of numbers, it will output an array of the same dimension but full of complex numbers. It also says in the docs thatFourier
is equivalent to multiplication with aFourierMatrix
. If you go to the docs forFourierMatrix
you'll see the layout. $\endgroup$With[{f = 7, n = 50}, data = Table[Cos[2 \[Pi] (f x)/n], {x, n}, {y, n}]; MatrixPlot[Abs[Fourier[data]], ColorFunction -> GrayLevel]]
Here I have set up a cos wave with frequency f=7 (relative to the sample rate of 50). If you look at the brightest pixel, you'll see it appears on row 7+1 because row 1 col 1 is the DC coefficient 0 Hz. There is also the symmetric part at row 50-7+1 (because this is a Real valued signal). If we do the same but change x to y, we get a vertical cos wave, and you get the same thing but with the columns instead of rows. $\endgroup$