mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
182 lines
6.9 KiB
C
182 lines
6.9 KiB
C
4 years ago
|
/**
|
||
4 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
4 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
4 years ago
|
*
|
||
4 years ago
|
* 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.
|
||
4 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_DMRS_PDCCH_H
|
||
|
#define SRSRAN_DMRS_PDCCH_H
|
||
4 years ago
|
|
||
4 years ago
|
#include "srsran/phy/common/phy_common_nr.h"
|
||
|
#include "srsran/phy/phch/dci_nr.h"
|
||
|
#include "srsran/phy/resampling/interp.h"
|
||
|
#include "srsran/phy/resampling/resampler.h"
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Puts in the resource grid the DeModulation Reference Signals for decoding PDCCH.
|
||
|
*
|
||
4 years ago
|
* @remark: Implemented as specified by TS 38.211 V15.8.0 Section 7.1.4.3
|
||
|
*
|
||
4 years ago
|
* @attention it expects sf_symbols to be size SRSRAN_SLOT_LEN_RE_NR(cfg->carrier.nof_prb)
|
||
4 years ago
|
*
|
||
4 years ago
|
* @param[in] carrier Provides carrier configuration
|
||
|
* @param[in] coreset Provides higher layer CORSET configuration
|
||
|
* @param[in] slot_cfg Provides DL slot configuration
|
||
|
* @param[in] dci_location Provides DCI location
|
||
4 years ago
|
* @param sf_symbols is the resource grid where the DMRS resource elements will be written
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the configurations are valid, otherwise it returns an SRSRAN_ERROR code
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_dmrs_pdcch_put(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
const srsran_slot_cfg_t* slot_cfg,
|
||
|
const srsran_dci_location_t* dci_location,
|
||
4 years ago
|
cf_t* sf_symbols);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief PDCCH DMRS channel estimator object
|
||
|
*
|
||
4 years ago
|
* @see srsran_dmrs_pdcch_estimator_init
|
||
|
* @see srsran_dmrs_pdcch_estimator_free
|
||
|
* @see srsran_dmrs_pdcch_estimator_estimate
|
||
|
* @see srsran_dmrs_pdcch_estimator_measure
|
||
4 years ago
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
/// Current estimator carrier configuration
|
||
4 years ago
|
srsran_carrier_nr_t carrier;
|
||
4 years ago
|
|
||
|
/// Current estimator CORESET configuration
|
||
4 years ago
|
srsran_coreset_t coreset;
|
||
4 years ago
|
|
||
|
/// Stores the current CORESET bandwidth in PRB
|
||
|
uint32_t coreset_bw;
|
||
|
|
||
|
/// Stores the current CORESET size in RE
|
||
|
uint32_t coreset_sz;
|
||
|
|
||
|
/// Object for interpolating, it shall be initialised only once
|
||
4 years ago
|
srsran_interp_lin_t interpolator;
|
||
4 years ago
|
|
||
|
/// Pilots least square estimates, one vector for each possible symbol. Since there are one pilot every 4 sub-carriers
|
||
|
/// , each vector is three times the CORESEt band-width
|
||
4 years ago
|
cf_t* lse[SRSRAN_CORESET_DURATION_MAX];
|
||
4 years ago
|
|
||
|
/// Channel estimates, size coreset_sz
|
||
|
cf_t* ce;
|
||
4 years ago
|
|
||
|
/// Frequency domain smoothing filter
|
||
|
float* filter;
|
||
|
uint32_t filter_len;
|
||
4 years ago
|
} srsran_dmrs_pdcch_estimator_t;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Initialises the PDCCH DMRS channel estimator from a given carrier and CORESET configuration
|
||
|
*
|
||
4 years ago
|
* \attention The initialization function expects the object being previously zeroed on its first call
|
||
4 years ago
|
* \attention Initialization is required every time the carrier and/or CORESET changes. No free is required between
|
||
|
* initializations.
|
||
|
*
|
||
4 years ago
|
* @param[in,out] q provides PDCCH DMRS estimator object
|
||
|
* @param[in] carrier Provides carrier configuration
|
||
|
* @param[in] coreset Provides higher layer CORSET configuration
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the configurations are valid, otherwise it returns an SRSRAN_ERROR code
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_dmrs_pdcch_estimator_init(srsran_dmrs_pdcch_estimator_t* q,
|
||
|
const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Deallocate all memory allocated by a given PDCCH DMRS estimator object
|
||
|
* @param q provides PDCCH DMRS estimator object
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API void srsran_dmrs_pdcch_estimator_free(srsran_dmrs_pdcch_estimator_t* q);
|
||
4 years ago
|
|
||
|
/**
|
||
4 years ago
|
* @brief Estimates the configured CORESET channel from the received PDCCH's DMRS.
|
||
4 years ago
|
*
|
||
|
* This function is designed to be called prior to the PDCCH blind decoding and shall be called only once for every
|
||
4 years ago
|
* CORESET in every slot.
|
||
|
*
|
||
|
* The channel estimate measurements are performed at PDCCH candidate level through the function
|
||
4 years ago
|
* srsran_dmrs_pdcch_estimator_measure.
|
||
4 years ago
|
*
|
||
4 years ago
|
* @param[in,out] cfg Configuration that includes Carrier, CORESET and the Search Space
|
||
|
* @param[in] slot_cfg Slot index in the frame
|
||
|
* @param[in] sf_symbols Received resource grid.
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the configurations are valid, otherwise it returns an SRSRAN_ERROR code
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int
|
||
|
srsran_dmrs_pdcch_estimate(srsran_dmrs_pdcch_estimator_t* q, const srsran_slot_cfg_t* slot_cfg, const cf_t* sf_symbols);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief PDSCH DMRS measurement results
|
||
4 years ago
|
*
|
||
4 years ago
|
* @see srsran_dmrs_pdcch_estimator_measure
|
||
4 years ago
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
/// Linear reference signal received power (RSRP). Measure correlation
|
||
|
float rsrp;
|
||
4 years ago
|
float rsrp_dBfs;
|
||
4 years ago
|
|
||
|
/// Energy per resource element (EPRE)
|
||
|
float epre;
|
||
4 years ago
|
float epre_dBfs;
|
||
|
|
||
|
/// Normalized Correlation (RSRP / EPRE)
|
||
|
float norm_corr;
|
||
4 years ago
|
|
||
4 years ago
|
/// CFO Measure in Hz (only available for CORESET durations 2 and 3)
|
||
4 years ago
|
float cfo_hz;
|
||
|
|
||
|
/// Measure synchronization error in micro-seconds
|
||
|
float sync_error_us;
|
||
4 years ago
|
} srsran_dmrs_pdcch_measure_t;
|
||
4 years ago
|
|
||
|
/**
|
||
4 years ago
|
* @brief PDSCH DMRS Channel estimates structure
|
||
|
*
|
||
4 years ago
|
* @see srsran_dmrs_pdcch_get_ce
|
||
4 years ago
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
/// Channel estimates, subtract 1 DMRS for every 4 RE, a maximum of L=16 and 6 PRB per CCE
|
||
4 years ago
|
cf_t ce[SRSRAN_PDCCH_MAX_RE];
|
||
4 years ago
|
uint32_t nof_re;
|
||
|
float noise_var;
|
||
4 years ago
|
} srsran_dmrs_pdcch_ce_t;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Performs PDCCH DMRS measurements of a given DCI location
|
||
4 years ago
|
*
|
||
4 years ago
|
* @note The measurement is useful for determining whether there is a PDCCH transmission in the given DCI location.
|
||
|
*
|
||
|
* @param[in] q provides PDCCH DMRS estimator object
|
||
|
* @param[in] dci_location provides the search space
|
||
|
* @param[in] location Provides the aggregation level and CCE resource
|
||
|
* @param[out] measure Provides the structure for storing the channel estimate measurements
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the configurations are valid, otherwise it returns an SRSRAN_ERROR code
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_dmrs_pdcch_get_measure(const srsran_dmrs_pdcch_estimator_t* q,
|
||
|
const srsran_dci_location_t* location,
|
||
|
srsran_dmrs_pdcch_measure_t* measure);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Extracts PDCCH DMRS channel estimates of a given PDCCH candidate for an aggregation level
|
||
4 years ago
|
*
|
||
|
* @attention The provided aggregation level and candidate need to be according to the search space.
|
||
|
*
|
||
4 years ago
|
* @param[in] q provides PDCCH DMRS estimator object
|
||
|
* @param[in] location Provides the aggregation level and CCE resource
|
||
|
* @param[out] ce Provides the structure for storing the channel estimates
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the configurations are valid, otherwise it returns an SRSRAN_ERROR code
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_dmrs_pdcch_get_ce(const srsran_dmrs_pdcch_estimator_t* q,
|
||
|
const srsran_dci_location_t* location,
|
||
|
srsran_dmrs_pdcch_ce_t* ce);
|
||
4 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_DMRS_PDCCH_H
|