Added power allocation p_a in UE

This commit is contained in:
Xavier Arteaga 2017-11-21 11:51:18 +01:00
parent 91c9ddf244
commit 4ecd73c984
4 changed files with 12 additions and 2 deletions

View File

@ -3926,7 +3926,7 @@ typedef enum{
}LIBLTE_RRC_PDSCH_CONFIG_P_A_ENUM;
static const char liblte_rrc_pdsch_config_p_a_text[LIBLTE_RRC_PDSCH_CONFIG_P_A_N_ITEMS][20] = { "-6", "-4.77", "-3", "-1.77",
"0", "1", "2", "3"};
static const double liblte_rrc_pdsch_config_p_a_num[LIBLTE_RRC_PDSCH_CONFIG_P_A_N_ITEMS] = {-6, -4.77, -3, -1.77, 0, 1, 2, 3};
static const float liblte_rrc_pdsch_config_p_a_num[LIBLTE_RRC_PDSCH_CONFIG_P_A_N_ITEMS] = {-6, -4.77f, -3, -1.77f, 0, 1, 2, 3};
// Structs
// PDSCH Config Common struct defined above
// Functions

View File

@ -688,7 +688,7 @@ int srslte_pdsch_decode(srslte_pdsch_t *q,
float pdsch_scaling = 1.0f;
if (q->rho_a != 0.0f) {
pdsch_scaling = 1/q->rho_a;
pdsch_scaling = q->rho_a;
}
// Pre-decoder

View File

@ -601,6 +601,14 @@ int phch_worker::decode_pdsch(srslte_ra_dl_grant_t *grant, uint8_t *payload[SRSL
valid_config = false;
}
/* Set power allocation */
float rho_a = 1.0f, rho_b = 1.0f;
if (phy->config->dedicated.pdsch_cnfg_ded < LIBLTE_RRC_PDSCH_CONFIG_P_A_N_ITEMS) {
float rho_a_db = liblte_rrc_pdsch_config_p_a_num[(int) phy->config->dedicated.pdsch_cnfg_ded];
rho_a = powf(10.0f, rho_a_db / 20.0f) * sqrtf(2.0f);
}
srslte_ue_dl_set_power_alloc(&ue_dl, rho_a, rho_b);
Debug("DL Buffer TTI %d: Decoding PDSCH\n", tti);
/* Setup PDSCH configuration for this CFI, SFIDX and RVIDX */

View File

@ -1472,8 +1472,10 @@ void rrc::apply_phy_config_dedicated(LIBLTE_RRC_PHYSICAL_CONFIG_DEDICATED_STRUCT
}
if (phy_cnfg->pdsch_cnfg_ded_present) {
current_cfg->pdsch_cnfg_ded = phy_cnfg->pdsch_cnfg_ded;
rrc_log->info("Set PDSCH-Config=%s (present)\n", liblte_rrc_pdsch_config_p_a_text[(int) current_cfg->pdsch_cnfg_ded]);
} else if (apply_defaults) {
current_cfg->pdsch_cnfg_ded = LIBLTE_RRC_PDSCH_CONFIG_P_A_DB_0;
rrc_log->info("Set PDSCH-Config=%s (default)\n", liblte_rrc_pdsch_config_p_a_text[(int) current_cfg->pdsch_cnfg_ded]);
}
if (phy_cnfg->cqi_report_cnfg_present) {