2015-01-29 16:15:09 -08:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* Copyright 2013-2014 The srsLTE Developers. See the
|
2015-01-29 16:15:09 -08:00
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* This file is part of the srsLTE library.
|
2015-01-29 16:15:09 -08:00
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2015-01-29 16:15:09 -08:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
2015-01-29 16:15:09 -08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* A copy of the GNU Lesser General Public License can be found in
|
|
|
|
* the LICENSE file in the top-level directory of this distribution
|
|
|
|
* and at http://www.gnu.org/licenses/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-02-13 01:02:10 -08:00
|
|
|
#ifndef PUSCH_
|
2015-01-29 16:15:09 -08:00
|
|
|
#define PUSCH_
|
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2015-03-18 05:31:13 -07:00
|
|
|
#include "srslte/common/phy_common.h"
|
|
|
|
#include "srslte/mimo/precoding.h"
|
|
|
|
#include "srslte/mimo/layermap.h"
|
|
|
|
#include "srslte/modem/mod.h"
|
|
|
|
#include "srslte/modem/demod_soft.h"
|
|
|
|
#include "srslte/scrambling/scrambling.h"
|
|
|
|
#include "srslte/phch/regs.h"
|
|
|
|
#include "srslte/phch/sch.h"
|
|
|
|
#include "srslte/phch/harq.h"
|
|
|
|
#include "srslte/filter/dft_precoding.h"
|
2015-01-29 16:15:09 -08:00
|
|
|
|
|
|
|
#define TDEC_MAX_ITERATIONS 5
|
|
|
|
|
|
|
|
typedef _Complex float cf_t;
|
|
|
|
|
2015-03-05 09:36:15 -08:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
enum {
|
|
|
|
hop_mode_inter_sf = 1,
|
|
|
|
hop_mode_intra_sf = 0
|
|
|
|
} hop_mode;
|
|
|
|
uint32_t current_tx_nb;
|
|
|
|
uint32_t hopping_offset;
|
|
|
|
uint32_t n_sb;
|
|
|
|
} pusch_hopping_cfg_t;
|
|
|
|
|
|
|
|
|
2015-02-13 01:02:10 -08:00
|
|
|
/* PUSCH object */
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2015-03-18 05:41:50 -07:00
|
|
|
srslte_cell_t cell;
|
2015-03-05 09:36:15 -08:00
|
|
|
|
|
|
|
pusch_hopping_cfg_t hopping_cfg;
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-02-13 02:13:56 -08:00
|
|
|
uint32_t max_re;
|
2015-01-29 16:15:09 -08:00
|
|
|
bool rnti_is_set;
|
|
|
|
uint16_t rnti;
|
2015-02-13 01:02:10 -08:00
|
|
|
|
|
|
|
dft_precoding_t dft_precoding;
|
|
|
|
|
|
|
|
precoding_t equalizer;
|
2015-01-29 16:15:09 -08:00
|
|
|
|
|
|
|
/* buffers */
|
|
|
|
// void buffers are shared for tx and rx
|
2015-02-13 01:02:10 -08:00
|
|
|
cf_t *ce;
|
|
|
|
cf_t *pusch_z;
|
2015-01-29 16:15:09 -08:00
|
|
|
cf_t *pusch_d;
|
|
|
|
|
2015-02-11 23:57:37 -08:00
|
|
|
void *pusch_q;
|
|
|
|
void *pusch_g;
|
2015-01-29 16:15:09 -08:00
|
|
|
|
|
|
|
/* tx & rx objects */
|
|
|
|
modem_table_t mod[4];
|
|
|
|
demod_soft_t demod;
|
2015-03-18 05:41:50 -07:00
|
|
|
sequence_t seq_pusch[SRSLTE_NSUBFRAMES_X_FRAME];
|
2015-02-15 23:55:17 -08:00
|
|
|
sequence_t seq_type2_fo;
|
|
|
|
|
2015-01-29 16:15:09 -08:00
|
|
|
sch_t dl_sch;
|
|
|
|
|
|
|
|
}pusch_t;
|
|
|
|
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_init(pusch_t *q,
|
2015-03-18 05:41:50 -07:00
|
|
|
srslte_cell_t cell);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API void pusch_free(pusch_t *q);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API void pusch_set_hopping_cfg(pusch_t *q,
|
2015-03-05 09:36:15 -08:00
|
|
|
pusch_hopping_cfg_t *cfg);
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_set_rnti(pusch_t *q,
|
2015-02-13 02:13:56 -08:00
|
|
|
uint16_t rnti);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_encode(pusch_t *q,
|
2015-02-13 02:13:56 -08:00
|
|
|
harq_t *harq_process,
|
2015-01-29 16:15:09 -08:00
|
|
|
uint8_t *data,
|
2015-02-13 02:13:56 -08:00
|
|
|
cf_t *sf_symbols);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_encode_rnti(pusch_t *q,
|
2015-03-02 02:11:44 -08:00
|
|
|
harq_t *harq_process,
|
|
|
|
uint8_t *data,
|
|
|
|
uint16_t rnti,
|
|
|
|
cf_t *sf_symbols);
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_uci_encode(pusch_t *q,
|
2015-02-13 02:13:56 -08:00
|
|
|
harq_t *harq_process,
|
2015-01-29 16:15:09 -08:00
|
|
|
uint8_t *data,
|
|
|
|
uci_data_t uci_data,
|
2015-02-13 02:13:56 -08:00
|
|
|
cf_t *sf_symbols);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_uci_encode_rnti(pusch_t *q,
|
2015-03-02 02:11:44 -08:00
|
|
|
harq_t *harq,
|
|
|
|
uint8_t *data,
|
|
|
|
uci_data_t uci_data,
|
|
|
|
uint16_t rnti,
|
|
|
|
cf_t *sf_symbols);
|
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API int pusch_decode(pusch_t *q,
|
2015-02-13 02:13:56 -08:00
|
|
|
harq_t *harq_process,
|
2015-01-29 16:15:09 -08:00
|
|
|
cf_t *sf_symbols,
|
2015-02-13 01:02:10 -08:00
|
|
|
cf_t *ce,
|
2015-01-29 16:15:09 -08:00
|
|
|
float noise_estimate,
|
2015-02-13 02:13:56 -08:00
|
|
|
uint8_t *data);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API float pusch_average_noi(pusch_t *q);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
SRSLTE_API uint32_t pusch_last_noi(pusch_t *q);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
|
|
|
#endif
|