-
大小: 744KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-25
- 語言: 其他
- 標(biāo)簽:
資源簡介
OFDMA系統(tǒng)中資源分配包括原文和仿真代碼

代碼片段和文件信息
/***************************************************************************
Author:?Ian?C.?Wong?and?Robert?Mullenix???
Copyright?(C)?2004???Ian?C.?Wong
This?program?is?free?software;?you?can?redistribute?it?and/or
modify?it?under?the?terms?of?the?GNU?General?Public?License
as?published?by?the?Free?Software?Foundation;?either?version?2
of?the?License?or?(at?your?option)?any?later?version.
This?program?is?distributed?in?the?hope?that?it?will?be?useful
but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
GNU?General?Public?License?for?more?details.
You?should?have?received?a?copy?of?the?GNU?General?Public?License
along?with?this?program;?if?not?write?to?the?Free?Software
Foundation?Inc.?59?Temple?Place?-?Suite?330?Boston?MA??02111-1307?USA.
You?may?reach?the?author?at?wongic@mail.utexas.edu.
Or?visit?his?website?at?www.ece.utexas.edu/~iwong
******************************************************************************/
#include?“SIPS.h“
void?Shen_Challoc(SNRArray?*SNR?IDXArray?*IDX?int?user?int?*Shen_Assignment?
float?*Proportionality?int?*Hmin)
{
int?i?n?k;
float*?Data_rate;
int?*curIDX;
curIDX?=?(int?*)?malloc(user*sizeof(int));
memset(curIDX?0?user*sizeof(int));
Data_rate?=?(float?*)?malloc(user*sizeof(float));
//??First?round?have?each?user?select?the?channel?with?the?best?SNR
for?(k?=?0;?k? //?sort?in?descending?order
qsort((float?*)SNR[k]?(int?*)IDX[k]?N);
//n?=?Best_SNR(k?Shen_Assignment?IDX?curIDX);?//?assign?the?index?with?largest?value?w/c?is?first?element
n?=?Best_SNR(Shen_Assignment?IDX[k]?&curIDX[k]);
Shen_Assignment[n]?=?k;
Data_rate[k]?=?log2f(1?+?p*(float)?SNR[k][n]);
}
//??Second?round?give?the?worst?user?the?next?pick?until?all?subchannels?distributed
for?(i?=?0;?i? k?=?Worst_user(user?Data_rate?Proportionality);
//n?=?Best_SNR(k?Shen_Assignment?IDX?curIDX);
n?=?Best_SNR(Shen_Assignment?IDX[k]?&curIDX[k]);
Shen_Assignment[n]?=?k;
Hmin[k]?=?n;
Data_rate[k]?+=?log2f(1?+?p*(float)?SNR[k][n]);
}
free(Data_rate);
free(curIDX);
}
void?Wong_Challoc(SNRArray?*SNR?IDXArray?*IDX?int?user?int?*Wong_Assignment?
float?*Proportionality?int?*Hmin)
{
int?i?n?k;
float*?Data_rate;
int?*Nk;
char?*Exclude;
int?*curIDX;
register?int?Num_users?=?user;
int?N_star?=?N;
register?int?tmp;
curIDX?=?(int?*)?malloc(user*sizeof(int));
Data_rate?=?(float?*)?malloc(user*sizeof(float));
Nk?=?(int?*)malloc(user*sizeof(int));
Exclude?=?(char?*)malloc(user*sizeof(char));
memset(curIDX?0?user*sizeof(int));
memset(Exclude?0?user*sizeof(char));
for?(k?=?0;?k? tmp?=?(int)(Proportionality[k]*N);
N_star?-=?tmp;
Nk[k]?=?tmp;
}
//??First?round?have?each?user?select?the?channel?with?the?best?SNR
for?(k?=?0;?k? //?sort?in?de
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????250150??2008-10-30?21:45??A?Low?Complexity?Algorithm?for?Proportional.pdf
?????文件???????4835??2004-11-15?10:33??SIPS04C\SIPS04C\Challoc.cpp
?????文件??????18349??2004-11-15?11:12??SIPS04C\SIPS04C\COPYING.txt
?????文件????1206708??2004-09-16?16:51??SIPS04C\SIPS04C\data.txt
?????文件???????7267??2004-11-15?10:33??SIPS04C\SIPS04C\Palloc.cpp
?????文件????????733??2004-10-12?13:49??SIPS04C\SIPS04C\qsort.cpp
?????文件?????????65??2004-10-10?16:04??SIPS04C\SIPS04C\qsort.h
?????文件????????681??2004-11-12?15:19??SIPS04C\SIPS04C\Readme.txt
?????文件???????4919??2004-11-15?10:32??SIPS04C\SIPS04C\SIPS.h
?????文件???????5896??2004-11-15?10:32??SIPS04C\SIPS04C\SIPS04.cpp
?????文件???????2524??2003-10-11?14:08??SIPS04Matlab\SIPS04Matlab\chtry.m
?????文件??????18349??2004-11-15?11:12??SIPS04Matlab\SIPS04Matlab\COPYING.txt
?????文件????????422??2004-11-12?15:55??SIPS04Matlab\SIPS04Matlab\ReadmeMatlab.txt
?????文件???????2088??2004-11-15?10:37??SIPS04Matlab\SIPS04Matlab\rheesub.m
?????文件????????959??2004-11-15?10:38??SIPS04Matlab\SIPS04Matlab\rootfinding.m
?????文件???????2472??2004-11-15?10:37??SIPS04Matlab\SIPS04Matlab\shenpowerallo.m
?????文件???????5284??2004-11-15?10:36??SIPS04Matlab\SIPS04Matlab\SIPS04main.m
?????文件???????1579??2004-11-15?10:38??SIPS04Matlab\SIPS04Matlab\waterfilling.m
?????文件???????2167??2004-11-15?10:38??SIPS04Matlab\SIPS04Matlab\wongpowerallo.m
?????文件???????2827??2004-11-15?10:38??SIPS04Matlab\SIPS04Matlab\wongsuballo.m
?????目錄??????????0??2009-05-20?22:34??SIPS04C\SIPS04C
?????目錄??????????0??2009-05-20?22:34??SIPS04Matlab\SIPS04Matlab
?????目錄??????????0??2009-05-20?22:34??SIPS04C
?????目錄??????????0??2009-05-20?22:34??SIPS04Matlab
-----------?---------??----------?-----??----
??????????????1538274????????????????????24
評論
共有 條評論