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.
140 lines
4.9 KiB
C
140 lines
4.9 KiB
C
11 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
9 years ago
|
* Copyright 2013-2015 Software Radio Systems Limited
|
||
11 years ago
|
*
|
||
|
* \section LICENSE
|
||
|
*
|
||
10 years ago
|
* This file is part of the srsLTE library.
|
||
11 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
11 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
11 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
11 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
11 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: phich.h
|
||
|
*
|
||
|
* Description: Physical Hybrid ARQ indicator channel.
|
||
|
*
|
||
|
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.9
|
||
|
*****************************************************************************/
|
||
11 years ago
|
|
||
|
#ifndef PHICH_
|
||
|
#define PHICH_
|
||
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
8 years ago
|
#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"
|
||
11 years ago
|
#include "regs.h"
|
||
|
|
||
10 years ago
|
|
||
11 years ago
|
|
||
10 years ago
|
#define SRSLTE_PHICH_NORM_NSEQUENCES 8
|
||
10 years ago
|
#define SRSLTE_PHICH_EXT_NSEQUENCES 4
|
||
|
#define SRSLTE_PHICH_NBITS 3
|
||
|
|
||
|
#define SRSLTE_PHICH_NORM_MSYMB SRSLTE_PHICH_NBITS * 4
|
||
|
#define SRSLTE_PHICH_EXT_MSYMB SRSLTE_PHICH_NBITS * 2
|
||
|
#define SRSLTE_PHICH_MAX_NSYMB SRSLTE_PHICH_NORM_MSYMB
|
||
|
#define SRSLTE_PHICH_NORM_C 1
|
||
|
#define SRSLTE_PHICH_EXT_C 2
|
||
|
#define SRSLTE_PHICH_NORM_NSF 4
|
||
|
#define SRSLTE_PHICH_EXT_NSF 2
|
||
11 years ago
|
|
||
|
/* phich object */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
srslte_cell_t cell;
|
||
11 years ago
|
|
||
8 years ago
|
uint32_t nof_rx_antennas;
|
||
|
|
||
11 years ago
|
/* handler to REGs resource mapper */
|
||
10 years ago
|
srslte_regs_t *regs;
|
||
11 years ago
|
|
||
11 years ago
|
/* buffers */
|
||
8 years ago
|
cf_t ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||
|
cf_t sf_symbols[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||
10 years ago
|
cf_t x[SRSLTE_MAX_PORTS][SRSLTE_PHICH_MAX_NSYMB];
|
||
|
cf_t d[SRSLTE_PHICH_MAX_NSYMB];
|
||
|
cf_t d0[SRSLTE_PHICH_MAX_NSYMB];
|
||
|
cf_t z[SRSLTE_PHICH_NBITS];
|
||
11 years ago
|
|
||
11 years ago
|
/* bit message */
|
||
10 years ago
|
uint8_t data[SRSLTE_PHICH_NBITS];
|
||
10 years ago
|
float data_rx[SRSLTE_PHICH_NBITS];
|
||
11 years ago
|
|
||
11 years ago
|
/* tx & rx objects */
|
||
10 years ago
|
srslte_modem_table_t mod;
|
||
10 years ago
|
srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME];
|
||
9 years ago
|
|
||
10 years ago
|
} srslte_phich_t;
|
||
|
|
||
|
SRSLTE_API int srslte_phich_init(srslte_phich_t *q,
|
||
|
srslte_regs_t *regs,
|
||
|
srslte_cell_t cell);
|
||
|
|
||
8 years ago
|
SRSLTE_API int srslte_phich_init_multi(srslte_phich_t *q,
|
||
|
srslte_regs_t *regs,
|
||
|
srslte_cell_t cell,
|
||
|
uint32_t nof_rx_antennas);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_phich_free(srslte_phich_t *q);
|
||
|
|
||
9 years ago
|
SRSLTE_API void srslte_phich_calc(srslte_phich_t *q,
|
||
|
uint32_t n_prb_lowest,
|
||
|
uint32_t n_dmrs,
|
||
|
uint32_t *ngroup,
|
||
|
uint32_t *nseq);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_phich_decode(srslte_phich_t *q,
|
||
|
cf_t *slot_symbols,
|
||
|
cf_t *ce[SRSLTE_MAX_PORTS],
|
||
|
float noise_estimate,
|
||
|
uint32_t ngroup,
|
||
|
uint32_t nseq,
|
||
|
uint32_t nsubframe,
|
||
|
uint8_t *ack,
|
||
10 years ago
|
float *distance);
|
||
10 years ago
|
|
||
8 years ago
|
SRSLTE_API int srslte_phich_decode_multi(srslte_phich_t *q,
|
||
|
cf_t *slot_symbols[SRSLTE_MAX_PORTS],
|
||
|
cf_t *ce[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
|
||
|
float noise_estimate,
|
||
|
uint32_t ngroup,
|
||
|
uint32_t nseq,
|
||
|
uint32_t nsubframe,
|
||
|
uint8_t *ack,
|
||
|
float *distance);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_phich_encode(srslte_phich_t *q,
|
||
|
uint8_t ack,
|
||
|
uint32_t ngroup,
|
||
|
uint32_t nseq,
|
||
|
uint32_t nsubframe,
|
||
|
cf_t *slot_symbols[SRSLTE_MAX_PORTS]);
|
||
|
|
||
|
SRSLTE_API void srslte_phich_reset(srslte_phich_t *q,
|
||
|
cf_t *slot_symbols[SRSLTE_MAX_PORTS]);
|
||
|
|
||
|
SRSLTE_API uint32_t srslte_phich_ngroups(srslte_phich_t *q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API uint32_t srslte_phich_nsf(srslte_phich_t *q);
|
||
|
|
||
11 years ago
|
#endif // PHICH_
|