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

📄 carriersense.m

📁 数字通信调制解调
💻 M
字号:
% Program 6-9
% carriersense.m
%
% The function of the carrier sense
%
% Input arguments
%   no       : terminal which carrier sensing
%   now_time : now time
%
% Output argument
%   result   : 0: idle  1:busy
%
% Programmed by M.Okita
% Checked by H.Harada
%

function [result] = carriersense(no,now_time)

global Mnum Mstime Ttime Dtime                                          % definition of the global variable

delay = Dtime * Ttime;                                                  % calculation of the delay time

idx = find((Mstime+delay)<=now_time & now_time<=(Mstime+delay+Ttime));  % carrier sense
if length(idx) > 0                                                      % carrier is detected
    result = 1;                                                         % channel is busy
else                                                                    % charier can乫t be detected
    result = 0;                                                         % channel is idle
end

%%%%%%%%%%%%%%%%%%%%%% end of file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

⌨️ 快捷键说明

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