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-03-03 15:54:02 -08:00
|
|
|
#ifndef _cfo_
|
|
|
|
#define _cfo_
|
2014-01-28 03:41:17 -08:00
|
|
|
|
|
|
|
#include <complex.h>
|
|
|
|
|
2014-03-03 15:54:02 -08:00
|
|
|
typedef _Complex float cf_t;
|
|
|
|
|
|
|
|
/** If the frequency is changed more than the tolerance, a new table is generated */
|
|
|
|
#define CFO_TOLERANCE 0.00001
|
|
|
|
|
|
|
|
#define CFO_CEXPTAB_SIZE 4096
|
|
|
|
|
2014-01-28 03:41:17 -08:00
|
|
|
typedef struct {
|
2014-03-03 15:54:02 -08:00
|
|
|
float last_freq;
|
|
|
|
float tol;
|
|
|
|
int nsamples;
|
|
|
|
cexptab_t tab;
|
|
|
|
cf_t *cur_cexp;
|
|
|
|
}cfo_t;
|
|
|
|
|
|
|
|
int cfo_init(cfo_t *h, int nsamples);
|
|
|
|
void cfo_free(cfo_t *h);
|
|
|
|
|
|
|
|
void cfo_set_tol(cfo_t *h, float tol);
|
|
|
|
void cfo_correct(cfo_t *h, cf_t *x, float freq);
|
2014-01-28 03:41:17 -08:00
|
|
|
|
|
|
|
#endif
|