# Calculate SINR and Array-Gain for acoustic Beamforming in Matlab

I'm struggling to understand the equation and the reasons for this equation from Matlab's acoustic beamforming example. Here is the link: https://se.mathworks.com/help/phased/examples/acoustic-beamforming-using-a-microphone-array.html

In this example, they calculate array-gain, which should be the ratio of SINR after beamforming algorithm(whole array) and SINR on the input of one microphone. But they express it as follows

agCbf = pow2db(mean((voice_cleanspeech+voice_laugh).^2+noisePwr)/...
mean((cbfOut - voice_dft).^2))


where cbfOut - output vector after beamforming, voice_dft - the original signal/voice, voice_cleanspeech - the original signal of interference voice, voice_laugh - the second interference signal.

As far as I understand, array-gain should be something like:

$$AG = \dfrac{SNR_{Array}}{SNR_{Sensor}}$$

It's more or less clear how to calculate the denominator, but it's not clear how to calculate numerator. Maybe they did some tricky converting.