|
|
|
@ -482,8 +482,8 @@ public:
|
|
|
|
|
|
|
|
|
|
// Compute synch metrics and report it to the PHY state
|
|
|
|
|
sync_metrics_t new_sync_metrics = {};
|
|
|
|
|
new_sync_metrics.cfo = new_meas.cfo_hz;
|
|
|
|
|
set_sync_metrics(sync_metrics);
|
|
|
|
|
new_sync_metrics.cfo = new_meas.cfo_hz + ul_ext_cfo_hz;
|
|
|
|
|
set_sync_metrics(new_sync_metrics);
|
|
|
|
|
|
|
|
|
|
// Convert to CSI channel measurement and report new NZP-CSI-RS measurement to the PHY state
|
|
|
|
|
srsran_csi_channel_measurements_t measurements = {};
|
|
|
|
@ -499,11 +499,10 @@ public:
|
|
|
|
|
trs_measurements_mutex.lock();
|
|
|
|
|
trs_measurements.rsrp_dB = SRSRAN_VEC_SAFE_EMA(new_meas.rsrp_dB, trs_measurements.rsrp_dB, args.trs_epre_ema_alpha);
|
|
|
|
|
trs_measurements.epre_dB = SRSRAN_VEC_SAFE_EMA(new_meas.epre_dB, trs_measurements.epre_dB, args.trs_rsrp_ema_alpha);
|
|
|
|
|
trs_measurements.snr_dB = SRSRAN_VEC_SAFE_EMA(new_meas.snr_dB, trs_measurements.snr_dB, args.trs_sinr_ema_alpha);
|
|
|
|
|
// Consider CFO measurement invalid if the SNR is negative. In this case, set CFO to 0.
|
|
|
|
|
if (trs_measurements.snr_dB > 0.0f) {
|
|
|
|
|
if (new_meas.snr_dB > 0.0f) {
|
|
|
|
|
trs_measurements.cfo_hz = SRSRAN_VEC_SAFE_EMA(new_meas.cfo_hz, trs_measurements.cfo_hz, args.trs_cfo_ema_alpha);
|
|
|
|
|
} else {
|
|
|
|
|
trs_measurements.cfo_hz = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
trs_measurements.nof_re++;
|
|
|
|
|
trs_measurements_mutex.unlock();
|
|
|
|
|