Hey DavidB.

If you want to generate a fourier series you can "project" a data set (or signal) to an orthogonal basis which is made up of sines and cosines (as well as the linear term corresponding to 1 or cos(0)).

The assumption is though that your function is periodic in that it satisfies f(x+a) = f(x) for some value of a that is finite.

If you want to do this then you need to calculate the appropriate integral using your data points where the projection function involves the integral of d*sin(ax)*f(x)dx [e,f] where the constants all depend on the location of your function, the wavelength and the harmonic.