This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function equal_power_assignment(W, antennas_tx, antennas_rx, p_tx_max) | |
number_of_bs = integer(size(W, 1) / antennas_tx) | |
acc_matrix = kron(eye(number_of_bs), ones(antennas_tx)).' | |
abs_W_2 = abs2(W) | |
p_range::Array{Float64} = [0, 2^5] | |
p_stream = p_range[2]* ones(number_of_bs * antennas_rx) | |
p_tx = acc_matrix * abs_W_2 * p_stream | |
while p_tx_max - max(p_tx) > 0 | |
p_range[2] = 2 * p_range[2] | |
p_stream = p_range[2]* ones(number_of_bs * antennas_rx) |