?? link_adaptation.m
字號:
% function [st_baseStation,st_mobileStations] = link_adaptation(st_initConfig,st_baseStation,st_channelGrid,st_mobileStations)
function [st_baseStation,st_mobileStations,st_measurement] = link_adaptation(st_initConfig,st_baseStation,st_channelGrid,st_mobileStations,st_measurement)
% Each sub carrier of each each mobile for each antenna link to the desired BS
% needs to be given a modulation order, fec rate and power. This is the
% potential as predicted by the mobile or by the BS based on earlier
% channel state conditions, using the channelobject stored in the feedback
% element of the mobile unit.
% Extensive use of look up tables will be done here. SINR have to be
% computed here
% in the mobileStation structure, the there is a variable that has a copy
% of the channel object that is to be used as the fed back channel object.
% 1. LA is per mobile, but per sub carrier / sub channel of the base station.
% 2.
switch st_baseStation.scheduler_Algo
case {0 1}
lookUpTable = st_initConfig.thresholdAtFivePcFerLin;
AssignTable = st_initConfig.thresholdAtFivePcFerdB;
% lookUpTable = st_initConfig.thresholdAtTenPcFerLin;
% AssignTable = st_initConfig.thresholdAtTenPcFerdB;
case {2 4 5 6}
lookUpTable = st_initConfig.thresholdAtFivePcFerLin;
AssignTable = st_initConfig.thresholdAtFivePcFerdB;
% lookUpTable = st_initConfig.thptThresholdLookupLin*10^(st_initConfig.lookUpTableMargindB/10); % I add the margin here
% AssignTable = st_initConfig.thptThresholdLookupdB;
end
for lp_nmob=1:st_initConfig.nuMob
st_mobileStations(lp_nmob).ThptNext(1:st_baseStation.nuSubChannels)=0; % expected throughput in the next frame
lp_nTxAntenna = 1;
lp_nRxAntenna = 1;
% for lp_nTxAntenna=1:st_initConfig.nuAntennaBS
% for lp_nRxAntenna=1:st_initConfig.nuAntennaMS
st_mobileStations(lp_nmob).mod(lp_nTxAntenna,lp_nRxAntenna,1:st_baseStation.nuSubChannels)=0;
st_mobileStations(lp_nmob).fec(lp_nTxAntenna,lp_nRxAntenna,1:st_baseStation.nuSubChannels)=0;
st_mobileStations(lp_nmob).poweradjust(lp_nTxAntenna,lp_nRxAntenna,1:st_baseStation.nuSubChannels)=0;
% Measure SINR for the group of sub carriers together
for lp_nuSubChannels=1:st_baseStation.nuSubChannels
%Idx= max(find(lookUpTable<=(st_mobileStations(lp_nmob).sinrFeedBack(lp_nuSubChannels)-10^(st_initConfig.lookUpTableMargindB/10))));%find(st_initConfig.thresholdAtTenPcFerLin<=st_mobileStations(lp_nmob).sinrFeedBack(lp_ncarr));
Idx= max(find(lookUpTable<=(st_mobileStations(lp_nmob).sinrFeedBack(lp_nuSubChannels))));%-10^(st_initConfig.lookUpTableMargindB/10))));%find(st_initConfig.thresholdAtTenPcFerLin<=st_mobileStations(lp_nmob).sinrFeedBack(lp_ncarr));
if Idx > 0
st_mobileStations(lp_nmob).poweradjust(lp_nTxAntenna,lp_nRxAntenna,lp_nuSubChannels)=lookUpTable(Idx)/st_mobileStations(lp_nmob).sinrFeedBack(lp_nuSubChannels);
st_mobileStations(lp_nmob).mod(lp_nTxAntenna,lp_nRxAntenna,lp_nuSubChannels)=uint8(AssignTable(Idx,2));
st_mobileStations(lp_nmob).fec(lp_nTxAntenna,lp_nRxAntenna,lp_nuSubChannels)=AssignTable(Idx,3);
st_mobileStations(lp_nmob).ThptNext(lp_nuSubChannels)=AssignTable(Idx,2)*AssignTable(Idx,3)*st_baseStation.nuSubCarrPerSubChan*st_initConfig.nuOfdmSymbPerSubFrame/st_initConfig.subFramePeriod + 1e-10 * st_mobileStations(lp_nmob).sinrFeedBack(lp_nuSubChannels);
end
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -