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

📄 carrier_sense.m

📁 一个无线网络仿真程序
💻 M
字号:
function busy = carrier_sense(rv)
% check if the channel is busy

global node;
global white_noise_variance;
global rmodel cs_threshold;

Pr = 0;
I = find(node(:, 3)>0);
for i=1:length(I)
   tx1 = I(i);
   if tx1 == rv, continue; end
   Pr = Pr + recv_power(tx1, rv, rmodel);
end
% N0 = abs(random('norm', 0, white_noise_variance));
N0 = white_noise_variance;

% Pr+N0

if (Pr+N0) > cs_threshold
    busy = 1;
else
    busy = 0;
end

return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -