I am very confused by a sum I have been trying to solve analytically/ numerically for a long time. It comes from the idea of a physical problem where the observation is made that has a combined response of a number of entities. For example, I want to evaluate the mathematical sum at a observation point $\omega$ that looks like the following when $M \to \infty$ .


$$ L(\omega) = \sum\_{n = 0}^{N-1}\sum\_{m = 1}^{M} \exp\left(i \left( (\omega\_m - \omega)n + \beta\_m \right) \right) $$


Where all $\omega\_m$s are random draws from a normal distribution


$$ \omega\_m \sim \mathcal{N}(\mu, \sigma^2) $$


and the $\beta\_m$ are the normal draws from a uniform distribution


$$ \beta\_m \sim \mathcal{U}[-\pi, +\pi] $$


Let's try to solve it first with the sum with respect to $m$ and then $n$. The sum with respect to $m$ can be approximated to an infinite integral when $M \to \infty$.


$$ \mathbb{E}(L(\omega)) \approx M \sum\_{n = 0}^{N-1} \int\_{-\infty}^{+\infty} \int\_{-\pi}^{+\pi} \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)\exp(i(x - \omega)n)\frac{1}{2\pi} \exp(i\beta) d\beta dx $$


This integral is $0$ because of the integral $\int\_{-\pi}^{+\pi}\exp(i\beta) d\beta$.


Let's approach this sum first with respect to $n$ and then $m$. The function has a closed form with respect to the sum with $n$.


$$ L(\omega) = \sum\_{m = 1}^{M} \frac{\sin\left( \frac{N (\omega\_m-\omega)}{2} \right)}{\sin\left( \frac{(\omega\_m-\omega)}{2} \right)} \exp\left(i \left( (1-N)\frac{\omega\_m-\omega}{2} - \beta\_m \right) \right)$$


If I take the expectation here with an integral approximation, it also becomes $0$. However, I proceeded with finding the expression for the absolute value of $L(\omega)$ from the above expression.


$$ |L(\omega)|^2 = \sum\_{m = 1}^{M} \left| \frac{\sin\left( \frac{N (\omega\_m-\omega)}{2} \right)}{\sin\left( \frac{(\omega\_m-\omega)}{2} \right)} \right|^2 + \sum\_{p = 1}^{P} \sum\_{q = 1}^{Q} \frac{\sin\left( \frac{N (\omega\_p-\omega)}{2} \right)}{\sin\left( \frac{(\omega\_p-\omega)}{2} \right)} \frac{\sin\left( \frac{N (\omega\_q-\omega)}{2} \right)}{\sin\left( \frac{(\omega\_q-\omega)}{2} \right)} \cos\left( (1 - N) \frac{(\omega\_p-\omega\_q)}{2} + \beta\_q - \beta\_p \right) $$. The sum with $p$ and $q$ are similar to $m$. The second term is clearly $0$ based on the same type of approximations with expected value when $M \to \infty$. So, taking only the first term, the expected value becomes,


$$ |L(\omega)|^2 \approx M \int\_{-\infty}^{+\infty} \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \left| \frac{\sin\left( \frac{N (x-\omega)}{2} \right)}{\sin\left( \frac{(x-\omega)}{2} \right)} \right|^2 dx $$


Can I further reduce this to a closed form or a form that can only depend on $N$ numerically?


Let's take a simpler form by choosing $\mu = 0$, $\sigma = 1$ and find the integral at $\omega = 0$.


$$ |L(0)|^2 \approx M \int\_{-\infty}^{+\infty} \frac{1}{\sqrt{2\pi}} \exp\left(-\frac{(x)^2}{2}\right) \left| \frac{\sin\left( \frac{N (x)}{2} \right)}{\sin\left( \frac{(x)}{2} \right)} \right|^2 dx $$



A double sum with complex numbers having stochastic variables
Your final integral can be readily evaluated by expanding the fraction of sines into sums of exponentials $e^{ikx/2}$ with integer $k$, and integrating term by term with the Gaussian weight, to arrive at
$$|L(0)|^2 \equiv\frac{M}{\sqrt{2\pi}} \int\_{-\infty}^{+\infty} e^{-x^2/2} \frac{\sin^2\left(Nx/2 \right)}{\sin^2\left( x/2 \right)} \, dx=$$
$$=MN+2M e^{-N^2/2} \sum \_{k=1}^{N-1} k e^{\frac{1}{2} \left(2 k N-k^2\right)}.$$


