beamforming alg