udvat 115 Report post Posted November 14, 2010 Would anyone please write for me the multivariate(two variables will do) Fourier series in trigonometric form? 0 Share this post Link to post Share on other sites
Emergent 982 Report post Posted November 15, 2010 I'm pretty sure the following is correct... (All this is for an AABB in n dimensions):For each wavevector 'w,' you have two basis functions, x --> k cos(<w, x>)and x --> k sin(<w, x>)where <.,.> denotes the Euclidean inner product in R^n and k is a constant chosen to make the functions' L2 norms be 1 (things are just nicer that way); I'll get to it later. Assuming your domain is an AABB in n dimensions, with side lengths L_1,L_2,...,L_n, those wavevectors are any whose coefficients satisfy,w_i = (2 pi j_i)/L_ifor some integers j_1,...,j_n >= 0.Finally, the normalizing constant is,k = [(1/2) L1 L2 ... Ln]^(-1/2)for all basis functions except the one corresponding to the zero wavevector (for that one, get rid of the (1/2)).The coefficients, then, are the L2 inner products of those basis functions with the function you want to approximate (i.e., the integral over the box of their product).To summarize,where "=" in each case is in the L2 sense. I.e., two functions are "equal" iff the integral of the square of their difference is zero.Let me know if I've made a mistake somewhere....Also...1.) The square roots are nice theoretically because they give you an orthonormal basis instead of just an orthogonal one. But square roots aren't great computationally, so you can get rid of the 'k' in the second equation in my LaTeX box and remove the square root from the definition of 'k' on the 6th line, if you prefer.2.) If you're just truncating the sum by using, say, all the wavevectors in a box around the origin, then this isn't an issue... but, in the infinite case, the order in which you iterate matters; you need to reach each bounded index in a finite number of iterations. A "Cantor diagonalization"-like order will do that. I.e., do all the wavevectors whose wavenumber vector has a 1-norm of 1, then all those whose 1-norm is 2, etc. You can do that like, // In this pseudocode, arrays are 1-basedfor s[n] = 0 to infinity{ for s[n-1] = 0 to s[n] { i[n] = s[n]-s[n-1]; for s[n-2] = 0 to s[n-1] { i[n-1] = s[n-1]-s[n-2]; //... for s[1] = 0 to s[2] { i[2] = s[2] - s[1]; i[1] = s[1]; // Do something with index vector 'i.' } } }}or, for prettier code, with a nice iterator object......Also, all this said, I should probably ask what you're doing; you might actually want the DFT, DCT, or even something else...[Edited by - Emergent on November 15, 2010 10:52:54 PM] 0 Share this post Link to post Share on other sites
udvat 115 Report post Posted November 16, 2010 Hi Emergent,Thank you very much. You described it very nicely, it is a greathelp indeed.I just want to fit my data using matlab surface fitting tool box.So I need to use the multivariate Fourier series to see whetherI can represent my data using Fourier basis.Thanks again.:) 0 Share this post Link to post Share on other sites
Steve132 433 Report post Posted November 16, 2010 out of curiosity, is there any reason you don't simply use the fourier transform to do fit your data to the basis? It has built-in and well-tested fast 1-d,2-d and n-d implementations in matlab. 0 Share this post Link to post Share on other sites
udvat 115 Report post Posted November 17, 2010 I am using surface fitting tool(sftool) of matlab.It does not have library model for Fourier.However it has an option for custom model. So I needthe Fourier equation to make the custom model work as Fourier for me. 0 Share this post Link to post Share on other sites
Steve132 433 Report post Posted November 17, 2010 Right, I get that, but have you thought that maybe the surface fit tool doesn't include fourier basis functions because it is easier and more efficient to fit the surface using fft2? 0 Share this post Link to post Share on other sites