I have a series of discrete values that are periodic and I am looking to calculate the Fourier series of it. I learnt all of this in college but I can't for the life of me remember now.
The discrete series is as follows [18,17,16,12,8,5,5,8,12,14,16,17].
Using WolframAlpha I calculated that the FFT is as follows: {42.7239+0. i, 10.7348-2.01036 i, -1.58771+1.75 i, 0.288675-0.288675 i, -0.144338-0.25 i, 0.234828-0.010363 i, 0.57735+0. i, 0.234828+0.010363 i, -0.144338+0.25 i, 0.288675+0.288675 i, -1.58771-1.75 i, 10.7348+2.01036 i}
How do I transform this into a fourier series (sines and cosines)?
Wolfram says:
The coefficients $\nu_s$ is what W|A produced, and the second formula says how the original data is expressed in terms of them.
Following the formula, we end up with $$\frac{1}{\sqrt{12}}\left(42.7239 + (10.7348-2.01036 i)e^{-2\pi i (r-1)}+ (-1.58771+1.75 i)e^{-2\pi i 2(r-1)}+( 0.288675-0.288675 i)e^{-2\pi i 3(r-1)}+ (-0.144338-0.25 i)e^{-2\pi i 4(r-1)}+ (0.234828-0.010363 i)e^{-2\pi i 5(r-1)} + (0.57735)\cos( 2\pi 6 (r-1)) +\dots \right)$$ where I took some action beginning with the middle term (Nyquist frequency): it is purely cosine (real). The terms after it are conjugates of preceding ones, so do not need to be written down: we'll just double the real parts of those before.
The (unpolished) result is $$\frac{1}{\sqrt{12}}\left(42.7239 + 2\left[(10.7348\cos (-2\pi (r-1)) -2.01036\sin(-2\pi (r-1)) -1.58771\cos (-4\pi (r-1)) +1.75 \sin( -4\pi (r-1)) + 0.288675 \cos(-6 \pi (r-1)) - 0.288675 \sin (-6 \pi(r-1)) + (-0.144338) \cos(-8\pi (r-1)) -0.25 \sin(-8\pi 4(r-1))+ 0.234828\cos( -10\pi (r-1)) -0.010363\sin( -10\pi (r-1))\right] + 0.57735\cos( 12\pi (r-1)) \right)$$
Clearly, the minus signs within cosines are redundant, and from the sines they can be pulled out.
But my suggestion is: instead of WolframAlpha, use some software that allows you to continue such computations automatically, e.g., Scilab or Matlab.