remove unused ulsch measurements at gNB
This commit is contained in:
@@ -188,74 +188,3 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB, int slot, int first_symb, int num_sy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scope: This function computes the UL SNR from the UL channel estimates
|
|
||||||
//
|
|
||||||
// Todo:
|
|
||||||
// - averaging IIR filter for RX power and noise
|
|
||||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB,
|
|
||||||
NR_gNB_ULSCH_t *ulsch,
|
|
||||||
NR_gNB_PUSCH *pusch_vars,
|
|
||||||
unsigned char symbol,
|
|
||||||
uint8_t nrOfLayers)
|
|
||||||
{
|
|
||||||
uint32_t rx_power_tot = 0;
|
|
||||||
unsigned short rx_power_avg_dB;
|
|
||||||
unsigned short rx_power_tot_dB;
|
|
||||||
RU_t *ru = gNB->RU_list[0];
|
|
||||||
double rx_gain, rx_gain_offset;
|
|
||||||
if (ru && ru->rfdevice.openair0_cfg) {
|
|
||||||
rx_gain = ru->rfdevice.openair0_cfg->rx_gain[0];
|
|
||||||
rx_gain_offset = ru->rfdevice.openair0_cfg->rx_gain_offset[0];
|
|
||||||
} else if (ru && ru->ifdevice.openair0_cfg) {
|
|
||||||
rx_gain = ru->ifdevice.openair0_cfg->rx_gain[0];
|
|
||||||
rx_gain_offset = ru->ifdevice.openair0_cfg->rx_gain_offset[0];
|
|
||||||
} else {
|
|
||||||
LOG_W(NR_PHY, "no device for rx gain, take arbitrary gain = 1)\n");
|
|
||||||
rx_gain = 1;
|
|
||||||
rx_gain_offset = 0;
|
|
||||||
}
|
|
||||||
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
|
|
||||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
|
||||||
int ch_offset = fp->ofdm_symbol_size * symbol;
|
|
||||||
int N_RB_UL = ulsch->harq_process->ulsch_pdu.rb_size;
|
|
||||||
ulsch_measurements_gNB *ulsch_measurements = &ulsch->ulsch_measurements;
|
|
||||||
|
|
||||||
int rx_power[fp->nb_antennas_rx];
|
|
||||||
int rx_spatial_power[nrOfLayers][fp->nb_antennas_rx];
|
|
||||||
for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++){
|
|
||||||
rx_power[aarx] = 0;
|
|
||||||
|
|
||||||
for (int aatx = 0; aatx < nrOfLayers; aatx++){
|
|
||||||
rx_spatial_power[aatx][aarx] =
|
|
||||||
(signal_energy_nodc((c16_t*)&pusch_vars->ul_ch_estimates[aatx * fp->nb_antennas_rx + aarx][ch_offset],
|
|
||||||
N_RB_UL * NR_NB_SC_PER_RB));
|
|
||||||
|
|
||||||
if (rx_spatial_power[aatx][aarx] < 0) {
|
|
||||||
rx_spatial_power[aatx][aarx] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rx_power[aarx] += rx_spatial_power[aatx][aarx];
|
|
||||||
}
|
|
||||||
LOG_D(PHY, "[RNTI %04x] RX power in antenna %d = %d\n", ulsch->rnti, aarx, rx_power[aarx]);
|
|
||||||
|
|
||||||
rx_power_tot += rx_power[aarx];
|
|
||||||
}
|
|
||||||
|
|
||||||
rx_power_tot_dB = (unsigned short)dB_fixed(rx_power_tot);
|
|
||||||
rx_power_avg_dB = rx_power_tot_dB;
|
|
||||||
|
|
||||||
ulsch_measurements->wideband_cqi_tot = dB_fixed2(rx_power_tot, meas->n0_power_tot);
|
|
||||||
ulsch_measurements->rx_rssi_dBm =
|
|
||||||
rx_power_avg_dB + 30 - SQ15_SQUARED_NORM_FACTOR_DB - (rx_gain - rx_gain_offset) - dB_fixed(fp->ofdm_symbol_size);
|
|
||||||
|
|
||||||
LOG_D(PHY,
|
|
||||||
"[RNTI %04x] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d\n",
|
|
||||||
ulsch->rnti,
|
|
||||||
ulsch_measurements->rx_rssi_dBm,
|
|
||||||
rx_power_avg_dB,
|
|
||||||
N_RB_UL,
|
|
||||||
ulsch_measurements->wideband_cqi_tot,
|
|
||||||
meas->n0_power_tot,
|
|
||||||
rx_power_tot);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -59,12 +59,6 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
|
|||||||
|
|
||||||
void gNB_I0_measurements(PHY_VARS_gNB *gNB, int slot, int first_symb, int num_symb, uint32_t rb_mask_ul[14][9]);
|
void gNB_I0_measurements(PHY_VARS_gNB *gNB, int slot, int first_symb, int num_symb, uint32_t rb_mask_ul[14][9]);
|
||||||
|
|
||||||
void nr_gnb_measurements(PHY_VARS_gNB *gNB,
|
|
||||||
NR_gNB_ULSCH_t *ulsch,
|
|
||||||
NR_gNB_PUSCH *pusch_vars,
|
|
||||||
unsigned char symbol,
|
|
||||||
uint8_t nrOfLayers);
|
|
||||||
|
|
||||||
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||||
const c16_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]);
|
const c16_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]);
|
||||||
|
|
||||||
|
|||||||
@@ -1188,12 +1188,7 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB,
|
|||||||
pusch_ch_est_dmrs_pos_slot_mem);
|
pusch_ch_est_dmrs_pos_slot_mem);
|
||||||
nvar += nvar_tmp;
|
nvar += nvar_tmp;
|
||||||
}
|
}
|
||||||
// measure the SNR from the channel estimation
|
|
||||||
nr_gnb_measurements(gNB,
|
|
||||||
&gNB->ulsch[ulsch_id],
|
|
||||||
pusch_vars,
|
|
||||||
symbol,
|
|
||||||
rel15_ul->nrOfLayers);
|
|
||||||
allocCast2D(n0_subband_power,
|
allocCast2D(n0_subband_power,
|
||||||
unsigned int,
|
unsigned int,
|
||||||
gNB->measurements.n0_subband_power,
|
gNB->measurements.n0_subband_power,
|
||||||
|
|||||||
@@ -215,13 +215,6 @@ static inline int crcType(int nbSeg, int len)
|
|||||||
return len > NR_MAX_PDSCH_TBS ? CRC24_A : CRC16;
|
return len > NR_MAX_PDSCH_TBS ? CRC24_A : CRC16;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
//! estimated rssi (dBm)
|
|
||||||
int rx_rssi_dBm;
|
|
||||||
/// Wideband CQI (sum of all RX antennas, in dB)
|
|
||||||
char wideband_cqi_tot;
|
|
||||||
} ulsch_measurements_gNB;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t frame;
|
uint32_t frame;
|
||||||
uint32_t slot;
|
uint32_t slot;
|
||||||
@@ -243,7 +236,6 @@ typedef struct {
|
|||||||
/// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around
|
/// Flag to indicate that the UL configuration has been handled. Used to remove a stale ULSCH when frame wraps around
|
||||||
uint8_t handled;
|
uint8_t handled;
|
||||||
delay_t delay;
|
delay_t delay;
|
||||||
ulsch_measurements_gNB ulsch_measurements;
|
|
||||||
} NR_gNB_ULSCH_t;
|
} NR_gNB_ULSCH_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user