srsLTE/lib/include/srslte/phy/modem/modem_table.h

87 lines
2.6 KiB
C
Raw Normal View History

/**
2014-01-28 03:41:17 -08:00
*
* \section COPYRIGHT
2014-01-28 03:41:17 -08:00
*
2015-11-13 04:22:33 -08:00
* Copyright 2013-2015 Software Radio Systems Limited
*
* \section LICENSE
*
* This file is part of the srsLTE library.
*
* srsLTE is free software: you can redistribute it and/or modify
2015-05-08 08:05:40 -07:00
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
2014-01-28 03:41:17 -08:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015-05-08 08:05:40 -07:00
* GNU Affero General Public License for more details.
2014-01-28 03:41:17 -08:00
*
2015-05-08 08:05:40 -07:00
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
2014-01-28 03:41:17 -08:00
*/
/******************************************************************************
* File: modem_table.h
*
* Description: Modem tables used for modulation/demodulation.
* Supports BPSK, QPSK, 16QAM and 64QAM.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 7.1
*****************************************************************************/
2018-03-31 10:04:04 -07:00
#ifndef SRSLTE_MODEM_TABLE_H
#define SRSLTE_MODEM_TABLE_H
2014-01-28 03:41:17 -08:00
#include <stdbool.h>
#include <complex.h>
#include <stdint.h>
2017-05-18 00:48:24 -07:00
#include "srslte/phy/common/phy_common.h"
#include "srslte/config.h"
2015-09-18 15:17:19 -07:00
typedef struct {
cf_t symbol[8];
} bpsk_packed_t;
2015-09-18 13:47:37 -07:00
typedef struct {
cf_t symbol[4];
} qpsk_packed_t;
typedef struct {
cf_t symbol[2];
} qam16_packed_t;
typedef struct SRSLTE_API {
2015-09-18 13:47:37 -07:00
cf_t* symbol_table; // bit-to-symbol mapping
uint32_t nsymbols; // number of modulation symbols
uint32_t nbits_x_symbol; // number of bits per symbol
bool byte_tables_init;
2015-09-18 15:17:19 -07:00
bpsk_packed_t *symbol_table_bpsk;
2015-09-18 13:47:37 -07:00
qpsk_packed_t *symbol_table_qpsk;
qam16_packed_t *symbol_table_16qam;
}srslte_modem_table_t;
2014-01-28 03:41:17 -08:00
SRSLTE_API void srslte_modem_table_init(srslte_modem_table_t* q);
SRSLTE_API void srslte_modem_table_free(srslte_modem_table_t* q);
SRSLTE_API void srslte_modem_table_reset(srslte_modem_table_t* q);
SRSLTE_API int srslte_modem_table_set(srslte_modem_table_t* q,
2015-03-18 11:14:24 -07:00
cf_t* table,
uint32_t nsymbols,
uint32_t nbits_x_symbol);
SRSLTE_API int srslte_modem_table_lte(srslte_modem_table_t* q,
srslte_mod_t modulation);
2014-01-28 03:41:17 -08:00
2015-09-18 13:47:37 -07:00
SRSLTE_API void srslte_modem_table_bytes(srslte_modem_table_t* q);
2018-03-31 10:04:04 -07:00
#endif // SRSLTE_MODEM_TABLE_H