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.
103 lines
3.4 KiB
C
103 lines
3.4 KiB
C
4 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
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
|
#ifndef SRSRAN_ZC_SEQUENCE_H
|
||
|
#define SRSRAN_ZC_SEQUENCE_H
|
||
4 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
4 years ago
|
#include <stdbool.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
4 years ago
|
/**
|
||
|
* @brief Defines the maximum number of ZC sequence groups (u)
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_ZC_SEQUENCE_NOF_GROUPS 30
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Defines the maximum number of base sequences (v)
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_ZC_SEQUENCE_NOF_BASE 2
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Generates ZC sequences given the required parameters used in the TS 36 series (LTE)
|
||
|
*
|
||
|
* @remark Implemented as defined in TS 36.211 section 5.5.1 Generation of the reference signal sequence
|
||
|
*
|
||
|
* @param[in] u Group number {0,1,...29}
|
||
|
* @param[in] v Base sequence
|
||
|
* @param[in] alpha Phase shift
|
||
|
* @param[in] nof_prb Number of PRB
|
||
|
* @param[out] sequence Output sequence
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the generation is successful, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_zc_sequence_generate_lte(uint32_t u, uint32_t v, float alpha, uint32_t nof_prb, cf_t* sequence);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Generates ZC sequences given the required parameters used in the TS 38 series (NR)
|
||
|
*
|
||
|
* @remark Implemented as defined in TS 38.211 section 5.2.2 Low-PAPR sequence generation
|
||
4 years ago
|
*
|
||
4 years ago
|
* @param u Group number {0,1,...29}
|
||
|
* @param v base sequence
|
||
|
* @param alpha Phase shift
|
||
|
* @param m Number of PRB
|
||
|
* @param delta Delta parameter described in specification
|
||
|
* @param sequence Output sequence
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the generation is successful, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int
|
||
|
srsran_zc_sequence_generate_nr(uint32_t u, uint32_t v, float alpha, uint32_t m, uint32_t delta, cf_t* sequence);
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Low-PAPR ZC sequence look-up-table
|
||
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
uint32_t M_zc;
|
||
|
uint32_t nof_alphas;
|
||
4 years ago
|
cf_t* sequence[SRSRAN_ZC_SEQUENCE_NOF_GROUPS][SRSRAN_ZC_SEQUENCE_NOF_BASE];
|
||
|
} srsran_zc_sequence_lut_t;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Initialises a Low-PAPR sequence look-up-table object using NR tables
|
||
|
*
|
||
|
* @param q Object pointer
|
||
|
* @param m Number of PRB
|
||
|
* @param delta Delta parameter described in specification
|
||
|
* @param alphas Vector with the alpha shift parameters
|
||
|
* @param nof_alphas Number alpha shifts to generate
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the initialization is successful, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_zc_sequence_lut_init_nr(srsran_zc_sequence_lut_t* q,
|
||
4 years ago
|
uint32_t m,
|
||
|
uint32_t delta,
|
||
|
float* alphas,
|
||
|
uint32_t nof_alphas);
|
||
|
|
||
|
/**
|
||
|
* @brief Deallocates a Low-PAPR sequence look-up-table object
|
||
|
* @param q Object pointer
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API void srsran_zc_sequence_lut_free(srsran_zc_sequence_lut_t* q);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Get a Low-PAPR sequence from the LUT
|
||
|
* @param q Object pointer
|
||
|
* @param u Group number {0,1,...29}
|
||
|
* @param v base sequence
|
||
|
* @param alpha_idx Phase shift index
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if the generation is successful, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API const cf_t*
|
||
|
srsran_zc_sequence_lut_get(const srsran_zc_sequence_lut_t* q, uint32_t u, uint32_t v, uint32_t alpha_idx);
|
||
4 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_ZC_SEQUENCE_H
|