From a612009ea754c0f4e9394a5ad1f52912fd9c9071 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 17 May 2016 18:35:23 +0200 Subject: [PATCH] Fixed PDCCH not looking for aggregation level L=8. Fixed PCFICH encoder not accepting cfi=3 --- srslte/examples/pdsch_enodeb.c | 8 ++++++-- srslte/examples/pdsch_ue.c | 13 +++++++++---- srslte/lib/fec/viterbi.c | 6 ++++-- srslte/lib/phch/cqi.c | 6 +++++- srslte/lib/phch/pcfich.c | 4 ++-- srslte/lib/phch/pdcch.c | 2 +- srslte/lib/ue/ue_dl.c | 7 ++----- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/srslte/examples/pdsch_enodeb.c b/srslte/examples/pdsch_enodeb.c index 011164bd8..d593cfac5 100644 --- a/srslte/examples/pdsch_enodeb.c +++ b/srslte/examples/pdsch_enodeb.c @@ -66,7 +66,7 @@ srslte_cell_t cell = { int net_port = -1; // -1 generates random dataThat means there is some problem sending samples to the device -uint32_t cfi=2; +uint32_t cfi=3; uint32_t mcs_idx = 1, last_mcs_idx = 1; int nof_frames = -1; @@ -597,7 +597,11 @@ int main(int argc, char **argv) { for (i=0;iK = 7; q->R = 3; q->framebits = framebits; - q->gain_quant = 32; + q->gain_quant = DEFAULT_GAIN; q->tail_biting = tail_biting; q->decode = decode37; q->free = free37; @@ -168,7 +170,7 @@ int init37_sse(srslte_viterbi_t *q, uint32_t poly[3], uint32_t framebits, bool t q->K = 7; q->R = 3; q->framebits = framebits; - q->gain_quant = 20; + q->gain_quant = DEFAULT_GAIN; q->tail_biting = tail_biting; q->decode = decode37_sse; q->free = free37_sse; diff --git a/srslte/lib/phch/cqi.c b/srslte/lib/phch/cqi.c index 175065fcd..cbde55177 100644 --- a/srslte/lib/phch/cqi.c +++ b/srslte/lib/phch/cqi.c @@ -141,7 +141,11 @@ bool srslte_cqi_send(uint32_t I_cqi_pmi, uint32_t tti) { /* SNR-to-CQI conversion, got from "Downlink SNR to CQI Mapping for Different Multiple Antenna Techniques in LTE" * Table III. */ -static float cqi_to_snr_table[15] = { 1.95, 4, 6, 8, 10, 11.95, 14.05, 16, 17.9, 19.9, 21.5, 23.45, 25.0, 27.30, 29}; +// Original version +//static float cqi_to_snr_table[15] = { 1.95, 4, 6, 8, 10, 11.95, 14.05, 16, 17.9, 19.9, 21.5, 23.45, 25.0, 27.30, 29}; + +// From experimental measurements @ 5 MHz +static float cqi_to_snr_table[15] = { 0, 1.25, 2.5, 3.75, 5, 6, 7.5, 9, 11.5, 13.0, 15.0, 18, 20, 22.5, 26.5}; uint8_t srslte_cqi_from_snr(float snr) { diff --git a/srslte/lib/phch/pcfich.c b/srslte/lib/phch/pcfich.c index 96e5c9446..c102e2b28 100644 --- a/srslte/lib/phch/pcfich.c +++ b/srslte/lib/phch/pcfich.c @@ -134,7 +134,7 @@ float srslte_pcfich_cfi_decode(srslte_pcfich_t *q, uint32_t *cfi) { /** Encodes the CFI producing a vector of 32 bits. * 36.211 10.3 section 5.3.4 */ -int srslte_pcfich_cfi_encode(int cfi, uint8_t bits[PCFICH_CFI_LEN]) { +int srslte_pcfich_cfi_encode(uint32_t cfi, uint8_t bits[PCFICH_CFI_LEN]) { if (cfi < 1 || cfi > 3) { return SRSLTE_ERROR_INVALID_INPUTS; } else{ @@ -220,7 +220,7 @@ int srslte_pcfich_encode(srslte_pcfich_t *q, uint32_t cfi, cf_t *slot_symbols[SR int i; if (q != NULL && - cfi < 3 && + cfi <= 3 && slot_symbols != NULL && subframe < SRSLTE_NSUBFRAMES_X_FRAME) { diff --git a/srslte/lib/phch/pdcch.c b/srslte/lib/phch/pdcch.c index 19256eb14..1123c0192 100644 --- a/srslte/lib/phch/pdcch.c +++ b/srslte/lib/phch/pdcch.c @@ -192,7 +192,7 @@ uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t *q, srslte_dci_location_t *c, k = 0; // All aggregation levels from 8 to 1 - for (l = 0; l < 3; l++) { + for (l = 3; l >= 0; l--) { L = (1 << l); // For all possible ncce offset for (i = 0; i < SRSLTE_MIN(q->nof_cce / L, S[l]/PDCCH_FORMAT_NOF_CCE(l)); i++) { diff --git a/srslte/lib/ue/ue_dl.c b/srslte/lib/ue/ue_dl.c index ec8ed2447..fbb449653 100644 --- a/srslte/lib/ue/ue_dl.c +++ b/srslte/lib/ue/ue_dl.c @@ -194,16 +194,12 @@ 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); @@ -221,7 +217,8 @@ int srslte_ue_dl_decode_estimate(srslte_ue_dl_t *q, uint32_t sf_idx, uint32_t *c /* First decode PCFICH and obtain CFI */ if (srslte_pcfich_decode(&q->pcfich, q->sf_symbols, q->ce, - srslte_chest_dl_get_noise_estimate(&q->chest), sf_idx, cfi, &cfi_corr)<0) { + srslte_chest_dl_get_noise_estimate(&q->chest), + sf_idx, cfi, &cfi_corr)<0) { fprintf(stderr, "Error decoding PCFICH\n"); return SRSLTE_ERROR; }