def WMMSE_sum_rate(p_int, H, Pmax, var_noise):
K = np.size(p_int)
vnew = 0
b = np.sqrt(p_int)
f = np.zeros(K)
w = np.zeros(K)
for i in range(K):
f[i] = H[i, i] * b[i] / (np.square(H[i, :]) @ np.square(b) + var_noise)
w[i] = 1 / (1 - f[i] * b[i] * H[i, i])
vnew = vnew + math.log2(w[i])
VV = np.zeros(100)
for iter in range(100):
vold = vnew
for i in range(K):
btmp = w[i] * f[i] * H[i, i] / sum(w * np.square(f) * np.square(H[:, i]))
b[i] = min(btmp, np.sqrt(Pmax)) + max(btmp, 0) - btmp
vnew = 0
for i in range(K):
f[i] = H[i, i] * b[i] / ((np.square(H[i, :])) @ (np.square(b)) + var_noise)
w[i] = 1 / (1 - f[i] * b[i] * H[i, i])
vnew = vnew + math.log2(w[i])
VV[iter] = vnew
if vnew - vold <= 1e-3:
break
p_opt = np.square(b)
return p_opt
# Functions for performance evaluation
function_wmmse_powercontrol.py 文件源码
python
阅读 149
收藏 0
点赞 0
评论 0
评论列表
文章目录