I have a question regarding the solution of a specific problem. I've encountered an issue when trying to calculate the correlation function and spectral density for a stationary random process with independent initial phases. I'm hoping for your assistance and expert insights on this matter.
Problem
I need to determine the correlation function $B(\tau)$ and the spectral density $B(\omega)$ of a stationary random process defined as
$$ s(t) = \sum_{i} A_{0_i} \cos(\omega_{0_i} t + \phi_i) $$
where $A_{0_i}$ and $\omega_{0_i}$ represent constant amplitudes and angular frequencies, and $\phi_1, \phi_2, ..., \phi_n$ are mutually independent random initial phases uniformly distributed in the interval $[-\pi, \pi]$.
To solve this problem, I decided to use the formula of the correlation function of a random process: $$ m_{11}(t_1, t_2) = \overline{\xi(t_1) \cdot \xi(t_2)} = \iint_{-\infty}^{\infty} x_1 \cdot x_2 \cdot W_2(x_1, x_2, t_1, t_2)\ dx_1\ dx_2 = B_\xi(t_1, t_2) $$
So I get this expression: $$ B(\tau) = \iint_{-\infty}^{\infty} \sum_{i} A_{0_i} \cos(\omega_{0_i} t_1 + \phi_i) \sum_{j} A_{0_j} \cos(\omega_{0_j} t_2 + \phi_j)\ d\phi_i\ d\phi_j $$
But most likely it is incorrect. I still can't understand, I have only 1 random variable, so I have a probability density only by $\phi$? And where will the sums from under the integral go? Did I set them up correctly at all, these amounts? Well, i.e. by i and j, or only by i?
I understand that I ask a lot of questions, but I am grateful in advance for any help
EDIT: I came to the following conclusion - The correlation function will look like this: $$ B(\tau) = \int_{-\infty}^{\infty} \sum_{i} A_{0_i} \cos(\omega_{0_i} t + \phi_i) \sum_{i} A_{0_i} \cos(\omega_{0_i} (t+\tau) + \phi_i) \cdot \frac{1}{2\pi}\ d\phi\ $$ so i can do like this: $$ B(\tau) = \frac{1}{4\pi} \int_{-\pi}^{\pi} \sum_{i} \sum_{j} A_{0_i} A_{0_j}[\cos(\omega_{0_i} t + \omega_{0_i} (t + \tau) + \phi_i + \phi_j) \cdot \cos(t(\omega_{0_i}-\omega_{0_j}) + \omega_{0_i}\tau + \phi_i - \phi_j)] d\phi\ $$ You can see that I have changed the integration interval. I did this because my random variable is distributed evenly over this interval. Then I consider separately the cosines in cases where $i = j$ and $i \neq j$, and in this case it turns out that only the second cosine at $i = j$ is equal to: $$ \int_{-\pi}^{\pi} \cos(\omega \tau)d\phi\ = \phi \cos(\omega \tau) $$
As a result, I came to the following: $$ B(\tau) = \frac{1}{4\pi} \int_{-\pi}^{\pi} \sum_{i} \sum_{i} A_{0_i}^2\cos(\omega_{0_i} \tau) d\phi\ = \sum_{i}^{n^2} \frac{A_{0_i}^2}{2}\cdot cos(\omega_{0_i} \tau) $$ To clarify, I have all the default amounts up to n If I have any inaccuracies, I would be happy to discuss them