autocorrelation.m

来自「802.11仿真源码 对分析RSSI很有用的」· M 代码 · 共 19 行

M
19
字号
function Autocorrelation = Autocorrelation(file, Strength, lag)
% This function ->
%       Autocorrelation: open auto'i', calculates the autocorrelation with
%       the lag passed as an argument. The autocorrelation, Lags and bounds
%       are outputted to the screen while the specific autocorrelation is
%       printed to auto'i'
filename = sprintf('auto%d',file);
fid = fopen(filename,'w');
extract = '0';
if (fid == -1)
    disp(['ERROR: File not found or could not be opened for read. Please check auto file name']);
end

[ACF,Lags,Bounds] = autocorr(Strength, 16)

extract = ACF(lag + 1)
fprintf(fid, '%f\n', extract);

fclose(fid);

⌨️ 快捷键说明

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