2014-03-03 11:09:26 -08:00
|
|
|
/**
|
2014-01-28 03:41:17 -08:00
|
|
|
*
|
2014-03-03 11:09:26 -08:00
|
|
|
* \section COPYRIGHT
|
2014-01-28 03:41:17 -08:00
|
|
|
*
|
2014-03-03 11:09:26 -08:00
|
|
|
* Copyright 2013-2014 The libLTE Developers. See the
|
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
|
|
|
* This file is part of the libLTE library.
|
|
|
|
*
|
|
|
|
* libLTE is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* libLTE is distributed in the hope that it will be useful,
|
2014-01-28 03:41:17 -08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
2014-03-03 11:09:26 -08:00
|
|
|
* A copy of the GNU Lesser General Public License can be found in
|
|
|
|
* the LICENSE file in the top-level directory of this distribution
|
|
|
|
* and at http://www.gnu.org/licenses/.
|
|
|
|
*
|
2014-01-28 03:41:17 -08:00
|
|
|
*/
|
|
|
|
|
2014-03-03 11:09:26 -08:00
|
|
|
|
2014-01-28 03:41:17 -08:00
|
|
|
#ifndef SYNC_
|
|
|
|
#define SYNC_
|
|
|
|
|
|
|
|
#include "pss.h"
|
|
|
|
#include "sss.h"
|
|
|
|
#include "sfo.h"
|
|
|
|
|
|
|
|
enum sync_pss_det { ABSOLUTE, PEAK_MEAN};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
pss_synch_t pss[3]; // One for each N_id_2
|
|
|
|
sss_synch_t sss[3]; // One for each N_id_2
|
|
|
|
enum sync_pss_det pss_mode;
|
|
|
|
float threshold;
|
|
|
|
float peak_to_avg;
|
|
|
|
int force_N_id_2;
|
|
|
|
int N_id_2;
|
|
|
|
int N_id_1;
|
|
|
|
int slot_id;
|
|
|
|
float cfo;
|
|
|
|
}sync_t;
|
|
|
|
|
2014-03-03 11:09:26 -08:00
|
|
|
int sync_run(sync_t *q, cf_t *input);
|
2014-01-28 03:41:17 -08:00
|
|
|
float sync_get_cfo(sync_t *q);
|
|
|
|
void sync_pss_det_absolute(sync_t *q);
|
|
|
|
void sync_pss_det_peakmean(sync_t *q);
|
|
|
|
void sync_force_N_id_2(sync_t *q, int force_N_id_2);
|
|
|
|
int sync_get_slot_id(sync_t *q);
|
|
|
|
float sync_get_peak_to_avg(sync_t *q);
|
|
|
|
int sync_get_N_id_2(sync_t *q);
|
|
|
|
int sync_get_N_id_1(sync_t *q);
|
|
|
|
int sync_get_cell_id(sync_t *q);
|
|
|
|
void sync_set_threshold(sync_t *q, float threshold);
|
2014-01-30 06:45:59 -08:00
|
|
|
int sync_init(sync_t *q, int frame_size);
|
2014-01-28 03:41:17 -08:00
|
|
|
void sync_free(sync_t *q);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|