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.
115 lines
3.6 KiB
C
115 lines
3.6 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: pbch.h
|
||
|
*
|
||
10 years ago
|
* Description: Physical broadcast channel. If cell.nof_ports = 0, the number
|
||
|
* of ports is blindly determined using the CRC of the received
|
||
|
* codeword for 1, 2 and 4 ports
|
||
10 years ago
|
*
|
||
|
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.6
|
||
|
*****************************************************************************/
|
||
11 years ago
|
|
||
|
#ifndef PBCH_
|
||
|
#define PBCH_
|
||
|
|
||
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"
|
||
|
#include "srslte/phy/fec/rm_conv.h"
|
||
|
#include "srslte/phy/fec/convcoder.h"
|
||
|
#include "srslte/phy/fec/viterbi.h"
|
||
|
#include "srslte/phy/fec/crc.h"
|
||
11 years ago
|
|
||
10 years ago
|
#define SRSLTE_BCH_PAYLOAD_LEN 24
|
||
|
#define SRSLTE_BCH_PAYLOADCRC_LEN (SRSLTE_BCH_PAYLOAD_LEN+16)
|
||
|
#define SRSLTE_BCH_ENCODED_LEN 3*(SRSLTE_BCH_PAYLOADCRC_LEN)
|
||
11 years ago
|
|
||
|
/* PBCH object */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
srslte_cell_t cell;
|
||
11 years ago
|
|
||
11 years ago
|
uint32_t nof_symbols;
|
||
11 years ago
|
|
||
11 years ago
|
/* buffers */
|
||
10 years ago
|
cf_t *ce[SRSLTE_MAX_PORTS];
|
||
10 years ago
|
cf_t *symbols[SRSLTE_MAX_PORTS];
|
||
|
cf_t *x[SRSLTE_MAX_PORTS];
|
||
|
cf_t *d;
|
||
|
float *llr;
|
||
11 years ago
|
float *temp;
|
||
10 years ago
|
float rm_f[SRSLTE_BCH_ENCODED_LEN];
|
||
10 years ago
|
uint8_t *rm_b;
|
||
10 years ago
|
uint8_t data[SRSLTE_BCH_PAYLOADCRC_LEN];
|
||
|
uint8_t data_enc[SRSLTE_BCH_ENCODED_LEN];
|
||
11 years ago
|
|
||
11 years ago
|
uint32_t frame_idx;
|
||
11 years ago
|
|
||
11 years ago
|
/* tx & rx objects */
|
||
10 years ago
|
srslte_modem_table_t mod;
|
||
10 years ago
|
srslte_sequence_t seq;
|
||
10 years ago
|
srslte_viterbi_t decoder;
|
||
|
srslte_crc_t crc;
|
||
|
srslte_convcoder_t encoder;
|
||
10 years ago
|
bool search_all_ports;
|
||
10 years ago
|
|
||
10 years ago
|
} srslte_pbch_t;
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_pbch_init(srslte_pbch_t *q,
|
||
10 years ago
|
srslte_cell_t cell);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_pbch_free(srslte_pbch_t *q);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_pbch_decode(srslte_pbch_t *q,
|
||
11 years ago
|
cf_t *slot1_symbols,
|
||
10 years ago
|
cf_t *ce_slot1[SRSLTE_MAX_PORTS],
|
||
10 years ago
|
float noise_estimate,
|
||
10 years ago
|
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||
10 years ago
|
uint32_t *nof_tx_ports,
|
||
9 years ago
|
int *sfn_offset);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_pbch_encode(srslte_pbch_t *q,
|
||
10 years ago
|
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN],
|
||
9 years ago
|
cf_t *slot1_symbols[SRSLTE_MAX_PORTS],
|
||
|
uint32_t frame_idx);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_pbch_decode_reset(srslte_pbch_t *q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_pbch_mib_unpack(uint8_t *msg,
|
||
10 years ago
|
srslte_cell_t *cell,
|
||
10 years ago
|
uint32_t *sfn);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_pbch_mib_pack(srslte_cell_t *cell,
|
||
10 years ago
|
uint32_t sfn,
|
||
|
uint8_t *msg);
|
||
|
|
||
11 years ago
|
#endif // PBCH_
|