uselognmap.m

来自「基于OFDM的无线宽带系统仿真It contains mainly two pa」· M 代码 · 共 38 行

M
38
字号
function logn = uselognmap(pos, lognmap, mapvec)% DESCRIPTION logn = uselognmap(pos, lognmap, mapvec)%  Generates correlated lognormal values that are position dependent.%  This routine is closely related to crelognmap.m% INPUT%  pos --        any matrix with complex positions.%                values are folded back into the map when outside%  lognmap --    Global variable containing the lognormal map.%  mapvec --     two complex vector elements describing the size of the map% OUTPUT%  logn --       Value of lognormal fading. Same size as the "pos"%                input argument% SEE ALSO %  crelognmap% by Magnus Almgren 960508, revised 991101% the same border must be used as when the map was createborder = 1; % extension for cubic interpolationsiz = size(lognmap,1)-2*border; % size of side of map% the inverse base of v (v(1)*base => [1 0] and v(2)*base => [0 1] base = inv([real(mapvec.') imag(mapvec.')]);% the portions of v(1) and v(2) for each position elementrpos = [real(pos(:)) imag(pos(:))];% wrap it  back into the interval {0,1}mpos = mod_(rpos*base,1);pos1 = reshape(mpos(:,1), size(pos));pos2 = reshape(mpos(:,2), size(pos));% vectors used by interp2 for table lookup mapi = (-1:siz)/siz;% make the interpolationlogn = interp2(mapi, mapi, lognmap.', pos2, pos1, 'cubic');

⌨️ 快捷键说明

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