move PL comutation at MAC
This commit is contained in:
@@ -122,8 +122,6 @@ void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue,
|
||||
uint32_t rx_power_fil_dB,
|
||||
uint8_t gNB_id);
|
||||
|
||||
void compute_nr_PL(PHY_VARS_NR_UE *ue, int ssb_index);
|
||||
|
||||
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
|
||||
NR_UE_PDSCH **pdsch_vars,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
@@ -46,31 +46,6 @@
|
||||
//#define DEBUG_MEAS_UE
|
||||
//#define DEBUG_RANK_EST
|
||||
|
||||
// Returns the pathloss in dB for the active UL BWP on the selected carrier based on the DL RS associated with the PRACH transmission
|
||||
// computation according to clause 7.4 (Physical random access channel) of 3GPP TS 38.213 version 16.3.0 Release 16
|
||||
// Assumptions:
|
||||
// - PRACH transmission from a UE is not in response to a detection of a PDCCH order by the UE
|
||||
// Measurement units:
|
||||
// - referenceSignalPower: dBm/RE (average EPRE of the resources elements that carry secondary synchronization signals in dBm)
|
||||
void compute_nr_PL(PHY_VARS_NR_UE *ue, int ssb_index){
|
||||
|
||||
//TODO improve PL measurements. Probably not correct as it is.
|
||||
|
||||
long referenceSignalPower = ue->nrUE_config.ssb_config.ss_pbch_power;
|
||||
int16_t pathloss = (int16_t)(referenceSignalPower - ue->measurements.ssb_rsrp_dBm[ssb_index]);
|
||||
|
||||
LOG_D(PHY, "In %s: pathloss %d dB, UE RX total gain %d dB, referenceSignalPower %ld dBm/RE (%f mW), RSRP %d dBm (%f mW)\n",
|
||||
__FUNCTION__,
|
||||
pathloss,
|
||||
ue->rx_total_gain_dB,
|
||||
referenceSignalPower,
|
||||
pow(10, referenceSignalPower/10),
|
||||
ue->measurements.ssb_rsrp_dBm[ssb_index],
|
||||
pow(10, ue->measurements.ssb_rsrp_dBm[ssb_index]/10));
|
||||
|
||||
ue->measurements.pathloss = pathloss;
|
||||
}
|
||||
|
||||
uint32_t get_nr_rx_total_gain_dB (module_id_t Mod_id,uint8_t CC_id)
|
||||
{
|
||||
|
||||
|
||||
@@ -147,8 +147,6 @@ typedef struct {
|
||||
//! total estimated noise power (dBm)
|
||||
short n0_power_tot_dBm;
|
||||
|
||||
int16_t pathloss;
|
||||
|
||||
// UE measurements
|
||||
//! estimated received spatial signal power (linear)
|
||||
int rx_spatial_power[NUMBER_OF_CONNECTED_gNB_MAX][2][2];
|
||||
@@ -596,7 +594,6 @@ typedef struct {
|
||||
// when off, defaults to frequency domain interpolation
|
||||
int chest_freq;
|
||||
int chest_time;
|
||||
int generate_ul_signal[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
UE_NR_SCAN_INFO_t scan_info[NB_BANDS_MAX];
|
||||
|
||||
|
||||
@@ -173,7 +173,6 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.cell_id = frame_parms->Nid_cell;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_start_subcarrier = frame_parms->ssb_start_subcarrier;
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.rsrp_dBm = ue->measurements.ssb_rsrp_dBm[frame_parms->ssb_index];
|
||||
rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pathloss = ue->measurements.pathloss;
|
||||
break;
|
||||
case FAPI_NR_CSIRS_IND:
|
||||
memcpy(&rx_ind->rx_indication_body[n_pdus - 1].csirs_measurements,
|
||||
@@ -1100,7 +1099,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
|
||||
LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx);
|
||||
nr_ue_pbch_procedures(gNB_id, ue, proc, estimateSz, dl_ch_estimates, phy_pdcch_config);
|
||||
compute_nr_PL(ue, ssb_index);
|
||||
|
||||
if (ue->no_timing_correction==0) {
|
||||
LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction);
|
||||
|
||||
@@ -213,12 +213,8 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
|
||||
pucch_pdu = &pucch_vars->pucch_pdu[i];
|
||||
uint16_t nb_of_prbs = pucch_pdu->prb_size;
|
||||
/* Generate PUCCH signal according to its format and parameters */
|
||||
ue->generate_ul_signal[gNB_id] = 1;
|
||||
|
||||
int16_t PL = ue->measurements.pathloss; /* LTE function because NR path loss not yet implemented FFS TODO NR */
|
||||
int contributor = (10 * log10((double)(pow(2,(ue->frame_parms.numerology_index)) * nb_of_prbs)));
|
||||
|
||||
int16_t pucch_tx_power = pucch_pdu->pucch_tx_power + contributor + PL;
|
||||
int16_t pucch_tx_power = pucch_pdu->pucch_tx_power;
|
||||
|
||||
if (pucch_tx_power > ue->tx_power_max_dBm)
|
||||
pucch_tx_power = ue->tx_power_max_dBm;
|
||||
|
||||
Reference in New Issue
Block a user