Beamforming algorithms