導航:首頁 > 源碼編譯 > 功率分配演算法

功率分配演算法

發布時間: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鈥攗
)+

閱讀全文

與功率分配演算法相關的資料

熱點內容
程序員那麼可愛姜逸城初戀 瀏覽:495
modbustcp編程 瀏覽:490
實況為什麼安卓看不了 瀏覽:129
Java多線程Queue 瀏覽:94
雲伺服器499元三年 瀏覽:980
nbd源碼 瀏覽:846
x86在arm上編譯 瀏覽:7
linux怎麼配置網路 瀏覽:307
程序員想要的小禮物 瀏覽:186
java獲取網頁url 瀏覽:624
怎麼做解壓神器泡泡版 瀏覽:966
自己動手做一個c編譯器 瀏覽:929
手機如何鏈接谷歌伺服器地址 瀏覽:137
廢掉一個程序員的武功 瀏覽:249
java樹形演算法 瀏覽:641
通達信加鎖指標源碼怎麼看 瀏覽:754
將同名文件移動到部分同名文件夾 瀏覽:403
擺盪指標加壓力線源碼 瀏覽:915
新一代單片機特徵 瀏覽:770
王者的伺服器什麼時候才修好 瀏覽:281