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

📄 stats.m

📁 802.11仿真源码 对分析RSSI很有用的
💻 M
字号:
function Stats(Strength, RSSI, size, Time)
% This function ->
%       State:
%          - Given the original strength data the std, mean and range is
%          calcuated. 
%          - The variance of signal strength is drawn over the 
%          propper calculated timetime
%          - If the exact time is wanted and not an estiamate, the time 
%          within the then the packets file is passed as an argumented. If
%          this is wanted uncomment line 25-33 and comment line 14-23.

%  Actually calculate the time that the experiment was run, as input vector
%  is only the different in time. 
Time(1) = 1;
Time(2) = 3;
for i=2:length(Strength)
    Time(i) = Time(i-1) + size + 1;
end

% Change to minutes
for i=1:length(Time)
    Time(i) = (Time(i)/60) * 2;
end

% Time(1) = 0;
% for (i=2:length(Time))
%     Time(i) = Time(i - 1) + Time(i);
% end

% % Change to minutes
% for i=1:length(Time)
%     Time(i) = (Time(i)/60);
% end

%  Statistical Analysis
%  The sample standard deviation, the sample mean, the sample range
disp('Stats for RSSI:')
Standard_Deviation = std(RSSI)
Mean = (mean(RSSI) - 256)
Range = max(RSSI) - min(RSSI)

figure; plot(Time, Strength); title('Time Variance of Signal Strength'); xlabel('Time (minutes)'); ylabel('Signal Strength (dB)');

⌨️ 快捷键说明

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