srsLTE/lib/include/srsran/phy/sync/psss.h

71 lines
1.7 KiB
C
Raw Normal View History

/**
2019-10-11 03:10:07 -07:00
*
* \section COPYRIGHT
2019-10-11 03:10:07 -07:00
*
2021-03-19 03:45:56 -07:00
* Copyright 2013-2021 Software Radio Systems Limited
2019-10-11 03:10:07 -07:00
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
2019-10-11 03:10:07 -07:00
*
*/
/******************************************************************************
* File: psss.h
*
* Description: Primary sidelink synchronization signal (PSSS) generation and detection.
*
*
* Reference: 3GPP TS 36.211 version 15.6.0 Release 15 Sec. 9.7.1
*****************************************************************************/
2021-03-19 03:45:56 -07:00
#ifndef SRSRAN_PSSS_H
#define SRSRAN_PSSS_H
2019-10-11 03:10:07 -07:00
#include <stdbool.h>
#include <stdint.h>
2021-03-19 03:45:56 -07:00
#include "srsran/config.h"
#include "srsran/phy/common/phy_common.h"
#include "srsran/phy/dft/dft.h"
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
#define SRSRAN_PSSS_LEN 62
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
typedef struct SRSRAN_API {
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
cf_t psss_signal[2][SRSRAN_PSSS_LEN]; // One sequence for each N_id_2
2019-10-11 03:10:07 -07:00
cf_t** psss_sf_freq;
cf_t* input_pad_freq;
cf_t* input_pad_time;
cf_t* dot_prod_output;
cf_t* dot_prod_output_time;
cf_t* shifted_output;
float* shifted_output_abs;
int32_t corr_peak_pos;
float corr_peak_value;
uint32_t N_id_2;
2021-03-19 03:45:56 -07:00
srsran_dft_plan_t plan_input;
srsran_dft_plan_t plan_out;
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
} srsran_psss_t;
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_psss_init(srsran_psss_t* q, uint32_t nof_prb, srsran_cp_t cp);
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_psss_generate(cf_t* psss_signal, uint32_t N_id_2);
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API void srsran_psss_put_sf_buffer(cf_t* psss_signal, cf_t* sf_buffer, uint32_t nof_prb, srsran_cp_t cp);
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API int srsran_psss_find(srsran_psss_t* q, cf_t* input, uint32_t nof_prb, srsran_cp_t cp);
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
SRSRAN_API void srsran_psss_free(srsran_psss_t* q);
2019-10-11 03:10:07 -07:00
2021-03-19 03:45:56 -07:00
#endif // SRSRAN_PSSS_H