From 9741f87e2ccdc4a6f82ce2c3c31e71274432e5d9 Mon Sep 17 00:00:00 2001 From: ismagom Date: Thu, 21 Apr 2016 10:07:49 +0200 Subject: [PATCH 1/3] Reduced time offset correcting period to 25 ms --- srslte/lib/ue/ue_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srslte/lib/ue/ue_sync.c b/srslte/lib/ue/ue_sync.c index a301b0c24..a4e87dc6a 100644 --- a/srslte/lib/ue/ue_sync.c +++ b/srslte/lib/ue/ue_sync.c @@ -44,7 +44,7 @@ cf_t dummy[MAX_TIME_OFFSET]; #define TRACK_MAX_LOST 4 #define TRACK_FRAME_SIZE 32 #define FIND_NOF_AVG_FRAMES 4 -#define DEFAULT_SAMPLE_OFFSET_CORRECT_PERIOD 10 +#define DEFAULT_SAMPLE_OFFSET_CORRECT_PERIOD 5 #define DEFAULT_SFO_EMA_COEFF 0.1 cf_t dummy_offset_buffer[1024*1024]; From 73c50d3b52ffac7a8094bce25cf5a2714af4e6d3 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 25 Apr 2016 21:55:52 +0200 Subject: [PATCH 2/3] Fix erroneously-capitalized KHz -> kHz --- srslte/examples/cell_measurement.c | 4 ++-- srslte/examples/pdsch_ue.c | 2 +- srslte/examples/tutorial_examples/pss.c | 2 +- srslte/lib/sync/sync.c | 2 +- srslte/lib/sync/test/pss_file.c | 2 +- srslte/lib/sync/test/pss_usrp.c | 2 +- srslte/lib/ue/ue_sync.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/srslte/examples/cell_measurement.c b/srslte/examples/cell_measurement.c index 6529490dc..6de938c78 100644 --- a/srslte/examples/cell_measurement.c +++ b/srslte/examples/cell_measurement.c @@ -313,7 +313,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Error decoding UE DL\n");fflush(stdout); return -1; } else if (n == 0) { - printf("CFO: %+6.4f KHz, SFO: %+6.4f Khz, NOI: %.2f, PDCCH-Det: %.3f\r", + printf("CFO: %+6.4f kHz, SFO: %+6.4f kHz, NOI: %.2f, PDCCH-Det: %.3f\r", srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync)/1000, srslte_sch_average_noi(&ue_dl.pdsch.dl_sch), (float) ue_dl.nof_detected/nof_trials); @@ -355,7 +355,7 @@ int main(int argc, char **argv) { // Plot and Printf if ((nframes%10) == 0) { - printf("CFO: %+8.4f KHz, SFO: %+8.4f Khz, RSSI: %5.1f dBm, RSSI/ref-symbol: %+5.1f dBm, " + printf("CFO: %+8.4f kHz, SFO: %+8.4f kHz, RSSI: %5.1f dBm, RSSI/ref-symbol: %+5.1f dBm, " "RSRP: %+5.1f dBm, RSRQ: %5.1f dB, SNR: %5.1f dB\r", srslte_ue_sync_get_cfo(&ue_sync)/1000, srslte_ue_sync_get_sfo(&ue_sync)/1000, 10*log10(rssi*1000) - rx_gain_offset, diff --git a/srslte/examples/pdsch_ue.c b/srslte/examples/pdsch_ue.c index a652d132a..0fc43d36d 100644 --- a/srslte/examples/pdsch_ue.c +++ b/srslte/examples/pdsch_ue.c @@ -570,7 +570,7 @@ int main(int argc, char **argv) { if (gain < 0) { gain = 10*log10(srslte_agc_get_gain(&ue_sync.agc)); } - printf("CFO: %+6.2f KHz, " + printf("CFO: %+6.2f kHz, " "SNR: %4.1f dB, " "PDCCH-Miss: %5.2f%%, PDSCH-BLER: %5.2f%%\r", diff --git a/srslte/examples/tutorial_examples/pss.c b/srslte/examples/tutorial_examples/pss.c index 8a665d700..fc2f43242 100644 --- a/srslte/examples/tutorial_examples/pss.c +++ b/srslte/examples/tutorial_examples/pss.c @@ -296,7 +296,7 @@ int main(int argc, char **argv) { frame_cnt++; printf("[%5d]: Pos: %5d, PSR: %4.1f (~%4.1f) Pdet: %4.2f, " - "FA: %4.2f, CFO: %+4.1f KHz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f\%\r", + "FA: %4.2f, CFO: %+4.1f kHz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f\%\r", frame_cnt, peak_idx, peak_value, mean_peak, diff --git a/srslte/lib/sync/sync.c b/srslte/lib/sync/sync.c index faa41946b..41a4c5efc 100644 --- a/srslte/lib/sync/sync.c +++ b/srslte/lib/sync/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; } - 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", + 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/sync/test/pss_file.c b/srslte/lib/sync/test/pss_file.c index afca92f5c..7f70ad8ff 100644 --- a/srslte/lib/sync/test/pss_file.c +++ b/srslte/lib/sync/test/pss_file.c @@ -293,7 +293,7 @@ int main(int argc, char **argv) { frame_cnt++; printf("[%5d]: Pos: %5d, PSR: %4.1f (~%4.1f) Pdet: %4.2f, " - "FA: %4.2f, CFO: %+4.1f KHz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f%%\r", + "FA: %4.2f, CFO: %+4.1f kHz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f%%\r", frame_cnt, peak_idx - flen/10, peak_value, mean_peak, diff --git a/srslte/lib/sync/test/pss_usrp.c b/srslte/lib/sync/test/pss_usrp.c index 85ba3d9fe..74d9c8dea 100644 --- a/srslte/lib/sync/test/pss_usrp.c +++ b/srslte/lib/sync/test/pss_usrp.c @@ -301,7 +301,7 @@ int main(int argc, char **argv) { } printf("[%5d]: Pos: %5d (%d-%d), PSR: %4.1f (~%4.1f) Pdet: %4.2f, " - "FA: %4.2f, CFO: %+4.1f KHz, SFO: %+.2f Hz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f%%\r", + "FA: %4.2f, CFO: %+4.1f kHz, SFO: %+.2f Hz SSSmiss: %4.2f/%4.2f/%4.2f CPNorm: %.0f%%\r", frame_cnt, peak_idx, min_peak_, max_peak_, peak_value, mean_peak, diff --git a/srslte/lib/ue/ue_sync.c b/srslte/lib/ue/ue_sync.c index a301b0c24..345aae359 100644 --- a/srslte/lib/ue/ue_sync.c +++ b/srslte/lib/ue/ue_sync.c @@ -80,7 +80,7 @@ int srslte_ue_sync_init_file(srslte_ue_sync_t *q, uint32_t nof_prb, char *file_n goto clean_exit; } - INFO("Offseting input file by %d samples and %.1f KHz\n", offset_time, offset_freq/1000); + INFO("Offseting input file by %d samples and %.1f kHz\n", offset_time, offset_freq/1000); srslte_filesource_read(&q->file_source, dummy_offset_buffer, offset_time); srslte_ue_sync_reset(q); From ed063b04db47e7576587a9f6baaa64cf3f670a3b Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 25 Apr 2016 22:15:52 +0200 Subject: [PATCH 3/3] ch_estimation: Fix subframe_config switch in srslte_refsignal_srs_send_cs --- srslte/lib/ch_estimation/refsignal_ul.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srslte/lib/ch_estimation/refsignal_ul.c b/srslte/lib/ch_estimation/refsignal_ul.c index 854c87d3a..18003b451 100644 --- a/srslte/lib/ch_estimation/refsignal_ul.c +++ b/srslte/lib/ch_estimation/refsignal_ul.c @@ -681,13 +681,13 @@ int srslte_refsignal_srs_send_cs(uint32_t subframe_config, uint32_t sf_idx) { } else { return 0; } - } else if (subframe_config == 8) { + } else if (subframe_config == 7) { if (((sf_idx%tsfc)==0) || ((sf_idx%tsfc)==1)){ return 1; } else { return 0; } - } else if (subframe_config == 9) { + } else if (subframe_config == 8) { if (((sf_idx%tsfc)==2) || ((sf_idx%tsfc)==3)){ return 1; } else {