def fourier_series(x, *a):
output = <NUM_LIT:0><EOL>output += a[<NUM_LIT:0>]/<NUM_LIT:2><EOL>w = a[<NUM_LIT:1>]<EOL>for n in range(<NUM_LIT:2>, len(a), <NUM_LIT:2>):<EOL><INDENT>n_ = n/<NUM_LIT:2><EOL>val1 = a[n]<EOL>val2 = a[n+<NUM_LIT:1>]<EOL>output += val1*np.sin(n_*x*w)<EOL>output += val2*np.cos(n_*x*w)<EOL><DEDENT>return output<EOL>
Arbitrary dimensionality fourier series.

The first parameter is a_0, and the second parameter is the interval/scale
parameter.

The parameters are altering sin and cos paramters.

n = (len(a)-2)/2