Per-antenna SNR

master
Ismael Gomez 7 years ago
parent 143bec18e3
commit a08c662028

@ -159,10 +159,6 @@ SRSLTE_API void srslte_chest_dl_average_subframe(srslte_chest_dl_t *q,
SRSLTE_API float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q); SRSLTE_API float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q);
SRSLTE_API float srslte_chest_dl_get_noise_estimate_ant_port(srslte_chest_dl_t *q,
uint32_t ant_idx,
uint32_t port_idx);
SRSLTE_API float srslte_chest_dl_get_cfo(srslte_chest_dl_t *q); SRSLTE_API float srslte_chest_dl_get_cfo(srslte_chest_dl_t *q);
SRSLTE_API float srslte_chest_dl_get_snr(srslte_chest_dl_t *q); SRSLTE_API float srslte_chest_dl_get_snr(srslte_chest_dl_t *q);

@ -596,22 +596,24 @@ float srslte_chest_dl_get_noise_estimate(srslte_chest_dl_t *q) {
return n/q->last_nof_antennas; return n/q->last_nof_antennas;
} }
float srslte_chest_dl_get_noise_estimate_ant_port(srslte_chest_dl_t *q, uint32_t ant_idx, uint32_t port_idx) {
return q->noise_estimate[ant_idx][port_idx];
}
float srslte_chest_dl_get_snr(srslte_chest_dl_t *q) { float srslte_chest_dl_get_snr(srslte_chest_dl_t *q) {
#ifdef FREQ_SEL_SNR #ifdef FREQ_SEL_SNR
int nref=SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, 0); int nref=SRSLTE_REFSIGNAL_NUM_SF(q->cell.nof_prb, 0);
return srslte_vec_acc_ff(q->snr_vector, nref)/nref; return srslte_vec_acc_ff(q->snr_vector, nref)/nref;
#else #else
return srslte_chest_dl_get_rsrp(q)/srslte_chest_dl_get_noise_estimate(q); float rsrp = 0;
for (int i=0;i<q->last_nof_antennas;i++) {
for (int j=0;j<q->cell.nof_ports;j++) {
rsrp += q->rsrp[i][j]/q->cell.nof_ports;
}
}
return rsrp/srslte_chest_dl_get_noise_estimate(q);
#endif #endif
} }
float srslte_chest_dl_get_snr_ant_port(srslte_chest_dl_t *q, uint32_t ant_idx, uint32_t port_idx) { float srslte_chest_dl_get_snr_ant_port(srslte_chest_dl_t *q, uint32_t ant_idx, uint32_t port_idx) {
return srslte_chest_dl_get_rsrp_ant_port(q, ant_idx, port_idx)/srslte_chest_dl_get_noise_estimate_ant_port(q, ant_idx, port_idx); return srslte_chest_dl_get_rsrp_ant_port(q, ant_idx, port_idx)/srslte_chest_dl_get_noise_estimate(q);
} }
float srslte_chest_dl_get_rssi(srslte_chest_dl_t *q) { float srslte_chest_dl_get_rssi(srslte_chest_dl_t *q) {

Loading…
Cancel
Save