I am trying to program a Fourier Series equation that I will use for a normed fit that is not a least squares fit. If I write
f[t_]:= a[[1]]/2 + Sum[a[[2 k]] Sin[2 k π t] + a[[2 k + 1]] Cos[2 k π t], {k, 1, kMax}]
the equation compiles. However, I cannot use it later. I believe the problem is that I have not defined the coefficients correctly.
Can anyone tell me how to define this equation? I want to create a list of the function at points on an interval for which I have other data to be fitted, so I can create an error function and minimize for the best fit coefficients. I am trying to create the function with unknown coefficients, so I can use a range of norm functions.
a
andkMax
, as well ast
. $\endgroup$