clear all; close all; clc;
ParameterSet = 'pico';
EvaluationMode = 'simulation'; % {simulation, analysis}
Thinning_Assumption = 'on';
fprintf('Parameter Set: %s\nEvaluation Mode: %s\nThinning Assumption: %s\n', ParameterSet, EvaluationMode, Thinning_Assumption);
if strcmp(ParameterSet,'macro')
% Parameter-Set: MACRO
PM = 40; % Macro BS transmit power
alphaL = 2.42; % LOS exponent
alphaN = 4.28; % NLOS exponent
cL = 10^((103.4 - 24.2*3)/10); % Free space path loss intercept自由空间路径损耗截断指数(视距、非视距)
cN = 10^((131.1 - 42.8*3)/10);
RCM = 250; % Average cell size
else
% Parameter Set: PICO
PM = 0.25;
alphaL = 2; % LOS exponent
alphaN = 4; % NLOS exponent
cL = 10^((103.8 - 20.9*3)/10); % Free space path loss intercept
cN = 10^((145.4 - 37.5*3)/10);
RCM = 40; % Average cell size
end
% dependent parameter
lambdaM = 1/(2*sqrt(3)*RCM^2);%宏基站分布密度
% Buildings
LB = 10^(-1);%穿墙损耗?
Ri = 15; % Indoor area radius [m]建筑覆盖面积
% Indoor
PS = 0.1; % Small cell BS transmit power
% Small scale fading; parameters for Nakagami fading.
Omega = 1;%多径散射场的平均功率
NL = 1; % 3
NN = 1; % 2
if strcmp(EvaluationMode, 'simulation')
% Noise
Bandwidth = 10*10^6;%10MB
NoisePowerDensity = 10^(-174/10)*10^-3;
NoiseFigure = 10^(9/10);
N0 = NoisePowerDensity*Bandwidth*NoiseFigure; % Noise Power
else
N0 = 0;
end
% Calibration coefficients 校准系数
% alphaB = 1; %0.85;
% alphaSIR = 1; %0.5;
% Numerical evaluation 数值计算
Tmin = 0.1;
Tmax = 2^6 - 1;
aCvector = 0.2:0.1:0.8;
etaVector = [0.2, 0.8];
BSVector = [1, 6];
LWVector = [1,10^(-2)];%穿墙损耗
% PcEvalVec = -10:2:20;
%
SimAreaRadius = 1000;%仿真半径
SimArea = (SimAreaRadius^2)*pi;%仿真面积
NrOfRealizations = 10^3;%仿真数number of realizations
%% PREALLOCATE MEMORY
% Distances and misc
NumberOfVisibleSmallCells = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));%创建多维矩阵用于存储计算结果
AssociationToSmallCell = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
MacroDistance = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
SmallCellDistance = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
% SIR Results
MacroSIRSim = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
SmallCellSIRSim = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
% Rate Results
MacroRateSim = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
SmallcellRateSim = zeros(NrOfRealizations, length(aCvector), length(etaVector), length(BSVector), length(LWVector));
%% ENTER MAIN SIMULATION LOOP
% Indoor area coverage ratio
for ii=1:length(aCvector)
fprintf('pI = %g:', aCvector(ii));
% Occupation probability
for jj = 1:length(etaVector)
for kk = 1:length(BSVector)
eta = etaVector(jj);
BS = BSVector(kk);
lambdaB = -log(1-aCvector(ii))/(Ri^2*pi); % Indoor area density
lambdaS = eta*lambdaB;
betaB = 2*lambdaB*Ri;
pB = lambdaB*Ri^2*pi;
fprintf(' %g ', eta);
for ll = 1:NrOfRealizations
% Realizations
if ~mod(ll,NrOfRealizations/10) fprintf('*'); end
%% Macro BSs
NumberOfMacroBSs = poissrnd(SimArea*lambdaM);
MacroRiAll = SimAreaRadius * sqrt(rand(NumberOfMacroBSs,1));
% Additional macro BS to check approximation
if strcmp(Thinning_Assumption,'off')
NumberOfAddMacroBSs = poissrnd(1/3*Ri^2*pi*lambdaM);
MacroRiAdd = Ri * sqrt(rand(NumberOfAddMacroBSs,1));
MacroRiAll = [MacroRiAll; MacroRiAdd];
end
% Calculate path losses from macro BSs
MacroPathLosses = 1/cN* MacroRiAll.^(-alphaN) .* exp(-(betaB*MacroRiAll-pB)*(1-LB));
%% Small Cell BSs
NumberOfSmallcells = poissrnd(SimArea * lambdaS);
SmallcellRiAll = SimAreaRadius * sqrt(rand(NumberOfSmallcells,1));
% Exclude smallcells inside Ri
IncludedSmallcells = (SmallcellRiAll - Ri) >= 0;
SmallcellRiGuard = SmallcellRiAll(IncludedSmallcells);
BernoulliParamsSC = exp(-betaB*(SmallcellRiGuard));
VisibleSCs = logical(binornd(1,BernoulliParamsSC));
InvisibleSCs = logical(1-VisibleSCs);
% Path Losses
% Visible Small Cells
SmallcellRiLOS = SmallcellRiGuard(VisibleSCs);
SmallcellPathLossesLOS = 1/cL * SmallcellRiLOS.^(-alphaL);
% Invisible Small Cells
SmallcellRiNLOS = SmallcellRiGuard(InvisibleSCs);
SmallcellPathLossesNLOS = 1/cN * SmallcellRiNLOS.^(-alphaN).*exp(-(betaB*SmallcellRiNLOS-pB)*(1-LB));
%% Loop over wall penetration losses
for mm = 1:length(LWVector)
LW = LWVector(mm);
% Received powers
SmallCellReceivePowers = sort(PS * SmallcellPathLossesLOS * LW, 'descend');
SmallCellReceivePowersInt = PS * SmallcellPathLossesNLOS * LW;
MacroReceivePowers = sort(PM * MacroPathLosses , 'descend');
AssociationToSmallCell_ = -1; % Identify faulty simulations by -1.
if ~isempty(MacroReceivePowers)
if ~isempty(SmallCellReceivePowers)
AssociationToSmallCell_ = BS * SmallCellReceivePowers(1) > MacroReceivePowers(1);
else
AssociationToSmallCell_ = 0;
end
end
% Generate small scale fading
% Macro
gM = gamrnd(NN, Omega/NN, size(MacroReceivePowers));
% Small cells
gSLOS = gamrnd(NL, Omega/NL, size(SmallCellReceivePowers));
% Small cell interferers
gSNLOS = gamrnd(NN, Omega/NN, size(SmallCellReceivePowersInt));
SIRbounded = 0;
Rate = 0;
% Calculate SIR and rate
% If associated with small cell
if AssociationToSmallCell_==1
DesiredRxPower = SmallCellReceivePowers(1);
SmallCellReceivePowers(1) = [];
g0 = gSLOS(1);
gSLOS(1) = [];
SIRraw = DesiredRxPower*g0 / (nansum(gM.*MacroReceivePowers)+nansum(gSLOS.*SmallCellReceivePowers)+nansum(gSNLOS.*SmallCellReceivePowersInt));
SIRbounded = max(min(SIRraw,Tmax),Tmin);
Rate = log2(1 + SIRbounded);
% if associated with outdoor BS
elseif Association
没有合适的资源?快使用搜索试试~ 我知道了~
【覆盖率分析】蜂窝异构网络(多径散热场)覆盖率分析【含Matlab源码 3318期】.zip
共8个文件
jpg:7个
m:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 9 浏览量
2024-06-22
11:41:04
上传
评论
收藏 191KB ZIP 举报
温馨提示
Matlab领域上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 功率谱估计: 故障诊断分析: 雷达通信:雷达LFM、MIMO、成像、定位、干扰、检测、信号分析、脉冲压缩 滤波估计:SOC估计 目标定位:WSN定位、滤波跟踪、目标定位 生物电信号:肌电信号EMG、脑电信号EEG、心电信号ECG 通信系统:DOA估计、编码译码、变分模态分解、管道泄漏、滤波器、数字信号处理+传输+分析+去噪、数字信号调制、误码率、信号估计、DTMF、信号检测识别融合、LEACH协议、信号检测、水声通信
资源推荐
资源详情
资源评论
收起资源包目录
【覆盖率分析】蜂窝异构网络(多径散热场)覆盖率分析【含Matlab源码 3318期】.zip (8个子文件)
【覆盖率分析】基于matlab蜂窝异构网络(多径散热场)覆盖率分析【含Matlab源码 3318期】
运行结果1.jpg 35KB
运行结果6.jpg 33KB
运行结果5.jpg 39KB
Coverage_and_rate_of_typical_outdoor_user.m 21KB
运行结果2.jpg 36KB
运行结果4.jpg 35KB
运行结果7.jpg 35KB
运行结果3.jpg 35KB
共 8 条
- 1
资源评论
Matlab领域
- 粉丝: 3w+
- 资源: 3168
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功