Commit f52f4bab authored by Khodr Saaifan's avatar Khodr Saaifan Committed by Thomas Schlichter

Code Clean Up: UE Measurements are working fine includes RSRP, RSSI, Noise...

Code Clean Up: UE Measurements are working fine includes RSRP, RSSI, Noise Floor, Rank calc, and pmi. In addition, the UE meas is corrected in print_stats.c
parent 2d7336a6
......@@ -6792,7 +6792,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
int i, aarx;
uint16_t pmiq=0;
uint32_t pmivect = 0;
uint8_t rank = meas->rank[eNB_id];
uint8_t rank = meas->rank[eNB_id];//sfn: rank is 1
int pmi_re,pmi_im;
int nb_subbands=0;
......@@ -6828,13 +6828,13 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
// pmi_im = meas->subband_pmi_im[eNB_id][i][meas->selected_rx_antennas[eNB_id][i]];
// printf("pmi => (%d,%d)\n",pmi_re,pmi_im);
if ((pmi_re > pmi_im) && (pmi_re > -pmi_im))
if ((pmi_re > pmi_im) && (pmi_re > -pmi_im))//angle -45 to 45
pmiq = PMI_2A_11;
else if ((pmi_re < pmi_im) && (pmi_re > -pmi_im))
else if ((pmi_re < pmi_im) && (pmi_re > -pmi_im))//angle 45 to 135
pmiq = PMI_2A_1j;
else if ((pmi_re < pmi_im) && (pmi_re < -pmi_im))
else if ((pmi_re < pmi_im) && (pmi_re < -pmi_im))//angle 135 to 225
pmiq = PMI_2A_1m1;
else if ((pmi_re > pmi_im) && (pmi_re < -pmi_im))
else if ((pmi_re > pmi_im) && (pmi_re < -pmi_im))//angle 225 to 315
pmiq = PMI_2A_1mj;
// printf("subband %d, pmi%d \n",i,pmiq);
......@@ -6898,9 +6898,16 @@ uint16_t quantize_subband_pmi2(PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_i
pmiq = PMI_2A_1mj;
pmivect |= (pmiq<<(2*i));
} else {
// This needs to be done properly!!!
pmivect = 0;
} else if (rank==1)
{
pmi_re = meas->subband_pmi_re[eNB_id][i][a_id];
pmi_im = meas->subband_pmi_im[eNB_id][i][a_id];
if (pmi_re >= pmi_im)
pmiq = PMI_2A_R1_11;
else
pmiq = PMI_2A_R1_1j;
pmivect |= ((pmiq-1)<<(i)); //shift 1 since only one bit
}
}
......@@ -7138,13 +7145,13 @@ void fill_CQI(LTE_UE_ULSCH_t *ulsch,PHY_MEASUREMENTS *meas,uint8_t eNB_id,uint8_
switch (uci_format) {
case wideband_cqi_rank1_2A:
((wideband_cqi_rank1_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode);
((wideband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,7);
((wideband_cqi_rank1_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,25);
break;
case wideband_cqi_rank2_2A:
((wideband_cqi_rank2_2A_5MHz *)o)->cqi1 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->cqi2 = sinr2cqi(sinr_tmp,trans_mode); //FIXME: calculate rank2 cqi
((wideband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,7);
((wideband_cqi_rank2_2A_5MHz *)o)->pmi = quantize_subband_pmi(meas,eNB_id,25);
break;
case HLC_subband_cqi_nopmi:
......
......@@ -37,6 +37,8 @@
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
//SFN
#include "sudas_tm4.h"
#ifndef USER_MODE
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
......@@ -1431,6 +1433,9 @@ void rx_phich(PHY_VARS_UE *ue,
ulsch->O_RI = 0;
ulsch->O = 0;
ulsch->uci_format = HLC_subband_cqi_nopmi;
//sfn
//sudas_LOG_PHY(debug_sudas_LOG_PHY,"last ret: format HLC_subband_cqi_nopmi\n");
// fflush(debug_sudas_LOG_PHY);
// disable phich decoding since it is the last retransmission
ulsch->harq_processes[harq_pid]->status = IDLE;
......@@ -1443,6 +1448,10 @@ void rx_phich(PHY_VARS_UE *ue,
}
else
{
//sfn
//sudas_LOG_PHY(debug_sudas_LOG_PHY,"ret: format HLC_subband_cqi_nopmi\n");
// fflush(debug_sudas_LOG_PHY);
// ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
ulsch->harq_processes[harq_pid]->rvidx = rv_table[ulsch->harq_processes[harq_pid]->round&3];
ulsch->O_RI = 0;
......@@ -1610,6 +1619,10 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
ulsch[UE_id]->harq_processes[harq_pid]->Or1 = 0;
ulsch[UE_id]->harq_processes[harq_pid]->uci_format = HLC_subband_cqi_nopmi;
//sfn
//sudas_LOG_PHY(debug_sudas_LOG_PHY,"ACK : format HLC_subband_cqi_nopmi\n");
// fflush(debug_sudas_LOG_PHY);
} else {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
eNB->Mod_id,harq_pid,proc->frame_tx,subframe);
......
This diff is collapsed.
......@@ -36,6 +36,8 @@
#include "LAYER2/MAC/defs.h"
#include "SCHED/defs.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//SFN
#include "sudas_tm4.h"
#include "assertions.h"
......@@ -269,16 +271,28 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
ulsch->O_RI = 1;
if (meas->rank[eNB_id] == 1) {
//SFN
// sudas_LOG_PHY(debug_sudas_LOG_PHY,"Rank 2, format wideband_cqi_rank2_2A\n");
// fflush(debug_sudas_LOG_PHY);
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
ulsch->o_RI[0] = 1;
} else {
//SFN
// sudas_LOG_PHY(debug_sudas_LOG_PHY,"Rank 1, format wideband_cqi_rank1_2A\n");
// fflush(debug_sudas_LOG_PHY);
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
ulsch->o_RI[0] = 0;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
//sfn
// sudas_LOG_PHY(debug_sudas_LOG_PHY,"default, format HLC_subband_cqi_nopmi\n");
// fflush(debug_sudas_LOG_PHY);
fill_CQI(ulsch,meas,eNB_id,0,ue->frame_parms.N_RB_DL,0, transmission_mode,ue->sinr_eff);
if (((proc->frame_tx % 100) == 0) || (proc->frame_tx < 10))
......
......@@ -541,7 +541,7 @@ int trx_usrp_set_gains(openair0_device* device,
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0);
// limit to maximum gain
if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) {
LOG_E(PHY,"RX Gain 0 too high, reduce by %f dB\n",
LOG_E(PHY,"RX Gain 0 too high, reduce by %f dB\n",openair0_cfg[0].rx_gain_offset[0],
openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] - gain_range.stop());
exit(-1);
}
......
......@@ -721,7 +721,7 @@ static void check_dev_config( rrh_module_t *mod_enb) {
mod_enb->devs->openair0_cfg->rx_freq[3],
mod_enb->devs->openair0_cfg->tx_freq[3],
mod_enb->devs->openair0_cfg->rxg_mode[0],
mod_enb->devs->openair0_cfg->tx_gain[0],
mod_enb->devs->openair0_cfg->rx_gain[0],
mod_enb->devs->openair0_cfg->tx_gain[0],
mod_enb->devs->openair0_cfg->rx_gain[1],
mod_enb->devs->openair0_cfg->tx_gain[1],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment