# Cross power spectral matrix from PSDs and coherence using matrix notation

I have a vector containing all the PSD of a series of signals

$$\underline{s} = \left[ |S_{x_1x_1}| |S_{x_2x_2}| |S_{x_3x_3}| ...\right]^T$$

I also have a matrix $$\gamma^2$$ containing all the coherences

$$\gamma_{ij} = \frac{|S_{x_ix_j}|^2}{S_{x_ix_i} S_{x_jx_j}}$$

I would like to obtain the matrix of the cross-spectral densities, i.e. a matrix $$\mathbf{S}$$ so that $$S_{ij} = |S_{x_ix_j}|^2$$

Is it possibile to obtain it from $$\underline{s}$$ and $$\mathbf{\gamma}$$ using matrix notation?

The only way I found at the moment is:

$$\mathbf{S} = (s s^T) \circ \gamma$$

where $$\circ$$ indicates the Hadamard (element-wise) power and multiplication. This is however seldom used and usually element-wise multiplication is avoided in linear algebra.

Is there another way to do it?

$$S= diag(\underline{s}) \cdot \underline{\underline{\gamma}} \cdot diag(\underline{s})$$