Algorithm for power allocation in localization processes