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

📄 untitled.m

📁 Foschini & Mirjanic algorithm in Constrained Power control(CPC) for mobile networks
💻 M
字号:
% Power control for wireless cellular network
% Foschini-Miljinic Alg.

clc;
clear all;
close all;

% Number of users
N = 10;
P_MAX = 2; % Maximum allowable power
P_MIN = 0;
sinr_tar = 10;
etta = 1e-10; % noise power
% initial random vector
p = rand(1,N);
%spreading gain
SG = 1e-2;

% Cell size and nodes positions
R_min = 2;
R_max = 5;
r= R_min + (R_max-R_min)*rand(1,N);

% Links gain
g=1./r.^4;
sinr=20*rand(1,N);
iter=1;
erorr=1;
while erorr > 1e-5
    iter = iter+1;
% the loop for mobile stations   
    i = 1;
    while i <= N
       tot_intf = 0;
 % calculate total interference for each iterration      
       for j = 1:N 
          tot_intf = tot_intf + g(j).*p(iter-1,j);
       end
 %caculate user interfernce for mobile station i      
       useri_intf= tot_intf -(g(i).*p(iter-1,i));
 %calculate sinr and new power for mobile station i      
       sinr(iter,i)=(g(i).*p(iter-1,i))/(etta+SG.*useri_intf);
       new_p=(sinr_tar/sinr(iter,i))*p(iter-1,i);
       p(iter,i)= min(P_MAX,max(P_MIN,new_p));
% plot for each iterration
      if (p(iter,i) == 2)
           N = N-1;
           p(:,i) = [];
           sinr(:,i) = [];
           i=i-1;
      end
      subplot(2,1,1),plot(p);
      subplot(2,1,2),plot(sinr);
       i  = i+1;
    end
%condition of reach to the convergence status
    erorr=0;
    for t = 1:N
        erorr = erorr +( sinr(iter,t) - sinr(iter-1,t)).^2;
    end
end

⌨️ 快捷键说明

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