From 86d4ce52e05255c64246f75317fe391aa0c80e8a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 15 Mar 2018 12:27:55 +0100 Subject: [PATCH] Make intra-frequency measurement period/length a parameter --- lib/include/srslte/interfaces/ue_interfaces.h | 2 ++ srsue/hdr/phy/phch_recv.h | 2 -- srsue/src/main.cc | 8 ++++++++ srsue/src/phy/phch_recv.cc | 14 +++++++------- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index e69419983..bea0cb05c 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -494,6 +494,8 @@ typedef struct { bool sic_pss_enabled; float rx_gain_offset; bool pdsch_csi_enabled; + uint32_t intra_freq_meas_len_ms; + uint32_t intra_freq_meas_period_ms; } phy_args_t; diff --git a/srsue/hdr/phy/phch_recv.h b/srsue/hdr/phy/phch_recv.h index f955b30ce..378dfb8f9 100644 --- a/srsue/hdr/phy/phch_recv.h +++ b/srsue/hdr/phy/phch_recv.h @@ -233,8 +233,6 @@ private: void write(uint32_t tti, cf_t *data, uint32_t nsamples); private: void run_thread(); - const static int INTRA_FREQ_MEAS_LEN_MS = 20; - const static int INTRA_FREQ_MEAS_PERIOD_MS = 200; const static int INTRA_FREQ_MEAS_PRIO = DEFAULT_PRIORITY + 5; scell_recv scell; diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 00fd23cf8..8753e7630 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -203,6 +203,14 @@ void parse_args(all_args_t *args, int argc, char *argv[]) { bpo::value(&args->expert.phy.equalizer_mode)->default_value("mmse"), "Equalizer mode") + ("expert.intra_freq_meas_len_ms", + bpo::value(&args->expert.phy.intra_freq_meas_len_ms)->default_value(20), + "Duration of the intra-frequency neighbour cell measurement in ms.") + + ("expert.intra_freq_meas_period_ms", + bpo::value(&args->expert.phy.intra_freq_meas_period_ms)->default_value(200), + "Period of intra-frequency neighbour cell measurement in ms. Maximum as per 3GPP is 200 ms.") + ("expert.cfo_is_doppler", bpo::value(&args->expert.phy.cfo_is_doppler)->default_value(false), "Assume detected CFO is doppler and correct the UL in the same direction. If disabled, the CFO is assumed" diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index 5821a1bf3..8227a2882 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -1436,11 +1436,11 @@ void phch_recv::intra_measure::init(phch_common *common, rrc_interface_phy *rrc, receive_enabled = false; // Start scell - scell.init(log_h, common->args->sic_pss_enabled, INTRA_FREQ_MEAS_LEN_MS); + scell.init(log_h, common->args->sic_pss_enabled, common->args->intra_freq_meas_len_ms); - search_buffer = (cf_t*) srslte_vec_malloc(INTRA_FREQ_MEAS_LEN_MS*SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB)*sizeof(cf_t)); + search_buffer = (cf_t*) srslte_vec_malloc(common->args->intra_freq_meas_len_ms*SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB)*sizeof(cf_t)); - if (srslte_ringbuffer_init(&ring_buffer, sizeof(cf_t)*INTRA_FREQ_MEAS_LEN_MS*2*SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB))) { + if (srslte_ringbuffer_init(&ring_buffer, sizeof(cf_t)*common->args->intra_freq_meas_len_ms*2*SRSLTE_SF_LEN_PRB(SRSLTE_MAX_PRB))) { return; } @@ -1510,7 +1510,7 @@ void phch_recv::intra_measure::rem_cell(int pci) { void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples) { if (receive_enabled) { - if ((tti%INTRA_FREQ_MEAS_PERIOD_MS) == 0) { + if ((tti%common->args->intra_freq_meas_period_ms) == 0) { receiving = true; receive_cnt = 0; measure_tti = tti; @@ -1522,7 +1522,7 @@ void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples receiving = false; } else { receive_cnt++; - if (receive_cnt == INTRA_FREQ_MEAS_LEN_MS) { + if (receive_cnt == common->args->intra_freq_meas_len_ms) { tti_sync.increase(); receiving = false; } @@ -1541,8 +1541,8 @@ void phch_recv::intra_measure::run_thread() if (running) { // Read data from buffer and find cells in it - srslte_ringbuffer_read(&ring_buffer, search_buffer, INTRA_FREQ_MEAS_LEN_MS*current_sflen*sizeof(cf_t)); - int found_cells = scell.find_cells(search_buffer, common->rx_gain_offset, primary_cell, INTRA_FREQ_MEAS_LEN_MS, info); + srslte_ringbuffer_read(&ring_buffer, search_buffer, common->args->intra_freq_meas_len_ms*current_sflen*sizeof(cf_t)); + int found_cells = scell.find_cells(search_buffer, common->rx_gain_offset, primary_cell, common->args->intra_freq_meas_len_ms, info); receiving = false; for (int i=0;i