📄 bitload.asv
字号:
function [bits_alloc,energy_alloc,SNR] = BitLoad(subchan_gains,total_bits,num_subc,gap,noise,M)% Bit Loading Algorithm% ---------------------%% Inputs :% subchan_gains : SubCarrier Gains% total_bits : Total Number of bits % num_subc : Number of Subcarriers% gap : Gap of the system% noise : Noise Power% M : Max Constellation Size% Outputs:% bits_alloc : Bits allocation for each subchannel% power_alloc : Total Power allocation % ---------------------------------------------------------------% Compute SNR's for each channelSNR = ComputeSNR(subchan_gains,noise,gap);% This function just initializes the system with a particular bit % allocation and energy allocation using Chow's Algorithm. This is % further efficientize using Campello's Algorithm[bits_alloc, energy_alloc] = chow_algo(SNR,num_subc,M);% Form the Energy Increment Table based on the present channel% gains for all the subchannels in order to be used by Campello% Algorithmenergytable = EnergyTableInit(SNR,M);% Efficientize the algorithm using the Campello's algorithm[bits_alloc,energy_alloc] = campello_algo(bits_alloc,energy_alloc,energytable,total_bits,num_subc,M);for i=1:length(bits_alloc) if bits_alloc(i)>0 else SNR(i)=0; endendfor i=1:length(bits_alloc) if SNR(i)==0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -