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

📄 showterm.m

📁 fading 在无线中的应用
💻 M
字号:
function showterm(par, res, sys, mobid) % DESCRIPTION showterm(par, res, sys, mobid)%  Plot terminal movements with handoff and sir values.%  New plots are made for each mobile.% INPUT%  par --          basic enviromental entitities%  .cellradius --  cell radius [m]%  .km --          km^2+lm^2+km*lm => the number of sites%  .lm --          related to km above%  .sps --         number of sectors per site%  .ncluster --    number of clusters equals ncluster^2%  .kpc --         number of allocated channels per cell%  .gainconst --   gain at 1 meter distance [dB] %  .noise --       thermal noise floor [dBm]%  .alpha --       distance attenuation coefficient%  .sigma --       standard deviation for the lognormal fading [dB]%  .raa --         lognormal correlation down link (typical 0.5)%  .corrdist --    lognormal fading correlation distance [m]%  .offtraf --     average number of offered calls to a cell [Erlang/cell]     %  .mht --         mean holding time [seconds]  %  .amean --       acceleration [m/s/s]%  .vmean --       speed  [m/s]%  .pinit --       init power set to each new link [dBm]%  .sirmin --      C/I level under which a call is dropped [dB] %  .homargin --    gain margin between two bases used at Hand Off [dB]%  .dt --          time interval in the simulation loop [s]%  .maxiter --     number of iterations in the main loop %  .seed --        seed to all random sequencies in the simulation%  sta --          state %  .xym --         position in complex form [m]%  .xyv --         speed imag <=> north real <=> east [m/s] %  .m --           mobile identity number%  .b --           base station index%  .k --           channel number%  .pul --         transmitted power up link  [dBm]%  .cul --         received carrier power up link [dBm]%  .iul --         interference power up link  [dBm]%  .sirul --       signal to interference ratio up link [dB]%  .pdl --         transmitted power down link  [dBm]%  .cdl --         carrier downlink [dBm]%  .idl --         interference down link [dBm]%  .sirdl --       signal to interference down link [dB]%  .mtop --        max mobile number used sofar%  .obk --         the allocation of channels%  .seed --        the seed before next iteration%  sys --          all intermediate values needed to simulate  %  .xyb --         base positions [m]%  .fib --         cell center vector [m]%  .rombvec --     stem vectors [m]%  .lobevector --  antenna gain diagram [dB]%  .iniobk --      channel plan%  .lognmap --     lognormal map [dB]%  .mapvec --      lognormal map vectors [m]%  mobid --        vector of mobile identities to show% by Magnus Almgren 000608 modified by Sofia Mosesson 000704if ~exist('mobid', 'var') mobid = 1:res{end}.mtop; % show all mobiles endfor j= 1:length(mobid)-1 interesting = showterm1(par,res,sys,mobid(j)); if interesting == 1;  input('return->next mobile, ^C->end') endendshowterm1(par,res,sys,mobid(end));%--------------------------------------------------%--------------------------------------------------function interesting = showterm1(par,res,sys,mobid) sirul=[];sirdl=[];xym = [];b = [];t = (1:length(res(:)))'*par.dt;for j = 1:length(t) ind = res{j}.m==mobid; if sum(ind)>0  sirul = [sirul; res{j}.sirul(ind)];  sirdl = [sirdl; res{j}.sirdl(ind)];  xym = [xym; res{j}.xym(ind)];  b = [b; res{j}.b(ind)]; else  sirul = [sirul; nan];  sirdl = [sirdl; nan];  xym = [xym; nan];  b = [b; nan]; endendinteresting = 0;if sum(isfinite(sirul)) >= min(3, par.maxiter) % Anything of interest. % Show sir uplink and downlink for a terminal. interesting = 1; handoff = logical([0; abs(diff(b))>0]); if (par.sirmin == -Inf)  sirmin = 10;  sirmin_expl = 'typical drop-line'; else  sirmin = par.sirmin;  sirmin_expl = 'drop-line';  end  %-------------------------------------------------- figure(1) p1 = plot(t, [sirul sirdl],'.-'); hold on p2 = plot(t(handoff), [sirul(handoff) sirdl(handoff)], 'r.'); % Mark handoff point with red. p3 = plot(t, sirmin*ones(length(t),1), 'black--'); % Plot a dropline. if (~isempty(p2))  legend([p1; p2(1); p3], 'uplink', 'downlink', 'handoff', sirmin_expl); else  legend([p1; p3], 'uplink', 'downlink', sirmin_expl) end title(['Up & Down Link SIR for terminal ' num2str(mobid)]) xlabel('Time  [s]') ylabel('SIR  [dB]')  set(gca, 'xlim', [min(t) max(t)]) set(gca, 'ylim', [-10 60])  hold off  %-------------------------------------------------- % Show the travelled path including.  % Hand off (green) and start position (blue). figure(2) plothex(sys.xyb, sys.fib) title(['Movement for terminal ' num2str(mobid)]) hold on xyms = xym(isfinite(xym)); plot(xyms, 'g.') plot(xyms, 'g') plot(xyms(1),'b.') % show starting point if ~isempty(xym(handoff))  plot(xym(handoff),'r.') % show handoffs end hold offend

⌨️ 快捷键说明

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