This is the problem in the book 'Classical and multilinear harmonic analysis, volume 1'
Let $f(x)=\sum_{n=0}^{N}[a_{n}\cos{2\pi nx}+b_{n}\sin{2\pi nx}]$ be a nonnegative function defiend on $[0,1]$. Show that there exists an complex sequence $\{c_{n} \}_{n=0}^{N}$ such that $$f(x)=|\sum_{n=0}^{N}c_{n}e^{2\pi inx}|^2$$
I have no idea. How can we use the property that $f$ is a positive function?