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.
157 lines
5.3 KiB
C
157 lines
5.3 KiB
C
11 years ago
|
/**
|
||
11 years ago
|
*
|
||
11 years ago
|
* \section COPYRIGHT
|
||
11 years ago
|
*
|
||
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/.
|
||
|
*
|
||
11 years ago
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: sss.h
|
||
|
*
|
||
|
* Description: Secondary synchronization signal (SSS) generation and detection.
|
||
|
*
|
||
|
*
|
||
|
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 6.11.2
|
||
|
*****************************************************************************/
|
||
11 years ago
|
|
||
11 years ago
|
#ifndef SSS_
|
||
|
#define SSS_
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
8 years ago
|
#include "srslte/phy/common/phy_common.h"
|
||
|
#include "srslte/phy/dft/dft.h"
|
||
11 years ago
|
|
||
|
|
||
10 years ago
|
#define SRSLTE_SSS_N 31
|
||
|
#define SRSLTE_SSS_LEN 2*SRSLTE_SSS_N
|
||
11 years ago
|
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
|
int z1[SRSLTE_SSS_N][SRSLTE_SSS_N];
|
||
|
int c[2][SRSLTE_SSS_N];
|
||
|
int s[SRSLTE_SSS_N][SRSLTE_SSS_N];
|
||
|
}srslte_sss_tables_t;
|
||
11 years ago
|
|
||
|
/* Allocate 32 complex to make it multiple of 32-byte AVX instructions alignment requirement.
|
||
10 years ago
|
* Should use srslte_vec_malloc() to make it platform agnostic.
|
||
11 years ago
|
*/
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
|
float z1[SRSLTE_SSS_N][SRSLTE_SSS_N];
|
||
|
float c[2][SRSLTE_SSS_N];
|
||
|
float s[SRSLTE_SSS_N][SRSLTE_SSS_N];
|
||
|
float sd[SRSLTE_SSS_N][SRSLTE_SSS_N-1];
|
||
|
}srslte_sss_fc_tables_t;
|
||
11 years ago
|
|
||
|
|
||
|
/* Low-level API */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
11 years ago
|
|
||
10 years ago
|
srslte_dft_plan_t dftp_input;
|
||
10 years ago
|
|
||
|
uint32_t fft_size;
|
||
11 years ago
|
|
||
11 years ago
|
float corr_peak_threshold;
|
||
10 years ago
|
uint32_t symbol_sz;
|
||
|
uint32_t subframe_sz;
|
||
|
uint32_t N_id_2;
|
||
|
|
||
|
uint32_t N_id_1_table[30][30];
|
||
10 years ago
|
srslte_sss_fc_tables_t fc_tables[3]; // one for each N_id_2
|
||
11 years ago
|
|
||
10 years ago
|
float corr_output_m0[SRSLTE_SSS_N];
|
||
|
float corr_output_m1[SRSLTE_SSS_N];
|
||
10 years ago
|
|
||
10 years ago
|
}srslte_sss_synch_t;
|
||
11 years ago
|
|
||
|
|
||
|
/* Basic functionality */
|
||
10 years ago
|
SRSLTE_API int srslte_sss_synch_init(srslte_sss_synch_t *q,
|
||
|
uint32_t fft_size);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_realloc(srslte_sss_synch_t *q,
|
||
|
uint32_t fft_size);
|
||
|
|
||
|
SRSLTE_API void srslte_sss_synch_free(srslte_sss_synch_t *q);
|
||
|
|
||
|
SRSLTE_API void srslte_sss_generate(float *signal0,
|
||
|
float *signal5,
|
||
|
uint32_t cell_id);
|
||
|
|
||
|
SRSLTE_API void srslte_sss_put_slot(float *sss,
|
||
|
cf_t *symbol,
|
||
|
uint32_t nof_prb,
|
||
|
srslte_cp_t cp);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_set_N_id_2(srslte_sss_synch_t *q,
|
||
|
uint32_t N_id_2);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_m0m1_partial(srslte_sss_synch_t *q,
|
||
|
cf_t *input,
|
||
|
uint32_t M,
|
||
|
cf_t ce[2*SRSLTE_SSS_N],
|
||
|
uint32_t *m0,
|
||
|
float *m0_value,
|
||
|
uint32_t *m1,
|
||
|
float *m1_value);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_m0m1_diff_coh(srslte_sss_synch_t *q,
|
||
|
cf_t *input,
|
||
|
cf_t ce[2*SRSLTE_SSS_N],
|
||
|
uint32_t *m0,
|
||
|
float *m0_value,
|
||
|
uint32_t *m1,
|
||
|
float *m1_value);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_m0m1_diff(srslte_sss_synch_t *q,
|
||
|
cf_t *input,
|
||
|
uint32_t *m0,
|
||
|
float *m0_value,
|
||
|
uint32_t *m1,
|
||
|
float *m1_value);
|
||
|
|
||
|
|
||
|
SRSLTE_API uint32_t srslte_sss_synch_subframe(uint32_t m0,
|
||
|
uint32_t m1);
|
||
|
|
||
|
SRSLTE_API int srslte_sss_synch_N_id_1(srslte_sss_synch_t *q,
|
||
|
uint32_t m0,
|
||
10 years ago
|
uint32_t m1);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_sss_synch_frame(srslte_sss_synch_t *q,
|
||
|
cf_t *input,
|
||
|
uint32_t *subframe_idx,
|
||
|
uint32_t *N_id_1);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_sss_synch_set_threshold(srslte_sss_synch_t *q,
|
||
|
float threshold);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_sss_synch_set_symbol_sz(srslte_sss_synch_t *q,
|
||
|
uint32_t symbol_sz);
|
||
11 years ago
|
|
||
10 years ago
|
SRSLTE_API void srslte_sss_synch_set_subframe_sz(srslte_sss_synch_t *q,
|
||
|
uint32_t subframe_sz);
|
||
11 years ago
|
|
||
11 years ago
|
#endif // SSS_
|
||
11 years ago
|
|