📄 measuremobilesinr2.m
字号:
function [st_mobileStations,st_channelGrid] = measureMobileSinr2(st_initConfig,st_baseStation,st_channelGrid,st_mobileStations)% the difference between this one and the one before is the SINR calc% method% 1. Measure the SINR per sub carrier of each mobile% 2. Store in each mobile station structure% This function will measure the signal to interference plus noise ratio at% each OFDM symbol at each sub carrier for each mobile at each location,% for as many frames as being simulated.% Each mobile object's channel object has been updated and is ready in the% condition when transmission can begin. But this is against%load ch_mat;g = threeSectorpathGain(st_initConfig.locMS,st_initConfig.locBS,st_initConfig.fib,st_initConfig.rombvec,st_initConfig.attConst,st_initConfig.alpha, st_initConfig.sigma, st_initConfig.raa, st_initConfig.lobeVector, st_channelGrid.lognmapShadow,st_channelGrid.mapvecShadow, st_initConfig.sps, st_initConfig.nuCluster,st_initConfig.ncell_per_cluster,st_initConfig.dmin);g_lin = 10.^(g/10);st_channelGrid.g_lin = g_lin;for lp_nmob=st_baseStation.new_mobile_handles sinr = nan(1,st_initConfig.nuSubCarr); for lp_nuOFDMSymbs = 1:1;%st_initConfig.nuOfdmSymbPerFrame gain_ctf = nan(st_initConfig.nuSubCarr,st_initConfig.nuBs,st_initConfig.nuAntennaBS,st_initConfig.nuAntennaMS); for lp_nBs = 1:st_initConfig.nuBs for lp_nTxAntenna=1:st_initConfig.nuAntennaBS for lp_nRxAntenna=1:st_initConfig.nuAntennaMS gain_ctf(1:st_initConfig.nuSubCarr,lp_nBs,lp_nTxAntenna,lp_nRxAntenna)=g_lin(lp_nmob,lp_nBs)*st_channelGrid.gain_ch(st_initConfig.sub_cars,st_mobileStations(lp_nmob).ch_idx(lp_nBs,lp_nTxAntenna,lp_nRxAntenna)); end end end sinr_tmp = sum(gain_ctf(:,st_initConfig.desiredBsIdx,1,:)./(sum(gain_ctf(:,st_initConfig.intfBsIdxvector,1,:),2) + st_initConfig.noisePowerPerSubc/st_initConfig.maxPowBsSubCarr),4); sinr(lp_nuOFDMSymbs,1:st_initConfig.nuSubCarr)=sinr_tmp; end sinrChErr = sinr + sqrt(10^(1/10))*randn(size(sinr)); % add 1dB error sinrChErr(sinrChErr<0) = 1e-10; % when less than 0, make it 0 for lp_nuSubChannels=1:st_baseStation.nuSubChannels st_mobileStations(lp_nmob).sinrFeedBack(lp_nuSubChannels)=mean(mean(sinrChErr(:,(lp_nuSubChannels-1)*st_baseStation.nuSubCarrPerSubChan+1:(lp_nuSubChannels)*st_baseStation.nuSubCarrPerSubChan ),1)); st_mobileStations(lp_nmob).sinrFeedBackNoChErr(lp_nuSubChannels)=mean(mean(sinr(:,(lp_nuSubChannels-1)*st_baseStation.nuSubCarrPerSubChan+1:(lp_nuSubChannels)*st_baseStation.nuSubCarrPerSubChan ),1)); end st_mobileStations(lp_nmob).ThptAvgPast = 1; st_mobileStations(lp_nmob).fair = 1;end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -