# How to implement a Fourier series?

I've got a Fourier series (amplitude An and phase Phi, see below) 12 terms which I would like to implement in Mathematica. The Fourier series is given in terms of An*Sin[n*tn+Phi] where tn is the time (0 to 7.5 seconds).

I do not fully understand how the FourierSeries support function operates. Can anybody help me out to implement this?

An = {28.38975, 37.58583, 21.02345, 7.665592, 4.809436, 4.181973, 1.940692, 0.5870049, 1.181256, 0.84039, 0.02259011, 0.3071458, 0.3226207};
An = An/100;
Phi = {0.0, 0.08367674, -1.486758, 2.865675, 0.1677238, 4.630239, 3.088379, -0.3053668, 4.410703, 3.181538,1.242886, 4.156753, 2.946186};


Is this what you want...

Sum[An[[n]] Sin[n tn + Phi[[n]]], {n, 1, Length[An]}]

Out[1]= -0.00587005 Sin[0.305367 - 8 tn] -
0.210235 Sin[1.48676 - 3 tn] + 0.283898 Sin[0. + tn] +
0.375858 Sin[0.0836767 + 2 tn] + 0.0766559 Sin[2.86568 + 4 tn] +
0.0480944 Sin[0.167724 + 5 tn] + 0.0418197 Sin[4.63024 + 6 tn] +
0.0194069 Sin[3.08838 + 7 tn] + 0.0118126 Sin[4.4107 + 9 tn] +
0.0084039 Sin[3.18154 + 10 tn] + 0.000225901 Sin[1.24289 + 11 tn] +
0.00307146 Sin[4.15675 + 12 tn] + 0.00322621 Sin[2.94619 + 13 tn]

• Thank you, I wanted to implement a matlab code, where this is a part of. I believe it should not be a sum but a new vector with twelve new variables. – David Apr 18 at 8:10
• Just change Sum to Table – Jon McLoone Apr 18 at 13:06