GNU Radio's GFDM Package
auto_cross_corr_multicarrier_sync_cc.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2016 Johannes Demel.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22#ifndef INCLUDED_GFDM_AUTO_CROSS_CORR_MULTICARRIER_SYNC_CC_H
23#define INCLUDED_GFDM_AUTO_CROSS_CORR_MULTICARRIER_SYNC_CC_H
24
25#include <complex>
26#include <vector>
27#include <fftw3.h>
28#include <boost/shared_ptr.hpp>
29#include <stdexcept>
30
31#include "gfdm_kernel_utils.h"
32
33namespace gr {
34 namespace gfdm {
35
36 /*!
37 * \brief Simplified version of "Improved Preamble-Aided Timing Estimation for OFDM Systems"
38 *
39 */
41 {
42 public:
43 typedef std::complex<float> gfdm_complex;
44 typedef boost::shared_ptr<auto_cross_corr_multicarrier_sync_cc> sptr;
45
46 auto_cross_corr_multicarrier_sync_cc(int subcarriers, int cp_len, std::vector<gfdm_complex> preamble);
48
49 int detect_frame_start(const gfdm_complex *p_in, int ninput_size);
50 void cross_correlate_preamble(gfdm_complex* p_out, const gfdm_complex* p_in, const int ninput_size);
51 void fixed_lag_auto_correlate(gfdm_complex* p_out, const gfdm_complex* p_in, const int ninput_size);
52 int find_peak(float* vals, const int ninput_size);
54 void normalize_power_level(gfdm_complex* p_out, const gfdm_complex* p_in, const float norm_factor, const int ninput_size);
55 float last_cfo(){return d_last_cfo;};
56 float frame_phase(){return d_frame_phase;};
57 float preamble_attenuation(){ return d_preamble_attenuation;};
58 int subcarriers(){ return d_subcarriers;};
59 int cp_len(){ return d_cp_len;};
60 private:
61 int d_subcarriers;
62 int d_cp_len;
63 int d_buffer_len;
64
65 gfdm_complex* d_preamble;
66 gfdm_complex* d_auto_corr;
67 float* d_abs_auto_corr;
68 gfdm_complex* d_xcorr;
69 float* d_abs_xcorr;
70
71 float d_last_cfo;
72 float d_frame_phase;
73 float d_preamble_attenuation;
74
75 fftwf_plan d_fxc_plan;
76 fftwf_plan d_ixc_plan;
77 gfdm_complex* d_fxc_in;
78 gfdm_complex* d_fxc_out;
79 gfdm_complex* d_ixc_in;
80 gfdm_complex* d_ixc_out;
81 gfdm_complex* d_freq_preamble;
82
83 float d_reference_preamble_energy;
84
85 float calculate_normalized_cfo(const gfdm_complex corr_val);
86 void adjust_buffer_size(const int ninput_size);
87 };
88
89 } // namespace gfdm
90} // namespace gr
91
92#endif /* INCLUDED_GFDM_AUTO_CROSS_CORR_MULTICARRIER_SYNC_CC_H */
93
Simplified version of "Improved Preamble-Aided Timing Estimation for OFDM Systems".
Definition auto_cross_corr_multicarrier_sync_cc.h:41
int find_peak(float *vals, const int ninput_size)
float frame_phase()
Definition auto_cross_corr_multicarrier_sync_cc.h:56
std::complex< float > gfdm_complex
Definition auto_cross_corr_multicarrier_sync_cc.h:43
boost::shared_ptr< auto_cross_corr_multicarrier_sync_cc > sptr
Definition auto_cross_corr_multicarrier_sync_cc.h:44
int detect_frame_start(const gfdm_complex *p_in, int ninput_size)
float last_cfo()
Definition auto_cross_corr_multicarrier_sync_cc.h:55
float calculate_preamble_attenuation(const gfdm_complex *p_in)
void fixed_lag_auto_correlate(gfdm_complex *p_out, const gfdm_complex *p_in, const int ninput_size)
float preamble_attenuation()
Definition auto_cross_corr_multicarrier_sync_cc.h:57
auto_cross_corr_multicarrier_sync_cc(int subcarriers, int cp_len, std::vector< gfdm_complex > preamble)
int subcarriers()
Definition auto_cross_corr_multicarrier_sync_cc.h:58
int cp_len()
Definition auto_cross_corr_multicarrier_sync_cc.h:59
void normalize_power_level(gfdm_complex *p_out, const gfdm_complex *p_in, const float norm_factor, const int ninput_size)
void cross_correlate_preamble(gfdm_complex *p_out, const gfdm_complex *p_in, const int ninput_size)
<+description+>
Definition gfdm_kernel_utils.h:40
Definition add_cyclic_prefix_cc.h:30