Updated missing changes

master
Ismael Gomez 7 years ago
parent 28e12dbf7d
commit 2c3386a486

@ -181,11 +181,11 @@ private:
uint32_t offset; uint32_t offset;
} cell_info_t; } cell_info_t;
void init(srslte::log *log_h, bool sic_pss_enabled, uint32_t max_sf_window); void init(srslte::log *log_h, bool sic_pss_enabled, uint32_t max_sf_window);
void deinit();
void reset(); void reset();
int find_cells(cf_t *input_buffer, float rx_gain_offset, srslte_cell_t current_cell, uint32_t nof_sf, cell_info_t found_cells[MAX_CELLS]); int find_cells(cf_t *input_buffer, float rx_gain_offset, srslte_cell_t current_cell, uint32_t nof_sf, cell_info_t found_cells[MAX_CELLS]);
private: private:
cf_t *input_cfo_corrected;
cf_t *sf_buffer[SRSLTE_MAX_PORTS]; cf_t *sf_buffer[SRSLTE_MAX_PORTS];
srslte::log *log_h; srslte::log *log_h;
srslte_sync_t sync_find; srslte_sync_t sync_find;
@ -202,6 +202,7 @@ private:
// Class to perform intra-frequency measurements // Class to perform intra-frequency measurements
class intra_measure : public thread { class intra_measure : public thread {
public: public:
~intra_measure();
void init(phch_common *common, rrc_interface_phy *rrc, srslte::log *log_h); void init(phch_common *common, rrc_interface_phy *rrc, srslte::log *log_h);
void stop(); void stop();
void add_cell(int pci); void add_cell(int pci);
@ -212,8 +213,6 @@ private:
void write(uint32_t tti, cf_t *data, uint32_t nsamples); void write(uint32_t tti, cf_t *data, uint32_t nsamples);
private: private:
void run_thread(); void run_thread();
const static int INTRA_FREQ_MEAS_LEN_MS = 50;
const static int INTRA_FREQ_MEAS_PERIOD_MS = 200;
const static int INTRA_FREQ_MEAS_PRIO = DEFAULT_PRIORITY + 5; const static int INTRA_FREQ_MEAS_PRIO = DEFAULT_PRIORITY + 5;
scell_recv scell; scell_recv scell;

@ -1247,7 +1247,7 @@ phch_recv::measure::ret_code phch_recv::measure::run_subframe(uint32_t sf_idx)
return ERROR; return ERROR;
} }
float rsrp = srslte_chest_dl_get_rsrp(&ue_dl.chest); float rsrp = srslte_chest_dl_get_rsrp_neighbour(&ue_dl.chest);
float rsrq = srslte_chest_dl_get_rsrq(&ue_dl.chest); float rsrq = srslte_chest_dl_get_rsrq(&ue_dl.chest);
float snr = srslte_chest_dl_get_snr(&ue_dl.chest); float snr = srslte_chest_dl_get_snr(&ue_dl.chest);
float rssi = srslte_vec_avg_power_cf(buffer[0], SRSLTE_SF_LEN_PRB(current_prb)); float rssi = srslte_vec_avg_power_cf(buffer[0], SRSLTE_SF_LEN_PRB(current_prb));
@ -1295,8 +1295,10 @@ void phch_recv::scell_recv::init(srslte::log *log_h, bool sic_pss_enabled, uint3
uint32_t max_sf_size = SRSLTE_SF_LEN(max_fft_sz); uint32_t max_sf_size = SRSLTE_SF_LEN(max_fft_sz);
sf_buffer[0] = (cf_t*) srslte_vec_malloc(sizeof(cf_t)*max_sf_size); sf_buffer[0] = (cf_t*) srslte_vec_malloc(sizeof(cf_t)*max_sf_size);
input_cfo_corrected = (cf_t*) srslte_vec_malloc(sizeof(cf_t)*15*max_sf_size); if (!sf_buffer[0]) {
fprintf(stderr, "Error allocating %d bytes for scell\n", sizeof(cf_t)*max_sf_size);
return;
}
measure_p.init(sf_buffer, log_h, 1, max_sf_window); measure_p.init(sf_buffer, log_h, 1, max_sf_window);
//do this different we don't need all this search window. //do this different we don't need all this search window.
@ -1304,6 +1306,7 @@ void phch_recv::scell_recv::init(srslte::log *log_h, bool sic_pss_enabled, uint3
fprintf(stderr, "Error initiating sync_find\n"); fprintf(stderr, "Error initiating sync_find\n");
return; return;
} }
srslte_sync_set_sss_algorithm(&sync_find, SSS_FULL);
srslte_sync_cp_en(&sync_find, false); srslte_sync_cp_en(&sync_find, false);
srslte_sync_set_cfo_pss_enable(&sync_find, true); srslte_sync_set_cfo_pss_enable(&sync_find, true);
srslte_sync_set_threshold(&sync_find, 1.7); srslte_sync_set_threshold(&sync_find, 1.7);
@ -1317,12 +1320,16 @@ void phch_recv::scell_recv::init(srslte::log *log_h, bool sic_pss_enabled, uint3
srslte_sync_set_sss_eq_enable(&sync_find, true); srslte_sync_set_sss_eq_enable(&sync_find, true);
sync_find.pss.chest_on_filter = true; sync_find.pss.chest_on_filter = true;
sync_find.sss_channel_equalize = false;
sync_find.sss_channel_equalize = true;
reset(); reset();
} }
void phch_recv::scell_recv::deinit() {
srslte_sync_free(&sync_find);
free(sf_buffer[0]);
}
void phch_recv::scell_recv::reset() void phch_recv::scell_recv::reset()
{ {
current_fft_sz = 0; current_fft_sz = 0;
@ -1498,6 +1505,12 @@ int phch_recv::meas_stop(uint32_t earfcn, int pci) {
return -1; return -1;
} }
phch_recv::intra_measure::~intra_measure() {
srslte_ringbuffer_free(&ring_buffer);
scell.deinit();
free(search_buffer);
}
void phch_recv::intra_measure::init(phch_common *common, rrc_interface_phy *rrc, srslte::log *log_h) { void phch_recv::intra_measure::init(phch_common *common, rrc_interface_phy *rrc, srslte::log *log_h) {
this->rrc = rrc; this->rrc = rrc;
this->log_h = log_h; this->log_h = log_h;
@ -1505,11 +1518,11 @@ void phch_recv::intra_measure::init(phch_common *common, rrc_interface_phy *rrc,
receive_enabled = false; receive_enabled = false;
// Start scell // 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; return;
} }
@ -1573,7 +1586,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) { void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples) {
if (receive_enabled) { if (receive_enabled) {
if ((tti%INTRA_FREQ_MEAS_PERIOD_MS) == 0) { if ((tti%common->args->intra_freq_meas_period_ms) == 0) {
receiving = true; receiving = true;
receive_cnt = 0; receive_cnt = 0;
measure_tti = tti; measure_tti = tti;
@ -1585,7 +1598,7 @@ void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples
receiving = false; receiving = false;
} else { } else {
receive_cnt++; receive_cnt++;
if (receive_cnt == INTRA_FREQ_MEAS_LEN_MS) { if (receive_cnt == common->args->intra_freq_meas_len_ms) {
tti_sync.increase(); tti_sync.increase();
receiving = false; receiving = false;
} }
@ -1604,8 +1617,8 @@ void phch_recv::intra_measure::run_thread()
if (running) { if (running) {
// Read data from buffer and find cells in it // 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)); 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, INTRA_FREQ_MEAS_LEN_MS, info); int found_cells = scell.find_cells(search_buffer, common->rx_gain_offset, primary_cell, common->args->intra_freq_meas_len_ms, info);
receiving = false; receiving = false;
for (int i=0;i<found_cells;i++) { for (int i=0;i<found_cells;i++) {

@ -429,10 +429,12 @@ void phch_worker::compute_ri(uint8_t *ri, uint8_t *pmi, float *sinr) {
} }
uci_data.uci_ri_len = 1; uci_data.uci_ri_len = 1;
} else if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) { } else if (phy->config->dedicated.antenna_info_explicit_value.tx_mode == LIBLTE_RRC_TRANSMISSION_MODE_4) {
if (sinr) {
srslte_ue_dl_ri_pmi_select(&ue_dl, ri, pmi, sinr); srslte_ue_dl_ri_pmi_select(&ue_dl, ri, pmi, sinr);
Debug("TM4 ri=%d; pmi=%d; SINR=%.1fdB\n", ue_dl.ri, ue_dl.pmi[ue_dl.ri], 10*log10f(ue_dl.sinr[ue_dl.ri][ue_dl.pmi[ue_dl.ri]])); Debug("TM4 ri=%d; pmi=%d; SINR=%.1fdB\n", ue_dl.ri, ue_dl.pmi[ue_dl.ri], 10*log10f(ue_dl.sinr[ue_dl.ri][ue_dl.pmi[ue_dl.ri]]));
} }
} }
}
bool phch_worker::extract_fft_and_pdcch_llr() { bool phch_worker::extract_fft_and_pdcch_llr() {
bool decode_pdcch = true; bool decode_pdcch = true;

Loading…
Cancel
Save