Practical Channel-Aware Resource Allocation: With MATLAB and Python Code