Waterfilling algorithm (Scripts) Publisher's description
from Kenneth Shum
the water-filling process
% the water-filling process
% x: a vector with each component representing noise power
% P: total power
% The returned vector p maximizes the total sum rate given by
% sum(log(1 + p./x)), subject to the power constraint sum(p)== P, p>=0.
% The return a vector p also minimizes
% subject to the constraints
% sum(p)==P; p>=0
% The second output "level" is the water level
% Sample usage:
% Three parallel Gaussian channels with noise powers 1, 2 and 3.
% The total power is 2.
% >> waterfill([1 2 3],2)
% ans =
% 1.5000 0.5000 0
% Author: Kenneth Shum, 2010
% T. M. Cover and J. A. Thomas, "Elements of Information Theory", John Wiley & Sons, 2006
System Requirements:MATLAB 7.4 (R2007a)
Program Release Status: New Release
Program Install Support: Install and Uninstall