function [User, BS] = parameter_def_bf_optimize(User,Cells,BS,Sim,Chn)

for c = 1:Sim.Num_Cell
    for b = 1:Sim.Num_BS
        
        BS(c,b).quantization_noise = Sim.sqr_gap * BS(c,b).compression_power / (2^(BS(c,b).current_compression_bkhaul) - 1);
      %  BS(c,b).bf_power_constraint = min(BS(c,b).total_power_budget - BS(c,b).quantization_noise, ...
      %      BS(c,b).total_power_budget/( Sim.sqr_gap/(2^BS(c,b).total_bkhaul_budget - 1)+ 1));        
      %  BS(c,b).compression_power_constraint = BS(c,b).quantization_noise / Sim.sqr_gap * (2^(BS(c,b).current_compression_bkhaul) - 1);
      %  BS(c,b).bf_power_constraint = min(BS(c,b).total_power_budget - BS(c,b).quantization_noise, BS(c,b).compression_power_constraint);

    end
end

for c = 1:Sim.Num_Cell
    for ik = 1:length(Cells(c).Scheduled_User)
        k = Cells(c).Scheduled_User(ik);
        
        User(c,k).eff_rx_noise = Sim.noise;
        
        for cc = 1:Sim.Num_Cell
            for bb = 1:Sim.Num_BS
                
                User(c,k).eff_rx_noise = User(c,k).eff_rx_noise + norm(Get_Chn(Chn, [cc bb], c,k, Sim))^2 * BS(cc,bb).quantization_noise;
            end
        end
 
    end
end
