Removed modulation enum from LDPC RM

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent a8074fe39d
commit 0439161de6

@ -185,8 +185,7 @@ typedef enum SRSLTE_API {
} srslte_phich_r_t; } srslte_phich_r_t;
/// LTE duplex modes. /// LTE duplex modes.
typedef enum SRSLTE_API typedef enum SRSLTE_API {
{
/// FDD uses frame structure type 1. /// FDD uses frame structure type 1.
SRSLTE_FDD = 0, SRSLTE_FDD = 0,
/// TDD uses frame structure type 2. /// TDD uses frame structure type 2.
@ -208,7 +207,7 @@ typedef struct SRSLTE_API {
/// TS 36.211 v13.13.0 Table 4.2-1. /// TS 36.211 v13.13.0 Table 4.2-1.
uint32_t ss_config; uint32_t ss_config;
/// Set to true when the fields have been configured, otherwise false. /// Set to true when the fields have been configured, otherwise false.
bool configured; bool configured;
} srslte_tdd_config_t; } srslte_tdd_config_t;
/// TDD uplink-downlink subframe types. /// TDD uplink-downlink subframe types.
@ -276,12 +275,15 @@ typedef enum SRSLTE_API {
typedef enum SRSLTE_API { SRSLTE_MIMO_DECODER_ZF, SRSLTE_MIMO_DECODER_MMSE } srslte_mimo_decoder_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 { typedef enum SRSLTE_API {
SRSLTE_MOD_BPSK = 0, SRSLTE_MOD_BPSK = 0, /*!< \brief pi/2-BPSK. */
SRSLTE_MOD_QPSK, SRSLTE_MOD_QPSK, /*!< \brief QPSK. */
SRSLTE_MOD_16QAM, SRSLTE_MOD_16QAM, /*!< \brief QAM16. */
SRSLTE_MOD_64QAM, SRSLTE_MOD_64QAM, /*!< \brief QAM64. */
SRSLTE_MOD_256QAM, SRSLTE_MOD_256QAM, /*!< \brief QAM256. */
SRSLTE_MOD_NITEMS SRSLTE_MOD_NITEMS
} srslte_mod_t; } srslte_mod_t;

@ -32,19 +32,9 @@
#ifndef SRSLTE_LDPCRM_H #ifndef SRSLTE_LDPCRM_H
#define SRSLTE_LDPCRM_H #define SRSLTE_LDPCRM_H
#include "srslte/phy/common/phy_common.h"
#include "srslte/phy/fec/ldpc/base_graph.h" #include "srslte/phy/fec/ldpc/base_graph.h"
/*!
* \brief Types of modulations and associated modulation order.
*/
typedef enum SRSLTE_API {
BPSK, /*!< \brief pi/2-BPSK. */
QPSK, /*!< \brief QPSK. */
QAM16, /*!< \brief QAM16. */
QAM64, /*!< \brief QAM64. */
QAM256 /*!< \brief QAM256. */
} mod_type_t;
/*! /*!
* \brief Describes a rate matcher or rate dematcher (K, F are ignored at rate matcher) * \brief Describes a rate matcher or rate dematcher (K, F are ignored at rate matcher)
*/ */
@ -90,7 +80,7 @@ SRSLTE_API int srslte_ldpc_rm_tx(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref); const uint32_t Nref);
/*! /*!
@ -125,7 +115,7 @@ SRSLTE_API int srslte_ldpc_rm_rx_f(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref); const uint32_t Nref);
/*! /*!
@ -159,7 +149,7 @@ SRSLTE_API int srslte_ldpc_rm_rx_s(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref); const uint32_t Nref);
/*! /*!
@ -194,7 +184,7 @@ SRSLTE_API int srslte_ldpc_rm_rx_c(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref); const uint32_t Nref);
/*! /*!

@ -62,7 +62,7 @@ static const uint32_t BASEN[2] = {66, 50};
static const uint32_t BASEK[2] = {22, 10}; static const uint32_t BASEK[2] = {22, 10};
/*! /*!
* \brief Look-up table: Retuns the mod order associated to a mod_type_t * \brief Look-up table: Retuns the mod order associated to a srslte_mod_t
* *
*/ */
static const uint32_t MODORD[5] = {1, 2, 4, 6, 8}; static const uint32_t MODORD[5] = {1, 2, 4, 6, 8};
@ -116,14 +116,14 @@ struct pRM_rx_c {
/*! /*!
* Initialize rate-matching parameters * Initialize rate-matching parameters
*/ */
static int init_rm(srslte_ldpc_rm_t* p, static int init_rm(srslte_ldpc_rm_t* p,
const uint32_t E, const uint32_t E,
const uint32_t F, const uint32_t F,
const uint32_t bg, const uint32_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref) const uint32_t Nref)
{ {
if (p == NULL) { if (p == NULL) {
return -1; return -1;
@ -574,7 +574,7 @@ int srslte_ldpc_rm_tx(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref) const uint32_t Nref)
{ {
@ -605,7 +605,7 @@ int srslte_ldpc_rm_rx_f(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref) const uint32_t Nref)
{ {
@ -637,7 +637,7 @@ int srslte_ldpc_rm_rx_s(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref) const uint32_t Nref)
{ {
@ -670,7 +670,7 @@ int srslte_ldpc_rm_rx_c(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg, const srslte_basegraph_t bg,
const uint32_t ls, const uint32_t ls,
const uint8_t rv, const uint8_t rv,
const mod_type_t mod_type, const srslte_mod_t mod_type,
const uint32_t Nref) const uint32_t Nref)
{ {

@ -60,14 +60,15 @@
#include "srslte/phy/utils/random.h" #include "srslte/phy/utils/random.h"
#include "srslte/phy/utils/vector.h" #include "srslte/phy/utils/vector.h"
static srslte_basegraph_t base_graph = BG1; /*!< \brief Base Graph (BG1 or BG2). */ static srslte_basegraph_t base_graph = BG1; /*!< \brief Base Graph (BG1 or BG2). */
static uint32_t lift_size = 2; /*!< \brief Lifting Size. */ static uint32_t lift_size = 2; /*!< \brief Lifting Size. */
static uint32_t rm_length = 0; /*!< \brief Codeword length after rate matching. */ static uint32_t rm_length = 0; /*!< \brief Codeword length after rate matching. */
static uint32_t F = 22 - 5; /*!< \brief Number of filler bits in each CBS. */ static uint32_t F = 22 - 5; /*!< \brief Number of filler bits in each CBS. */
static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */ static uint32_t E = 14000; /*!< \brief Rate-matched Codeword size. */
static mod_type_t mod_type = BPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256 = 4 */ static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */
static uint32_t Nref = 0; /*!< \brief Limited buffer size. */ static srslte_mod_t mod_type = SRSLTE_MOD_BPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256 = 4 */
static float snr = 0; /*!< \brief Signal-to-Noise Ratio [dB]. */ static uint32_t Nref = 0; /*!< \brief Limited buffer size. */
static float snr = 0; /*!< \brief Signal-to-Noise Ratio [dB]. */
static int finalK = 0; /*!< \brief Number of uncoded bits (message length, including punctured and filler bits). */ static int finalK = 0; /*!< \brief Number of uncoded bits (message length, including punctured and filler bits). */
static int finalN = 0; /*!< \brief Number of coded bits (codeword length). */ static int finalN = 0; /*!< \brief Number of coded bits (codeword length). */
@ -121,7 +122,7 @@ void parse_args(int argc, char** argv)
rv = (uint8_t)strtol(optarg, NULL, 10); rv = (uint8_t)strtol(optarg, NULL, 10);
break; break;
case 'm': case 'm':
mod_type = (mod_type_t)strtol(optarg, NULL, 10); mod_type = (srslte_mod_t)strtol(optarg, NULL, 10);
break; break;
case 'M': case 'M':
Nref = (uint32_t)strtol(optarg, NULL, 10); Nref = (uint32_t)strtol(optarg, NULL, 10);

@ -53,14 +53,14 @@
#include "srslte/phy/utils/random.h" #include "srslte/phy/utils/random.h"
#include "srslte/phy/utils/vector.h" #include "srslte/phy/utils/vector.h"
static srslte_basegraph_t base_graph = BG2; /*!< \brief Base Graph (BG1 or BG2). */ static srslte_basegraph_t base_graph = BG2; /*!< \brief Base Graph (BG1 or BG2). */
static uint32_t lift_size = 208; /*!< \brief Lifting Size. */ static uint32_t lift_size = 208; /*!< \brief Lifting Size. */
static uint32_t C = 2; /*!< \brief Number of code block segments (CBS). */ static uint32_t C = 2; /*!< \brief Number of code block segments (CBS). */
static uint32_t F = 10; /*!< \brief Number of filler bits in each CBS. */ static uint32_t F = 10; /*!< \brief Number of filler bits in each CBS. */
static uint32_t E = 0; /*!< \brief Rate-matched codeword size (E = 0, no rate matching). */ static uint32_t E = 0; /*!< \brief Rate-matched codeword size (E = 0, no rate matching). */
static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */ static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */
static mod_type_t mod_type = QPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256. */ static srslte_mod_t mod_type = SRSLTE_MOD_QPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256. */
static uint32_t Nref = 0; /*!< \brief Limited buffer size.*/ static uint32_t Nref = 0; /*!< \brief Limited buffer size.*/
static uint32_t N = 0; /*!< \brief Codeblock size (including punctured and filler bits). */ static uint32_t N = 0; /*!< \brief Codeblock size (including punctured and filler bits). */
static uint32_t K = 0; /*!< \brief Codeword size. */ static uint32_t K = 0; /*!< \brief Codeword size. */
@ -104,7 +104,7 @@ void parse_args(int argc, char** argv)
rv = (uint8_t)strtol(optarg, NULL, 10); rv = (uint8_t)strtol(optarg, NULL, 10);
break; break;
case 'm': case 'm':
mod_type = (mod_type_t)strtol(optarg, NULL, 10); mod_type = (srslte_mod_t)strtol(optarg, NULL, 10);
break; break;
case 'M': case 'M':
Nref = (uint32_t)strtol(optarg, NULL, 10); Nref = (uint32_t)strtol(optarg, NULL, 10);

Loading…
Cancel
Save