diff --git a/srslte/include/srslte/enb/enb_dl.h b/srslte/include/srslte/enb/enb_dl.h index a95c6f824..eca63d6d3 100644 --- a/srslte/include/srslte/enb/enb_dl.h +++ b/srslte/include/srslte/enb/enb_dl.h @@ -88,6 +88,7 @@ typedef struct SRSLTE_API { float sss_signal5[SRSLTE_SSS_LEN]; uint32_t nof_rnti; + float tx_amp; } srslte_enb_dl_t; @@ -114,6 +115,9 @@ SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t *q); SRSLTE_API void srslte_enb_dl_set_cfi(srslte_enb_dl_t *q, uint32_t cfi); +SRSLTE_API void srslte_enb_dl_set_amp(srslte_enb_dl_t *q, + float amp); + SRSLTE_API void srslte_enb_dl_clear_sf(srslte_enb_dl_t *q); SRSLTE_API void srslte_enb_dl_put_sync(srslte_enb_dl_t *q, diff --git a/srslte/include/srslte/phch/cqi.h b/srslte/include/srslte/phch/cqi.h index 931f09566..9a7b243be 100644 --- a/srslte/include/srslte/phch/cqi.h +++ b/srslte/include/srslte/phch/cqi.h @@ -40,7 +40,7 @@ #include "srslte/config.h" #include "srslte/common/phy_common.h" -#define SRSLTE_CQI_MAX_BITS 20 +#define SRSLTE_CQI_MAX_BITS 64 typedef struct { bool configured; diff --git a/srslte/lib/enb/enb_dl.c b/srslte/lib/enb/enb_dl.c index 7d42145e5..bbe122c96 100644 --- a/srslte/lib/enb/enb_dl.c +++ b/srslte/lib/enb/enb_dl.c @@ -37,7 +37,7 @@ #define CURRENT_SLOTLEN_RE SRSLTE_SLOT_LEN_RE(q->cell.nof_prb, q->cell.cp) #define CURRENT_SFLEN_RE SRSLTE_SF_LEN_RE(q->cell.nof_prb, q->cell.cp) -#define SRSLTE_ENB_RF_AMP 0.5 +#define SRSLTE_ENB_RF_AMP 0.1 int srslte_enb_dl_init(srslte_enb_dl_t *q, srslte_cell_t cell, uint32_t nof_rnti) { @@ -53,6 +53,7 @@ int srslte_enb_dl_init(srslte_enb_dl_t *q, srslte_cell_t cell, uint32_t nof_rnti q->cell = cell; q->cfi = 3; q->nof_rnti = nof_rnti; + q->tx_amp = SRSLTE_ENB_RF_AMP; if (srslte_ofdm_tx_init(&q->ifft, q->cell.cp, q->cell.nof_prb)) { fprintf(stderr, "Error initiating FFT\n"); @@ -146,6 +147,11 @@ void srslte_enb_dl_free(srslte_enb_dl_t *q) } } +void srslte_enb_dl_set_amp(srslte_enb_dl_t *q, float amp) +{ + q->tx_amp = amp; +} + void srslte_enb_dl_set_cfi(srslte_enb_dl_t *q, uint32_t cfi) { q->cfi = cfi; @@ -214,7 +220,7 @@ void srslte_enb_dl_gen_signal(srslte_enb_dl_t *q, cf_t *signal_buffer) // TODO: PAPR control float norm_factor = (float) sqrt(q->cell.nof_prb)/15; - srslte_vec_sc_prod_cfc(signal_buffer, SRSLTE_ENB_RF_AMP*norm_factor, signal_buffer, SRSLTE_SF_LEN_PRB(q->cell.nof_prb)); + srslte_vec_sc_prod_cfc(signal_buffer, q->tx_amp*norm_factor, signal_buffer, SRSLTE_SF_LEN_PRB(q->cell.nof_prb)); } int srslte_enb_dl_cfg_rnti(srslte_enb_dl_t *q, uint32_t idx, uint16_t rnti) diff --git a/srslte/lib/phch/uci.c b/srslte/lib/phch/uci.c index 8861749e2..dd0633768 100644 --- a/srslte/lib/phch/uci.c +++ b/srslte/lib/phch/uci.c @@ -314,6 +314,7 @@ int decode_cqi_long(srslte_uci_cqi_pusch_t *q, int16_t *q_bits, uint32_t Q, } ret = srslte_crc_checksum(&q->crc, q->tmp_cqi, nof_bits + 8); + printf("ret=%d, nof_bits=%d\n", ret, nof_bits); if (ret == 0) { memcpy(data, q->tmp_cqi, nof_bits*sizeof(uint8_t)); ret = 1;