I was wondering whether it's possible to do Fourier decomposition using linear regression.
Let me explain this.
Given the samples $(x_1 y_1), \dots, (x_n, y_n)$ with $x_i, y_i \in \mathbb R$, we can maximize the likelihood $$ \begin{pmatrix} y_1 \\ \vdots \\ y_n \end{pmatrix} \sim \mathcal N\left(Xw, I\sigma^2\right) $$ of $y_1, \dots, y_n$ w.r.t. the vector $w$, where $$ X = \begin{pmatrix} \varphi\left(x_1\right) \\ \vdots \\ \varphi\left(x_n\right) \end{pmatrix} $$ and $\varphi : \mathbb R \to \mathbb R^m$ is a non-linear transformation, by choosing $$ w = \left(X^\mathsf{T} X\right)^{-1} X^\mathsf{T} y \text. $$
Clearly, the vector $w$ weights the contribution of the features $\varphi_1, \dots, \varphi_m$ to the linear model.
Now, assume that all $x_i \in \left[0; 1\right]$ and that we choose $$ \varphi_i\left(x\right) = \cos\left( \frac{2\pi}{i} x + \beta_i \right) \text. $$ I believe, that if we knew the correct phase $\beta_i$ of the frequency $2\pi/i$ in the Fourier spectrum $\hat x$ of $x$ on $\left[0; 1\right]$, then $w$ would recover the magnitudes of the frequencies $2\pi/1, \dots, 2\pi/m$ in $\hat x$, wouldn't it? If yes, is there any chance to estimate $\beta_i$? Of course, without actually computing $\hat x$.