Removed modulation enum from LDPC RM

This commit is contained in:
Xavier Arteaga 2020-11-03 09:18:48 +01:00 committed by Andre Puschmann
parent a8074fe39d
commit 0439161de6
5 changed files with 47 additions and 54 deletions

View File

@ -185,8 +185,7 @@ typedef enum SRSLTE_API {
} srslte_phich_r_t;
/// LTE duplex modes.
typedef enum SRSLTE_API
{
typedef enum SRSLTE_API {
/// FDD uses frame structure type 1.
SRSLTE_FDD = 0,
/// TDD uses frame structure type 2.
@ -276,12 +275,15 @@ typedef enum SRSLTE_API {
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,
SRSLTE_MOD_QPSK,
SRSLTE_MOD_16QAM,
SRSLTE_MOD_64QAM,
SRSLTE_MOD_256QAM,
SRSLTE_MOD_BPSK = 0, /*!< \brief pi/2-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;

View File

@ -32,19 +32,9 @@
#ifndef SRSLTE_LDPCRM_H
#define SRSLTE_LDPCRM_H
#include "srslte/phy/common/phy_common.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)
*/
@ -90,7 +80,7 @@ SRSLTE_API int srslte_ldpc_rm_tx(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg,
const uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
const uint32_t Nref);
/*!

View File

@ -62,7 +62,7 @@ static const uint32_t BASEN[2] = {66, 50};
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};
@ -122,7 +122,7 @@ static int init_rm(srslte_ldpc_rm_t* p,
const uint32_t bg,
const uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
const uint32_t Nref)
{
if (p == NULL) {
@ -574,7 +574,7 @@ int srslte_ldpc_rm_tx(srslte_ldpc_rm_t* q,
const srslte_basegraph_t bg,
const uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
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 uint32_t ls,
const uint8_t rv,
const mod_type_t mod_type,
const srslte_mod_t mod_type,
const uint32_t Nref)
{

View File

@ -64,8 +64,9 @@ static srslte_basegraph_t base_graph = BG1; /*!< \brief Base Graph (BG1 or BG
static uint32_t lift_size = 2; /*!< \brief Lifting Size. */
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 E = 14000; /*!< \brief Rate-matched Codeword size. */
static uint8_t rv = 0; /*!< \brief Redundancy version {0-3}. */
static mod_type_t mod_type = BPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256 = 4 */
static srslte_mod_t mod_type = SRSLTE_MOD_BPSK; /*!< \brief Modulation type: BPSK, QPSK, QAM16, QAM64, QAM256 = 4 */
static uint32_t Nref = 0; /*!< \brief Limited buffer size. */
static float snr = 0; /*!< \brief Signal-to-Noise Ratio [dB]. */
@ -121,7 +122,7 @@ void parse_args(int argc, char** argv)
rv = (uint8_t)strtol(optarg, NULL, 10);
break;
case 'm':
mod_type = (mod_type_t)strtol(optarg, NULL, 10);
mod_type = (srslte_mod_t)strtol(optarg, NULL, 10);
break;
case 'M':
Nref = (uint32_t)strtol(optarg, NULL, 10);

View File

@ -59,7 +59,7 @@ static uint32_t C = 2; /*!< \brief Number of code block se
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 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 N = 0; /*!< \brief Codeblock size (including punctured and filler bits). */
@ -104,7 +104,7 @@ void parse_args(int argc, char** argv)
rv = (uint8_t)strtol(optarg, NULL, 10);
break;
case 'm':
mod_type = (mod_type_t)strtol(optarg, NULL, 10);
mod_type = (srslte_mod_t)strtol(optarg, NULL, 10);
break;
case 'M':
Nref = (uint32_t)strtol(optarg, NULL, 10);