I have a large list of pairs of values (x, f(x)). Importantly, the distance between each value of x is not consistent. For instance, x might be 2, then 3, then 7, then 9.
How would I use this data to find a Fourier Series?
I have a large list of pairs of values (x, f(x)). Importantly, the distance between each value of x is not consistent. For instance, x might be 2, then 3, then 7, then 9.
How would I use this data to find a Fourier Series?
Use least squares $$\min_c J(c),\qquad J(c)= \sum_{k=1}^K|\sum_{n=0}^{N-1} c_n e^{2i\pi n x_k}-f(x_k)|^2$$ As every least square problem the solution is found from $c$ such that $\partial J(c)=0$, which is a linear equation in $c$. There are some gradient descent algorithms to solve for $c$ where $NK$ is large.
Often we add a regularization term, replacing $J(c)$ by $J(c)+\epsilon \|c\|^2$.