2014-03-27 09:31:25 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
2015-11-13 04:22:33 -08:00
|
|
|
* Copyright 2013-2015 Software Radio Systems Limited
|
2014-03-27 09:31:25 -07:00
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* This file is part of the srsLTE library.
|
2014-03-27 09:31:25 -07:00
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* 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
|
2014-03-27 09:31:25 -07:00
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
2014-03-27 09:31:25 -07: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-03-27 09:31:25 -07:00
|
|
|
*
|
2015-05-08 08:05:40 -07:00
|
|
|
* A copy of the GNU Affero General Public License can be found in
|
2014-03-27 09:31:25 -07:00
|
|
|
* the LICENSE file in the top-level directory of this distribution
|
|
|
|
* and at http://www.gnu.org/licenses/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-04-03 05:49:12 -07:00
|
|
|
/******************************************************************************
|
|
|
|
* File: pcfich.h
|
|
|
|
*
|
|
|
|
* Description: Physical control format indicator channel
|
|
|
|
*
|
|
|
|
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.7
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSLTE_PCFICH_H
|
|
|
|
#define SRSLTE_PCFICH_H
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2017-05-18 00:48:24 -07:00
|
|
|
#include "srslte/phy/common/phy_common.h"
|
|
|
|
#include "srslte/phy/mimo/precoding.h"
|
|
|
|
#include "srslte/phy/mimo/layermap.h"
|
|
|
|
#include "srslte/phy/modem/mod.h"
|
|
|
|
#include "srslte/phy/modem/demod_soft.h"
|
|
|
|
#include "srslte/phy/scrambling/scrambling.h"
|
|
|
|
#include "srslte/phy/phch/regs.h"
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2014-12-17 16:30:31 -08:00
|
|
|
#define PCFICH_CFI_LEN 32
|
|
|
|
#define PCFICH_RE PCFICH_CFI_LEN/2
|
2014-03-27 09:31:25 -07:00
|
|
|
|
|
|
|
/* PCFICH object */
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2015-03-18 05:41:50 -07:00
|
|
|
srslte_cell_t cell;
|
2014-06-17 02:11:41 -07:00
|
|
|
int nof_symbols;
|
2017-02-17 00:58:37 -08:00
|
|
|
|
|
|
|
uint32_t nof_rx_antennas;
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
/* handler to REGs resource mapper */
|
2015-03-18 11:14:24 -07:00
|
|
|
srslte_regs_t *regs;
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
/* buffers */
|
2017-02-17 00:58:37 -08:00
|
|
|
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][PCFICH_RE];
|
2015-03-18 11:14:24 -07:00
|
|
|
cf_t symbols[SRSLTE_MAX_PORTS][PCFICH_RE];
|
|
|
|
cf_t x[SRSLTE_MAX_PORTS][PCFICH_RE];
|
|
|
|
cf_t d[PCFICH_RE];
|
2014-12-17 16:30:31 -08:00
|
|
|
|
|
|
|
// cfi table in floats
|
|
|
|
float cfi_table_float[3][PCFICH_CFI_LEN];
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
/* bit message */
|
2014-10-17 11:44:01 -07:00
|
|
|
uint8_t data[PCFICH_CFI_LEN];
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2014-12-17 16:30:31 -08:00
|
|
|
/* received soft bits */
|
|
|
|
float data_f[PCFICH_CFI_LEN];
|
|
|
|
|
2014-06-17 02:11:41 -07:00
|
|
|
/* tx & rx objects */
|
2015-09-21 10:31:42 -07:00
|
|
|
srslte_modem_table_t mod;
|
2015-03-18 11:14:24 -07:00
|
|
|
srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME];
|
2016-04-08 08:04:01 -07:00
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
} srslte_pcfich_t;
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2017-09-05 06:26:36 -07:00
|
|
|
SRSLTE_API int srslte_pcfich_init(srslte_pcfich_t *q,
|
|
|
|
uint32_t nof_rx_antennas);
|
2017-02-17 00:58:37 -08:00
|
|
|
|
2017-09-01 04:29:11 -07:00
|
|
|
SRSLTE_API int srslte_pcfich_set_cell(srslte_pcfich_t *q,
|
|
|
|
srslte_regs_t *regs,
|
|
|
|
srslte_cell_t cell);
|
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API void srslte_pcfich_free(srslte_pcfich_t *q);
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API int srslte_pcfich_decode(srslte_pcfich_t *q,
|
2014-06-29 10:51:25 -07:00
|
|
|
cf_t *sf_symbols,
|
2015-03-18 05:41:50 -07:00
|
|
|
cf_t *ce[SRSLTE_MAX_PORTS],
|
2014-11-13 07:14:22 -08:00
|
|
|
float noise_estimate,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t subframe,
|
|
|
|
uint32_t *cfi,
|
2014-12-17 16:30:31 -08:00
|
|
|
float *corr_result);
|
2014-06-29 10:51:25 -07:00
|
|
|
|
2017-02-17 00:58:37 -08:00
|
|
|
SRSLTE_API int srslte_pcfich_decode_multi(srslte_pcfich_t *q,
|
|
|
|
cf_t *sf_symbols[SRSLTE_MAX_PORTS],
|
|
|
|
cf_t *ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
|
|
|
|
float noise_estimate,
|
|
|
|
uint32_t subframe,
|
|
|
|
uint32_t *cfi,
|
|
|
|
float *corr_result);
|
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API int srslte_pcfich_encode(srslte_pcfich_t *q,
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t cfi,
|
2015-03-18 05:41:50 -07:00
|
|
|
cf_t *sf_symbols[SRSLTE_MAX_PORTS],
|
2014-07-01 01:48:51 -07:00
|
|
|
uint32_t subframe);
|
2014-03-27 09:31:25 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSLTE_PCFICH_H
|