# Expected value of sum of N sines with random phase differences

This is a follow-up to this question. It discusses the amplitude of a sum of $$N$$ functions of the form $$a\sin(kx+c)$$

$$\sum_{i=1}^{N} a\sin(kx+c_i)$$

with $$a$$ and $$k$$ constant and $$c_i$$ random numbers between $$0$$ and $$2π$$. Let's assume for the following that the $$c_i$$ are uniformly distributed within those limits. I am interested in the total result of that sum.

It is clear to me, according to for instance this link, that the sum of sine/cosine functions with the same frequency but different phases is again a sine/cosine function of the same frequency, but with different amplitude and phase. The expected value of the new amplitude amounts to $$Na^2$$. However, what happens to the phase of the sum? Intuitively, I would assume that for large $$N$$, the summation of all those sine/cosine functions with different phase tends to zero, as we will have all different shifts of them and there will always be pairs that completely cancel. This means, while we have a non-zero amplitude, the expected value of the phase should be $$0$$, $$π$$ or $$2π$$ when dealing with sine functions, and the total sum turns zero then. Is that assumption correct? How is it possible to calculate the expected value of the total phase, which, again from this link, can be calculated by

$$\tan c=\frac{\sum_{i=1}^{N} \sin c_i}{\sum_{i=1}^{N} \cos c_i}$$?

In addition, I am not sure if it would be the proper way to calculate the expected value of the sum of sines by considering resulting amplitude and phase separately. Wouldn't be the proper way to use something like the law of the unconscious statistician?

Any help and/or literature recommendations are greatly appreciated. I feel this is a rather common problem, but was not able to find useful references.

If you want the expectation of the sum $$\sum_i a\sin(kx+c_i)$$, where $$a$$ and $$k$$ are constant, and each $$c_i$$ has uniform distribution between $$0$$ and $$2\pi$$, then the expectation is zero for each $$x$$, since the $$i$$th term in the sum has expectation $$E\left[a\sin(kx+c_i)\right]=\int_0^{2\pi}a\sin(kx+t)\frac1{2\pi}\,dt=0.$$ So yes, you can get the expectation via Unconscious Statistician. If you attempt to convert the sum to the form $$A\sin(kx+c')$$, you have to contend with the fact that both amplitude $$A$$ and phase $$c'$$ are random quantities.
• @Minow It's because the expectation is averaging over all realizations of the experiment. For any given realization of phase, we perceive a sine wave of frequency $k$, but averaging over all possible phases returns zero. Consider the degenerate case of only one singer in your choir, located a randomly chosen distance from your ear. What this means is that the expectation of the experiment isn't really as interesting an entity as each realization of the experiment. – grand_chat Nov 29 '18 at 18:42
Lets start with an identity: $$a \sin(\theta)+b\cos(\theta)=r\sin(\theta + \arctan(b/a))$$ with $$r=\sqrt{a^2+b^2}$$
Now we look at $$\sum \sin(kx+c_i)=Im \sum e^{i(kx+c_i)}$$ $$=Im \left[ (\cos(kx)+i\sin(kx))\sum (\cos(c_i)+i\sin(c_i)) \right]$$ Collecting the imaginary part, we are left with $$\left[\sum \sin(c_i)\right] \cos(kx) + \left[\sum \cos(c_i)\right]\sin(kx)$$ using the first identity completes the job.
• Lets simplify and look at $\sum e^{i c_j}$ the phase is just the angle of this complex vector. If you consider this sum as a random walk, the distribution of the end of the walk is distributed equally in all angles, so the expectation is indeed zero. – user619894 Nov 29 '18 at 21:57