Skip to content

Instantly share code, notes, and snippets.

View nutsiepully's full-sized avatar

Pulkit Bhuwalka nutsiepully

  • Google
  • Mountain View, CA
View GitHub Profile
@nutsiepully
nutsiepully / issue_4107
Created August 21, 2013 17:07
Code that led to segmentation fault and non-terminating state.
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)