mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
206 lines
8.8 KiB
C
206 lines
8.8 KiB
C
10 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
9 years ago
|
* Copyright 2013-2015 Software Radio Systems Limited
|
||
10 years ago
|
*
|
||
|
* \section LICENSE
|
||
|
*
|
||
10 years ago
|
* This file is part of the srsLTE library.
|
||
10 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
10 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
10 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
10 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
10 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/**********************************************************************************************
|
||
|
* File: refsignal_ul.h
|
||
|
*
|
||
|
* Description: Object to manage uplink reference signals for channel estimation.
|
||
|
*
|
||
|
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.5
|
||
|
*********************************************************************************************/
|
||
|
|
||
10 years ago
|
#ifndef SRSLTE_REFSIGNAL_UL_
|
||
|
#define SRSLTE_REFSIGNAL_UL_
|
||
10 years ago
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
8 years ago
|
#include "srslte/phy/phch/pucch.h"
|
||
|
#include "srslte/phy/common/phy_common.h"
|
||
10 years ago
|
|
||
10 years ago
|
#define SRSLTE_NOF_GROUPS_U 30
|
||
|
#define SRSLTE_NOF_SEQUENCES_U 2
|
||
|
#define SRSLTE_NOF_DELTA_SS 30
|
||
|
#define SRSLTE_NOF_CSHIFT 8
|
||
10 years ago
|
|
||
9 years ago
|
#define SRSLTE_REFSIGNAL_UL_L(ns_idx, cp) ((ns_idx+1)*SRSLTE_CP_NSYMB(cp)-4)
|
||
|
|
||
8 years ago
|
/* PUSCH DMRS common configuration (received in SIB2) */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
uint32_t cyclic_shift;
|
||
|
uint32_t delta_ss;
|
||
10 years ago
|
bool group_hopping_en;
|
||
|
bool sequence_hopping_en;
|
||
10 years ago
|
}srslte_refsignal_dmrs_pusch_cfg_t;
|
||
10 years ago
|
|
||
8 years ago
|
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
8 years ago
|
// Common Configuration
|
||
10 years ago
|
uint32_t subframe_config;
|
||
|
uint32_t bw_cfg;
|
||
8 years ago
|
|
||
|
// Dedicated configuration
|
||
|
uint32_t B;
|
||
|
uint32_t b_hop;
|
||
10 years ago
|
uint32_t n_srs;
|
||
8 years ago
|
uint32_t I_srs;
|
||
10 years ago
|
uint32_t k_tc;
|
||
|
uint32_t n_rrc;
|
||
10 years ago
|
bool configured;
|
||
10 years ago
|
}srslte_refsignal_srs_cfg_t;
|
||
10 years ago
|
|
||
|
/** Uplink DeModulation Reference Signal (DMRS) */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
srslte_cell_t cell;
|
||
10 years ago
|
srslte_refsignal_dmrs_pusch_cfg_t pusch_cfg;
|
||
|
srslte_pucch_cfg_t pucch_cfg;
|
||
10 years ago
|
srslte_refsignal_srs_cfg_t srs_cfg;
|
||
10 years ago
|
|
||
10 years ago
|
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
|
||
10 years ago
|
float *tmp_arg;
|
||
10 years ago
|
uint32_t n_prs_pusch[SRSLTE_NOF_DELTA_SS][SRSLTE_NSLOTS_X_FRAME]; // We precompute n_prs needed for cyclic shift alpha at srslte_refsignal_dl_init()
|
||
|
uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME];
|
||
|
uint32_t u_pucch[SRSLTE_NSLOTS_X_FRAME];
|
||
|
uint32_t v_pusch[SRSLTE_NSLOTS_X_FRAME][SRSLTE_NOF_DELTA_SS];
|
||
|
} srslte_refsignal_ul_t;
|
||
|
|
||
10 years ago
|
typedef struct {
|
||
|
cf_t **r[SRSLTE_NOF_CSHIFT][SRSLTE_NSUBFRAMES_X_FRAME];
|
||
|
} srslte_refsignal_ul_dmrs_pregen_t;
|
||
|
|
||
|
typedef struct {
|
||
|
cf_t *r[SRSLTE_NSUBFRAMES_X_FRAME];
|
||
|
} srslte_refsignal_srs_pregen_t;
|
||
10 years ago
|
|
||
|
SRSLTE_API int srslte_refsignal_ul_init(srslte_refsignal_ul_t *q,
|
||
|
srslte_cell_t cell);
|
||
|
|
||
|
SRSLTE_API void srslte_refsignal_ul_free(srslte_refsignal_ul_t *q);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_refsignal_ul_set_cfg(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_dmrs_pusch_cfg_t *pusch_cfg,
|
||
|
srslte_pucch_cfg_t *pucch_cfg,
|
||
10 years ago
|
srslte_refsignal_srs_cfg_t *srs_cfg);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_refsignal_r_uv_arg_1prb(float *arg,
|
||
|
uint32_t u);
|
||
|
|
||
8 years ago
|
SRSLTE_API uint32_t srslte_refsignal_dmrs_N_rs(srslte_pucch_format_t format,
|
||
|
srslte_cp_t cp);
|
||
|
|
||
|
SRSLTE_API uint32_t srslte_refsignal_dmrs_pucch_symbol(uint32_t m,
|
||
|
srslte_pucch_format_t format,
|
||
|
srslte_cp_t cp);
|
||
|
|
||
10 years ago
|
SRSLTE_API bool srslte_refsignal_dmrs_pusch_cfg_isvalid(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_dmrs_pusch_cfg_t *cfg,
|
||
10 years ago
|
uint32_t nof_prb);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_ul_dmrs_pregen_t *pregen);
|
||
|
|
||
|
SRSLTE_API void srslte_refsignal_dmrs_pusch_pregen_free(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_ul_dmrs_pregen_t *pregen);
|
||
|
|
||
|
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen_put(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_ul_dmrs_pregen_t *pregen,
|
||
|
uint32_t nof_prb,
|
||
|
uint32_t sf_idx,
|
||
|
uint32_t cyclic_shift_for_dmrs,
|
||
|
uint32_t n_prb[2],
|
||
|
cf_t *sf_symbols);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_dmrs_pusch_gen(srslte_refsignal_ul_t *q,
|
||
|
uint32_t nof_prb,
|
||
|
uint32_t sf_idx,
|
||
10 years ago
|
uint32_t cyclic_shift_for_dmrs,
|
||
10 years ago
|
cf_t *r_pusch);
|
||
|
|
||
|
SRSLTE_API void srslte_refsignal_dmrs_pusch_put(srslte_refsignal_ul_t *q,
|
||
10 years ago
|
cf_t *r_pusch,
|
||
|
uint32_t nof_prb,
|
||
|
uint32_t n_prb[2],
|
||
|
cf_t *sf_symbols);
|
||
|
|
||
9 years ago
|
SRSLTE_API void srslte_refsignal_dmrs_pusch_get(srslte_refsignal_ul_t *q,
|
||
|
cf_t *sf_symbols,
|
||
|
uint32_t nof_prb,
|
||
|
uint32_t n_prb[2],
|
||
|
cf_t *r_pusch);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_dmrs_pucch_gen(srslte_refsignal_ul_t *q,
|
||
10 years ago
|
srslte_pucch_format_t format,
|
||
10 years ago
|
uint32_t n_pucch, // n_pucch_1 or n_pucch_2 depending on format
|
||
|
uint32_t sf_idx,
|
||
10 years ago
|
uint8_t pucch2_bits[2],
|
||
10 years ago
|
cf_t *r_pucch);
|
||
10 years ago
|
|
||
|
SRSLTE_API int srslte_refsignal_dmrs_pucch_put(srslte_refsignal_ul_t* q,
|
||
10 years ago
|
srslte_pucch_format_t format,
|
||
|
uint32_t n_pucch,
|
||
10 years ago
|
cf_t *r_pucch,
|
||
|
cf_t *output);
|
||
10 years ago
|
|
||
8 years ago
|
SRSLTE_API int srslte_refsignal_dmrs_pucch_get(srslte_refsignal_ul_t* q,
|
||
|
srslte_pucch_format_t format,
|
||
|
uint32_t n_pucch,
|
||
|
cf_t *input,
|
||
|
cf_t *r_pucch);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_srs_pregen(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_srs_pregen_t *pregen);
|
||
|
|
||
|
SRSLTE_API int srslte_refsignal_srs_pregen_put(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_srs_pregen_t *pregen,
|
||
|
uint32_t tti,
|
||
|
cf_t *sf_symbols);
|
||
|
|
||
|
SRSLTE_API void srslte_refsignal_srs_pregen_free(srslte_refsignal_ul_t *q,
|
||
|
srslte_refsignal_srs_pregen_t *pregen);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_srs_gen(srslte_refsignal_ul_t *q,
|
||
10 years ago
|
uint32_t sf_idx,
|
||
|
cf_t *r_srs);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_srs_put(srslte_refsignal_ul_t *q,
|
||
10 years ago
|
uint32_t tti,
|
||
10 years ago
|
cf_t *r_srs,
|
||
|
cf_t *sf_symbols);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_refsignal_srs_send_cs(uint32_t subframe_config,
|
||
|
uint32_t sf_idx);
|
||
|
|
||
|
SRSLTE_API int srslte_refsignal_srs_send_ue(uint32_t I_srs,
|
||
|
uint32_t tti);
|
||
|
|
||
10 years ago
|
SRSLTE_API uint32_t srslte_refsignal_srs_rb_start_cs(uint32_t bw_cfg,
|
||
|
uint32_t nof_prb);
|
||
|
|
||
|
SRSLTE_API uint32_t srslte_refsignal_srs_rb_L_cs(uint32_t bw_cfg,
|
||
|
uint32_t nof_prb);
|
||
|
|
||
10 years ago
|
SRSLTE_API uint32_t srslte_refsignal_srs_M_sc(srslte_refsignal_ul_t *q);
|
||
10 years ago
|
|
||
10 years ago
|
#endif
|