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?

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.

  • 1
    $\begingroup$ I've tried to formally note down your question a little more mathematician-like, so that there's no misunderstanding. Could you please confirm that the formulas say exactly what you meant to say? Also, are all the phases different, or can multiple phases be the same? $\endgroup$ May 22 '19 at 11:56
  • $\begingroup$ By the way, your problem is extremely similar to the problem of PAPR reduction in OFDM systems that use *PSK on their subcarriers. $\endgroup$ May 22 '19 at 12:40
  • $\begingroup$ @MarcusMüller The big formula is correct, although this part: "where fi, the frequency, fn is an integer from 1 to 10" doesn't make sense to me. Did you mean to remove "fi"? $\endgroup$
    – usernumber
    May 22 '19 at 12:49
  • $\begingroup$ ah, typo! better? $\endgroup$ May 22 '19 at 13:07
  • $\begingroup$ @MarcusMüller yep! $\endgroup$
    – usernumber
    May 22 '19 at 13:12

You can get pretty good results with an approximate linear chirp spread out over the period:

$$s(x) = \sum\limits_{n=1}^{N} \cos\left(2\pi \left(x n+ \frac{n^2}{2\times N}\right)\right), \quad N=10$$

$$m \approx 4.28$$

enter image description here

Group delay is the derivative of the phase with respect to frequency. For a linear (frequency as function of time) chirp, the phase should be a quadratic function of frequency. With discrete frequencies we don't get exactly that, but all frequencies seem to roughly find their slot in time if we sample the phase function. I wonder if a ping pong chirp would be possible here and if it would give a flatter envelope.

  • 1
    $\begingroup$ Your function actually looks similar to the bruteforced one: i.imgur.com/8o311xj.png (yours is the blue on the top). $\endgroup$
    – usernumber
    May 22 '19 at 15:49
  • 1
    $\begingroup$ The linear chirp is a great idea! Because we know that according to Parseval, the energy in the sum needs to be constant, no matter the phase offsets. Thus, a choice of phase offsets that distributes energy as evenly as possible in the spectrum is a good choice. A linear chirp distributes energy evenly over all frequencies :) $\endgroup$ May 22 '19 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.