diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 9c9ab1a29b951fdb530b1f47d6a654f75453ad08..4f11f79352ec608d6c6131eb3180acfb4af2dc5b 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -1857,6 +1857,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, generate_ul_ref_sigs_rx(); + init_ulsch_power_LUT(); + // SRS for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) { srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t)); diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 441cd5539a72102c7f16a0a004f1a7ca4fc8309a..3ee8df87e3296bbb2c2331e77032264a6cc5cf55 100644 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -2109,6 +2109,8 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t *payload); +void init_ulsch_power_LUT(void); + /*! \brief Check for PRACH TXop in subframe @param frame_parms Pointer to LTE_DL_FRAME_PARMS diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index 43c14bde1c1a2178bc964b86b5ae0eca4e929608..8e97a9af2eed59ea7931f2288b412af1c49df11a 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -1102,7 +1102,15 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, #endif } +int ulsch_power_LUT[750]; +void init_ulsch_power_LUT() { + + int i; + + for (i=0;i<750;i++) ulsch_power_LUT[i] = (int)ceil((pow(2.0,(double)i/100) - 1.0)); + +} void rx_ulsch(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, @@ -1166,19 +1174,26 @@ void rx_ulsch(PHY_VARS_eNB *eNB, int correction_factor = 1; int deltaMCS=1; - int MPR_times_Ks; + int MPR_times_100Ks; if (deltaMCS==1) { -// Note we're using TBS instead of sumKr, since didn't run segmentation yet! - MPR_times_Ks = 5*ulsch[UE_id]->harq_processes[harq_pid]->TBS/(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*4*ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); - if (MPR_times_Ks > 0) correction_factor = (1<<MPR_times_Ks) - 1; + // Note we're using TBS instead of sumKr, since didn't run segmentation yet! + + MPR_times_100Ks = 500*ulsch[UE_id]->harq_processes[harq_pid]->TBS/(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*4*ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch); + + AssertFatal(MPR_times_100Ks < 750 && MPR_times_100Ks >= 0,"Impossible value for MPR_times_100Ks %d (TBS %d,Nre %d)\n", + MPR_times_100Ks,ulsch[UE_id]->harq_processes[harq_pid]->TBS, + (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*4*ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch)); + + if (MPR_times_100Ks > 0) correction_factor = ulsch_power_LUT[MPR_times_100Ks]; + } for (i=0; i<frame_parms->nb_antennas_rx; i++) { pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i], ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)/correction_factor; -//printf("%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i])); - + /* printf("%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_times10(pusch_vars->ulsch_power[i])); + */ } diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 8e476e06b7075aeba59f9dbee11e5b589d51de61..c7cc203da6ba20e2316b843e88f3da6e9edc216c 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -577,7 +577,6 @@ static void* eNB_thread_prach_br( void* param ) { #endif -extern void init_fep_thread(PHY_VARS_eNB *, pthread_attr_t *); extern void init_td_thread(PHY_VARS_eNB *, pthread_attr_t *); extern void init_te_thread(PHY_VARS_eNB *, pthread_attr_t *);