I have 10 cosine waves of the form $\cos(2\pi(x f_n+\varphi_n))$, where $f_n$, the frequency, is an integer from 1 to 10 and $\varphi_i$, the phase, is a number from 0 to 1:
$$s(x) = \sum\limits_{n=1}^{10} \cos\left(2\pi (x n+ \varphi_n)\right), \quad \varphi_i \in [0,1]$$
If I set all the phases to 0, $m = \max\limits_x \lvert s(x)\rvert$ peaks as high as 10. All phases at 0.25 peaks at 7.596. Setting the phase to any linear function of freq just moves the waveform, keeping the peak the same. But making the phases random can sometimes get the peaks below 5!
Is there a more systematic way (other than picking random phases and hoping for the best) to minimize the peak of these cosines?
Edit:
I think the peak has to be bigger than $\sqrt{5}$ (amplitude of square wave with same RMS as signal above). Also, after 3 million attempts of brute force guessing, the lowest peak was 3.576. The phases still don't have any sort of pattern to them, though.
