From cc4a4b05366ed5dca4b965ffbdf587ff789d1576 Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 18 Apr 2016 01:14:46 +0200 Subject: [PATCH] Minor fixes and improvements --- srslte/include/srslte/common/phy_common.h | 2 +- srslte/lib/ch_estimation/src/chest_dl.c | 10 ++-------- srslte/lib/sync/src/sync.c | 2 +- srslte/lib/ue/src/ue_dl.c | 6 +++++- srslte/lib/ue/src/ue_sync.c | 5 +++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/srslte/include/srslte/common/phy_common.h b/srslte/include/srslte/common/phy_common.h index e9ef965d2..3f168d0c9 100644 --- a/srslte/include/srslte/common/phy_common.h +++ b/srslte/include/srslte/common/phy_common.h @@ -128,7 +128,7 @@ typedef enum {SRSLTE_CP_NORM, SRSLTE_CP_EXT} srslte_cp_t; #define SRSLTE_NOF_LTE_BANDS 29 #define SRSLTE_DEFAULT_MAX_FRAMES_PBCH 500 -#define SRSLTE_DEFAULT_MAX_FRAMES_PSS 50 +#define SRSLTE_DEFAULT_MAX_FRAMES_PSS 10 #define SRSLTE_DEFAULT_NOF_VALID_PSS_FRAMES 10 diff --git a/srslte/lib/ch_estimation/src/chest_dl.c b/srslte/lib/ch_estimation/src/chest_dl.c index 838d556a9..c2ec616a6 100644 --- a/srslte/lib/ch_estimation/src/chest_dl.c +++ b/srslte/lib/ch_estimation/src/chest_dl.c @@ -125,14 +125,8 @@ int srslte_chest_dl_init(srslte_chest_dl_t *q, srslte_cell_t cell) goto clean_exit; } - q->smooth_filter_len = 0; - -#ifdef DEFAULT_FILTER_LEN - set_default_filter(q, DEFAULT_FILTER_LEN); -#else - float fil[3] = {0.1, 0.8, 0.1}; - srslte_chest_dl_set_smooth_filter(q, fil, 3); -#endif + q->smooth_filter_len = 3; + srslte_chest_dl_set_smooth_filter3_coeff(q, 0.1); q->cell = cell; } diff --git a/srslte/lib/sync/src/sync.c b/srslte/lib/sync/src/sync.c index bde37f0f1..faa41946b 100644 --- a/srslte/lib/sync/src/sync.c +++ b/srslte/lib/sync/src/sync.c @@ -471,7 +471,7 @@ srslte_sync_find_ret_t srslte_sync_find(srslte_sync_t *q, cf_t *input, uint32_t ret = SRSLTE_SYNC_NOFOUND; } - INFO("SYNC ret=%d N_id_2=%d find_offset=%d frame_len=%d, pos=%d peak=%.2f threshold=%.2f sf_idx=%d, CFO=%.3f KHz\n", + DEBUG("SYNC ret=%d N_id_2=%d find_offset=%d frame_len=%d, pos=%d peak=%.2f threshold=%.2f sf_idx=%d, CFO=%.3f KHz\n", ret, q->N_id_2, find_offset, q->frame_size, peak_pos, q->peak_value, q->threshold, q->sf_idx, 15*(q->cfo_i+q->mean_cfo)); diff --git a/srslte/lib/ue/src/ue_dl.c b/srslte/lib/ue/src/ue_dl.c index 4ac444284..ec8ed2447 100644 --- a/srslte/lib/ue/src/ue_dl.c +++ b/srslte/lib/ue/src/ue_dl.c @@ -102,7 +102,7 @@ int srslte_ue_dl_init(srslte_ue_dl_t *q, fprintf(stderr, "Error initiating SFO correct\n"); goto clean_exit; } - srslte_cfo_set_tol(&q->sfo_correct, 0); + srslte_cfo_set_tol(&q->sfo_correct, 1e-5/q->fft.symbol_sz); q->sf_symbols = srslte_vec_malloc(CURRENT_SFLEN_RE * sizeof(cf_t)); if (!q->sf_symbols) { @@ -194,12 +194,16 @@ int srslte_ue_dl_decode_fft_estimate(srslte_ue_dl_t *q, cf_t *input, uint32_t sf /* Correct SFO multiplying by complex exponential in the time domain */ if (q->sample_offset) { + struct timeval t[3]; + gettimeofday(&t[1], NULL); for (int i=0;i<2*SRSLTE_CP_NSYMB(q->cell.cp);i++) { srslte_cfo_correct(&q->sfo_correct, &q->sf_symbols[i*q->cell.nof_prb*SRSLTE_NRE], &q->sf_symbols[i*q->cell.nof_prb*SRSLTE_NRE], q->sample_offset / q->fft.symbol_sz); } + gettimeofday(&t[2], NULL); + get_time_interval(t); } return srslte_ue_dl_decode_estimate(q, sf_idx, cfi); diff --git a/srslte/lib/ue/src/ue_sync.c b/srslte/lib/ue/src/ue_sync.c index 3c4c432dd..a3f266fdc 100644 --- a/srslte/lib/ue/src/ue_sync.c +++ b/srslte/lib/ue/src/ue_sync.c @@ -361,7 +361,7 @@ static int track_peak_ok(srslte_ue_sync_t *q, uint32_t track_idx) { q->sf_idx = srslte_sync_get_sf_idx(&q->strack); q->frame_no_cnt++; if (q->frame_no_cnt >= TRACK_MAX_LOST) { - printf("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); + INFO("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); q->state = SF_FIND; } } else { @@ -426,7 +426,7 @@ static int track_peak_no(srslte_ue_sync_t *q) { /* if we missed too many PSS go back to FIND and consider this frame unsynchronized */ q->frame_no_cnt++; if (q->frame_no_cnt >= TRACK_MAX_LOST) { - printf("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); + INFO("\n%d frames lost. Going back to FIND\n", (int) q->frame_no_cnt); q->state = SF_FIND; return 0; } else { @@ -622,6 +622,7 @@ int srslte_ue_sync_zerocopy(srslte_ue_sync_t *q, cf_t *input_buffer) { void srslte_ue_sync_reset(srslte_ue_sync_t *q) { if (!q->file_mode) { + srslte_sync_reset(&q->sfind); srslte_sync_reset(&q->strack); } else { q->sf_idx = 9;