⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 link_adaptation.m

📁 基于OFDM的无线宽带系统仿真It contains mainly two parts, i.e. link-level simulator and system-level simulator.
💻 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 + -