1e3/RU2UE[ru_id][UE_id][CC_id]->sampling_rate,// sampling time (ns)
(double)PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB-66.227);// rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
#ifdef DEBUG_SIM
rx_pwr=signal_energy_fp(r_re0,r_im0,
nb_antennas_rx,
length<length_meas?length:length_meas,
0)/(12.0*frame_parms->N_RB_DL);
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (RU %d) %f dBm/RE for subframe %d\n",
1e3/UE2RU[0][ru_id][CC_id]->sampling_rate,// sampling time (ns)
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx-66.227);// rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
LOG_D(SIM,"UE %d: DL simulation 1: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
while(current_UE_rx_timestamp[UE_id][CC_id]<
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)){
LOG_D(SIM,"UE %d: DL simulation 2: UE_trx_read : current TS %"PRIi64", last TS %"PRIi64", sleeping\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
usleep(500);
}
LOG_D(SIM,"UE %d: DL simulation 3: UE_trx_read : current TS now %"PRIi64", last TS %"PRIi64"\n",UE_id,current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
//UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id];
AssertFatal(RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
AssertFatal(UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
1e3/RU2UE[ru_id][UE_id][CC_id]->sampling_rate,// sampling time (ns)
(double)PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB-66.227);// rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
#ifdef DEBUG_SIM
rx_pwr=signal_energy_fp(r_re0,r_im0,
nb_antennas_rx,
length<length_meas?length:length_meas,
0)/(12.0*frame_parms->N_RB_DL);
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (RU %d) %f dBm/RE for subframe %d\n",
1e3/UE2RU[0][ru_id][CC_id]->sampling_rate,// sampling time (ns)
(double)RC.ru[ru_id]->max_rxgain-(double)RC.ru[ru_id]->att_rx-66.227);// rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)