Avoid SCell receiver to copy

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent d39402ed54
commit 170fbefbf5

@ -26,18 +26,26 @@ class scell_recv
public:
explicit scell_recv(srslog::basic_logger& logger) : logger(logger) {}
void init(uint32_t max_sf_window);
void deinit();
void reset();
std::set<uint32_t> find_cells(const cf_t* input_buffer, const srsran_cell_t serving_cell, const uint32_t nof_sf);
void init(uint32_t max_sf_window);
void deinit();
void reset();
/**
* @brief Find neighbour cells in a given buffer
* @param input_buffer Provides the baseband samples
* @param serving_cell Current serving cell
* @param nof_sf Number of subframes contained in the baseband buffer
* @param found_cell_ids Provides a set where to insert the found cell identifiers (PCIs)
*/
void find_cells(const cf_t* input_buffer,
const srsran_cell_t& serving_cell,
const uint32_t& nof_sf,
std::set<uint32_t>& found_cell_ids);
private:
// 36.133 9.1.2.1 for band 7
constexpr static float ABSOLUTE_RSRP_THRESHOLD_DBM = -125;
cf_t* sf_buffer[SRSRAN_MAX_PORTS];
cf_t* sf_buffer[SRSRAN_MAX_PORTS] = {};
srslog::basic_logger& logger;
srsran_sync_t sync_find;
srsran_sync_t sync_find = {};
uint32_t current_fft_sz;
};

@ -52,12 +52,7 @@ void intra_measure_lte::measure_rat(const measure_context_t& context, std::vecto
std::set<uint32_t> cells_to_measure = context.active_pci;
// Detect new cells using PSS/SSS
std::set<uint32_t> detected_cells = scell_rx.find_cells(buffer.data(), serving_cell, context.meas_len_ms);
// Add detected cells to the list of cells to measure
for (const uint32_t& c : detected_cells) {
cells_to_measure.insert(c);
}
scell_rx.find_cells(buffer.data(), serving_cell, context.meas_len_ms, cells_to_measure);
// Initialise empty neighbour cell list
std::vector<phy_meas_t> neighbour_cells = {};

@ -68,18 +68,18 @@ void scell_recv::reset()
current_fft_sz = 0;
}
std::set<uint32_t>
scell_recv::find_cells(const cf_t* input_buffer, const srsran_cell_t serving_cell, const uint32_t nof_sf)
void scell_recv::find_cells(const cf_t* input_buffer,
const srsran_cell_t& serving_cell,
const uint32_t& nof_sf,
std::set<uint32_t>& found_cell_ids)
{
std::set<uint32_t> found_cell_ids = {};
uint32_t fft_sz = srsran_symbol_sz(serving_cell.nof_prb);
uint32_t sf_len = SRSRAN_SF_LEN(fft_sz);
if (fft_sz != current_fft_sz) {
if (srsran_sync_resize(&sync_find, nof_sf * sf_len, 5 * sf_len, fft_sz)) {
logger.error("Error resizing sync nof_sf=%d, sf_len=%d, fft_sz=%d", nof_sf, sf_len, fft_sz);
return found_cell_ids;
return;
}
current_fft_sz = fft_sz;
}
@ -88,7 +88,6 @@ scell_recv::find_cells(const cf_t* input_buffer, const srsran_cell_t serving_cel
int cell_id = 0;
for (uint32_t n_id_2 = 0; n_id_2 < 3; n_id_2++) {
if (n_id_2 != (serving_cell.id % 3)) {
srsran_sync_set_N_id_2(&sync_find, n_id_2);
@ -108,7 +107,7 @@ scell_recv::find_cells(const cf_t* input_buffer, const srsran_cell_t serving_cel
sync_res = srsran_sync_find(&sync_find, input_buffer, sf5_cnt * 5 * sf_len, &peak_idx);
if (sync_res == SRSRAN_SYNC_ERROR) {
logger.error("INTRA: Error calling sync_find()");
return found_cell_ids;
return;
}
if (sync_find.peak_value > max_peak && sync_res == SRSRAN_SYNC_FOUND && srsran_sync_sss_detected(&sync_find)) {
@ -144,7 +143,7 @@ scell_recv::find_cells(const cf_t* input_buffer, const srsran_cell_t serving_cel
}
}
}
return found_cell_ids;
return;
}
} // namespace scell

Loading…
Cancel
Save