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.
135 lines
4.5 KiB
C
135 lines
4.5 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: ue_mib.h
|
||
|
*
|
||
|
* Description: This object decodes the MIB from the PBCH of an LTE signal.
|
||
|
*
|
||
|
* The function srslte_ue_mib_decode() shall be called multiple
|
||
|
* times, each passing a number of samples multiple of 19200,
|
||
|
* sampled at 1.92 MHz (that is, 10 ms of samples).
|
||
|
*
|
||
|
* The function uses the sync_t object to find the PSS sequence and
|
||
|
* decode the PBCH to obtain the MIB.
|
||
10 years ago
|
*
|
||
10 years ago
|
* The function returns 0 until the MIB is decoded.
|
||
|
*
|
||
|
* See ue_cell_detect.c for an example.
|
||
|
*
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
|
|
||
11 years ago
|
#ifndef UE_MIB_
|
||
|
#define UE_MIB_
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
8 years ago
|
#include "srslte/phy/ue/ue_sync.h"
|
||
|
#include "srslte/phy/sync/cfo.h"
|
||
|
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||
|
#include "srslte/phy/phch/pbch.h"
|
||
|
#include "srslte/phy/dft/ofdm.h"
|
||
11 years ago
|
|
||
|
|
||
10 years ago
|
#define SRSLTE_UE_MIB_NOF_PRB 6
|
||
11 years ago
|
|
||
10 years ago
|
#define SRSLTE_UE_MIB_FOUND 1
|
||
|
#define SRSLTE_UE_MIB_NOTFOUND 0
|
||
11 years ago
|
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
srslte_sync_t sfind;
|
||
10 years ago
|
|
||
10 years ago
|
cf_t *sf_symbols;
|
||
10 years ago
|
cf_t *ce[SRSLTE_MAX_PORTS];
|
||
11 years ago
|
|
||
10 years ago
|
srslte_ofdm_t fft;
|
||
10 years ago
|
srslte_chest_dl_t chest;
|
||
10 years ago
|
srslte_pbch_t pbch;
|
||
10 years ago
|
|
||
10 years ago
|
uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_LEN];
|
||
10 years ago
|
uint32_t nof_tx_ports;
|
||
|
uint32_t sfn_offset;
|
||
11 years ago
|
|
||
|
uint32_t frame_cnt;
|
||
10 years ago
|
} srslte_ue_mib_t;
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_mib_init(srslte_ue_mib_t *q,
|
||
|
srslte_cell_t cell);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_mib_free(srslte_ue_mib_t *q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_mib_reset(srslte_ue_mib_t * q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_mib_decode(srslte_ue_mib_t * q,
|
||
|
cf_t *input,
|
||
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);
|
||
10 years ago
|
|
||
10 years ago
|
|
||
10 years ago
|
/* This interface uses ue_mib and ue_sync to first get synchronized subframes
|
||
|
* and then decode MIB
|
||
10 years ago
|
*
|
||
|
* This object calls the pbch object with nof_ports=0 for blind nof_ports determination
|
||
10 years ago
|
*/
|
||
|
typedef struct {
|
||
10 years ago
|
srslte_ue_mib_t ue_mib;
|
||
|
srslte_ue_sync_t ue_sync;
|
||
8 years ago
|
cf_t *sf_buffer[SRSLTE_MAX_PORTS];
|
||
8 years ago
|
uint32_t nof_rx_antennas;
|
||
10 years ago
|
} srslte_ue_mib_sync_t;
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_mib_sync_init(srslte_ue_mib_sync_t *q,
|
||
|
uint32_t cell_id,
|
||
|
srslte_cp_t cp,
|
||
8 years ago
|
int (recv_callback)(void*, void*, uint32_t, srslte_timestamp_t *),
|
||
10 years ago
|
void *stream_handler);
|
||
11 years ago
|
|
||
8 years ago
|
SRSLTE_API int srslte_ue_mib_sync_init_multi(srslte_ue_mib_sync_t *q,
|
||
|
uint32_t cell_id,
|
||
|
srslte_cp_t cp,
|
||
|
int (recv_callback)(void*, cf_t*[SRSLTE_MAX_PORTS], uint32_t, srslte_timestamp_t *),
|
||
|
uint32_t nof_rx_antennas,
|
||
|
void *stream_handler);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_mib_sync_free(srslte_ue_mib_sync_t *q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_mib_sync_reset(srslte_ue_mib_sync_t * q);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_mib_sync_decode(srslte_ue_mib_sync_t * q,
|
||
|
uint32_t max_frames_timeout,
|
||
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
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif // SYNC_FRAME_
|
||
|
|