mirror of https://github.com/pvnis/srsRAN_4G.git
rename srsLTE to srsRAN
parent
df8ec4ddd5
commit
4523ee6087
@ -1,15 +1,15 @@
|
||||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
set(CTEST_PROJECT_NAME "srsLTE")
|
||||
set(CTEST_PROJECT_NAME "srsRAN")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT")
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=srsLTE")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=srsRAN")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
set(VALGRIND_COMMAND_OPTIONS "--error-exitcode=1 --trace-children=yes --leak-check=full --show-reachable=yes --vex-guest-max-insns=25")
|
||||
|
@ -1,13 +0,0 @@
|
||||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(SRSLTE_VERSION_MAJOR 20)
|
||||
SET(SRSLTE_VERSION_MINOR 10)
|
||||
SET(SRSLTE_VERSION_PATCH 1)
|
||||
SET(SRSLTE_VERSION_STRING "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}")
|
||||
SET(SRSLTE_SOVERSION 0)
|
@ -1,21 +1,21 @@
|
||||
#
|
||||
# Copyright 2013-2020 Software Radio Systems Limited
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "srsLTE")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION "srsRAN")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LTE library for SDR.")
|
||||
SET(CPACK_PACKAGE_NAME "srslte")
|
||||
SET(CPACK_PACKAGE_NAME "srsran")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libboost-dev (>= 1.35)")
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "Ismael Gomez ")
|
||||
SET(CPACK_PACKAGE_VENDOR "Software Radio Systems Limited")
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SRSLTE_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SRSLTE_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${SRSLTE_VERSION_PATCH})
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SRSRAN_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SRSRAN_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${SRSRAN_VERSION_PATCH})
|
||||
SET(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
||||
########################################################################
|
@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright 2013-2021 Software Radio Systems Limited
|
||||
#
|
||||
# By using this file, you agree to the terms and conditions set
|
||||
# forth in the LICENSE file which can be found at the top level of
|
||||
# the distribution.
|
||||
#
|
||||
|
||||
SET(SRSRAN_VERSION_MAJOR 20)
|
||||
SET(SRSRAN_VERSION_MINOR 10)
|
||||
SET(SRSRAN_VERSION_PATCH 1)
|
||||
SET(SRSRAN_VERSION_STRING "${SRSRAN_VERSION_MAJOR}.${SRSRAN_VERSION_MINOR}.${SRSRAN_VERSION_PATCH}")
|
||||
SET(SRSRAN_SOVERSION 0)
|
@ -1,3 +1,3 @@
|
||||
usr/lib/*/libsrslte_rf.so*
|
||||
usr/share/srslte
|
||||
usr/bin/srslte_install_configs.sh
|
||||
usr/lib/*/libsrsran_rf.so*
|
||||
usr/share/srsran
|
||||
usr/bin/srsran_install_configs.sh
|
||||
|
@ -1,6 +1,6 @@
|
||||
Template: srslte/install_configs_question
|
||||
Template: srsran/install_configs_question
|
||||
Type: boolean
|
||||
Default: true
|
||||
Description: Install configs?
|
||||
This installs the default srsLTE configuration files to the user's
|
||||
home directory (~/.config/srslte) but keeps any existing config files.
|
||||
This installs the default srsRAN configuration files to the user's
|
||||
home directory (~/.config/srsran) but keeps any existing config files.
|
||||
|
@ -1,2 +1,2 @@
|
||||
usr/lib/*/*.a
|
||||
usr/include/srslte
|
||||
usr/include/srsran
|
||||
|
@ -1,64 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CONFIG_H
|
||||
#define SRSLTE_CONFIG_H
|
||||
|
||||
// Generic helper definitions for shared library support
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#define SRSLTE_IMPORT __declspec(dllimport)
|
||||
#define SRSLTE_EXPORT __declspec(dllexport)
|
||||
#define SRSLTE_LOCAL
|
||||
#else
|
||||
#if __GNUC__ >= 4
|
||||
#define SRSLTE_IMPORT __attribute__((visibility("default")))
|
||||
#define SRSLTE_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define SRSLTE_IMPORT
|
||||
#define SRSLTE_EXPORT
|
||||
#define SRSLTE_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Define SRSLTE_API
|
||||
// SRSLTE_API is used for the public API symbols.
|
||||
#ifdef SRSLTE_DLL_EXPORTS // defined if we are building the SRSLTE DLL (instead of using it)
|
||||
#define SRSLTE_API SRSLTE_EXPORT
|
||||
#else
|
||||
#define SRSLTE_API SRSLTE_IMPORT
|
||||
#endif
|
||||
|
||||
// Useful macros for templates
|
||||
#define CONCAT(a, b) a##b
|
||||
#define CONCAT2(a, b) CONCAT(a, b)
|
||||
|
||||
#define STRING2(x) #x
|
||||
#define STRING(x) STRING2(x)
|
||||
|
||||
// Common error codes
|
||||
#define SRSLTE_SUCCESS 0
|
||||
#define SRSLTE_ERROR -1
|
||||
#define SRSLTE_ERROR_INVALID_INPUTS -2
|
||||
#define SRSLTE_ERROR_TIMEOUT -3
|
||||
#define SRSLTE_ERROR_INVALID_COMMAND -4
|
||||
#define SRSLTE_ERROR_OUT_OF_BOUNDS -5
|
||||
#define SRSLTE_ERROR_CANT_START -6
|
||||
#define SRSLTE_ERROR_ALREADY_STARTED -7
|
||||
|
||||
// cf_t definition
|
||||
typedef _Complex float cf_t;
|
||||
|
||||
#ifdef ENABLE_C16
|
||||
typedef _Complex short int c16_t;
|
||||
#endif /* ENABLE_C16 */
|
||||
|
||||
#endif // SRSLTE_CONFIG_H
|
@ -1,164 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: chest_dl.h
|
||||
*
|
||||
* Description: 3GPP LTE Downlink channel estimator and equalizer.
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
* This object depends on the srslte_refsignal_t object for creating the LTE
|
||||
* CSR signal.
|
||||
*
|
||||
* Reference:
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CHEST_DL_H
|
||||
#define SRSLTE_CHEST_DL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
#include "srslte/phy/sync/pss.h"
|
||||
#include "wiener_dl.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
uint32_t nof_re;
|
||||
float noise_estimate;
|
||||
float noise_estimate_dbm;
|
||||
float snr_db;
|
||||
float snr_ant_port_db[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp;
|
||||
float rsrp_dbm;
|
||||
float rsrp_neigh;
|
||||
float rsrp_port_dbm[SRSLTE_MAX_PORTS];
|
||||
float rsrp_ant_port_dbm[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrq;
|
||||
float rsrq_db;
|
||||
float rsrq_ant_port_db[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rssi_dbm;
|
||||
float cfo;
|
||||
float sync_error;
|
||||
} srslte_chest_dl_res_t;
|
||||
|
||||
// Noise estimation algorithm
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_NOISE_ALG_REFS = 0,
|
||||
SRSLTE_NOISE_ALG_PSS,
|
||||
SRSLTE_NOISE_ALG_EMPTY,
|
||||
} srslte_chest_dl_noise_alg_t;
|
||||
|
||||
// Channel estimator algorithm
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_ESTIMATOR_ALG_AVERAGE = 0,
|
||||
SRSLTE_ESTIMATOR_ALG_INTERPOLATE,
|
||||
SRSLTE_ESTIMATOR_ALG_WIENER,
|
||||
} srslte_chest_dl_estimator_alg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
srslte_refsignal_t csr_refs;
|
||||
srslte_refsignal_t** mbsfn_refs;
|
||||
|
||||
srslte_wiener_dl_t* wiener_dl;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_average;
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* tmp_noise;
|
||||
cf_t* tmp_cfo_estimate;
|
||||
|
||||
#ifdef FREQ_SEL_SNR
|
||||
float snr_vector[12000];
|
||||
float pilot_power[12000];
|
||||
#endif
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
srslte_interp_lin_t srslte_interp_lin;
|
||||
srslte_interp_lin_t srslte_interp_lin_3;
|
||||
srslte_interp_lin_t srslte_interp_lin_mbsfn;
|
||||
|
||||
float rssi[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float rsrp_corr[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float noise_estimate[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float sync_err[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
float cfo;
|
||||
|
||||
/* Use PSS for noise estimation in LS linear interpolation mode */
|
||||
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||||
cf_t tmp_pss[SRSLTE_PSS_LEN];
|
||||
cf_t tmp_pss_noisy[SRSLTE_PSS_LEN];
|
||||
|
||||
} srslte_chest_dl_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
srslte_chest_dl_estimator_alg_t estimator_alg;
|
||||
srslte_chest_dl_noise_alg_t noise_alg;
|
||||
|
||||
srslte_chest_filter_t filter_type;
|
||||
float filter_coef[2];
|
||||
|
||||
uint16_t mbsfn_area_id;
|
||||
bool rsrp_neighbour;
|
||||
bool cfo_estimate_enable;
|
||||
uint32_t cfo_estimate_sf_mask;
|
||||
bool sync_error_enable;
|
||||
|
||||
} srslte_chest_dl_cfg_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_init(srslte_chest_dl_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_free(srslte_chest_dl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_res_init(srslte_chest_dl_res_t* q, uint32_t max_prb);
|
||||
SRSLTE_API int srslte_chest_dl_res_init_re(srslte_chest_dl_res_t* q, uint32_t nof_re);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_set_identity(srslte_chest_dl_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_set_ones(srslte_chest_dl_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_res_free(srslte_chest_dl_res_t* q);
|
||||
|
||||
/* These functions change the internal object state */
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_set_mbsfn_area_id(srslte_chest_dl_t* q, uint16_t mbsfn_area_id);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_set_cell(srslte_chest_dl_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not change the internal state */
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_estimate(srslte_chest_dl_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
cf_t* input[SRSLTE_MAX_PORTS],
|
||||
srslte_chest_dl_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_estimate_cfg(srslte_chest_dl_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_cfg_t* cfg,
|
||||
cf_t* input[SRSLTE_MAX_PORTS],
|
||||
srslte_chest_dl_res_t* res);
|
||||
|
||||
SRSLTE_API srslte_chest_dl_estimator_alg_t srslte_chest_dl_str2estimator_alg(const char* str);
|
||||
|
||||
#endif // SRSLTE_CHEST_DL_H
|
@ -1,88 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CHEST_DL_NBIOT_H
|
||||
#define SRSLTE_CHEST_DL_NBIOT_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl_nbiot.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
/*! \brief Downlink channel estimation for NB-IoT
|
||||
*
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
* This object depends on the srslte_refsignal_t object for creating the LTE CSR signal.
|
||||
*/
|
||||
typedef struct {
|
||||
srslte_nbiot_cell_t cell;
|
||||
srslte_refsignal_dl_nbiot_t nrs_signal;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_average;
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* tmp_noise;
|
||||
|
||||
uint32_t smooth_filter_len;
|
||||
float smooth_filter[SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN];
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
srslte_interp_lin_t srslte_interp_lin;
|
||||
|
||||
float rssi[SRSLTE_MAX_PORTS];
|
||||
float rsrp[SRSLTE_MAX_PORTS];
|
||||
float noise_estimate[SRSLTE_MAX_PORTS];
|
||||
|
||||
srslte_chest_dl_noise_alg_t noise_alg;
|
||||
|
||||
} srslte_chest_dl_nbiot_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_init(srslte_chest_dl_nbiot_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_free(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_set_cell(srslte_chest_dl_nbiot_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_smooth_filter(srslte_chest_dl_nbiot_t* q, float* filter, uint32_t filter_len);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_smooth_filter3_coeff(srslte_chest_dl_nbiot_t* q, float w);
|
||||
|
||||
SRSLTE_API void srslte_chest_dl_nbiot_set_noise_alg(srslte_chest_dl_nbiot_t* q,
|
||||
srslte_chest_dl_noise_alg_t noise_estimation_alg);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_estimate(srslte_chest_dl_nbiot_t* q, cf_t* input, cf_t** ce, uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API int srslte_chest_dl_nbiot_estimate_port(srslte_chest_dl_nbiot_t* q,
|
||||
cf_t* input,
|
||||
cf_t* ce,
|
||||
uint32_t sf_idx,
|
||||
uint32_t port_id);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_noise_estimate(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_snr(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rssi(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rsrq(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_dl_nbiot_get_rsrp(srslte_chest_dl_nbiot_t* q);
|
||||
|
||||
#endif // SRSLTE_CHEST_DL_NBIOT_H
|
@ -1,107 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CHEST_SL_H
|
||||
#define SRSLTE_CHEST_SL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/phy/common/phy_common_sl.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
#define SRSLTE_SL_N_RU_SEQ (30)
|
||||
#define SRSLTE_SL_MAX_DMRS_SYMB (4)
|
||||
#define SRSLTE_SL_DEFAULT_NOF_DMRS_CYCLIC_SHIFTS (1)
|
||||
#define SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS (4)
|
||||
|
||||
// Base Sequence Number - always 0 for sidelink: 3GPP TS 36.211 version 15.6.0 Release 15 Sec. 5.5.1.4
|
||||
#define SRSLTE_SL_BASE_SEQUENCE_NUMBER 0
|
||||
#define SRSLTE_SL_MAX_DMRS_PERIOD_LENGTH 320
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t prb_start_idx; // PRB start idx to map RE from RIV
|
||||
uint32_t nof_prb; // PSSCH nof_prb, Length of continuous PRB to map RE (in the pool) from RIV
|
||||
uint32_t N_x_id;
|
||||
uint32_t sf_idx; // PSSCH sf_idx
|
||||
uint32_t cyclic_shift;
|
||||
} srslte_chest_sl_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
srslte_sl_channels_t channel;
|
||||
srslte_cell_sl_t cell;
|
||||
srslte_sl_comm_resource_pool_t sl_comm_resource_pool;
|
||||
srslte_chest_sl_cfg_t chest_sl_cfg;
|
||||
|
||||
uint32_t sf_n_re;
|
||||
|
||||
uint32_t M_sc_rs;
|
||||
int8_t nof_dmrs_symbols;
|
||||
|
||||
// Orthogonal Sequence (W) Transmission Mode 1, 2 and PSBCH
|
||||
int8_t w[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Cyclic Shift Values
|
||||
int8_t n_CS[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Reference Signal Cyclic Shift
|
||||
float alpha[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
// Group Hopping Flag
|
||||
uint32_t* f_gh_pattern;
|
||||
|
||||
cf_t* r_sequence[SRSLTE_SL_MAX_DMRS_SYMB][SRSLTE_SL_MAX_PSCCH_NOF_DMRS_CYCLIC_SHIFTS];
|
||||
|
||||
cf_t* r_sequence_rx[SRSLTE_SL_MAX_DMRS_SYMB];
|
||||
|
||||
cf_t* ce;
|
||||
cf_t* ce_average;
|
||||
cf_t* noise_tmp;
|
||||
float noise_estimated;
|
||||
|
||||
srslte_interp_linsrslte_vec_t lin_vec_sl;
|
||||
|
||||
bool sync_error_enable;
|
||||
bool rsrp_enable;
|
||||
float sync_err;
|
||||
float rsrp_corr;
|
||||
|
||||
} srslte_chest_sl_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_init(srslte_chest_sl_t* q,
|
||||
srslte_sl_channels_t channel,
|
||||
srslte_cell_sl_t cell,
|
||||
srslte_sl_comm_resource_pool_t sl_comm_resource_pool);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_set_cell(srslte_chest_sl_t* q, srslte_cell_sl_t cell);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_set_cfg(srslte_chest_sl_t* q, srslte_chest_sl_cfg_t chest_sl_cfg);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_get_sync_error(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_estimate_noise(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API float srslte_chest_sl_get_rsrp(srslte_chest_sl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_put_dmrs(srslte_chest_sl_t* q, cf_t* sf_buffer);
|
||||
|
||||
SRSLTE_API int srslte_chest_sl_get_dmrs(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t** dmrs_received);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_estimate(srslte_chest_sl_t* q, cf_t* sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_equalize(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t* equalized_sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_ls_estimate_equalize(srslte_chest_sl_t* q, cf_t* sf_buffer, cf_t* equalized_sf_buffer);
|
||||
|
||||
SRSLTE_API void srslte_chest_sl_free(srslte_chest_sl_t* q);
|
||||
|
||||
#endif
|
@ -1,116 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: chest_ul.h
|
||||
*
|
||||
* Description: 3GPP LTE Uplink channel estimator and equalizer.
|
||||
* Estimates the channel in the resource elements transmitting references and
|
||||
* interpolates for the rest of the resource grid.
|
||||
* The equalizer uses the channel estimates to produce an estimation of the
|
||||
* transmitted symbol.
|
||||
*
|
||||
* Reference:
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CHEST_UL_H
|
||||
#define SRSLTE_CHEST_UL_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_common.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/resampling/interp.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
cf_t* ce;
|
||||
uint32_t nof_re;
|
||||
float noise_estimate;
|
||||
float noise_estimate_dbm;
|
||||
float rsrp;
|
||||
float rsrp_dBfs;
|
||||
float epre;
|
||||
float epre_dBfs;
|
||||
float snr;
|
||||
float snr_db;
|
||||
float cfo_hz;
|
||||
float ta_us;
|
||||
} srslte_chest_ul_res_t;
|
||||
|
||||
typedef struct {
|
||||
srslte_cell_t cell;
|
||||
|
||||
srslte_refsignal_ul_t dmrs_signal;
|
||||
srslte_refsignal_ul_dmrs_pregen_t dmrs_pregen;
|
||||
bool dmrs_signal_configured;
|
||||
|
||||
srslte_refsignal_srs_pregen_t srs_pregen;
|
||||
bool srs_signal_configured;
|
||||
|
||||
cf_t* pilot_estimates;
|
||||
cf_t* pilot_estimates_tmp[4];
|
||||
cf_t* pilot_recv_signal;
|
||||
cf_t* pilot_known_signal;
|
||||
cf_t* tmp_noise;
|
||||
|
||||
#ifdef FREQ_SEL_SNR
|
||||
float snr_vector[12000];
|
||||
float pilot_power[12000];
|
||||
#endif
|
||||
uint32_t smooth_filter_len;
|
||||
float smooth_filter[SRSLTE_CHEST_MAX_SMOOTH_FIL_LEN];
|
||||
|
||||
srslte_interp_linsrslte_vec_t srslte_interp_linvec;
|
||||
|
||||
} srslte_chest_ul_t;
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_init(srslte_chest_ul_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_free(srslte_chest_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_res_init(srslte_chest_ul_res_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_res_set_identity(srslte_chest_ul_res_t* q);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_res_free(srslte_chest_ul_res_t* q);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_set_cell(srslte_chest_ul_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_chest_ul_pregen(srslte_chest_ul_t* q,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_pusch(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_pucch(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_chest_ul_estimate_srs(srslte_chest_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* input,
|
||||
srslte_chest_ul_res_t* res);
|
||||
|
||||
#endif // SRSLTE_CHEST_UL_H
|
@ -1,124 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_CSI_RS_H_
|
||||
#define SRSLTE_CSI_RS_H_
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include <complex.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW1 4
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW2 12
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_ROW4 3
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_OTHER 6
|
||||
#define SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_MAX 12
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_row_1 = 0,
|
||||
srslte_csi_rs_resource_mapping_row_2,
|
||||
srslte_csi_rs_resource_mapping_row_4,
|
||||
srslte_csi_rs_resource_mapping_row_other,
|
||||
} srslte_csi_rs_resource_mapping_row_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_density_three = 0,
|
||||
srslte_csi_rs_resource_mapping_density_dot5_even,
|
||||
srslte_csi_rs_resource_mapping_density_dot5_odd,
|
||||
srslte_csi_rs_resource_mapping_density_one,
|
||||
srslte_csi_rs_resource_mapping_density_spare
|
||||
} srslte_csi_rs_density_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
srslte_csi_rs_cdm_nocdm = 0,
|
||||
srslte_csi_rs_cdm_fd_cdm2,
|
||||
srslte_csi_rs_cdm_cdm4_fd2_td2,
|
||||
srslte_csi_rs_cdm_cdm8_fd2_td4
|
||||
} srslte_csi_rs_cdm_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-FrequencyOccupation flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t start_rb; ///< PRB where this CSI resource starts in relation to common resource block #0 (CRB#0) on the
|
||||
///< common resource block grid. Only multiples of 4 are allowed (0, 4, ..., 274)
|
||||
|
||||
uint32_t nof_rb; ///< Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. The
|
||||
///< smallest configurable number is the minimum of 24 and the width of the associated BWP. If the
|
||||
///< configured value is larger than the width of the corresponding BWP, the UE shall assume that the
|
||||
///< actual CSI-RS bandwidth is equal to the width of the BWP.
|
||||
} srslte_csi_rs_freq_occupation_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-ResourcePeriodicityAndOffset flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t period; // 4,5,8,10,16,20,32,40,64,80,160,320,640
|
||||
uint32_t offset; // 0..period-1
|
||||
} srslte_csi_rs_period_and_offset_t;
|
||||
|
||||
/**
|
||||
* @brief Contains CSI-RS-ResourceMapping flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_row_t row;
|
||||
bool frequency_domain_alloc[SRSLTE_CSI_RS_NOF_FREQ_DOMAIN_ALLOC_MAX];
|
||||
uint32_t ports; // 1, 2, 4, 8, 12, 16, 24, 32
|
||||
uint32_t first_symbol_idx; // 0..13
|
||||
uint32_t first_symbol_idx2; // 2..12 (set to 0 for disabled)
|
||||
srslte_csi_rs_cdm_t cdm;
|
||||
srslte_csi_rs_density_t density;
|
||||
srslte_csi_rs_freq_occupation_t freq_band;
|
||||
} srslte_csi_rs_resource_mapping_t;
|
||||
|
||||
/**
|
||||
* @brief Contains NZP-CSI-RS-Resource flattened configuration
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_csi_rs_resource_mapping_t resource_mapping;
|
||||
|
||||
float power_control_offset; // -8..15 dB
|
||||
float power_control_offset_ss; // -3, 0, 3, 6 dB
|
||||
|
||||
uint32_t scrambling_id; // 0..1023
|
||||
|
||||
srslte_csi_rs_period_and_offset_t periodicity;
|
||||
|
||||
} srslte_csi_rs_nzp_resource_t;
|
||||
|
||||
SRSLTE_API int srslte_csi_rs_nzp_put(const srslte_carrier_nr_t* carrier,
|
||||
const srslte_slot_cfg_t* slot_cfg,
|
||||
const srslte_csi_rs_nzp_resource_t* resource,
|
||||
cf_t* grid);
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
float rsrp;
|
||||
float rsrp_dB;
|
||||
float epre;
|
||||
float epre_dB;
|
||||
float n0;
|
||||
float n0_dB;
|
||||
float snr_dB;
|
||||
uint32_t nof_re;
|
||||
} srslte_csi_rs_measure_t;
|
||||
|
||||
SRSLTE_API int srslte_csi_rs_nzp_measure(const srslte_carrier_nr_t* carrier,
|
||||
const srslte_slot_cfg_t* slot_cfg,
|
||||
const srslte_csi_rs_nzp_resource_t* resource,
|
||||
const cf_t* grid,
|
||||
srslte_csi_rs_measure_t* measure);
|
||||
|
||||
SRSLTE_API uint32_t srslte_csi_rs_measure_info(const srslte_csi_rs_measure_t* measure, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_CSI_RS_H_
|
@ -1,92 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: refsignal_dl.h
|
||||
*
|
||||
* Description: Object to manage downlink reference signals for channel estimation.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.10
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_DL_H
|
||||
#define SRSLTE_REFSIGNAL_DL_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
// Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb
|
||||
#define SRSLTE_REFSIGNAL_NUM_SF_MBSFN(nof_prb, port_id) ((2 + 18) * (nof_prb))
|
||||
|
||||
#define SRSLTE_REFSIGNAL_MAX_NUM_SF(nof_prb) (8 * nof_prb)
|
||||
#define SRSLTE_REFSIGNAL_MAX_NUM_SF_MBSFN(nof_prb) SRSLTE_REFSIGNAL_NUM_SF_MBSFN(nof_prb, 0)
|
||||
|
||||
#define SRSLTE_REFSIGNAL_PILOT_IDX(i, l, cell) (2 * cell.nof_prb * (l) + (i))
|
||||
|
||||
#define SRSLTE_REFSIGNAL_PILOT_IDX_MBSFN(i, l, cell) ((6 * cell.nof_prb * (l) + (i)))
|
||||
|
||||
/** Cell-Specific Reference Signal */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
cf_t* pilots[2][SRSLTE_NOF_SF_X_FRAME]; // Saves the reference signal per subframe for ports 0,1 and ports 2,3
|
||||
srslte_sf_t type;
|
||||
uint16_t mbsfn_area_id;
|
||||
} srslte_refsignal_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_init(srslte_refsignal_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_set_cell(srslte_refsignal_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_free(srslte_refsignal_t* q);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_cs_put_sf(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id, cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_cs_get_sf(srslte_refsignal_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
uint32_t port_id,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* pilots);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_fidx(srslte_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nsymbol(uint32_t l, srslte_cp_t cp, uint32_t port_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_v(uint32_t port_id, uint32_t ref_symbol_idx);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_symbols(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_pilots_x_slot(uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_cs_nof_re(srslte_refsignal_t* q, srslte_dl_sf_cfg_t* sf, uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_init(srslte_refsignal_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_set_cell(srslte_refsignal_t* q, srslte_cell_t cell, uint16_t mbsfn_area_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_get_sf(srslte_cell_t cell, uint32_t port_id, cf_t* sf_symbols, cf_t* pilots);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_nsymbol(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_fidx(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_mbsfn_nof_symbols();
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_put_sf(srslte_cell_t cell,
|
||||
uint32_t port_id,
|
||||
cf_t* cs_pilots,
|
||||
cf_t* mbsfn_pilots,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_mbsfn_gen_seq(srslte_refsignal_t* q, srslte_cell_t cell, uint32_t N_mbsfn_id);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_DL_H
|
@ -1,55 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_DL_NBIOT_H
|
||||
#define SRSLTE_REFSIGNAL_DL_NBIOT_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
// Number of references in a subframe: there are 2 symbols for port_id=0,1 x 2 slots x 2 refs per prb
|
||||
#define SRSLTE_NBIOT_NUM_NRS_X_SYM_X_PORT 2
|
||||
|
||||
// Max number of symbols with RE in one PRB (4 ports LTE plus 2 port NB-IoT)
|
||||
#define SRSLTE_NBIOT_MAX_NUM_RE_WITH_REFS 40
|
||||
|
||||
#define SRSLTE_NBIOT_REFSIGNAL_NUM_SF(nof_prb, port_id) (((port_id) < 2 ? 8 : 4) * (nof_prb))
|
||||
#define SRSLTE_NBIOT_REFSIGNAL_PILOT_IDX(i, l, nof_prb) (2 * nof_prb * (l) + (i))
|
||||
|
||||
/** Brief: Narrowband Reference Signal (NRS)
|
||||
*
|
||||
* Object to manage downlink reference signals for channel estimation. (3GPP TS 36.211 version 13.3 Sec. 10.2.6)
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
cf_t* pilots[2][SRSLTE_NOF_SF_X_FRAME]; // Saves the reference signal per subframe for ports 0 and 1
|
||||
} srslte_refsignal_dl_nbiot_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dl_nbiot_init(srslte_refsignal_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dl_nbiot_free(srslte_refsignal_dl_nbiot_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dl_nbiot_nof_symbols(uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dl_nbiot_set_cell(srslte_refsignal_dl_nbiot_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_dl_nbiot_fidx(srslte_nbiot_cell_t cell, uint32_t l, uint32_t port_id, uint32_t m);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_nrs_nsymbol(uint32_t l);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_nbiot_cs_nof_re(srslte_nbiot_cell_t* cell, uint32_t port_id);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_nrs_put_sf(srslte_nbiot_cell_t cell, uint32_t port_id, cf_t* pilots, cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_nrs_get_sf(srslte_nbiot_cell_t cell, uint32_t port_id, cf_t* sf_symbols, cf_t* pilots);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_DL_NBIOT_H
|
@ -1,184 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* 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
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_REFSIGNAL_UL_H
|
||||
#define SRSLTE_REFSIGNAL_UL_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
|
||||
#define SRSLTE_NOF_GROUPS_U 30
|
||||
#define SRSLTE_NOF_SEQUENCES_U 2
|
||||
#define SRSLTE_NOF_DELTA_SS 30
|
||||
#define SRSLTE_NOF_CSHIFT 8
|
||||
|
||||
#define SRSLTE_REFSIGNAL_UL_L(ns_idx, cp) ((ns_idx + 1) * SRSLTE_CP_NSYMB(cp) - 4)
|
||||
|
||||
/* PUSCH DMRS common configuration (received in SIB2) */
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t cyclic_shift;
|
||||
uint32_t delta_ss;
|
||||
bool group_hopping_en;
|
||||
bool sequence_hopping_en;
|
||||
} srslte_refsignal_dmrs_pusch_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
// Common Configuration
|
||||
uint32_t subframe_config;
|
||||
uint32_t bw_cfg;
|
||||
bool simul_ack;
|
||||
|
||||
// Dedicated configuration
|
||||
uint32_t B;
|
||||
uint32_t b_hop;
|
||||
uint32_t n_srs;
|
||||
uint32_t I_srs;
|
||||
uint32_t k_tc;
|
||||
uint32_t n_rrc;
|
||||
bool dedicated_enabled;
|
||||
bool common_enabled;
|
||||
bool configured;
|
||||
} srslte_refsignal_srs_cfg_t;
|
||||
|
||||
/** Uplink DeModulation Reference Signal (DMRS) */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
|
||||
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;
|
||||
|
||||
typedef struct {
|
||||
uint32_t max_prb;
|
||||
cf_t** r[SRSLTE_NOF_CSHIFT][SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_refsignal_ul_dmrs_pregen_t;
|
||||
|
||||
typedef struct {
|
||||
cf_t* r[SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_refsignal_srs_pregen_t;
|
||||
|
||||
SRSLTE_API int srslte_refsignal_ul_set_cell(srslte_refsignal_ul_t* q, srslte_cell_t cell);
|
||||
|
||||
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);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen_init(srslte_refsignal_ul_dmrs_pregen_t* pregen, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_pregen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_ul_dmrs_pregen_t* pregen,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg);
|
||||
|
||||
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_ul_sf_cfg_t* sf_cfg,
|
||||
srslte_refsignal_ul_dmrs_pregen_t* pregen,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pusch_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* cfg,
|
||||
uint32_t nof_prb,
|
||||
uint32_t sf_idx,
|
||||
uint32_t cyclic_shift_for_dmrs,
|
||||
cf_t* r_pusch);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dmrs_pusch_put(srslte_refsignal_ul_t* q,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* r_pusch,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_dmrs_pusch_get(srslte_refsignal_ul_t* q,
|
||||
srslte_pusch_cfg_t* pusch_cfg,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* r_pusch);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_dmrs_pucch_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
cf_t* r_pucch);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_dmrs_pucch_put(srslte_refsignal_ul_t* q, srslte_pucch_cfg_t* cfg, cf_t* r_pucch, cf_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_refsignal_dmrs_pucch_get(srslte_refsignal_ul_t* q, srslte_pucch_cfg_t* cfg, cf_t* input, cf_t* r_pucch);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_pregen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_pregen_t* pregen,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* dmrs);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_pregen_put(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_pregen_t* pregen,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
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);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_gen(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
uint32_t sf_idx,
|
||||
cf_t* r_srs);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_put(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
uint32_t tti,
|
||||
cf_t* r_srs,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_refsignal_srs_get(srslte_refsignal_ul_t* q,
|
||||
srslte_refsignal_srs_cfg_t* cfg,
|
||||
uint32_t tti,
|
||||
cf_t* r_srs,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg,
|
||||
srslte_pusch_cfg_t* pusch_cfg);
|
||||
|
||||
SRSLTE_API void srslte_refsignal_srs_pucch_shortened(srslte_refsignal_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg,
|
||||
srslte_pucch_cfg_t* pucch_cfg);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
SRSLTE_API uint32_t srslte_refsignal_srs_M_sc(srslte_refsignal_ul_t* q, srslte_refsignal_srs_cfg_t* cfg);
|
||||
|
||||
#endif // SRSLTE_REFSIGNAL_UL_H
|
@ -1,524 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: phy_common.h
|
||||
*
|
||||
* Description: Common parameters and lookup functions for PHY
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHY_COMMON_H
|
||||
#define SRSLTE_PHY_COMMON_H
|
||||
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
#define SRSLTE_NOF_SF_X_FRAME 10
|
||||
#define SRSLTE_NOF_SLOTS_PER_SF 2
|
||||
#define SRSLTE_NSLOTS_X_FRAME (SRSLTE_NOF_SLOTS_PER_SF * SRSLTE_NOF_SF_X_FRAME)
|
||||
|
||||
#define SRSLTE_NSOFT_BITS 250368 // Soft buffer size for Category 1 UE
|
||||
|
||||
#define SRSLTE_PC_MAX 23 // Maximum TX power for Category 1 UE (in dBm)
|
||||
|
||||
#define SRSLTE_NOF_NID_1 (168)
|
||||
#define SRSLTE_NOF_NID_2 (3)
|
||||
#define SRSLTE_NUM_PCI (SRSLTE_NOF_NID_1 * SRSLTE_NOF_NID_2)
|
||||
|
||||
#define SRSLTE_MAX_CARRIERS 5 // Maximum number of supported simultaneous carriers
|
||||
#define SRSLTE_MAX_PORTS 4
|
||||
#define SRSLTE_MAX_CHANNELS (SRSLTE_MAX_CARRIERS * SRSLTE_MAX_PORTS)
|
||||
#define SRSLTE_MAX_LAYERS 4
|
||||
#define SRSLTE_MAX_CODEWORDS 2
|
||||
#define SRSLTE_MAX_TB SRSLTE_MAX_CODEWORDS
|
||||
#define SRSLTE_MAX_QM 8
|
||||
|
||||
#define SRSLTE_MAX_CODEBLOCKS 32
|
||||
|
||||
#define SRSLTE_MAX_CODEBOOKS 4
|
||||
|
||||
#define SRSLTE_NOF_CFI 3
|
||||
#define SRSLTE_CFI_ISVALID(x) ((x >= 1 && x <= 3))
|
||||
#define SRSLTE_CFI_IDX(x) ((x - 1) % SRSLTE_NOF_CFI)
|
||||
|
||||
#define SRSLTE_LTE_CRC24A 0x1864CFB
|
||||
#define SRSLTE_LTE_CRC24B 0X1800063
|
||||
#define SRSLTE_LTE_CRC24C 0X1B2B117
|
||||
#define SRSLTE_LTE_CRC16 0x11021
|
||||
#define SRSLTE_LTE_CRC11 0xE21
|
||||
#define SRSLTE_LTE_CRC8 0x19B
|
||||
#define SRSLTE_LTE_CRC6 0x61
|
||||
|
||||
#define SRSLTE_MAX_MBSFN_AREA_IDS 256
|
||||
#define SRSLTE_PMCH_RV 0
|
||||
|
||||
typedef enum { SRSLTE_CP_NORM = 0, SRSLTE_CP_EXT } srslte_cp_t;
|
||||
typedef enum { SRSLTE_SF_NORM = 0, SRSLTE_SF_MBSFN } srslte_sf_t;
|
||||
|
||||
#define SRSLTE_INVALID_RNTI 0x0 // TS 36.321 - Table 7.1-1 RNTI 0x0 isn't a valid DL RNTI
|
||||
#define SRSLTE_CRNTI_START 0x000B
|
||||
#define SRSLTE_CRNTI_END 0xFFF3
|
||||
#define SRSLTE_RARNTI_START 0x0001
|
||||
#define SRSLTE_RARNTI_END 0x000A
|
||||
#define SRSLTE_SIRNTI 0xFFFF
|
||||
#define SRSLTE_PRNTI 0xFFFE
|
||||
#define SRSLTE_MRNTI 0xFFFD
|
||||
|
||||
#define SRSLTE_RNTI_ISRAR(rnti) (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)
|
||||
#define SRSLTE_RNTI_ISUSER(rnti) (rnti >= SRSLTE_CRNTI_START && rnti <= SRSLTE_CRNTI_END)
|
||||
#define SRSLTE_RNTI_ISSI(rnti) (rnti == SRSLTE_SIRNTI)
|
||||
#define SRSLTE_RNTI_ISPA(rnti) (rnti == SRSLTE_PRNTI)
|
||||
#define SRSLTE_RNTI_ISMBSFN(rnti) (rnti == SRSLTE_MRNTI)
|
||||
#define SRSLTE_RNTI_ISSIRAPA(rnti) (SRSLTE_RNTI_ISSI(rnti) || SRSLTE_RNTI_ISRAR(rnti) || SRSLTE_RNTI_ISPA(rnti))
|
||||
|
||||
#define SRSLTE_CELL_ID_UNKNOWN 1000
|
||||
|
||||
#define SRSLTE_MAX_NSYMB 7
|
||||
|
||||
#define SRSLTE_MAX_PRB 110
|
||||
#define SRSLTE_NRE 12
|
||||
|
||||
#define SRSLTE_SYMBOL_SZ_MAX 2048
|
||||
|
||||
#define SRSLTE_CP_NORM_NSYMB 7
|
||||
#define SRSLTE_CP_NORM_SF_NSYMB (2 * SRSLTE_CP_NORM_NSYMB)
|
||||
#define SRSLTE_CP_NORM_0_LEN 160
|
||||
#define SRSLTE_CP_NORM_LEN 144
|
||||
|
||||
#define SRSLTE_CP_EXT_NSYMB 6
|
||||
#define SRSLTE_CP_EXT_SF_NSYMB (2 * SRSLTE_CP_EXT_NSYMB)
|
||||
#define SRSLTE_CP_EXT_LEN 512
|
||||
#define SRSLTE_CP_EXT_7_5_LEN 1024
|
||||
|
||||
#define SRSLTE_CP_ISNORM(cp) (cp == SRSLTE_CP_NORM)
|
||||
#define SRSLTE_CP_ISEXT(cp) (cp == SRSLTE_CP_EXT)
|
||||
#define SRSLTE_CP_NSYMB(cp) (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_NSYMB : SRSLTE_CP_EXT_NSYMB)
|
||||
|
||||
#define SRSLTE_CP_LEN(symbol_sz, c) ((int)ceilf((((float)(c) * (symbol_sz)) / 2048.0f)))
|
||||
#define SRSLTE_CP_LEN_NORM(symbol, symbol_sz) \
|
||||
(((symbol) == 0) ? SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_0_LEN) : SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_NORM_LEN))
|
||||
#define SRSLTE_CP_LEN_EXT(symbol_sz) (SRSLTE_CP_LEN((symbol_sz), SRSLTE_CP_EXT_LEN))
|
||||
|
||||
#define SRSLTE_CP_SZ(symbol_sz, cp) \
|
||||
(SRSLTE_CP_LEN(symbol_sz, (SRSLTE_CP_ISNORM(cp) ? SRSLTE_CP_NORM_LEN : SRSLTE_CP_EXT_LEN)))
|
||||
#define SRSLTE_SYMBOL_SZ(symbol_sz, cp) (symbol_sz + SRSLTE_CP_SZ(symbol_sz, cp))
|
||||
#define SRSLTE_SLOT_LEN(symbol_sz) (symbol_sz * 15 / 2)
|
||||
#define SRSLTE_SF_LEN(symbol_sz) (symbol_sz * 15)
|
||||
#define SRSLTE_SF_LEN_MAX (SRSLTE_SF_LEN(SRSLTE_SYMBOL_SZ_MAX))
|
||||
|
||||
#define SRSLTE_SLOT_LEN_PRB(nof_prb) (SRSLTE_SLOT_LEN(srslte_symbol_sz(nof_prb)))
|
||||
#define SRSLTE_SF_LEN_PRB(nof_prb) ((uint32_t)SRSLTE_SF_LEN(srslte_symbol_sz(nof_prb)))
|
||||
|
||||
#define SRSLTE_SLOT_LEN_RE(nof_prb, cp) (nof_prb * SRSLTE_NRE * SRSLTE_CP_NSYMB(cp))
|
||||
#define SRSLTE_SF_LEN_RE(nof_prb, cp) (2 * SRSLTE_SLOT_LEN_RE(nof_prb, cp))
|
||||
#define SRSLTE_NOF_RE(cell) (2 * SRSLTE_SLOT_LEN_RE(cell.nof_prb, cell.cp))
|
||||
|
||||
#define SRSLTE_TA_OFFSET (10e-6)
|
||||
|
||||
#define SRSLTE_LTE_TS (1.0f / (15000.0f * 2048.0f))
|
||||
|
||||
#define SRSLTE_SLOT_IDX_CPNORM(symbol_idx, symbol_sz) \
|
||||
(symbol_idx == 0 ? 0 \
|
||||
: (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_0_LEN) + \
|
||||
(symbol_idx - 1) * (symbol_sz + SRSLTE_CP_LEN(symbol_sz, SRSLTE_CP_NORM_LEN))))
|
||||
#define SRSLTE_SLOT_IDX_CPEXT(idx, symbol_sz) (idx * (symbol_sz + SRSLTE_CP(symbol_sz, SRSLTE_CP_EXT_LEN)))
|
||||
|
||||
#define SRSLTE_RE_IDX(nof_prb, symbol_idx, sample_idx) ((symbol_idx) * (nof_prb) * (SRSLTE_NRE) + sample_idx)
|
||||
|
||||
#define SRSLTE_RS_VSHIFT(cell_id) (cell_id % 6)
|
||||
|
||||
#define SRSLTE_GUARD_RE(nof_prb) ((srslte_symbol_sz(nof_prb) - nof_prb * SRSLTE_NRE) / 2)
|
||||
|
||||
#define SRSLTE_SYMBOL_HAS_REF(l, cp, nof_ports) ((l == 1 && nof_ports == 4) || l == 0 || l == SRSLTE_CP_NSYMB(cp) - 3)
|
||||
|
||||
#define SRSLTE_NOF_CTRL_SYMBOLS(cell, cfi) (cfi + (cell.nof_prb < 10 ? 1 : 0))
|
||||
|
||||
#define SRSLTE_SYMBOL_HAS_REF_MBSFN(l, s) ((l == 2 && s == 0) || (l == 0 && s == 1) || (l == 4 && s == 1))
|
||||
|
||||
#define SRSLTE_NON_MBSFN_REGION_GUARD_LENGTH(non_mbsfn_region, symbol_sz) \
|
||||
((non_mbsfn_region == 1) \
|
||||
? (SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz)) \
|
||||
: (2 * SRSLTE_CP_LEN_EXT(symbol_sz) - SRSLTE_CP_LEN_NORM(0, symbol_sz) - SRSLTE_CP_LEN_NORM(1, symbol_sz)))
|
||||
|
||||
#define SRSLTE_FDD_NOF_HARQ (FDD_HARQ_DELAY_DL_MS + FDD_HARQ_DELAY_UL_MS)
|
||||
#define SRSLTE_MAX_HARQ_PROC 15
|
||||
|
||||
#define SRSLTE_NOF_LTE_BANDS 58
|
||||
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_PBCH 500
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_PSS 10
|
||||
#define SRSLTE_DEFAULT_NOF_VALID_PSS_FRAMES 10
|
||||
|
||||
#define ZERO_OBJECT(x) memset(&(x), 0x0, sizeof((x)))
|
||||
|
||||
typedef enum SRSLTE_API { SRSLTE_PHICH_NORM = 0, SRSLTE_PHICH_EXT } srslte_phich_length_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_PHICH_R_1_6 = 0,
|
||||
SRSLTE_PHICH_R_1_2,
|
||||
SRSLTE_PHICH_R_1,
|
||||
SRSLTE_PHICH_R_2
|
||||
} srslte_phich_r_t;
|
||||
|
||||
/// LTE duplex modes.
|
||||
typedef enum SRSLTE_API {
|
||||
/// FDD uses frame structure type 1.
|
||||
SRSLTE_FDD = 0,
|
||||
/// TDD uses frame structure type 2.
|
||||
SRSLTE_TDD = 1
|
||||
} srslte_frame_type_t;
|
||||
|
||||
/// Maximum number of TDD special subframe configurations.
|
||||
#define SRSLTE_MAX_TDD_SS_CONFIGS (10u)
|
||||
|
||||
/// Maximum number of TDD uplink-downlink subframe configurations.
|
||||
#define SRSLTE_MAX_TDD_SF_CONFIGS (7u)
|
||||
|
||||
/// Configuration fields for operating in TDD mode.
|
||||
typedef struct SRSLTE_API {
|
||||
/// Uplink-downlink configuration, valid range is [0,SRSLTE_MAX_TDD_SF_CONFIGS[.
|
||||
/// TS 36.211 v8.9.0 Table 4.2-2.
|
||||
uint32_t sf_config;
|
||||
/// Special subframe symbol length configuration, valid range is [0,SRSLTE_MAX_TDD_SS_CONFIGS[.
|
||||
/// TS 36.211 v13.13.0 Table 4.2-1.
|
||||
uint32_t ss_config;
|
||||
/// Set to true when the fields have been configured, otherwise false.
|
||||
bool configured;
|
||||
} srslte_tdd_config_t;
|
||||
|
||||
/// TDD uplink-downlink subframe types.
|
||||
typedef enum SRSLTE_API {
|
||||
/// Subframe is reserved for downlink transmissions.
|
||||
SRSLTE_TDD_SF_D = 0,
|
||||
/// Subframe is reserved for uplink transmissions.
|
||||
SRSLTE_TDD_SF_U = 1,
|
||||
/// Special subframe.
|
||||
SRSLTE_TDD_SF_S = 2,
|
||||
} srslte_tdd_sf_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t mbsfn_area_id;
|
||||
uint8_t non_mbsfn_region_length;
|
||||
uint8_t mbsfn_mcs;
|
||||
bool enable;
|
||||
bool is_mcch;
|
||||
} srslte_mbsfn_cfg_t;
|
||||
|
||||
// Common cell constant properties that require object reconfiguration
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t nof_prb;
|
||||
uint32_t nof_ports;
|
||||
uint32_t id;
|
||||
srslte_cp_t cp;
|
||||
srslte_phich_length_t phich_length;
|
||||
srslte_phich_r_t phich_resources;
|
||||
srslte_frame_type_t frame_type;
|
||||
} srslte_cell_t;
|
||||
|
||||
// Common downlink properties that may change every subframe
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_tdd_config_t tdd_config;
|
||||
uint32_t tti;
|
||||
uint32_t cfi;
|
||||
srslte_sf_t sf_type;
|
||||
uint32_t non_mbsfn_region;
|
||||
} srslte_dl_sf_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_tdd_config_t tdd_config;
|
||||
uint32_t tti;
|
||||
bool shortened;
|
||||
} srslte_ul_sf_cfg_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_TM1 = 0,
|
||||
SRSLTE_TM2,
|
||||
SRSLTE_TM3,
|
||||
SRSLTE_TM4,
|
||||
SRSLTE_TM5,
|
||||
SRSLTE_TM6,
|
||||
SRSLTE_TM7,
|
||||
SRSLTE_TM8,
|
||||
SRSLTE_TMINV // Invalid Transmission Mode
|
||||
} srslte_tm_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_TXSCHEME_PORT0,
|
||||
SRSLTE_TXSCHEME_DIVERSITY,
|
||||
SRSLTE_TXSCHEME_SPATIALMUX,
|
||||
SRSLTE_TXSCHEME_CDD
|
||||
} srslte_tx_scheme_t;
|
||||
|
||||
typedef enum SRSLTE_API { SRSLTE_MIMO_DECODER_ZF, SRSLTE_MIMO_DECODER_MMSE } srslte_mimo_decoder_t;
|
||||
|
||||
/*!
|
||||
* \brief Types of modulations and associated modulation order.
|
||||
*/
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_MOD_BPSK = 0, /*!< \brief BPSK. */
|
||||
SRSLTE_MOD_QPSK, /*!< \brief QPSK. */
|
||||
SRSLTE_MOD_16QAM, /*!< \brief QAM16. */
|
||||
SRSLTE_MOD_64QAM, /*!< \brief QAM64. */
|
||||
SRSLTE_MOD_256QAM, /*!< \brief QAM256. */
|
||||
SRSLTE_MOD_NITEMS
|
||||
} srslte_mod_t;
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_DCI_FORMAT0 = 0,
|
||||
SRSLTE_DCI_FORMAT1,
|
||||
SRSLTE_DCI_FORMAT1A,
|
||||
SRSLTE_DCI_FORMAT1B,
|
||||
SRSLTE_DCI_FORMAT1C,
|
||||
SRSLTE_DCI_FORMAT1D,
|
||||
SRSLTE_DCI_FORMAT2,
|
||||
SRSLTE_DCI_FORMAT2A,
|
||||
SRSLTE_DCI_FORMAT2B,
|
||||
// SRSLTE_DCI_FORMAT3,
|
||||
// SRSLTE_DCI_FORMAT3A,
|
||||
SRSLTE_DCI_FORMATN0,
|
||||
SRSLTE_DCI_FORMATN1,
|
||||
SRSLTE_DCI_FORMATN2,
|
||||
SRSLTE_DCI_FORMAT_RAR, // Not a real LTE format. Used internally to indicate RAR grant
|
||||
SRSLTE_DCI_NOF_FORMATS
|
||||
} srslte_dci_format_t;
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_NORMAL = 0, /* No cell selection no pucch3 */
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_CS,
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_PUCCH3,
|
||||
SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_ERROR,
|
||||
} srslte_ack_nack_feedback_mode_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
int id;
|
||||
float fd;
|
||||
} srslte_earfcn_t;
|
||||
|
||||
enum band_geographical_area {
|
||||
SRSLTE_BAND_GEO_AREA_ALL,
|
||||
SRSLTE_BAND_GEO_AREA_NAR,
|
||||
SRSLTE_BAND_GEO_AREA_APAC,
|
||||
SRSLTE_BAND_GEO_AREA_EMEA,
|
||||
SRSLTE_BAND_GEO_AREA_JAPAN,
|
||||
SRSLTE_BAND_GEO_AREA_CALA,
|
||||
SRSLTE_BAND_GEO_AREA_NA
|
||||
};
|
||||
|
||||
///< NB-IoT specific structs
|
||||
typedef enum {
|
||||
SRSLTE_NBIOT_MODE_INBAND_SAME_PCI = 0,
|
||||
SRSLTE_NBIOT_MODE_INBAND_DIFFERENT_PCI,
|
||||
SRSLTE_NBIOT_MODE_GUARDBAND,
|
||||
SRSLTE_NBIOT_MODE_STANDALONE,
|
||||
SRSLTE_NBIOT_MODE_N_ITEMS,
|
||||
} srslte_nbiot_mode_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t base; // the umbrella or super cell
|
||||
uint32_t nbiot_prb; // the index of the NB-IoT PRB within the cell
|
||||
uint32_t n_id_ncell;
|
||||
uint32_t nof_ports; // The number of antenna ports for NB-IoT
|
||||
bool is_r14; // Whether the cell is a R14 cell
|
||||
srslte_nbiot_mode_t mode;
|
||||
} srslte_nbiot_cell_t;
|
||||
|
||||
#define SRSLTE_NBIOT_MAX_PORTS 2
|
||||
#define SRSLTE_NBIOT_MAX_CODEWORDS SRSLTE_MAX_CODEWORDS
|
||||
|
||||
#define SRSLTE_SF_LEN_PRB_NBIOT (SRSLTE_SF_LEN_PRB(1))
|
||||
|
||||
#define SRSLTE_SF_LEN_RE_NBIOT (SRSLTE_SF_LEN_RE(1, SRSLTE_CP_NORM))
|
||||
|
||||
#define SRSLTE_NBIOT_FFT_SIZE 128
|
||||
#define SRSLTE_NBIOT_FREQ_SHIFT_FACTOR ((float)-0.5)
|
||||
#define SRSLTE_NBIOT_NUM_RX_ANTENNAS 1
|
||||
#define SRSLTE_NBIOT_MAX_PRB 1
|
||||
|
||||
#define SRSLTE_NBIOT_DEFAULT_NUM_PRB_BASECELL 1
|
||||
#define SRSLTE_NBIOT_DEFAULT_PRB_OFFSET 0
|
||||
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_NPBCH 500
|
||||
#define SRSLTE_DEFAULT_MAX_FRAMES_NPSS 20
|
||||
#define SRSLTE_DEFAULT_NOF_VALID_NPSS_FRAMES 20
|
||||
|
||||
#define SRSLTE_NBIOT_NPBCH_NOF_TOTAL_BITS (1600) ///< Number of bits for the entire NPBCH (See 36.211 Sec 10.2.4.1)
|
||||
#define SRSLTE_NBIOT_NPBCH_NOF_BITS_SF \
|
||||
(SRSLTE_NBIOT_NPBCH_NOF_TOTAL_BITS / 8) ///< The NPBCH is transmitted in 8 blocks (See 36.211 Sec 10.2.4.4)
|
||||
|
||||
#define SRSLTE_MAX_DL_BITS_CAT_NB1 (680) ///< TS 36.306 v15.4.0 Table 4.1C-1
|
||||
|
||||
///< PHY common function declarations
|
||||
|
||||
SRSLTE_API bool srslte_cell_isvalid(srslte_cell_t* cell);
|
||||
|
||||
SRSLTE_API void srslte_cell_fprint(FILE* stream, srslte_cell_t* cell, uint32_t sfn);
|
||||
|
||||
SRSLTE_API bool srslte_cellid_isvalid(uint32_t cell_id);
|
||||
|
||||
SRSLTE_API bool srslte_nofprb_isvalid(uint32_t nof_prb);
|
||||
|
||||
/**
|
||||
* Returns the subframe type for a given subframe number and a TDD configuration.
|
||||
* Check TS 36.211 v8.9.0 Table 4.2-2.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @param sf_idx Subframe number, must be in range [0,SRSLTE_NOF_SF_X_FRAME[.
|
||||
* @return Returns the subframe type.
|
||||
*/
|
||||
SRSLTE_API srslte_tdd_sf_t srslte_sfidx_tdd_type(srslte_tdd_config_t tdd_config, uint32_t sf_idx);
|
||||
|
||||
/**
|
||||
* Returns the number of UpPTS symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of UpPTS symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_up(srslte_tdd_config_t tdd_config);
|
||||
|
||||
/**
|
||||
* Returns the number of GP symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of GP symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_gp(srslte_tdd_config_t tdd_config);
|
||||
|
||||
/**
|
||||
* Returns the number of DwPTS symbols in a subframe.
|
||||
* Check TS 36.211 v13.13.0 Table 4.2-1.
|
||||
*
|
||||
* @param tdd_config TDD configuration.
|
||||
* @return Returns the number of DwPTS symbols.
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_dw(srslte_tdd_config_t tdd_config);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdd_nof_harq(srslte_tdd_config_t tdd_config);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sfidx_tdd_nof_dw_slot(srslte_tdd_config_t tdd_config, uint32_t slot, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API bool srslte_sfidx_isvalid(uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API bool srslte_portid_isvalid(uint32_t port_id);
|
||||
|
||||
SRSLTE_API bool srslte_N_id_2_isvalid(uint32_t N_id_2);
|
||||
|
||||
SRSLTE_API bool srslte_N_id_1_isvalid(uint32_t N_id_1);
|
||||
|
||||
SRSLTE_API bool srslte_symbol_sz_isvalid(uint32_t symbol_sz);
|
||||
|
||||
SRSLTE_API int srslte_symbol_sz(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_symbol_sz_power2(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_nof_prb(uint32_t symbol_sz);
|
||||
|
||||
SRSLTE_API uint32_t srslte_max_cce(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_sampling_freq_hz(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API void srslte_use_standard_symbol_size(bool enabled);
|
||||
|
||||
SRSLTE_API bool srslte_symbol_size_is_standard();
|
||||
|
||||
SRSLTE_API uint32_t srslte_re_x_prb(uint32_t ns, uint32_t symbol, uint32_t nof_ports, uint32_t nof_symbols);
|
||||
|
||||
SRSLTE_API uint32_t srslte_voffset(uint32_t symbol_id, uint32_t cell_id, uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API int srslte_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME], uint32_t cell_id);
|
||||
|
||||
SRSLTE_API uint32_t srslte_N_ta_new_rar(uint32_t ta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_N_ta_new(uint32_t N_ta_old, uint32_t ta);
|
||||
|
||||
SRSLTE_API float srslte_coderate(uint32_t tbs, uint32_t nof_re);
|
||||
|
||||
SRSLTE_API char* srslte_cp_string(srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_str2mod(const char* mod_str);
|
||||
|
||||
SRSLTE_API char* srslte_mod_string(srslte_mod_t mod);
|
||||
|
||||
SRSLTE_API uint32_t srslte_mod_bits_x_symbol(srslte_mod_t mod);
|
||||
|
||||
SRSLTE_API uint8_t srslte_band_get_band(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API bool srslte_band_is_tdd(uint32_t band);
|
||||
|
||||
SRSLTE_API double srslte_band_fd(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API double srslte_band_fu(uint32_t ul_earfcn);
|
||||
|
||||
SRSLTE_API uint32_t srslte_band_ul_earfcn(uint32_t dl_earfcn);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_band_get_fd_band(uint32_t band, srslte_earfcn_t* earfcn, int earfcn_start, int earfcn_end, uint32_t max_elems);
|
||||
|
||||
SRSLTE_API int srslte_band_get_fd_band_all(uint32_t band, srslte_earfcn_t* earfcn, uint32_t max_nelems);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_band_get_fd_region(enum band_geographical_area region, srslte_earfcn_t* earfcn, uint32_t max_elems);
|
||||
|
||||
SRSLTE_API int srslte_str2mimotype(char* mimo_type_str, srslte_tx_scheme_t* type);
|
||||
|
||||
SRSLTE_API char* srslte_mimotype2str(srslte_tx_scheme_t mimo_type);
|
||||
|
||||
/* Returns the interval tti1-tti2 mod 10240 */
|
||||
SRSLTE_API uint32_t srslte_tti_interval(uint32_t tti1, uint32_t tti2);
|
||||
|
||||
SRSLTE_API uint32_t srslte_print_check(char* s, size_t max_len, uint32_t cur_len, const char* format, ...);
|
||||
|
||||
SRSLTE_API bool srslte_nbiot_cell_isvalid(srslte_nbiot_cell_t* cell);
|
||||
SRSLTE_API bool srslte_nbiot_portid_isvalid(uint32_t port_id);
|
||||
SRSLTE_API float srslte_band_fu_nbiot(uint32_t ul_earfcn, const float m_ul);
|
||||
|
||||
SRSLTE_API char* srslte_nbiot_mode_string(srslte_nbiot_mode_t mode);
|
||||
|
||||
/**
|
||||
* Returns a constant string pointer with the ACK/NACK feedback mode
|
||||
*
|
||||
* @param ack_nack_feedback_mode Mode
|
||||
* @return Returns constant pointer with the text of the mode if succesful, `error` otherwise
|
||||
*/
|
||||
SRSLTE_API const char* srslte_ack_nack_feedback_mode_string(srslte_ack_nack_feedback_mode_t ack_nack_feedback_mode);
|
||||
|
||||
/**
|
||||
* Returns a constant string pointer with the ACK/NACK feedback mode
|
||||
*
|
||||
* @param ack_nack_feedback_mode Mode
|
||||
* @return Returns constant pointer with the text of the mode if succesful, `error` otherwise
|
||||
*/
|
||||
SRSLTE_API srslte_ack_nack_feedback_mode_t srslte_string_ack_nack_feedback_mode(const char* str);
|
||||
|
||||
/**
|
||||
* Returns the number of bits for Rank Indicador reporting depending on the cell
|
||||
*
|
||||
* @param cell
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_ri_nof_bits(const srslte_cell_t* cell);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SRSLTE_PHY_COMMON_H
|
@ -1,167 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: phy_common_sl.h
|
||||
*
|
||||
* Description: Common parameters and lookup functions for Sidelink PHY
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 15.3.0 Release 15
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHY_COMMON_SL_H
|
||||
#define SRSLTE_PHY_COMMON_SL_H
|
||||
|
||||
/**
|
||||
* \brief Common parameters and lookup functions for Sidelink PHY
|
||||
*/
|
||||
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_TM1 = 0,
|
||||
SRSLTE_SIDELINK_TM2,
|
||||
SRSLTE_SIDELINK_TM3,
|
||||
SRSLTE_SIDELINK_TM4
|
||||
} srslte_sl_tm_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_PSBCH = 0, // Physical Sidelink Broadcast Channel
|
||||
SRSLTE_SIDELINK_PSCCH, // Physical Sidelink Control Channel
|
||||
SRSLTE_SIDELINK_PSSCH, // Physical Sidelink Shared Channel
|
||||
SRSLTE_SIDELINK_PSDCH // Physical Sidelink Discovery Channel
|
||||
} srslte_sl_channels_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_sl_tm_t tm;
|
||||
uint32_t N_sl_id;
|
||||
uint32_t nof_prb;
|
||||
srslte_cp_t cp;
|
||||
} srslte_cell_sl_t;
|
||||
|
||||
#define SRSLTE_SL_MAX_PERIOD_LENGTH 320 // SL-PeriodComm-r12 3GPP TS 36.331 Section 6.3.8
|
||||
// SL-CommResourcePool: 3GPP TS 36.331 version 15.6.0 Release 15 Section 6.3.8
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t period_length;
|
||||
|
||||
uint32_t prb_num;
|
||||
uint32_t prb_start;
|
||||
uint32_t prb_end;
|
||||
|
||||
uint8_t pscch_sf_bitmap[SRSLTE_SL_MAX_PERIOD_LENGTH];
|
||||
uint8_t pssch_sf_bitmap[SRSLTE_SL_MAX_PERIOD_LENGTH];
|
||||
|
||||
uint32_t size_sub_channel; // sizeSubchannel-r14
|
||||
uint32_t num_sub_channel; // numSubchannel-r14
|
||||
uint32_t start_prb_sub_channel; // startRB-Subchannel-r14 offset
|
||||
bool adjacency_pscch_pssch; // adjacencyPSCCH-PSSCH-r14
|
||||
|
||||
uint32_t sf_bitmap_tm34_len;
|
||||
uint8_t sf_bitmap_tm34[SRSLTE_SL_MAX_PERIOD_LENGTH]; // sl_Subframe_r14: 3GPP 36.331 Section 6.3.8
|
||||
} srslte_sl_comm_resource_pool_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_SIDELINK_DATA_SYMBOL = 0,
|
||||
SRSLTE_SIDELINK_SYNC_SYMBOL,
|
||||
SRSLTE_SIDELINK_DMRS_SYMBOL,
|
||||
SRSLTE_SIDELINK_GUARD_SYMBOL
|
||||
} srslte_sl_symbol_t;
|
||||
|
||||
#define SRSLTE_SL_DUPLEX_MODE_FDD (1)
|
||||
#define SRSLTE_SL_DUPLEX_MODE_TDD (2)
|
||||
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_OFFSET (0.005f)
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_THRESHOLD_HIGH (0.49f) // square(0.7), max 70% of main peak
|
||||
#define SRSLTE_SLSS_SIDE_PEAK_THRESHOLD_LOW (0.09f) // square(0.3), min 30% of main peak
|
||||
|
||||
#define SRSLTE_PSBCH_NOF_PRB (6)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_PRB (2)
|
||||
|
||||
#define SRSLTE_MIB_SL_LEN (40) // TM1/2: 40 bits
|
||||
#define SRSLTE_MIB_SL_V2X_LEN (48) // TM3/4: 48 bits
|
||||
#define SRSLTE_MIB_SL_MAX_LEN (SRSLTE_MIB_SL_V2X_LEN)
|
||||
|
||||
#define SRSLTE_SL_TM12_DEFAULT_NUM_DMRS_SYMBOLS (2)
|
||||
#define SRSLTE_SL_TM34_DEFAULT_NUM_DMRS_SYMBOLS (4) ///< In TM3/4, all channels have 4 DMRS by default
|
||||
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DATA_SYMBOLS (8) // PSBCH is in 8 OFDM symbols (but only 7 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DATA_SYMBOLS_EXT \
|
||||
(6) // PSBCH is in 7 OFDM symbols for extended cyclic prefix (but only 6 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM12_NUM_DMRS_SYMBOLS (2) ///< PSBCH has 2 DMRS symbols
|
||||
#define SRSLTE_PSBCH_TM12_NUM_SYNC_SYMBOLS (4) ///< Two symbols PSSS and two SSSS
|
||||
|
||||
#define SRSLTE_PSBCH_TM34_NUM_DATA_SYMBOLS (7) ///< SL-BCH is in 7 OFDM symbols (but only 6 are tx'ed)
|
||||
#define SRSLTE_PSBCH_TM34_NUM_DMRS_SYMBOLS (3) ///< PSBCH has 3 DMRS symbols in TM3 and TM4
|
||||
#define SRSLTE_PSBCH_TM34_NUM_SYNC_SYMBOLS (4) ///< Two symbols PSSS and two SSSS
|
||||
|
||||
#define SRSLTE_SCI_CRC_LEN (16)
|
||||
#define SRSLTE_SCI_MAX_LEN (45)
|
||||
#define SRSLTE_SCI_TM34_LEN (32)
|
||||
|
||||
#define SRSLTE_PSCCH_QM 2
|
||||
#define SRSLTE_PSCCH_TM12_NOF_PRB (1)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_PRB (2)
|
||||
#define SRSLTE_PSCCH_MAX_NOF_PRB (SRSLTE_PSCCH_TM34_NOF_PRB)
|
||||
#define SRSLTE_PSCCH_SCRAMBLING_SEED (510) ///< Scrambling seed for PSCCH is 510
|
||||
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS (12)
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DMRS_SYMBOLS (2)
|
||||
#define SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS_EXT (10)
|
||||
|
||||
#define SRSLTE_PSCCH_TM34_NUM_DATA_SYMBOLS (10)
|
||||
#define SRSLTE_PSCCH_TM34_NUM_DMRS_SYMBOLS (4)
|
||||
|
||||
#define SRSLTE_PSCCH_TM12_NOF_CODED_BITS \
|
||||
(SRSLTE_NRE * SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS * SRSLTE_PSCCH_TM12_NOF_PRB * SRSLTE_PSCCH_QM)
|
||||
#define SRSLTE_PSCCH_TM34_NOF_CODED_BITS \
|
||||
(SRSLTE_NRE * SRSLTE_PSCCH_TM34_NUM_DATA_SYMBOLS * SRSLTE_PSCCH_TM34_NOF_PRB * SRSLTE_PSCCH_QM)
|
||||
#define SRSLTE_PSCCH_MAX_CODED_BITS SRSLTE_MAX(SRSLTE_PSCCH_TM12_NOF_CODED_BITS, SRSLTE_PSCCH_TM34_NOF_CODED_BITS)
|
||||
|
||||
#define SRSLTE_PSSCH_MAX_QM 6
|
||||
#define SRSLTE_PSSCH_CRC_LEN 24
|
||||
#define SRSLTE_MAX_CODEWORD_LEN 168000 // 12 subcarriers * 100 PRB * 14 symbols * 10 bits, assuming 1024QAM
|
||||
#define SRSLTE_SL_SCH_MAX_TB_LEN (48936) // 3GPP 36.306 v15.4.0 Table 4.1B-1
|
||||
#define SRSLTE_PSSCH_MAX_CODED_BITS (3 * SRSLTE_TCOD_MAX_LEN_CB + SRSLTE_TCOD_TOTALTAIL)
|
||||
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DATA_SYMBOLS (12) // PSSCH is in 12 OFDM symbols (but only 11 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DMRS_SYMBOLS (2) // PSSCH has 2 DMRS symbols in TM1 and TM2
|
||||
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DATA_SYMBOLS_CP_EXT \
|
||||
(10) // PSSCH is in 10 OFDM symbols for extended cyclic prefix (but only 9 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM12_NUM_DMRS_SYMBOLS_CP_EXT \
|
||||
(2) // PSSCH has 2 DMRS symbols for extended cyclic prefix in TM1 and TM2
|
||||
|
||||
#define SRSLTE_PSSCH_TM34_NUM_DATA_SYMBOLS (10) // PSSCH is in 10 OFDM symbols (but only 9 are tx'ed)
|
||||
#define SRSLTE_PSSCH_TM34_NUM_DMRS_SYMBOLS (4) // PSSCH has 4 DMRS symbols in TM3 and TM4
|
||||
|
||||
SRSLTE_API int srslte_sl_group_hopping_f_gh(uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME * 2], uint32_t N_x_id);
|
||||
#define SRSLTE_PSCCH_MAX_NUM_DATA_SYMBOLS (SRSLTE_PSCCH_TM12_NUM_DATA_SYMBOLS)
|
||||
|
||||
SRSLTE_API bool srslte_slss_side_peak_pos_is_valid(uint32_t side_peak_pos,
|
||||
uint32_t main_peak_pos,
|
||||
uint32_t side_peak_delta_a,
|
||||
uint32_t side_peak_delta_b);
|
||||
SRSLTE_API bool srslte_slss_side_peak_value_is_valid(float side_peak_value, float threshold_low, float threshold_high);
|
||||
|
||||
SRSLTE_API int srslte_sl_tm_to_cell_sl_tm_t(srslte_cell_sl_t* q, uint32_t tm);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sl_get_num_symbols(srslte_sl_tm_t tm, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_psbch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_pscch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
SRSLTE_API bool srslte_pssch_is_symbol(srslte_sl_symbol_t type, srslte_sl_tm_t tm, uint32_t i, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sci_format0_sizeof(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API int srslte_sl_comm_resource_pool_get_default_config(srslte_sl_comm_resource_pool_t* q,
|
||||
srslte_cell_sl_t cell);
|
||||
|
||||
#endif // SRSLTE_PHY_COMMON_SL_H
|
@ -1,162 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: enb_dl.h
|
||||
*
|
||||
* Description: ENB downlink object.
|
||||
*
|
||||
* This module is a frontend to all the downlink data and control
|
||||
* channel processing modules for the ENB transmitter side.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_ENB_DL_H
|
||||
#define SRSLTE_ENB_DL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/ch_estimation/refsignal_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pbch.h"
|
||||
#include "srslte/phy/phch/pcfich.h"
|
||||
#include "srslte/phy/phch/pdcch.h"
|
||||
#include "srslte/phy/phch/pdsch.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/phich.h"
|
||||
#include "srslte/phy/phch/pmch.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/sync/pss.h"
|
||||
#include "srslte/phy/sync/sss.h"
|
||||
|
||||
#include "srslte/phy/enb/enb_ul.h"
|
||||
#include "srslte/phy/ue/ue_dl.h"
|
||||
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srslte/phy/utils/vector.h"
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
srslte_dl_sf_cfg_t dl_sf;
|
||||
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
||||
|
||||
srslte_ofdm_t ifft[SRSLTE_MAX_PORTS];
|
||||
srslte_ofdm_t ifft_mbsfn;
|
||||
|
||||
srslte_pbch_t pbch;
|
||||
srslte_pcfich_t pcfich;
|
||||
srslte_regs_t regs;
|
||||
srslte_pdcch_t pdcch;
|
||||
srslte_pdsch_t pdsch;
|
||||
srslte_pmch_t pmch;
|
||||
srslte_phich_t phich;
|
||||
|
||||
srslte_refsignal_t csr_signal;
|
||||
srslte_refsignal_t mbsfnr_signal;
|
||||
|
||||
cf_t pss_signal[SRSLTE_PSS_LEN];
|
||||
float sss_signal0[SRSLTE_SSS_LEN];
|
||||
float sss_signal5[SRSLTE_SSS_LEN];
|
||||
|
||||
uint32_t nof_common_locations[3];
|
||||
srslte_dci_location_t common_locations[3][SRSLTE_MAX_CANDIDATES_COM];
|
||||
|
||||
} srslte_enb_dl_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t ack;
|
||||
uint32_t n_prb_lowest;
|
||||
uint32_t n_dmrs;
|
||||
} srslte_enb_dl_phich_t;
|
||||
|
||||
/* This function shall be called just after the initial synchronization */
|
||||
SRSLTE_API int srslte_enb_dl_init(srslte_enb_dl_t* q, cf_t* out_buffer[SRSLTE_MAX_PORTS], uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_free(srslte_enb_dl_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_set_cell(srslte_enb_dl_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_location_is_common_ncce(srslte_enb_dl_t* q, uint32_t ncce);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_put_base(srslte_enb_dl_t* q, srslte_dl_sf_cfg_t* dl_sf);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_put_phich(srslte_enb_dl_t* q, srslte_phich_grant_t* grant, bool ack);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_dl_t* dci_dl);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t* q, srslte_dci_cfg_t* dci_cfg, srslte_dci_ul_t* dci_ul);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_put_pdsch(srslte_enb_dl_t* q, srslte_pdsch_cfg_t* pdsch, uint8_t* data[SRSLTE_MAX_CODEWORDS]);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_put_pmch(srslte_enb_dl_t* q, srslte_pmch_cfg_t* pmch_cfg, uint8_t* data);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_gen_signal(srslte_enb_dl_t* q);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_gen_cqi_periodic(const srslte_cell_t* cell,
|
||||
const srslte_dl_cfg_t* dl_cfg,
|
||||
uint32_t tti,
|
||||
uint32_t last_ri,
|
||||
srslte_cqi_cfg_t* cqi_cfg);
|
||||
|
||||
SRSLTE_API bool srslte_enb_dl_gen_cqi_aperiodic(const srslte_cell_t* cell,
|
||||
const srslte_dl_cfg_t* dl_cfg,
|
||||
uint32_t ri,
|
||||
srslte_cqi_cfg_t* cqi_cfg);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_save_signal(srslte_enb_dl_t* q);
|
||||
|
||||
/**
|
||||
* Generates the uplink control information configuration from the cell, subframe and HARQ ACK information. Note that
|
||||
* it expects the UCI configuration shall have been configured already with scheduling request and channel quality
|
||||
* information prior to this call.
|
||||
*
|
||||
* @param cell points to the physical layer cell parameters
|
||||
* @param sf points to the subframe configuration
|
||||
* @param ack_info is the HARQ-ACK information
|
||||
* @param uci_cfg the UCI configuration destination
|
||||
*/
|
||||
SRSLTE_API void srslte_enb_dl_gen_ack(const srslte_cell_t* cell,
|
||||
const srslte_dl_sf_cfg_t* sf,
|
||||
const srslte_pdsch_ack_t* ack_info,
|
||||
srslte_uci_cfg_t* uci_cfg);
|
||||
|
||||
/**
|
||||
* gets the HARQ-ACK values from the received Uplink Control Information configuration, the cell, and HARQ ACK
|
||||
* info itself. Note that it expects that the HARQ-ACK info has been set prior the UCI Data decoding.
|
||||
*
|
||||
* @param cell points to the physical layer cell parameters
|
||||
* @param uci_cfg points to the UCI configration
|
||||
* @param uci_value points to the received UCI values
|
||||
* @param ack_info is the HARQ-ACK information
|
||||
*/
|
||||
SRSLTE_API void srslte_enb_dl_get_ack(const srslte_cell_t* cell,
|
||||
const srslte_uci_cfg_t* uci_cfg,
|
||||
const srslte_uci_value_t* uci_value,
|
||||
srslte_pdsch_ack_t* pdsch_ack);
|
||||
|
||||
/**
|
||||
* Gets the maximum signal power in decibels full scale. It is equivalent to the transmit power if all resource elements
|
||||
* were populated.
|
||||
* @return The maximum power
|
||||
*/
|
||||
SRSLTE_API float srslte_enb_dl_get_maximum_signal_power_dBfs(uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_ENB_DL_H
|
@ -1,67 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_ENB_DL_NR_H
|
||||
#define SRSLTE_ENB_DL_NR_H
|
||||
|
||||
#include "srslte/phy/common/phy_common_nr.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/pdcch_nr.h"
|
||||
#include "srslte/phy/phch/pdsch_nr.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_pdsch_nr_args_t pdsch;
|
||||
srslte_pdcch_nr_args_t pdcch;
|
||||
uint32_t nof_tx_antennas;
|
||||
uint32_t nof_max_prb;
|
||||
} srslte_enb_dl_nr_args_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_prb;
|
||||
uint32_t nof_tx_antennas;
|
||||
srslte_carrier_nr_t carrier;
|
||||
srslte_coreset_t coreset;
|
||||
|
||||
srslte_ofdm_t fft[SRSLTE_MAX_PORTS];
|
||||
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS];
|
||||
srslte_pdsch_nr_t pdsch;
|
||||
srslte_dmrs_sch_t dmrs;
|
||||
|
||||
srslte_pdcch_nr_t pdcch;
|
||||
} srslte_enb_dl_nr_t;
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_init(srslte_enb_dl_nr_t* q, cf_t* output[SRSLTE_MAX_PORTS], const srslte_enb_dl_nr_args_t* args);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_set_carrier(srslte_enb_dl_nr_t* q, const srslte_carrier_nr_t* carrier);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_set_coreset(srslte_enb_dl_nr_t* q, const srslte_coreset_t* coreset);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_nr_free(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_base_zero(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API void srslte_enb_dl_nr_gen_signal(srslte_enb_dl_nr_t* q);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_pdcch_put(srslte_enb_dl_nr_t* q, const srslte_slot_cfg_t* slot_cfg, const srslte_dci_dl_nr_t* dci_dl);
|
||||
|
||||
SRSLTE_API int srslte_enb_dl_nr_pdsch_put(srslte_enb_dl_nr_t* q,
|
||||
const srslte_slot_cfg_t* slot,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
uint8_t* data[SRSLTE_MAX_TB]);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_enb_dl_nr_pdsch_info(const srslte_enb_dl_nr_t* q, const srslte_sch_cfg_nr_t* cfg, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_ENB_DL_NR_H
|
@ -1,78 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: enb_ul.h
|
||||
*
|
||||
* Description: ENB uplink object.
|
||||
*
|
||||
* This module is a frontend to all the uplink data and control
|
||||
* channel processing modules for the ENB receiver side.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_ENB_UL_H
|
||||
#define SRSLTE_ENB_UL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "srslte/phy/ch_estimation/chest_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/ofdm.h"
|
||||
#include "srslte/phy/phch/prach.h"
|
||||
#include "srslte/phy/phch/pucch.h"
|
||||
#include "srslte/phy/phch/pusch.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
#include "srslte/phy/utils/debug.h"
|
||||
#include "srslte/phy/utils/vector.h"
|
||||
|
||||
#include "srslte/config.h"
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
cf_t* sf_symbols;
|
||||
srslte_chest_ul_res_t chest_res;
|
||||
|
||||
srslte_ofdm_t fft;
|
||||
srslte_chest_ul_t chest;
|
||||
srslte_pusch_t pusch;
|
||||
srslte_pucch_t pucch;
|
||||
|
||||
} srslte_enb_ul_t;
|
||||
|
||||
/* This function shall be called just after the initial synchronization */
|
||||
SRSLTE_API int srslte_enb_ul_init(srslte_enb_ul_t* q, cf_t* in_buffer, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_enb_ul_free(srslte_enb_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_set_cell(srslte_enb_ul_t* q,
|
||||
srslte_cell_t cell,
|
||||
srslte_refsignal_dmrs_pusch_cfg_t* pusch_cfg,
|
||||
srslte_refsignal_srs_cfg_t* srs_cfg);
|
||||
|
||||
SRSLTE_API void srslte_enb_ul_fft(srslte_enb_ul_t* q);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_get_pucch(srslte_enb_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* ul_sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_pucch_res_t* res);
|
||||
|
||||
SRSLTE_API int srslte_enb_ul_get_pusch(srslte_enb_ul_t* q,
|
||||
srslte_ul_sf_cfg_t* ul_sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_res_t* res);
|
||||
|
||||
#endif // SRSLTE_ENB_UL_H
|
@ -1,114 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**********************************************************************************************
|
||||
* File: turbodecoder.h
|
||||
*
|
||||
* Description: Turbo Decoder.
|
||||
* Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent
|
||||
* encoders and one turbo code internal interleaver. The coding rate of turbo
|
||||
* encoder is 1/3.
|
||||
* MAP_GEN is the MAX-LOG-MAP generic implementation of the decoder.
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2
|
||||
*********************************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_TURBODECODER_H
|
||||
#define SRSLTE_TURBODECODER_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/fec/cbsegm.h"
|
||||
#include "srslte/phy/fec/turbo/tc_interl.h"
|
||||
|
||||
#define SRSLTE_TCOD_RATE 3
|
||||
#define SRSLTE_TCOD_TOTALTAIL 12
|
||||
|
||||
#define SRSLTE_TCOD_MAX_LEN_CB 6144
|
||||
|
||||
// Expect the input to be aligned for sub-block window processing.
|
||||
#define SRSLTE_TDEC_EXPECT_INPUT_SB 1
|
||||
|
||||
// Include interfaces for 8 and 16 bit decoder implementations
|
||||
#define LLR_IS_8BIT
|
||||
#include "srslte/phy/fec/turbo/turbodecoder_impl.h"
|
||||
#undef LLR_IS_8BIT
|
||||
|
||||
#define LLR_IS_16BIT
|
||||
#include "srslte/phy/fec/turbo/turbodecoder_impl.h"
|
||||
#undef LLR_IS_16BIT
|
||||
|
||||
#define SRSLTE_TDEC_NOF_AUTO_MODES_8 2
|
||||
#define SRSLTE_TDEC_NOF_AUTO_MODES_16 3
|
||||
|
||||
typedef enum { SRSLTE_TDEC_8, SRSLTE_TDEC_16 } srslte_tdec_llr_type_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_long_cb;
|
||||
|
||||
void* dec8_hdlr[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
void* dec16_hdlr[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
srslte_tdec_8bit_impl_t* dec8[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
srslte_tdec_16bit_impl_t* dec16[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
int nof_blocks8[SRSLTE_TDEC_NOF_AUTO_MODES_8];
|
||||
int nof_blocks16[SRSLTE_TDEC_NOF_AUTO_MODES_16];
|
||||
|
||||
// Declare as void types as can be int8 or int16
|
||||
void* app1;
|
||||
void* app2;
|
||||
void* ext1;
|
||||
void* ext2;
|
||||
void* syst0;
|
||||
void* parity0;
|
||||
void* parity1;
|
||||
|
||||
void* input_conv;
|
||||
|
||||
bool force_not_sb;
|
||||
|
||||
srslte_tdec_impl_type_t dec_type;
|
||||
|
||||
srslte_tdec_llr_type_t current_llr_type;
|
||||
uint32_t current_dec;
|
||||
uint32_t current_long_cb;
|
||||
uint32_t current_inter_idx;
|
||||
int current_cbidx;
|
||||
srslte_tc_interl_t interleaver[4][SRSLTE_NOF_TC_CB_SIZES];
|
||||
int n_iter;
|
||||
} srslte_tdec_t;
|
||||
|
||||
SRSLTE_API int srslte_tdec_init(srslte_tdec_t* h, uint32_t max_long_cb);
|
||||
|
||||
SRSLTE_API int srslte_tdec_init_manual(srslte_tdec_t* h, uint32_t max_long_cb, srslte_tdec_impl_type_t dec_type);
|
||||
|
||||
SRSLTE_API void srslte_tdec_free(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API void srslte_tdec_force_not_sb(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API int srslte_tdec_new_cb(srslte_tdec_t* h, uint32_t long_cb);
|
||||
|
||||
SRSLTE_API int srslte_tdec_get_nof_iterations(srslte_tdec_t* h);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks(uint32_t long_cb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_tdec_autoimp_get_subblocks_8bit(uint32_t long_cb);
|
||||
|
||||
SRSLTE_API void srslte_tdec_iteration(srslte_tdec_t* h, int16_t* input, uint8_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_tdec_run_all(srslte_tdec_t* h, int16_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
|
||||
|
||||
SRSLTE_API void srslte_tdec_iteration_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_tdec_run_all_8bit(srslte_tdec_t* h, int8_t* input, uint8_t* output, uint32_t nof_iterations, uint32_t long_cb);
|
||||
|
||||
#endif // SRSLTE_TURBODECODER_H
|
@ -1,26 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_FORMAT_H
|
||||
#define SRSLTE_FORMAT_H
|
||||
|
||||
typedef enum {
|
||||
SRSLTE_TEXT,
|
||||
SRSLTE_FLOAT,
|
||||
SRSLTE_COMPLEX_FLOAT,
|
||||
SRSLTE_COMPLEX_SHORT,
|
||||
SRSLTE_FLOAT_BIN,
|
||||
SRSLTE_COMPLEX_FLOAT_BIN,
|
||||
SRSLTE_COMPLEX_SHORT_BIN
|
||||
} srslte_datatype_t;
|
||||
|
||||
#endif // SRSLTE_FORMAT_H
|
@ -1,243 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: dci.h
|
||||
*
|
||||
* Description: Downlink control information (DCI).
|
||||
* Packing/Unpacking functions to convert between bit streams
|
||||
* and packed DCI UL/DL grants defined in ra.h
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.3.3
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_DCI_H
|
||||
#define SRSLTE_DCI_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
#define SRSLTE_DCI_MAX_BITS 128
|
||||
#define SRSLTE_RAR_GRANT_LEN 20
|
||||
|
||||
#define SRSLTE_DCI_IS_TB_EN(tb) (!(tb.mcs_idx == 0 && tb.rv == 1))
|
||||
#define SRSLTE_DCI_TB_DISABLE(tb) \
|
||||
do { \
|
||||
tb.mcs_idx = 0; \
|
||||
tb.rv = 1; \
|
||||
} while (0)
|
||||
#define SRSLTE_DCI_HEXDEBUG 0
|
||||
|
||||
typedef struct {
|
||||
bool multiple_csi_request_enabled;
|
||||
bool cif_enabled;
|
||||
bool cif_present;
|
||||
bool srs_request_enabled;
|
||||
bool ra_format_enabled;
|
||||
bool is_not_ue_ss;
|
||||
} srslte_dci_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t L; // Aggregation level (logarithmic)
|
||||
uint32_t ncce; // Position of first CCE of the dci
|
||||
} srslte_dci_location_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t payload[SRSLTE_DCI_MAX_BITS];
|
||||
uint32_t nof_bits;
|
||||
srslte_dci_location_t location;
|
||||
srslte_dci_format_t format;
|
||||
uint16_t rnti;
|
||||
} srslte_dci_msg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t mcs_idx;
|
||||
int rv;
|
||||
bool ndi;
|
||||
uint32_t cw_idx;
|
||||
} srslte_dci_tb_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint16_t rnti;
|
||||
srslte_dci_format_t format;
|
||||
srslte_dci_location_t location;
|
||||
uint32_t ue_cc_idx;
|
||||
|
||||
// Resource Allocation
|
||||
srslte_ra_type_t alloc_type;
|
||||
union {
|
||||
srslte_ra_type0_t type0_alloc;
|
||||
srslte_ra_type1_t type1_alloc;
|
||||
srslte_ra_type2_t type2_alloc;
|
||||
};
|
||||
|
||||
// Codeword information
|
||||
srslte_dci_tb_t tb[SRSLTE_MAX_CODEWORDS];
|
||||
bool tb_cw_swap;
|
||||
uint32_t pinfo;
|
||||
|
||||
// Power control
|
||||
bool pconf;
|
||||
bool power_offset;
|
||||
uint8_t tpc_pucch;
|
||||
|
||||
// RA order
|
||||
bool is_ra_order;
|
||||
uint32_t ra_preamble;
|
||||
uint32_t ra_mask_idx;
|
||||
|
||||
// Release 10
|
||||
uint32_t cif;
|
||||
bool cif_present;
|
||||
bool srs_request;
|
||||
bool srs_request_present;
|
||||
|
||||
// Other parameters
|
||||
uint32_t pid;
|
||||
uint32_t dai;
|
||||
bool is_tdd;
|
||||
bool is_dwpts;
|
||||
bool sram_id;
|
||||
|
||||
// For debugging purposes
|
||||
#if SRSLTE_DCI_HEXDEBUG
|
||||
uint32_t nof_bits;
|
||||
char hex_str[SRSLTE_DCI_MAX_BITS];
|
||||
#endif
|
||||
} srslte_dci_dl_t;
|
||||
|
||||
/** Unpacked DCI Format0 message */
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint16_t rnti;
|
||||
srslte_dci_format_t format;
|
||||
srslte_dci_location_t location;
|
||||
uint32_t ue_cc_idx;
|
||||
|
||||
srslte_ra_type2_t type2_alloc;
|
||||
/* 36.213 Table 8.4-2: SRSLTE_RA_PUSCH_HOP_HALF is 0 for < 10 Mhz and 10 for > 10 Mhz.
|
||||
* SRSLTE_RA_PUSCH_HOP_QUART is 00 for > 10 Mhz and SRSLTE_RA_PUSCH_HOP_QUART_NEG is 01 for > 10 Mhz.
|
||||
*/
|
||||
enum {
|
||||
SRSLTE_RA_PUSCH_HOP_DISABLED = -1,
|
||||
SRSLTE_RA_PUSCH_HOP_QUART = 0,
|
||||
SRSLTE_RA_PUSCH_HOP_QUART_NEG = 1,
|
||||
SRSLTE_RA_PUSCH_HOP_HALF = 2,
|
||||
SRSLTE_RA_PUSCH_HOP_TYPE2 = 3
|
||||
} freq_hop_fl;
|
||||
|
||||
// Codeword information
|
||||
srslte_dci_tb_t tb;
|
||||
uint32_t n_dmrs;
|
||||
bool cqi_request;
|
||||
|
||||
// TDD parametres
|
||||
uint32_t dai;
|
||||
uint32_t ul_idx;
|
||||
bool is_tdd;
|
||||
|
||||
// Power control
|
||||
uint8_t tpc_pusch;
|
||||
|
||||
// Release 10
|
||||
uint32_t cif;
|
||||
bool cif_present;
|
||||
uint8_t multiple_csi_request;
|
||||
bool multiple_csi_request_present;
|
||||
bool srs_request;
|
||||
bool srs_request_present;
|
||||
srslte_ra_type_t ra_type;
|
||||
bool ra_type_present;
|
||||
|
||||
// For debugging purposes
|
||||
#if SRSLTE_DCI_HEXDEBUG
|
||||
uint32_t nof_bits;
|
||||
char hex_str[SRSLTE_DCI_MAX_BITS];
|
||||
#endif /* SRSLTE_DCI_HEXDEBUG */
|
||||
|
||||
} srslte_dci_ul_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t rba;
|
||||
uint32_t trunc_mcs;
|
||||
uint32_t tpc_pusch;
|
||||
bool ul_delay;
|
||||
bool cqi_request;
|
||||
bool hopping_flag;
|
||||
} srslte_dci_rar_grant_t;
|
||||
|
||||
SRSLTE_API void srslte_dci_rar_unpack(uint8_t payload[SRSLTE_RAR_GRANT_LEN], srslte_dci_rar_grant_t* rar);
|
||||
|
||||
SRSLTE_API void srslte_dci_rar_pack(srslte_dci_rar_grant_t* rar, uint8_t payload[SRSLTE_RAR_GRANT_LEN]);
|
||||
|
||||
SRSLTE_API int srslte_dci_rar_to_ul_dci(srslte_cell_t* cell, srslte_dci_rar_grant_t* rar, srslte_dci_ul_t* dci_ul);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_pusch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_ul_t* dci,
|
||||
srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_pusch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_ul_t* dci);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_pdsch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_dl_t* dci,
|
||||
srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_pdsch(srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_dl_t* dci);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_format_sizeof(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_cfg_t* cfg,
|
||||
srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API void srslte_dci_dl_fprint(FILE* f, srslte_dci_dl_t* dci, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_dl_info(const srslte_dci_dl_t* dci_dl, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_ul_info(srslte_dci_ul_t* dci_ul, char* info_str, uint32_t len);
|
||||
|
||||
SRSLTE_API srslte_dci_format_t srslte_dci_format_from_string(char* str);
|
||||
|
||||
SRSLTE_API char* srslte_dci_format_string(srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API char* srslte_dci_format_string_short(srslte_dci_format_t format);
|
||||
|
||||
SRSLTE_API bool
|
||||
srslte_location_find(const srslte_dci_location_t* locations, uint32_t nof_locations, srslte_dci_location_t x);
|
||||
|
||||
SRSLTE_API bool
|
||||
srslte_location_find_ncce(const srslte_dci_location_t* locations, uint32_t nof_locations, uint32_t ncce);
|
||||
|
||||
SRSLTE_API int srslte_dci_location_set(srslte_dci_location_t* c, uint32_t L, uint32_t nCCE);
|
||||
|
||||
SRSLTE_API bool srslte_dci_location_isvalid(srslte_dci_location_t* c);
|
||||
|
||||
SRSLTE_API void srslte_dci_cfg_set_common_ss(srslte_dci_cfg_t* cfg);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_format_max_tb(srslte_dci_format_t format);
|
||||
|
||||
#endif // DCI_
|
@ -1,74 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @file dci_nbiot.h
|
||||
*
|
||||
* @brief Downlink control information (DCI) for NB-IoT.
|
||||
*
|
||||
* Packing/Unpacking functions to convert between bit streams
|
||||
* and packed DCI UL/DL grants defined in ra_nbiot.h
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 13.2.0 Release 13 Sec. 6.4.3
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_DCI_NBIOT_H
|
||||
#define SRSLTE_DCI_NBIOT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/ra_nbiot.h"
|
||||
|
||||
#define SRSLTE_DCI_MAX_BITS 128
|
||||
#define SRSLTE_NBIOT_RAR_GRANT_LEN 15
|
||||
|
||||
SRSLTE_API void srslte_nbiot_dci_rar_grant_unpack(srslte_nbiot_dci_rar_grant_t* rar,
|
||||
const uint8_t grant[SRSLTE_NBIOT_RAR_GRANT_LEN]);
|
||||
|
||||
SRSLTE_API int srslte_nbiot_dci_msg_to_dl_grant(const srslte_dci_msg_t* msg,
|
||||
const uint16_t msg_rnti,
|
||||
srslte_ra_nbiot_dl_dci_t* dl_dci,
|
||||
srslte_ra_nbiot_dl_grant_t* grant,
|
||||
const uint32_t sfn,
|
||||
const uint32_t sf_idx,
|
||||
const uint32_t r_max,
|
||||
const srslte_nbiot_mode_t mode);
|
||||
|
||||
SRSLTE_API int srslte_nbiot_dci_msg_to_ul_grant(const srslte_dci_msg_t* msg,
|
||||
srslte_ra_nbiot_ul_dci_t* ul_dci,
|
||||
srslte_ra_nbiot_ul_grant_t* grant,
|
||||
const uint32_t rx_tti,
|
||||
const srslte_npusch_sc_spacing_t spacing);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_nbiot_dci_rar_to_ul_grant(srslte_nbiot_dci_rar_grant_t* rar, srslte_ra_nbiot_ul_grant_t* grant, uint32_t rx_tti);
|
||||
|
||||
SRSLTE_API bool srslte_nbiot_dci_location_isvalid(const srslte_dci_location_t* c);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_pack_npdsch(const srslte_ra_nbiot_dl_dci_t* data,
|
||||
const srslte_dci_format_t format,
|
||||
srslte_dci_msg_t* msg,
|
||||
const bool crc_is_crnti);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_dci_msg_unpack_npdsch(const srslte_dci_msg_t* msg, srslte_ra_nbiot_dl_dci_t* data, const bool crc_is_crnti);
|
||||
|
||||
SRSLTE_API int srslte_dci_msg_unpack_npusch(const srslte_dci_msg_t* msg, srslte_ra_nbiot_ul_dci_t* data);
|
||||
|
||||
SRSLTE_API uint32_t srslte_dci_nbiot_format_sizeof(srslte_dci_format_t format);
|
||||
|
||||
#endif // SRSLTE_DCI_NBIOT_H
|
@ -1,143 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPBCH_H
|
||||
#define SRSLTE_NPBCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_MIB_NB_LEN 34
|
||||
#define SRSLTE_MIB_NB_CRC_LEN (SRSLTE_MIB_NB_LEN + 16)
|
||||
#define SRSLTE_MIB_NB_ENC_LEN (3 * SRSLTE_MIB_NB_CRC_LEN)
|
||||
|
||||
#define SRSLTE_NPBCH_NUM_RE (12 * 11 - 4 * 8) // 100 RE, entire PRB minus 3 symbols minus 4 times NRS=CRS REs
|
||||
#define SRSLTE_NPBCH_NUM_BLOCKS 8 // MIB-NB is split across 8 blocks
|
||||
#define SRSLTE_NPBCH_NUM_REP 8 // number of repetitions per block
|
||||
#define SRSLTE_NPBCH_NUM_FRAMES (SRSLTE_NPBCH_NUM_BLOCKS * SRSLTE_NPBCH_NUM_REP)
|
||||
|
||||
typedef struct {
|
||||
uint16_t sfn;
|
||||
uint16_t hfn;
|
||||
uint8_t sched_info_sib1;
|
||||
uint8_t sys_info_tag;
|
||||
bool ac_barring;
|
||||
srslte_nbiot_mode_t mode;
|
||||
} srslte_mib_nb_t;
|
||||
|
||||
/**
|
||||
* \brief Narrowband Physical broadcast channel (NPBCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 13 Sec. 10.2.4
|
||||
*/
|
||||
typedef struct SRS_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
|
||||
uint32_t frame_idx;
|
||||
uint32_t nof_symbols;
|
||||
|
||||
// buffers
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
float* llr;
|
||||
float* temp;
|
||||
float rm_f[SRSLTE_MIB_NB_ENC_LEN];
|
||||
uint8_t* rm_b;
|
||||
uint8_t data[SRSLTE_MIB_NB_CRC_LEN];
|
||||
uint8_t data_enc[SRSLTE_MIB_NB_ENC_LEN];
|
||||
|
||||
srslte_nbiot_mode_t op_mode;
|
||||
|
||||
// tx & rx objects
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq;
|
||||
srslte_sequence_t seq_r14[SRSLTE_NPBCH_NUM_BLOCKS];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
bool search_all_ports;
|
||||
} srslte_npbch_t;
|
||||
|
||||
SRSLTE_API int srslte_npbch_init(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npbch_free(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npbch_set_cell(srslte_npbch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_npbch_mib_pack(uint32_t sfn, uint32_t hfn, srslte_mib_nb_t mib, uint8_t* msg);
|
||||
|
||||
SRSLTE_API void srslte_npbch_mib_unpack(uint8_t* msg, srslte_mib_nb_t* mib);
|
||||
|
||||
SRSLTE_API void srslte_mib_nb_printf(FILE* stream, srslte_nbiot_cell_t cell, srslte_mib_nb_t* mib);
|
||||
|
||||
SRSLTE_API int srslte_npbch_put_subframe(srslte_npbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
cf_t* sf[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
SRSLTE_API int srslte_npbch_encode(srslte_npbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
cf_t* sf[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
int srslte_npbch_rotate(srslte_npbch_t* q,
|
||||
uint32_t nf,
|
||||
cf_t* input_signal,
|
||||
cf_t* output_signal,
|
||||
int num_samples,
|
||||
bool back);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode(srslte_npbch_t* q,
|
||||
cf_t* slot1_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode_nf(srslte_npbch_t* q,
|
||||
cf_t* slot1_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint8_t bch_payload[SRSLTE_MIB_NB_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset,
|
||||
int nf);
|
||||
|
||||
SRSLTE_API void srslte_npbch_decode_reset(srslte_npbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npbch_decode_frame(srslte_npbch_t* q,
|
||||
uint32_t src,
|
||||
uint32_t dst,
|
||||
uint32_t n,
|
||||
uint32_t nof_bits,
|
||||
uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npbch_crc_check(srslte_npbch_t* q, uint8_t* bits, uint32_t nof_ports);
|
||||
|
||||
SRSLTE_API void srslte_npbch_crc_set_mask(uint8_t* data, int nof_ports);
|
||||
|
||||
SRSLTE_API int srslte_npbch_cp(cf_t* input, cf_t* output, srslte_nbiot_cell_t cell, bool put);
|
||||
|
||||
#endif // SRSLTE_NPBCH_H
|
@ -1,124 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPDCCH_H
|
||||
#define SRSLTE_NPDCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_RARNTI_END_NBIOT 0x0100
|
||||
#define SRSLTE_NBIOT_NUM_NRS_SYMS 8
|
||||
#define SRSLTE_NPDCCH_MAX_RE (SRSLTE_NRE * SRSLTE_CP_NORM_SF_NSYMB - SRSLTE_NBIOT_NUM_NRS_SYMS)
|
||||
|
||||
#define SRSLTE_NBIOT_DCI_MAX_SIZE 23
|
||||
#define SRSLTE_AL_REPETITION_USS 64 // Higher layer configured parameter al-Repetition-USS
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_NPDCCH_FORMAT1 = 0,
|
||||
SRSLTE_NPDCCH_FORMAT0_LOWER_HALF,
|
||||
SRSLTE_NPDCCH_FORMAT0_UPPER_HALF,
|
||||
SRSLTE_NPDCCH_FORMAT_NITEMS
|
||||
} srslte_npdcch_format_t;
|
||||
static const char srslte_npdcch_format_text[SRSLTE_NPDCCH_FORMAT_NITEMS][30] = {"Format 1",
|
||||
"Format 0 (Lower Half)",
|
||||
"Format 0 (Upper Half)"};
|
||||
|
||||
/**
|
||||
* @brief Narrowband Physical downlink control channel (NPDCCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 11 Sec. 6.8 and 10.2.5
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
uint32_t nof_cce;
|
||||
uint32_t ncce_bits;
|
||||
uint32_t max_bits;
|
||||
uint32_t i_n_start; /// start of the first OFDM symbol (signalled through NB-SIB1)
|
||||
uint32_t nof_nbiot_refs; /// number of NRS symbols per OFDM symbol
|
||||
uint32_t nof_lte_refs; /// number of CRS symbols per OFDM symbol
|
||||
uint32_t num_decoded_symbols;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
uint8_t* e;
|
||||
float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)];
|
||||
float* llr[2]; // Two layers of LLRs for Format0 and Format1 NPDCCH
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
|
||||
} srslte_npdcch_t;
|
||||
|
||||
SRSLTE_API int srslte_npdcch_init(srslte_npdcch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdcch_free(srslte_npdcch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npdcch_set_cell(srslte_npdcch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
/// Encoding function
|
||||
SRSLTE_API int srslte_npdcch_encode(srslte_npdcch_t* q,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_location_t location,
|
||||
uint16_t rnti,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint32_t nsubframe);
|
||||
|
||||
/// Decoding functions: Extract the LLRs and save them in the srslte_npdcch_t object
|
||||
SRSLTE_API int srslte_npdcch_extract_llr(srslte_npdcch_t* q,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint32_t sf_idx);
|
||||
|
||||
/// Decoding functions: Try to decode a DCI message after calling srslte_npdcch_extract_llr
|
||||
SRSLTE_API int srslte_npdcch_decode_msg(srslte_npdcch_t* q,
|
||||
srslte_dci_msg_t* msg,
|
||||
srslte_dci_location_t* location,
|
||||
srslte_dci_format_t format,
|
||||
uint16_t* crc_rem);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdcch_dci_decode(srslte_npdcch_t* q, float* e, uint8_t* data, uint32_t E, uint32_t nof_bits, uint16_t* crc);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdcch_dci_encode(srslte_npdcch_t* q, uint8_t* data, uint8_t* e, uint32_t nof_bits, uint32_t E, uint16_t rnti);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_npdcch_dci_encode_conv(srslte_npdcch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* coded_data, uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdcch_ue_locations(srslte_dci_location_t* c, uint32_t max_candidates);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdcch_common_locations(srslte_dci_location_t* c, uint32_t max_candidates);
|
||||
|
||||
int srslte_npdcch_cp(srslte_npdcch_t* q, cf_t* input, cf_t* output, bool put, srslte_npdcch_format_t format);
|
||||
int srslte_npdcch_put(srslte_npdcch_t* q, cf_t* symbols, cf_t* sf_symbols, srslte_npdcch_format_t format);
|
||||
int srslte_npdcch_get(srslte_npdcch_t* q, cf_t* symbols, cf_t* sf_symbols, srslte_npdcch_format_t format);
|
||||
|
||||
#endif // SRSLTE_NPDCCH_H
|
@ -1,151 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_NPDSCH_H
|
||||
#define SRSLTE_NPDSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/npdsch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_NPDSCH_MAX_RE \
|
||||
(SRSLTE_CP_NORM_SF_NSYMB * SRSLTE_NRE - 8) ///< Full PRB minus 8 RE for NRS (one antenna port)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS 680 ///< Max TBS in Rel13 NB-IoT
|
||||
#define SRSLTE_NPDSCH_CRC_LEN (24)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS_CRC (SRSLTE_NPDSCH_MAX_TBS + SRSLTE_NPDSCH_CRC_LEN)
|
||||
#define SRSLTE_NPDSCH_MAX_TBS_ENC (3 * SRSLTE_NPDSCH_MAX_TBS_CRC)
|
||||
#define SRSLTE_NPDSCH_MAX_NOF_SF 10
|
||||
#define SRSLTE_NPDSCH_NUM_SEQ (2 * SRSLTE_NOF_SF_X_FRAME) ///< for even and odd numbered SFNs
|
||||
|
||||
/* @brief Narrowband Physical Downlink shared channel (NPDSCH)
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 13.2.0 Release 13 Sec. 10.2.3
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_nbiot_cell_t cell;
|
||||
uint32_t max_re;
|
||||
bool rnti_is_set;
|
||||
uint16_t rnti;
|
||||
|
||||
// buffers
|
||||
uint8_t data[SRSLTE_NPDSCH_MAX_TBS_CRC];
|
||||
uint8_t data_enc[SRSLTE_NPDSCH_MAX_TBS_ENC];
|
||||
float rm_f[SRSLTE_NPDSCH_MAX_TBS_ENC];
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* sib_symbols[SRSLTE_MAX_PORTS]; // extra buffer for SIB1 symbols as they may be interleaved with other NPDSCH
|
||||
cf_t* tx_syms[SRSLTE_MAX_PORTS]; // pointer to either symbols or sib1_symbols
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
|
||||
float* llr;
|
||||
uint8_t* temp;
|
||||
uint8_t* rm_b;
|
||||
|
||||
// tx & rx objects
|
||||
srslte_modem_table_t mod;
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_sequence_t seq[SRSLTE_NPDSCH_NUM_SEQ];
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
} srslte_npdsch_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t hyper_sfn;
|
||||
// TODO: add all other fields
|
||||
} srslte_sys_info_block_type_1_nb_t;
|
||||
|
||||
SRSLTE_API int srslte_npdsch_init(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_free(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_set_cell(srslte_npdsch_t* q, srslte_nbiot_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_set_rnti(srslte_npdsch_t* q, uint16_t rnti);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_cfg(srslte_npdsch_cfg_t* cfg,
|
||||
srslte_nbiot_cell_t cell,
|
||||
srslte_ra_nbiot_dl_grant_t* grant,
|
||||
uint32_t sf_idx);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_rnti_idx(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
uint32_t rnti_idx,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_rnti(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
uint16_t rnti,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_encode_seq(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_tx_t* softbuffer,
|
||||
uint8_t* data,
|
||||
srslte_sequence_t* seq,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_decode(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_rx_t* softbuffer,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint32_t sfn,
|
||||
uint8_t* data);
|
||||
|
||||
SRSLTE_API int srslte_npdsch_decode_rnti(srslte_npdsch_t* q,
|
||||
srslte_npdsch_cfg_t* cfg,
|
||||
srslte_softbuffer_rx_t* softbuffer,
|
||||
cf_t* sf_symbols,
|
||||
cf_t* ce[SRSLTE_MAX_PORTS],
|
||||
float noise_estimate,
|
||||
uint16_t rnti,
|
||||
uint32_t sfn,
|
||||
uint8_t* data,
|
||||
uint32_t rep_counter);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdsch_rm_and_decode(srslte_npdsch_t* q, srslte_npdsch_cfg_t* cfg, float* softbits, uint8_t* data);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_npdsch_cp(srslte_npdsch_t* q, cf_t* input, cf_t* output, srslte_ra_nbiot_dl_grant_t* grant, bool put);
|
||||
|
||||
SRSLTE_API float srslte_npdsch_average_noi(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_npdsch_last_noi(srslte_npdsch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_sib1_pack(srslte_cell_t* cell, srslte_sys_info_block_type_1_nb_t* sib, uint8_t* payload);
|
||||
|
||||
SRSLTE_API void srslte_npdsch_sib1_unpack(uint8_t* const msg, srslte_sys_info_block_type_1_nb_t* sib);
|
||||
|
||||
#endif // SRSLTE_NPDSCH_H
|
@ -1,99 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pbch.h
|
||||
*
|
||||
* Description: Physical broadcast channel. If cell.nof_ports = 0, the number
|
||||
* of ports is blindly determined using the CRC of the received
|
||||
* codeword for 1, 2 and 4 ports
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.6
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PBCH_H
|
||||
#define SRSLTE_PBCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_BCH_PAYLOAD_LEN 24
|
||||
#define SRSLTE_BCH_PAYLOADCRC_LEN (SRSLTE_BCH_PAYLOAD_LEN + 16)
|
||||
#define SRSLTE_BCH_ENCODED_LEN 3 * (SRSLTE_BCH_PAYLOADCRC_LEN)
|
||||
|
||||
#define SRSLTE_PBCH_MAX_RE 256 // make it avx2-aligned
|
||||
|
||||
/* PBCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_symbols;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
float* llr;
|
||||
float* temp;
|
||||
float rm_f[SRSLTE_BCH_ENCODED_LEN];
|
||||
uint8_t* rm_b;
|
||||
uint8_t data[SRSLTE_BCH_PAYLOADCRC_LEN];
|
||||
uint8_t data_enc[SRSLTE_BCH_ENCODED_LEN];
|
||||
|
||||
uint32_t frame_idx;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq;
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
srslte_convcoder_t encoder;
|
||||
bool search_all_ports;
|
||||
|
||||
} srslte_pbch_t;
|
||||
|
||||
SRSLTE_API int srslte_pbch_init(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pbch_free(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pbch_set_cell(srslte_pbch_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_pbch_decode(srslte_pbch_t* q,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||||
uint32_t* nof_tx_ports,
|
||||
int* sfn_offset);
|
||||
|
||||
SRSLTE_API int srslte_pbch_encode(srslte_pbch_t* q,
|
||||
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
uint32_t frame_idx);
|
||||
|
||||
SRSLTE_API void srslte_pbch_decode_reset(srslte_pbch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pbch_mib_unpack(uint8_t* msg, srslte_cell_t* cell, uint32_t* sfn);
|
||||
|
||||
SRSLTE_API void srslte_pbch_mib_pack(srslte_cell_t* cell, uint32_t sfn, uint8_t* msg);
|
||||
|
||||
#endif // SRSLTE_PBCH_H
|
@ -1,82 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pcfich.h
|
||||
*
|
||||
* Description: Physical control format indicator channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.7
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PCFICH_H
|
||||
#define SRSLTE_PCFICH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define PCFICH_CFI_LEN 32
|
||||
#define PCFICH_RE PCFICH_CFI_LEN / 2
|
||||
|
||||
/* PCFICH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
int nof_symbols;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
/* handler to REGs resource mapper */
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t symbols[SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t x[SRSLTE_MAX_PORTS][PCFICH_RE];
|
||||
cf_t d[PCFICH_RE];
|
||||
|
||||
// cfi table in floats
|
||||
float cfi_table_float[3][PCFICH_CFI_LEN];
|
||||
|
||||
/* bit message */
|
||||
uint8_t data[PCFICH_CFI_LEN];
|
||||
|
||||
/* received soft bits */
|
||||
float data_f[PCFICH_CFI_LEN];
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
|
||||
} srslte_pcfich_t;
|
||||
|
||||
SRSLTE_API int srslte_pcfich_init(srslte_pcfich_t* q, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_set_cell(srslte_pcfich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_pcfich_free(srslte_pcfich_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_decode(srslte_pcfich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
float* corr_result);
|
||||
|
||||
SRSLTE_API int srslte_pcfich_encode(srslte_pcfich_t* q, srslte_dl_sf_cfg_t* sf, cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
#endif // SRSLTE_PCFICH_H
|
@ -1,137 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdcch.h
|
||||
*
|
||||
* Description: Physical downlink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.8
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDCCH_H
|
||||
#define SRSLTE_PDCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/rm_conv.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
typedef enum SRSLTE_API { SEARCH_UE, SEARCH_COMMON } srslte_pdcch_search_mode_t;
|
||||
|
||||
/* PDCCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
uint32_t nof_regs[3];
|
||||
uint32_t nof_cce[3];
|
||||
uint32_t max_bits;
|
||||
uint32_t nof_rx_antennas;
|
||||
bool is_ue;
|
||||
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
uint8_t* e;
|
||||
float rm_f[3 * (SRSLTE_DCI_MAX_BITS + 16)];
|
||||
float* llr;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
srslte_viterbi_t decoder;
|
||||
srslte_crc_t crc;
|
||||
|
||||
} srslte_pdcch_t;
|
||||
|
||||
SRSLTE_API int srslte_pdcch_init_ue(srslte_pdcch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pdcch_init_enb(srslte_pdcch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_pdcch_set_cell(srslte_pdcch_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_pdcch_set_regs(srslte_pdcch_t* q, srslte_regs_t* regs);
|
||||
|
||||
SRSLTE_API void srslte_pdcch_free(srslte_pdcch_t* q);
|
||||
|
||||
SRSLTE_API float srslte_pdcch_coderate(uint32_t nof_bits, uint32_t l);
|
||||
|
||||
/* Encoding function */
|
||||
SRSLTE_API int srslte_pdcch_encode(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_msg_t* msg,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
/* Decoding functions: Extract the LLRs and save them in the srslte_pdcch_t object */
|
||||
|
||||
SRSLTE_API int srslte_pdcch_extract_llr(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
/* Decoding functions: Try to decode a DCI message after calling srslte_pdcch_extract_llr */
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_decode_msg(srslte_pdcch_t* q, srslte_dl_sf_cfg_t* sf, srslte_dci_cfg_t* dci_cfg, srslte_dci_msg_t* msg);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_dci_decode(srslte_pdcch_t* q, float* e, uint8_t* data, uint32_t E, uint32_t nof_bits, uint16_t* crc);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_pdcch_dci_encode(srslte_pdcch_t* q, uint8_t* data, uint8_t* e, uint32_t nof_bits, uint32_t E, uint16_t rnti);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pdcch_dci_encode_conv(srslte_pdcch_t* q, uint8_t* data, uint32_t nof_bits, uint8_t* coded_data, uint16_t rnti);
|
||||
|
||||
/* Function for generation of UE-specific search space DCI locations */
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations(srslte_pdcch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_dci_location_t* locations,
|
||||
uint32_t max_locations,
|
||||
uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations_ncce(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates,
|
||||
uint32_t sf_idx,
|
||||
uint16_t rnti);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_ue_locations_ncce_L(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates,
|
||||
uint32_t sf_idx,
|
||||
uint16_t rnti,
|
||||
int L);
|
||||
|
||||
/* Function for generation of common search space DCI locations */
|
||||
SRSLTE_API uint32_t srslte_pdcch_common_locations(srslte_pdcch_t* q,
|
||||
srslte_dci_location_t* locations,
|
||||
uint32_t max_locations,
|
||||
uint32_t cfi);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdcch_common_locations_ncce(uint32_t nof_cce,
|
||||
srslte_dci_location_t* c,
|
||||
uint32_t max_candidates);
|
||||
|
||||
#endif // SRSLTE_PDCCH_H
|
@ -1,124 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdsch.h
|
||||
*
|
||||
* Description: Physical downlink shared channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.4
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDSCH_H
|
||||
#define SRSLTE_PDSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/* PDSCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
uint32_t max_re;
|
||||
|
||||
bool is_ue;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS]; /* Channel estimation (Rx only) */
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS]; /* PDSCH Encoded/Decoded Symbols */
|
||||
cf_t* x[SRSLTE_MAX_LAYERS]; /* Layer mapped */
|
||||
cf_t* d[SRSLTE_MAX_CODEWORDS]; /* Modulated/Demodulated codewords */
|
||||
void* e[SRSLTE_MAX_CODEWORDS];
|
||||
|
||||
float* csi[SRSLTE_MAX_CODEWORDS]; /* Channel Strengh Indicator */
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[SRSLTE_MOD_NITEMS];
|
||||
|
||||
// EVM buffers, one for each codeword (avoid concurrency issue with coworker)
|
||||
srslte_evm_buffer_t* evm_buffer[SRSLTE_MAX_CODEWORDS];
|
||||
float avg_evm;
|
||||
|
||||
srslte_sch_t dl_sch;
|
||||
|
||||
void* coworker_ptr;
|
||||
|
||||
} srslte_pdsch_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* payload;
|
||||
bool crc;
|
||||
float avg_iterations_block;
|
||||
float evm;
|
||||
} srslte_pdsch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pdsch_init_ue(srslte_pdsch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_init_enb(srslte_pdsch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_pdsch_free(srslte_pdsch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pdsch_enable_coworker(srslte_pdsch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_set_cell(srslte_pdsch_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API int srslte_pdsch_encode(srslte_pdsch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
uint8_t* data[SRSLTE_MAX_CODEWORDS],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_decode(srslte_pdsch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_t data[SRSLTE_MAX_CODEWORDS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_select_pmi(srslte_pdsch_t* q,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
uint32_t nof_layers,
|
||||
uint32_t* best_pmi,
|
||||
float sinr[SRSLTE_MAX_CODEBOOKS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_compute_cn(srslte_pdsch_t* q, srslte_chest_dl_res_t* channel, float* cn);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_grant_rx_info(srslte_pdsch_grant_t* grant,
|
||||
srslte_pdsch_res_t res[SRSLTE_MAX_CODEWORDS],
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_rx_info(srslte_pdsch_cfg_t* cfg,
|
||||
srslte_pdsch_res_t res[SRSLTE_MAX_CODEWORDS],
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_tx_info(srslte_pdsch_cfg_t* cfg, char* str, uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PDSCH_H
|
@ -1,103 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pdsch_nr.h
|
||||
*
|
||||
* Description: Physical downlink shared channel for NR
|
||||
*
|
||||
* Reference: 3GPP TS 38.211 V15.8.0 Sec. 7.3.1
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PDSCH_NR_H
|
||||
#define SRSLTE_PDSCH_NR_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/dmrs_sch.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/modem_table.h"
|
||||
#include "srslte/phy/phch/phch_cfg_nr.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch_nr.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/**
|
||||
* @brief PDSCH encoder and decoder initialization arguments
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_sch_nr_args_t sch;
|
||||
bool measure_evm;
|
||||
bool measure_time;
|
||||
} srslte_pdsch_nr_args_t;
|
||||
|
||||
/**
|
||||
* @brief PDSCH NR object
|
||||
*/
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t max_prb; ///< Maximum number of allocated prb
|
||||
uint32_t max_layers; ///< Maximum number of allocated layers
|
||||
uint32_t max_cw; ///< Maximum number of allocated code words
|
||||
srslte_carrier_nr_t carrier; ///< NR carrier configuration
|
||||
srslte_sch_nr_t sch; ///< SCH Encoder/Decoder Object
|
||||
uint8_t* b[SRSLTE_MAX_CODEWORDS]; ///< SCH Encoded and scrambled data
|
||||
cf_t* d[SRSLTE_MAX_CODEWORDS]; ///< PDSCH modulated bits
|
||||
cf_t* x[SRSLTE_MAX_LAYERS_NR]; ///< PDSCH modulated bits
|
||||
srslte_modem_table_t modem_tables[SRSLTE_MOD_NITEMS]; ///< Modulator tables
|
||||
srslte_evm_buffer_t* evm_buffer;
|
||||
bool meas_time_en;
|
||||
uint32_t meas_time_us;
|
||||
} srslte_pdsch_nr_t;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t* payload;
|
||||
bool crc;
|
||||
float evm;
|
||||
} srslte_pdsch_res_nr_t;
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_init_enb(srslte_pdsch_nr_t* q, const srslte_pdsch_nr_args_t* args);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_init_ue(srslte_pdsch_nr_t* q, const srslte_pdsch_nr_args_t* args);
|
||||
|
||||
SRSLTE_API void srslte_pdsch_nr_free(srslte_pdsch_nr_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_set_carrier(srslte_pdsch_nr_t* q, const srslte_carrier_nr_t* carrier);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_encode(srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
uint8_t* data[SRSLTE_MAX_TB],
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pdsch_nr_decode(srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_nr_t data[SRSLTE_MAX_TB]);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_nr_rx_info(const srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
const srslte_pdsch_res_nr_t* res,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pdsch_nr_tx_info(const srslte_pdsch_nr_t* q,
|
||||
const srslte_sch_cfg_nr_t* cfg,
|
||||
const srslte_sch_grant_nr_t* grant,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PDSCH_NR_H
|
@ -1,118 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: phich.h
|
||||
*
|
||||
* Description: Physical Hybrid ARQ indicator channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.9
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PHICH_H
|
||||
#define SRSLTE_PHICH_H
|
||||
|
||||
#include "regs.h"
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
#define SRSLTE_PHICH_NORM_NSEQUENCES 8
|
||||
#define SRSLTE_PHICH_EXT_NSEQUENCES 4
|
||||
#define SRSLTE_PHICH_NBITS 3
|
||||
|
||||
#define SRSLTE_PHICH_NORM_MSYMB SRSLTE_PHICH_NBITS * 4
|
||||
#define SRSLTE_PHICH_EXT_MSYMB SRSLTE_PHICH_NBITS * 2
|
||||
#define SRSLTE_PHICH_MAX_NSYMB SRSLTE_PHICH_NORM_MSYMB
|
||||
#define SRSLTE_PHICH_NORM_C 1
|
||||
#define SRSLTE_PHICH_EXT_C 2
|
||||
#define SRSLTE_PHICH_NORM_NSF 4
|
||||
#define SRSLTE_PHICH_EXT_NSF 2
|
||||
|
||||
/* phich object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
/* handler to REGs resource mapper */
|
||||
srslte_regs_t* regs;
|
||||
|
||||
/* buffers */
|
||||
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t sf_symbols[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t x[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t d[SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t d0[SRSLTE_PHICH_MAX_NSYMB];
|
||||
cf_t z[SRSLTE_PHICH_NBITS];
|
||||
|
||||
/* bit message */
|
||||
uint8_t data[SRSLTE_PHICH_NBITS];
|
||||
float data_rx[SRSLTE_PHICH_NBITS];
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod;
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
|
||||
} srslte_phich_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t ngroup;
|
||||
uint32_t nseq;
|
||||
} srslte_phich_resource_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t n_prb_lowest;
|
||||
uint32_t n_dmrs;
|
||||
uint32_t I_phich;
|
||||
} srslte_phich_grant_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool ack_value;
|
||||
float distance;
|
||||
} srslte_phich_res_t;
|
||||
|
||||
SRSLTE_API int srslte_phich_init(srslte_phich_t* q, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_phich_free(srslte_phich_t* q);
|
||||
|
||||
SRSLTE_API int srslte_phich_set_cell(srslte_phich_t* q, srslte_regs_t* regs, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_phich_set_regs(srslte_phich_t* q, srslte_regs_t* regs);
|
||||
|
||||
SRSLTE_API void srslte_phich_calc(srslte_phich_t* q, srslte_phich_grant_t* grant, srslte_phich_resource_t* n_phich);
|
||||
|
||||
SRSLTE_API int srslte_phich_decode(srslte_phich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
srslte_phich_resource_t n_phich,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_phich_res_t* result);
|
||||
|
||||
SRSLTE_API int srslte_phich_encode(srslte_phich_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_phich_resource_t n_phich,
|
||||
uint8_t ack,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API void srslte_phich_reset(srslte_phich_t* q, cf_t* slot_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API uint32_t srslte_phich_ngroups(srslte_phich_t* q);
|
||||
|
||||
SRSLTE_API uint32_t srslte_phich_nsf(srslte_phich_t* q);
|
||||
|
||||
#endif // SRSLTE_PHICH_H
|
@ -1,97 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pmch.h
|
||||
*
|
||||
* Description: Physical multicast channel
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.5
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PMCH_H
|
||||
#define SRSLTE_PMCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch.h"
|
||||
#include "srslte/phy/phch/ra_dl.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
typedef struct {
|
||||
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
|
||||
} srslte_pmch_seq_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_pdsch_cfg_t pdsch_cfg;
|
||||
uint16_t area_id;
|
||||
} srslte_pmch_cfg_t;
|
||||
|
||||
/* PMCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
uint32_t nof_rx_antennas;
|
||||
|
||||
uint32_t max_re;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS];
|
||||
cf_t* symbols[SRSLTE_MAX_PORTS];
|
||||
cf_t* x[SRSLTE_MAX_PORTS];
|
||||
cf_t* d;
|
||||
void* e;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[4];
|
||||
|
||||
// This is to generate the scrambling seq for multiple MBSFN Area IDs
|
||||
srslte_pmch_seq_t** seqs;
|
||||
|
||||
srslte_sch_t dl_sch;
|
||||
|
||||
} srslte_pmch_t;
|
||||
|
||||
SRSLTE_API int srslte_pmch_init(srslte_pmch_t* q, uint32_t max_prb, uint32_t nof_rx_antennas);
|
||||
|
||||
SRSLTE_API void srslte_pmch_free(srslte_pmch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pmch_set_cell(srslte_pmch_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API int srslte_pmch_set_area_id(srslte_pmch_t* q, uint16_t area_id);
|
||||
|
||||
SRSLTE_API void srslte_pmch_free_area_id(srslte_pmch_t* q, uint16_t area_id);
|
||||
|
||||
SRSLTE_API void srslte_configure_pmch(srslte_pmch_cfg_t* pmch_cfg, srslte_cell_t* cell, srslte_mbsfn_cfg_t* mbsfn_cfg);
|
||||
|
||||
SRSLTE_API int srslte_pmch_encode(srslte_pmch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pmch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS]);
|
||||
|
||||
SRSLTE_API int srslte_pmch_decode(srslte_pmch_t* q,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pmch_cfg_t* cfg,
|
||||
srslte_chest_dl_res_t* channel,
|
||||
cf_t* sf_symbols[SRSLTE_MAX_PORTS],
|
||||
srslte_pdsch_res_t* data);
|
||||
|
||||
#endif // SRSLTE_PMCH_H
|
@ -1,90 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_PSCCH_H
|
||||
#define SRSLTE_PSCCH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/phy/common/phy_common_sl.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/dft/dft_precoding.h"
|
||||
#include "srslte/phy/fec/convolutional/convcoder.h"
|
||||
#include "srslte/phy/fec/convolutional/viterbi.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/modem/modem_table.h"
|
||||
|
||||
/**
|
||||
* \brief Physical Sidelink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 15.6.0 Release 15 Section 9.4
|
||||
*/
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint32_t max_prb;
|
||||
srslte_cell_sl_t cell;
|
||||
|
||||
uint32_t sci_len;
|
||||
uint32_t nof_tx_re;
|
||||
|
||||
uint32_t pscch_nof_prb;
|
||||
|
||||
// crc
|
||||
uint8_t* c;
|
||||
srslte_crc_t crc;
|
||||
uint8_t* sci_crc;
|
||||
|
||||
// channel coding
|
||||
srslte_viterbi_t dec;
|
||||
srslte_convcoder_t encoder;
|
||||
uint8_t* d;
|
||||
int16_t* d_16;
|
||||
|
||||
// rate matching
|
||||
uint32_t E;
|
||||
uint8_t* e;
|
||||
int16_t* e_16;
|
||||
|
||||
uint8_t* e_bytes; ///< To pack bits to bytes
|
||||
uint32_t nof_symbols;
|
||||
|
||||
// interleaving
|
||||
uint32_t* interleaver_lut;
|
||||
uint8_t* codeword;
|
||||
uint8_t* codeword_bytes;
|
||||
|
||||
// scrambling
|
||||
srslte_sequence_t seq;
|
||||
|
||||
// modulation
|
||||
srslte_modem_table_t mod;
|
||||
cf_t* mod_symbols;
|
||||
int16_t* llr;
|
||||
|
||||
// dft precoding
|
||||
srslte_dft_precoding_t dft_precoder;
|
||||
srslte_dft_precoding_t idft_precoder;
|
||||
|
||||
cf_t* scfdma_symbols;
|
||||
|
||||
} srslte_pscch_t;
|
||||
|
||||
SRSLTE_API int srslte_pscch_init(srslte_pscch_t* q, uint32_t max_prb);
|
||||
SRSLTE_API int srslte_pscch_set_cell(srslte_pscch_t* q, srslte_cell_sl_t cell);
|
||||
SRSLTE_API int srslte_pscch_encode(srslte_pscch_t* q, uint8_t* sci, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_decode(srslte_pscch_t* q, cf_t* equalized_sf_syms, uint8_t* sci, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_put(srslte_pscch_t* q, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API int srslte_pscch_get(srslte_pscch_t* q, cf_t* sf_buffer, uint32_t prb_start_idx);
|
||||
SRSLTE_API void srslte_pscch_free(srslte_pscch_t* q);
|
||||
|
||||
#endif // SRSLTE_PSCCH_H
|
@ -1,175 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pucch.h
|
||||
*
|
||||
* Description: Physical uplink control channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.4
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PUCCH_H
|
||||
#define SRSLTE_PUCCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/chest_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/cqi.h"
|
||||
#include "srslte/phy/phch/pucch_cfg.h"
|
||||
#include "srslte/phy/phch/uci.h"
|
||||
|
||||
#define SRSLTE_PUCCH_N_SEQ SRSLTE_NRE
|
||||
#define SRSLTE_PUCCH2_NOF_BITS SRSLTE_UCI_CQI_CODED_PUCCH_B
|
||||
#define SRSLTE_PUCCH2_N_SF (5)
|
||||
#define SRSLTE_PUCCH_1A_2A_NOF_ACK (1)
|
||||
#define SRSLTE_PUCCH_1B_2B_NOF_ACK (2)
|
||||
#define SRSLTE_PUCCH3_NOF_BITS (4 * SRSLTE_NRE)
|
||||
#define SRSLTE_PUCCH_MAX_SYMBOLS (SRSLTE_PUCCH_N_SEQ * SRSLTE_PUCCH2_N_SF * SRSLTE_NOF_SLOTS_PER_SF)
|
||||
|
||||
// PUCCH Format 1B Channel selection
|
||||
#define SRSLTE_PUCCH_CS_MAX_ACK 4
|
||||
#define SRSLTE_PUCCH_CS_MAX_CARRIERS 2
|
||||
#define SRSLTE_PUCCH_FORMAT3_MAX_CARRIERS 5
|
||||
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1A (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT2 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT3 (0.5f)
|
||||
#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_DMRS (0.4f)
|
||||
|
||||
/* PUCCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
srslte_modem_table_t mod;
|
||||
|
||||
srslte_uci_cqi_pucch_t cqi;
|
||||
|
||||
srslte_sequence_t seq_f2;
|
||||
bool is_ue;
|
||||
|
||||
int16_t llr[SRSLTE_PUCCH3_NOF_BITS];
|
||||
uint8_t bits_scram[SRSLTE_PUCCH_MAX_BITS];
|
||||
cf_t d[SRSLTE_PUCCH_MAX_BITS / 2];
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB];
|
||||
uint32_t f_gh[SRSLTE_NSLOTS_X_FRAME];
|
||||
|
||||
cf_t* z;
|
||||
cf_t* z_tmp;
|
||||
cf_t* ce;
|
||||
|
||||
} srslte_pucch_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_value_t uci_data;
|
||||
float dmrs_correlation;
|
||||
float snr_db;
|
||||
float correlation;
|
||||
bool detected;
|
||||
|
||||
// PUCCH Measurements
|
||||
bool ta_valid;
|
||||
float ta_us;
|
||||
} srslte_pucch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pucch_init_ue(srslte_pucch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_pucch_init_enb(srslte_pucch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_pucch_free(srslte_pucch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pucch_set_cell(srslte_pucch_t* q, srslte_cell_t cell);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API void srslte_pucch_uci_gen_cfg(srslte_pucch_t* q, srslte_pucch_cfg_t* cfg, srslte_uci_data_t* uci_data);
|
||||
|
||||
SRSLTE_API int srslte_pucch_encode(srslte_pucch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_pucch_decode(srslte_pucch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pucch_cfg_t* cfg,
|
||||
srslte_chest_ul_res_t* channel,
|
||||
cf_t* sf_symbols,
|
||||
srslte_pucch_res_t* data);
|
||||
|
||||
/* Other utilities. These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API float srslte_pucch_alpha_format1(const uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB],
|
||||
const srslte_pucch_cfg_t* cfg,
|
||||
srslte_cp_t cp,
|
||||
bool is_dmrs,
|
||||
uint32_t ns,
|
||||
uint32_t l,
|
||||
uint32_t* n_oc,
|
||||
uint32_t* n_prime_ns);
|
||||
|
||||
SRSLTE_API float srslte_pucch_alpha_format2(const uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB],
|
||||
const srslte_pucch_cfg_t* cfg,
|
||||
uint32_t ns,
|
||||
uint32_t l);
|
||||
|
||||
SRSLTE_API int srslte_pucch_format2ab_mod_bits(srslte_pucch_format_t format, uint8_t bits[2], cf_t* d_10);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pucch_m(const srslte_pucch_cfg_t* cfg, srslte_cp_t cp);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pucch_n_prb(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg, uint32_t ns);
|
||||
|
||||
SRSLTE_API int srslte_pucch_n_cs_cell(srslte_cell_t cell,
|
||||
uint32_t n_cs_cell[SRSLTE_NSLOTS_X_FRAME][SRSLTE_CP_NORM_NSYMB]);
|
||||
|
||||
/**
|
||||
* Checks PUCCH collision from cell and two PUCCH configurations. The provided configurations shall provide format and
|
||||
* n_pucch resource prior to this call.
|
||||
*
|
||||
* @param cell cell parameters
|
||||
* @param cfg1 First PUCCH configuration
|
||||
* @param cfg2 Second PUCCH configuration
|
||||
* @return SRSLTE_SUCCESS if no collision, SRSLTE_ERROR if collision and otherwise SRSLTE_INVALID_INPUTS
|
||||
*/
|
||||
SRSLTE_API int
|
||||
srslte_pucch_collision(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg1, const srslte_pucch_cfg_t* cfg2);
|
||||
|
||||
/**
|
||||
* Checks PUCCH format 1b with channel selection collision configuration from a cell.
|
||||
*
|
||||
* @param cell cell parameters
|
||||
* @param cfg PUCCH configuration
|
||||
* @return SRSLTE_SUCCESS if no collision, SRSLTE_ERROR if collision and otherwise SRSLTE_INVALID_INPUTS
|
||||
*/
|
||||
SRSLTE_API int srslte_pucch_cfg_assert(const srslte_cell_t* cell, const srslte_pucch_cfg_t* cfg);
|
||||
|
||||
SRSLTE_API char* srslte_pucch_format_text(srslte_pucch_format_t format);
|
||||
|
||||
SRSLTE_API char* srslte_pucch_format_text_short(srslte_pucch_format_t format);
|
||||
|
||||
/**
|
||||
* Returns the number of ACK bits supported by a given PUCCH format
|
||||
* @param format PUCCH format
|
||||
* @return Returns the number of bits supported by the format
|
||||
*/
|
||||
SRSLTE_API uint32_t srslte_pucch_nof_ack_format(srslte_pucch_format_t format);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pucch_tx_info(srslte_pucch_cfg_t* cfg, srslte_uci_value_t* uci_data, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_pucch_rx_info(srslte_pucch_cfg_t* cfg, srslte_pucch_res_t* pucch_res, char* str, uint32_t str_len);
|
||||
|
||||
SRSLTE_API bool srslte_pucch_cfg_isvalid(srslte_pucch_cfg_t* cfg, uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_PUCCH_H
|
@ -1,130 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: pusch.h
|
||||
*
|
||||
* Description: Physical uplink shared channel.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_PUSCH_H
|
||||
#define SRSLTE_PUSCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/ch_estimation/refsignal_ul.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/dft/dft_precoding.h"
|
||||
#include "srslte/phy/mimo/layermap.h"
|
||||
#include "srslte/phy/mimo/precoding.h"
|
||||
#include "srslte/phy/modem/demod_soft.h"
|
||||
#include "srslte/phy/modem/evm.h"
|
||||
#include "srslte/phy/modem/mod.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/regs.h"
|
||||
#include "srslte/phy/phch/sch.h"
|
||||
#include "srslte/phy/scrambling/scrambling.h"
|
||||
|
||||
/* PUSCH object */
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_cell_t cell;
|
||||
|
||||
bool is_ue;
|
||||
uint16_t ue_rnti;
|
||||
uint32_t max_re;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
srslte_dft_precoding_t dft_precoding;
|
||||
|
||||
/* buffers */
|
||||
// void buffers are shared for tx and rx
|
||||
cf_t* ce;
|
||||
cf_t* z;
|
||||
cf_t* d;
|
||||
|
||||
void* q;
|
||||
void* g;
|
||||
|
||||
/* tx & rx objects */
|
||||
srslte_modem_table_t mod[SRSLTE_MOD_NITEMS];
|
||||
srslte_sch_t ul_sch;
|
||||
|
||||
// EVM buffer
|
||||
srslte_evm_buffer_t* evm_buffer;
|
||||
|
||||
} srslte_pusch_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t* ptr;
|
||||
srslte_uci_value_t uci;
|
||||
} srslte_pusch_data_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t* data;
|
||||
srslte_uci_value_t uci;
|
||||
bool crc;
|
||||
float avg_iterations_block;
|
||||
float evm;
|
||||
float epre_dbfs;
|
||||
} srslte_pusch_res_t;
|
||||
|
||||
SRSLTE_API int srslte_pusch_init_ue(srslte_pusch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API int srslte_pusch_init_enb(srslte_pusch_t* q, uint32_t max_prb);
|
||||
|
||||
SRSLTE_API void srslte_pusch_free(srslte_pusch_t* q);
|
||||
|
||||
/* These functions modify the state of the object and may take some time */
|
||||
SRSLTE_API int srslte_pusch_set_cell(srslte_pusch_t* q, srslte_cell_t cell);
|
||||
|
||||
/**
|
||||
* Asserts PUSCH grant attributes are in range
|
||||
* @param grant Pointer to PUSCH grant
|
||||
* @return it returns SRSLTE_SUCCESS if the grant is correct, otherwise it returns a SRSLTE_ERROR code
|
||||
*/
|
||||
SRSLTE_API int srslte_pusch_assert_grant(const srslte_pusch_grant_t* grant);
|
||||
|
||||
/* These functions do not modify the state and run in real-time */
|
||||
SRSLTE_API int srslte_pusch_encode(srslte_pusch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_data_t* data,
|
||||
cf_t* sf_symbols);
|
||||
|
||||
SRSLTE_API int srslte_pusch_decode(srslte_pusch_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
srslte_chest_ul_res_t* channel,
|
||||
cf_t* sf_symbols,
|
||||
srslte_pusch_res_t* data);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_grant_tx_info(srslte_pusch_grant_t* grant,
|
||||
srslte_uci_cfg_t* uci_cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_tx_info(srslte_pusch_cfg_t* cfg,
|
||||
srslte_uci_value_t* uci_data,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
SRSLTE_API uint32_t srslte_pusch_rx_info(srslte_pusch_cfg_t* cfg,
|
||||
srslte_pusch_res_t* res,
|
||||
srslte_chest_ul_res_t* chest_res,
|
||||
char* str,
|
||||
uint32_t str_len);
|
||||
|
||||
#endif // SRSLTE_PUSCH_H
|
@ -1,98 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures common in for DL and UL
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_H
|
||||
#define SRSLTE_RA_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
/**************************************************
|
||||
* Common structures used for Resource Allocation
|
||||
**************************************************/
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_mod_t mod;
|
||||
int tbs;
|
||||
int rv;
|
||||
uint32_t nof_bits;
|
||||
uint32_t cw_idx;
|
||||
bool enabled;
|
||||
|
||||
// this is for debugging and metrics purposes
|
||||
uint32_t mcs_idx;
|
||||
} srslte_ra_tb_t;
|
||||
|
||||
typedef enum SRSLTE_API {
|
||||
SRSLTE_RA_ALLOC_TYPE0 = 0,
|
||||
SRSLTE_RA_ALLOC_TYPE1 = 1,
|
||||
SRSLTE_RA_ALLOC_TYPE2 = 2
|
||||
} srslte_ra_type_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t rbg_bitmask;
|
||||
} srslte_ra_type0_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t vrb_bitmask;
|
||||
uint32_t rbg_subset;
|
||||
bool shift;
|
||||
} srslte_ra_type1_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint32_t riv; // if L_crb==0, DCI message packer will take this value directly
|
||||
enum { SRSLTE_RA_TYPE2_NPRB1A_2 = 0, SRSLTE_RA_TYPE2_NPRB1A_3 = 1 } n_prb1a;
|
||||
enum { SRSLTE_RA_TYPE2_NG1 = 0, SRSLTE_RA_TYPE2_NG2 = 1 } n_gap;
|
||||
enum { SRSLTE_RA_TYPE2_LOC = 0, SRSLTE_RA_TYPE2_DIST = 1 } mode;
|
||||
} srslte_ra_type2_t;
|
||||
|
||||
#define SRSLTE_RA_NOF_TBS_IDX 34
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type0_P(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_n_vrb_dl(uint32_t nof_prb, bool ngap_is_1);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_n_rb_step(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_ngap(uint32_t nof_prb, bool ngap_is_1);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type1_N_rb(uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_type2_to_riv(uint32_t L_crb, uint32_t RB_start, uint32_t nof_prb);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_ra_type2_from_riv(uint32_t riv, uint32_t* L_crb, uint32_t* RB_start, uint32_t nof_prb, uint32_t nof_vrb);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_idx_from_mcs(uint32_t mcs, bool use_tbs_index_alt, bool is_ul);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_ra_dl_mod_from_mcs(uint32_t mcs, bool use_tbs_index_alt);
|
||||
|
||||
SRSLTE_API srslte_mod_t srslte_ra_ul_mod_from_mcs(uint32_t mcs);
|
||||
|
||||
SRSLTE_API int srslte_ra_mcs_from_tbs_idx(uint32_t tbs_idx, bool use_tbs_index_alt, bool is_ul);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_from_idx(uint32_t tbs_idx, uint32_t n_prb);
|
||||
|
||||
SRSLTE_API int srslte_ra_tbs_to_table_idx(uint32_t tbs, uint32_t n_prb, uint32_t max_tbs_idx);
|
||||
|
||||
#endif // SRSLTE_RA_H
|
@ -1,65 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra_dl.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures for DL defined in Section 7
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_DL_H
|
||||
#define SRSLTE_RA_DL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/ra.h"
|
||||
|
||||
/**************************************************
|
||||
* Structures used for Downlink Resource Allocation
|
||||
**************************************************/
|
||||
|
||||
/** Functions to generate a grant from a received DCI */
|
||||
SRSLTE_API int srslte_ra_dl_dci_to_grant(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_tm_t tm,
|
||||
bool pdsch_use_tbs_index_alt,
|
||||
const srslte_dci_dl_t* dci,
|
||||
srslte_pdsch_grant_t* grant);
|
||||
|
||||
SRSLTE_API int
|
||||
srslte_ra_dl_grant_to_grant_prb_allocation(const srslte_dci_dl_t* dci, srslte_pdsch_grant_t* grant, uint32_t nof_prb);
|
||||
|
||||
/** Functions used by the eNodeB scheduler */
|
||||
SRSLTE_API uint32_t srslte_ra_dl_approx_nof_re(const srslte_cell_t* cell, uint32_t nof_prb, uint32_t nof_ctrl_symbols);
|
||||
|
||||
SRSLTE_API uint32_t ra_re_x_prb(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, uint32_t slot, uint32_t prb_idx);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_dl_grant_nof_re(const srslte_cell_t* cell,
|
||||
srslte_dl_sf_cfg_t* sf,
|
||||
srslte_pdsch_grant_t* grant);
|
||||
|
||||
/** Others */
|
||||
SRSLTE_API int srslte_dl_fill_ra_mcs(srslte_ra_tb_t* tb, int last_tbs, uint32_t nprb, bool pdsch_use_tbs_index_alt);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_ra_dl_compute_nof_re(const srslte_cell_t* cell, srslte_dl_sf_cfg_t* sf, srslte_pdsch_grant_t* grant);
|
||||
|
||||
SRSLTE_API uint32_t srslte_ra_dl_info(srslte_pdsch_grant_t* grant, char* info_str, uint32_t len);
|
||||
|
||||
#endif // SRSLTE_RA_DL_H
|
@ -1,60 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: ra_ul.h
|
||||
*
|
||||
* Description: Implements Resource allocation Procedures for UL defined in Sections 8
|
||||
*
|
||||
* Reference: 3GPP TS 36.213 version 10.0.1 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_RA_UL_H
|
||||
#define SRSLTE_RA_UL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/phch/dci.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
|
||||
// Structure for PUSCH frequency hopping procedure
|
||||
typedef struct SRSLTE_API {
|
||||
bool initialized;
|
||||
srslte_cell_t cell;
|
||||
srslte_sequence_t seq_type2_fo;
|
||||
} srslte_ra_ul_pusch_hopping_t;
|
||||
|
||||
SRSLTE_API int srslte_ra_ul_pusch_hopping_init(srslte_ra_ul_pusch_hopping_t* q, srslte_cell_t cell);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_pusch_hopping_free(srslte_ra_ul_pusch_hopping_t* q);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_pusch_hopping(srslte_ra_ul_pusch_hopping_t* q,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_hopping_cfg_t* hopping_cfg,
|
||||
srslte_pusch_grant_t* grant);
|
||||
|
||||
/** Functions to generate a grant from a received DCI */
|
||||
SRSLTE_API int srslte_ra_ul_dci_to_grant(srslte_cell_t* cell,
|
||||
srslte_ul_sf_cfg_t* sf,
|
||||
srslte_pusch_hopping_cfg_t* hopping_cfg,
|
||||
srslte_dci_ul_t* dci,
|
||||
srslte_pusch_grant_t* grant);
|
||||
|
||||
SRSLTE_API void srslte_ra_ul_compute_nof_re(srslte_pusch_grant_t* grant, srslte_cp_t cp, uint32_t N_srs);
|
||||
|
||||
/** Others */
|
||||
SRSLTE_API uint32_t srslte_ra_ul_info(const srslte_pusch_grant_t* grant, char* info_str, uint32_t len);
|
||||
|
||||
#endif // SRSLTE_RA_UL_H
|
@ -1,133 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: sch.h
|
||||
*
|
||||
* Description: Common UL and DL shared channel encode/decode functions.
|
||||
*
|
||||
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_SCH_H
|
||||
#define SRSLTE_SCH_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/fec/crc.h"
|
||||
#include "srslte/phy/fec/turbo/rm_turbo.h"
|
||||
#include "srslte/phy/fec/turbo/turbocoder.h"
|
||||
#include "srslte/phy/fec/turbo/turbodecoder.h"
|
||||
#include "srslte/phy/phch/pdsch_cfg.h"
|
||||
#include "srslte/phy/phch/pusch_cfg.h"
|
||||
#include "srslte/phy/phch/uci.h"
|
||||
|
||||
#ifndef SRSLTE_RX_NULL
|
||||
#define SRSLTE_RX_NULL 10000
|
||||
#endif
|
||||
|
||||
#ifndef SRSLTE_TX_NULL
|
||||
#define SRSLTE_TX_NULL 100
|
||||
#endif
|
||||
|
||||
/* DL-SCH AND UL-SCH common functions */
|
||||
typedef struct SRSLTE_API {
|
||||
|
||||
uint32_t max_iterations;
|
||||
float avg_iterations;
|
||||
|
||||
bool llr_is_8bit;
|
||||
|
||||
/* buffers */
|
||||
uint8_t* cb_in;
|
||||
uint8_t* parity_bits;
|
||||
void* e;
|
||||
uint8_t* temp_g_bits;
|
||||
uint32_t* ul_interleaver;
|
||||
srslte_uci_bit_t ack_ri_bits[57600]; // 4*M_sc*Qm_max for RI and ACK
|
||||
|
||||
srslte_tcod_t encoder;
|
||||
srslte_tdec_t decoder;
|
||||
srslte_crc_t crc_tb;
|
||||
srslte_crc_t crc_cb;
|
||||
|
||||
srslte_uci_cqi_pusch_t uci_cqi;
|
||||
|
||||
} srslte_sch_t;
|
||||
|
||||
SRSLTE_API int srslte_sch_init(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_sch_free(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API void srslte_sch_set_max_noi(srslte_sch_t* q, uint32_t max_iterations);
|
||||
|
||||
SRSLTE_API float srslte_sch_last_noi(srslte_sch_t* q);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_encode(srslte_sch_t* q, srslte_pdsch_cfg_t* cfg, uint8_t* data, uint8_t* e_bits);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_encode2(srslte_sch_t* q,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
uint8_t* e_bits,
|
||||
int codeword_idx,
|
||||
uint32_t nof_layers);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_decode(srslte_sch_t* q, srslte_pdsch_cfg_t* cfg, int16_t* e_bits, uint8_t* data);
|
||||
|
||||
SRSLTE_API int srslte_dlsch_decode2(srslte_sch_t* q,
|
||||
srslte_pdsch_cfg_t* cfg,
|
||||
int16_t* e_bits,
|
||||
uint8_t* data,
|
||||
int codeword_idx,
|
||||
uint32_t nof_layers);
|
||||
|
||||
SRSLTE_API int srslte_ulsch_encode(srslte_sch_t* q,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
uint8_t* data,
|
||||
srslte_uci_value_t* uci_data,
|
||||
uint8_t* g_bits,
|
||||
uint8_t* q_bits);
|
||||
|
||||
SRSLTE_API int srslte_ulsch_decode(srslte_sch_t* q,
|
||||
srslte_pusch_cfg_t* cfg,
|
||||
int16_t* q_bits,
|
||||
int16_t* g_bits,
|
||||
uint8_t* c_seq,
|
||||
uint8_t* data,
|
||||
srslte_uci_value_t* uci_data);
|
||||
|
||||
SRSLTE_API float srslte_sch_beta_cqi(uint32_t I_cqi);
|
||||
|
||||
SRSLTE_API float srslte_sch_beta_ack(uint32_t I_harq);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_ack(float beta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_cqi(float beta);
|
||||
|
||||
SRSLTE_API uint32_t srslte_sch_find_Ioffset_ri(float beta);
|
||||
|
||||
///< Sidelink uses PUSCH Interleaver in all channels
|
||||
SRSLTE_API void srslte_sl_ulsch_interleave(uint8_t* g_bits,
|
||||
uint32_t Qm,
|
||||
uint32_t H_prime_total,
|
||||
uint32_t N_pusch_symbs,
|
||||
uint8_t* q_bits);
|
||||
|
||||
///< Sidelink uses PUSCH Deinterleaver in all channels
|
||||
SRSLTE_API void srslte_sl_ulsch_deinterleave(int16_t* q_bits,
|
||||
uint32_t Qm,
|
||||
uint32_t H_prime_total,
|
||||
uint32_t N_pusch_symbs,
|
||||
int16_t* g_bits,
|
||||
uint32_t* inteleaver_lut);
|
||||
|
||||
#endif // SRSLTE_SCH_H
|
@ -1,64 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SRSLTE_UCI_CFG_H
|
||||
#define SRSLTE_UCI_CFG_H
|
||||
|
||||
#include "srslte/phy/phch/cqi.h"
|
||||
|
||||
#define SRSLTE_UCI_MAX_ACK_BITS 10
|
||||
#define SRSLTE_UCI_MAX_ACK_SR_BITS (SRSLTE_UCI_MAX_ACK_BITS + 1)
|
||||
#define SRSLTE_UCI_MAX_M 9
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
uint8_t ack_value[SRSLTE_UCI_MAX_ACK_BITS];
|
||||
bool valid;
|
||||
} srslte_uci_value_ack_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool pending_tb[SRSLTE_MAX_CODEWORDS]; //< Indicates whether there was a grant that requires an ACK/NACK
|
||||
uint32_t nof_acks; //< Number of transport blocks, deduced from transmission mode
|
||||
uint32_t ncce[SRSLTE_UCI_MAX_M];
|
||||
uint32_t N_bundle;
|
||||
uint32_t tdd_ack_M;
|
||||
uint32_t tdd_ack_m;
|
||||
bool tdd_is_multiplex;
|
||||
uint32_t tpc_for_pucch;
|
||||
uint32_t grant_cc_idx;
|
||||
} srslte_uci_cfg_ack_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_cfg_ack_t ack[SRSLTE_MAX_CARRIERS];
|
||||
srslte_cqi_cfg_t cqi;
|
||||
bool is_scheduling_request_tti;
|
||||
} srslte_uci_cfg_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
bool scheduling_request;
|
||||
srslte_cqi_value_t cqi;
|
||||
srslte_uci_value_ack_t ack;
|
||||
uint8_t ri; // Only 1-bit supported for RI
|
||||
} srslte_uci_value_t;
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
srslte_uci_cfg_t cfg;
|
||||
srslte_uci_value_t value;
|
||||
} srslte_uci_data_t;
|
||||
|
||||
typedef enum { UCI_BIT_0 = 0, UCI_BIT_1 = 1, UCI_BIT_REPETITION = 2, UCI_BIT_PLACEHOLDER = 3 } srslte_uci_bit_type_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t position;
|
||||
srslte_uci_bit_type_t type;
|
||||
} srslte_uci_bit_t;
|
||||
|
||||
#endif // SRSLTE_UCI_CFG_H
|
@ -1,49 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: scrambling.h
|
||||
*
|
||||
* Description: Generic scrambling functions used by UL and DL channels.
|
||||
*
|
||||
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3.1, 6.3.1
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_SCRAMBLING_H
|
||||
#define SRSLTE_SCRAMBLING_H
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
#include "srslte/phy/common/sequence.h"
|
||||
|
||||
/* Scrambling has no state */
|
||||
SRSLTE_API void srslte_scrambling_b(srslte_sequence_t* s, uint8_t* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_b_offset(srslte_sequence_t* s, uint8_t* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_bytes(srslte_sequence_t* s, uint8_t* data, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_f(srslte_sequence_t* s, float* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_f_offset(srslte_sequence_t* s, float* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_s(srslte_sequence_t* s, short* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_s_offset(srslte_sequence_t* s, short* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_sb_offset(srslte_sequence_t* s, int8_t* data, int offset, int len);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_c(srslte_sequence_t* s, cf_t* data);
|
||||
|
||||
SRSLTE_API void srslte_scrambling_c_offset(srslte_sequence_t* s, cf_t* data, int offset, int len);
|
||||
|
||||
#endif // SRSLTE_SCRAMBLING_H
|
@ -1,56 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2020 Software Radio Systems Limited
|
||||
*
|
||||
* By using this file, you agree to the terms and conditions set
|
||||
* forth in the LICENSE file which can be found at the top level of
|
||||
* the distribution.
|
||||
*
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* File: cfo.h
|
||||
*
|
||||
* Description: Carrier frequency offset correction using complex exponentials.
|
||||
*
|
||||
* Reference:
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SRSLTE_CFO_H
|
||||
#define SRSLTE_CFO_H
|
||||
|
||||
#include <complex.h>
|
||||
|
||||
#include "srslte/config.h"
|
||||
#include "srslte/phy/utils/cexptab.h"
|
||||
#include "srslte/phy/common/phy_common.h"
|
||||
|
||||
#define SRSLTE_CFO_CEXPTAB_SIZE 4096
|
||||
|
||||
typedef struct SRSLTE_API {
|
||||
float last_freq;
|
||||
float tol;
|
||||
int nsamples;
|
||||
int max_samples;
|
||||
srslte_cexptab_t tab;
|
||||
cf_t* cur_cexp;
|
||||
} srslte_cfo_t;
|
||||
|
||||
SRSLTE_API int srslte_cfo_init(srslte_cfo_t* h, uint32_t nsamples);
|
||||
|
||||
SRSLTE_API void srslte_cfo_free(srslte_cfo_t* h);
|
||||
|
||||
SRSLTE_API int srslte_cfo_resize(srslte_cfo_t* h, uint32_t samples);
|
||||
|
||||
SRSLTE_API void srslte_cfo_set_tol(srslte_cfo_t* h, float tol);
|
||||
|
||||
SRSLTE_API void srslte_cfo_correct(srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq);
|
||||
|
||||
SRSLTE_API void
|
||||
srslte_cfo_correct_offset(srslte_cfo_t* h, const cf_t* input, cf_t* output, float freq, int cexp_offset, int nsamples);
|
||||
|
||||
SRSLTE_API float srslte_cfo_est_corr_cp(cf_t* input_buffer, uint32_t nof_prb);
|
||||
|
||||
#endif // SRSLTE_CFO_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue