An algorithm calculates a correction value to be applied to a slot in an
adjustment period for power correction. The adjustment period is divided
into segments having a plurality of slots, and a target power value is
determined for each segment. For each slot, the algorithm determines
whether adding a correction value in a given slot would bring the actual
accumulative adjustment value closer or farther from the target power
value for the segment corresponding to the given slot. The correction
value is added to consecutive slots in the segment. The algorithm also
checks the total amount of adjustment applied to the slots over a sliding
adjustment window to make sure that the total amount of adjustment
applied to the slots in the window do not exceed a predetermined maximum
threshold.