Fix estimator

This commit is contained in:
ismagom 2015-02-25 10:05:57 +01:00
parent 83e3250c29
commit 9081f23ccb
2 changed files with 8 additions and 7 deletions

View File

@ -424,6 +424,7 @@ int main(int argc, char **argv) {
rsrp = 0; rsrp = 0;
} }
#ifdef adjust_estimator
/* Adjust channel estimator based on SNR */ /* Adjust channel estimator based on SNR */
if (10*log10(snr) < 5.0) { if (10*log10(snr) < 5.0) {
float f_low_snr[5]={0.05, 0.15, 0.6, 0.15, 0.05}; float f_low_snr[5]={0.05, 0.15, 0.6, 0.15, 0.05};
@ -435,7 +436,7 @@ int main(int argc, char **argv) {
float f_high_snr[3]={0.05, 0.9, 0.05}; float f_high_snr[3]={0.05, 0.9, 0.05};
chest_dl_set_filter_freq(&ue_dl.chest, f_high_snr, 3); chest_dl_set_filter_freq(&ue_dl.chest, f_high_snr, 3);
} }
#endif
} }
if (ue_sync_get_sfidx(&ue_sync) != 5 && ue_sync_get_sfidx(&ue_sync) != 0) { if (ue_sync_get_sfidx(&ue_sync) != 5 && ue_sync_get_sfidx(&ue_sync) != 0) {

View File

@ -63,7 +63,7 @@ int chest_dl_init(chest_dl_t *q, lte_cell_t cell)
{ {
bzero(q, sizeof(chest_dl_t)); bzero(q, sizeof(chest_dl_t));
ret = refsignal_cs_init(&q->csr_signal, cell); ret = refsignal_cs_generate(&q->csr_signal, cell);
if (ret != LIBLTE_SUCCESS) { if (ret != LIBLTE_SUCCESS) {
fprintf(stderr, "Error initializing CSR signal (%d)\n",ret); fprintf(stderr, "Error initializing CSR signal (%d)\n",ret);
goto clean_exit; goto clean_exit;
@ -117,13 +117,13 @@ int chest_dl_init(chest_dl_t *q, lte_cell_t cell)
} }
/* Set default time/freq filters */ /* Set default time/freq filters */
float f[3]={0.1, 0.8, 0.1}; float f[3]={0.15, 0.7, 0.15};
chest_dl_set_filter_freq(q, f, 3); chest_dl_set_filter_freq(q, f, 3);
//float f[5]={0.05, 0.15, 0.6, 0.15, 0.05}; //float f[5]={0.05, 0.15, 0.6, 0.15, 0.05};
//chest_dl_set_filter_freq(q, f, 5); //chest_dl_set_filter_freq(q, f, 5);
float t[2]={0.1, 0.9}; float t[2]={0.2, 0.8};
chest_dl_set_filter_time(q, t, 2); chest_dl_set_filter_time(q, t, 2);
q->cell = cell; q->cell = cell;
@ -285,9 +285,9 @@ static void interpolate_pilots(chest_dl_t *q, cf_t *ce, uint32_t port_id)
/* Interpolate in the frequency domain */ /* Interpolate in the frequency domain */
for (l=0;l<nsymbols;l++) { for (l=0;l<nsymbols;l++) {
uint32_t fidx_offset = refsignal_cs_fidx(q->cell, l, port_id, 0); uint32_t fidx_offset = refsignal_fidx(q->cell, l, port_id, 0);
interp_linear_offset(&q->interp_lin, &pilot_avg(0), interp_linear_offset(&q->interp_lin, &pilot_avg(0),
&ce[refsignal_cs_nsymbol(l,q->cell.cp, port_id) * q->cell.nof_prb * RE_X_RB], &ce[refsignal_nsymbol(l,q->cell.cp, port_id) * q->cell.nof_prb * RE_X_RB],
fidx_offset, RE_X_RB/2-fidx_offset); fidx_offset, RE_X_RB/2-fidx_offset);
} }
@ -323,7 +323,7 @@ float chest_dl_rssi(chest_dl_t *q, cf_t *input, uint32_t port_id) {
float rssi = 0; float rssi = 0;
uint32_t nsymbols = refsignal_cs_nof_symbols(port_id); uint32_t nsymbols = refsignal_cs_nof_symbols(port_id);
for (l=0;l<nsymbols;l++) { for (l=0;l<nsymbols;l++) {
cf_t *tmp = &input[refsignal_cs_nsymbol(l, q->cell.cp, port_id) * q->cell.nof_prb * RE_X_RB]; cf_t *tmp = &input[refsignal_nsymbol(l, q->cell.cp, port_id) * q->cell.nof_prb * RE_X_RB];
rssi += vec_dot_prod_conj_ccc(tmp, tmp, q->cell.nof_prb * RE_X_RB); rssi += vec_dot_prod_conj_ccc(tmp, tmp, q->cell.nof_prb * RE_X_RB);
} }
return rssi/nsymbols; return rssi/nsymbols;