-
Notifications
You must be signed in to change notification settings - Fork 146
/
Water_Pouring.m
29 lines (27 loc) · 831 Bytes
/
Water_Pouring.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [Gamma]=Water_Pouring(Lamda,SNR,nT)
%MIMO-OFDM Wireless Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
Gamma = zeros(1,length(Lamda));
r=length(Lamda); index=[1:r];
index_temp=index;
p=1;
while p<r
irp=[1:r-p+1].';
temp= sum(1./Lamda(index_temp(irp)));
mu = nT/(r-p+1.)*(1+1/SNR*temp);
Gamma(index_temp(irp))=mu-nT./(SNR*Lamda(index_temp(irp)));
if min(Gamma(index_temp))<0
i=find(Gamma==min(Gamma)); ii=find(index_temp==i);
index_temp2=[index_temp([1:ii-1]) index_temp([ii+1:end])];
clear index_temp;
index_temp=index_temp2;
p=p+1;
clear Gamma;