|
|
@ -912,18 +912,20 @@ int srslte_pucch_decode(srslte_pucch_t* q,
|
|
|
|
// Equalization
|
|
|
|
// Equalization
|
|
|
|
srslte_predecoding_single(q->z_tmp, q->ce, q->z, NULL, nof_re, 1.0f, channel->noise_estimate);
|
|
|
|
srslte_predecoding_single(q->z_tmp, q->ce, q->z, NULL, nof_re, 1.0f, channel->noise_estimate);
|
|
|
|
|
|
|
|
|
|
|
|
// DMRS Detection
|
|
|
|
// Perform DMRS Detection, if enabled
|
|
|
|
cf_t _dmrs_corr = srslte_vec_acc_cc(q->ce, nof_re) / nof_re;
|
|
|
|
if (isnormal(cfg->threshold_dmrs_detection)) {
|
|
|
|
float _rms = __real__(conjf(_dmrs_corr) * _dmrs_corr);
|
|
|
|
cf_t _dmrs_corr = srslte_vec_acc_cc(q->ce, SRSLTE_NRE) / SRSLTE_NRE;
|
|
|
|
float _pow = srslte_vec_avg_power_cf(q->ce, nof_re);
|
|
|
|
float rms = __real__(conjf(_dmrs_corr) * _dmrs_corr);
|
|
|
|
float _r = _rms / _pow;
|
|
|
|
float power = srslte_vec_avg_power_cf(q->ce, SRSLTE_NRE);
|
|
|
|
|
|
|
|
data->dmrs_correlation = rms / power;
|
|
|
|
|
|
|
|
|
|
|
|
// Return not detected if the ratio is 0, NAN, +/- Infinity or below threshold
|
|
|
|
// Return not detected if the ratio is 0, NAN, +/- Infinity or below threshold
|
|
|
|
if (!isnormal(_r) || _r < cfg->threshold_dmrs_detection) {
|
|
|
|
if (!isnormal(data->dmrs_correlation) || data->dmrs_correlation < cfg->threshold_dmrs_detection) {
|
|
|
|
|
|
|
|
data->correlation = 0.0f;
|
|
|
|
data->detected = false;
|
|
|
|
data->detected = false;
|
|
|
|
data->correlation = NAN;
|
|
|
|
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Perform ML-decoding
|
|
|
|
// Perform ML-decoding
|
|
|
|
bool pucch_found = decode_signal(q, sf, cfg, pucch_bits, nof_re, nof_uci_bits, &data->correlation);
|
|
|
|
bool pucch_found = decode_signal(q, sf, cfg, pucch_bits, nof_re, nof_uci_bits, &data->correlation);
|
|
|
@ -1368,7 +1370,7 @@ void srslte_pucch_tx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data, char* str, uint32_t str_len)
|
|
|
|
void srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_pucch_res_t* pucch_res, char* str, uint32_t str_len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint32_t n = srslte_print_check(str,
|
|
|
|
uint32_t n = srslte_print_check(str,
|
|
|
|
str_len,
|
|
|
|
str_len,
|
|
|
@ -1378,7 +1380,13 @@ void srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data,
|
|
|
|
srslte_pucch_format_text_short(cfg->format),
|
|
|
|
srslte_pucch_format_text_short(cfg->format),
|
|
|
|
cfg->n_pucch);
|
|
|
|
cfg->n_pucch);
|
|
|
|
|
|
|
|
|
|
|
|
if (uci_data) {
|
|
|
|
if (pucch_res) {
|
|
|
|
srslte_uci_data_info(&cfg->uci_cfg, uci_data, &str[n], str_len - n);
|
|
|
|
if (isnormal(cfg->threshold_dmrs_detection)) {
|
|
|
|
|
|
|
|
n = srslte_print_check(str, str_len, n, ", dmrs_corr=%.3f", pucch_res->dmrs_correlation);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n = srslte_print_check(str, str_len, n, ", corr=%.3f", pucch_res->correlation);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
srslte_uci_data_info(&cfg->uci_cfg, &pucch_res->uci_data, &str[n], str_len - n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|