导航:首页 > 源码编译 > 功率分配算法

功率分配算法

发布时间:2024-05-21 18:01:23

A. 鐢∕ATLAB瀹炵幇娉ㄦ按绠楁硶銆佸钩鍧囧姛鐜囧垎閰岖畻娉曚笌绾︽潫娉ㄦ按 绠楁硶绯荤粺钖炲悙閲忕殑姣旇缉

clear all
close all
clc
nt_V = [1 2 3 2 4];
nr_V = [1 2 2 3 4];
N0 = 1e-4;
B = 1;
Iteration = 1e2; % must be grater than 1e2
SNR_V_db = [-10:3:20];
SNR_V = 10.^(SNR_V_db/10);
color = ['b';'r';'g';'k';'m'];
notation = ['-o';'->';'<-';'-^';'-s'];
for(k = 1 : 5)
nt = nt_V(k);
nr = nr_V(k);
for(i = 1 : length(SNR_V))
Pt = N0 * SNR_V(i);
for(j = 1 : Iteration)
H = random('rayleigh',1,nr,nt);
[S V D] = svd(H);
landas(:,j) = diag(V);
[Capacity(i,j) PowerAllo] = WaterFilling_alg(Pt,landas(:,j),B,N0);
end
end
f1 = figure(1);
hold on
plot(SNR_V_db,mean(Capacity'),notation(k,:),'color',color(k,:))
clear landas
end
f1 = figure(1)
legend_str = [];
for( i = 1 : length(nt_V))
legend_str =[ legend_str ;...
{['nt = ',num2str(nt_V(i)),' , nr = ',num2str(nr_V(i))]}];
end
legend(legend_str)
grid on
set(f1,'color',[1 1 1])
xlabel('SNR in dB')
ylabel('Capacity bits/s/Hz')
function [Capacity PowerAllo] = WaterFilling_alg(PtotA,ChA,B,N0);
%
% WaterFilling in Optimising the Capacity
%===============
% Initialization
%===============
ChA = ChA + eps;
NA = length(ChA); % the number of subchannels allocated to

H = ChA.^2/(B*N0); % the parameter relate to SNR in subchannels
% assign the power to subchannel
PowerAllo = (PtotA + sum(1./H))/NA - 1./H;
while(length(find(PowerAllo < 0 ))>0)
IndexN = find(PowerAllo <= 0 );
IndexP = find(PowerAllo > 0);
MP = length(IndexP);
PowerAllo(IndexN) = 0;
ChAT = ChA(IndexP);
HT = ChAT.^2/(B*N0);
PowerAlloT = (PtotA + sum(1./HT))/MP - 1./HT;
PowerAllo(IndexP) = PowerAlloT;
end
PowerAllo = PowerAllo.';
Capacity = sum(log2(1+ PowerAllo.' .* H));

B. 锷熺巼娉ㄦ按绠楁硶涓绱犲拰濡备綍姹傝В𨰾夋牸链楁棩涔桦瓙(lambda)i銆

锘烘湰铡熺悊锛
淇″櫔姣旓纸鍗充俊鍙峰姛鐜囱氨涓庡櫔澹板姛鐜囱氨涔嫔拰锛変负甯告暟镞讹纴绯荤粺镓嶈兘杈惧埌镐讳俊阆揿归噺链澶х殑瑕佹眰銆
褰揝NR寰埚ぇ镞讹纴Pi绛夊姛鐜囧垎閰嶏纴娉ㄦ按绠楁硶锷熸晥娑埚け銆
鍦ㄥ姛鐜囧垎閰岖殑闂棰树腑锛屽彧链夋弧瓒虫敞姘村畾鐞嗘椂锛屾墠鑳借揪鍒颁俊阆揿归噺链澶у寲銆
涔熷氨鏄璇翠俊鍣姣斿ぇ镄勪俊阆揿垎寰楃殑锷熺巼澶氾纴淇″櫔姣斿皬镄勪俊阆揿垎寰楃殑锷熺巼灏戙
浣跨敤𨰾夋牸链楁棩涔桦瓙鍒嗛厤淇¢亾锷熺巼Pi浣垮缑淇¢亾瀹归噺链澶с
Pi锛(
1/(lambda)i钬攗
)+

阅读全文

与功率分配算法相关的资料

热点内容
光遇为什么之前没有安卓服 浏览:745
移动硬盘显示可用加密 浏览:944
python万能库开发 浏览:875
向日葵远程解压 浏览:883
androidedittext布局 浏览:320
题库管理app哪个好用 浏览:989
安卓游戏中亮度自动调节如何关闭 浏览:892
求派算法 浏览:551
pythonweb编程实例 浏览:190
鞋盒怎么做文件夹收纳盒视频 浏览:757
模拟电子技术第四版pdf 浏览:961
解压车贷后gps怎么找 浏览:352
源码数据库怎么配备 浏览:138
知乎程序员小灰 浏览:574
新概念英语第一册书pdf 浏览:8
安卓ans文件怎么打开 浏览:895
选择题改进分治算法的方法有 浏览:110
下载云服务器有什么好处 浏览:23
江苏机架式服务器云主机 浏览:411
linux补全命令 浏览:514