The Inspector (GNU Radio module gr-inspector)
ofdm_bouzegzi_c_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2016 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this software; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_INSPECTOR_OFDM_BOUZEGZI_C_IMPL_H
24 #define INCLUDED_INSPECTOR_OFDM_BOUZEGZI_C_IMPL_H
25 
27 #include <gnuradio/fft/fft.h>
28 
29 namespace gr {
30  namespace inspector {
31 
33  {
34  private:
35  int d_Nb, d_len;
36  double d_samp_rate;
37  float *d_x1, *d_y1, *d_x2, *d_y2, *d_tmp1, *d_tmp2, *d_real_pre, *d_imag_pre, *d_osc_vec;
38  gr_complex *d_sig_shift, *d_res;
39  std::vector<int> d_alpha, d_beta;
40  fft::fft_complex *d_fft;
41 
42  public:
43  ofdm_bouzegzi_c_impl(double samp_rate, int Nb,
44  const std::vector<int> &alpha,
45  const std::vector<int> &beta);
47 
48  void rescale_fft(bool forward);
49  void do_fft(const gr_complex *in, gr_complex *out);
50 
51  float autocorr(const gr_complex *sig, int a, int b, int p);
52  gr_complex autocorr_orig(const gr_complex *sig, int a, int b, int p);
53  float cost_func(const gr_complex *sig, int a, int b);
54 
55  // Where all the action really happens
56  int work(int noutput_items,
57  gr_vector_const_void_star &input_items,
58  gr_vector_void_star &output_items);
59  };
60 
61  } // namespace inspector
62 } // namespace gr
63 
64 #endif /* INCLUDED_INSPECTOR_ofdm_bouzegzi_C_IMPL_H */
OFDM parameter estimator (Bouzegzi algorithm)
Definition: ofdm_bouzegzi_c.h:41
ofdm_bouzegzi_c_impl(double samp_rate, int Nb, const std::vector< int > &alpha, const std::vector< int > &beta)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr_complex autocorr_orig(const gr_complex *sig, int a, int b, int p)
Definition: ofdm_bouzegzi_c_impl.h:32
Definition: ofdm_bouzegzi_c.h:30
void do_fft(const gr_complex *in, gr_complex *out)
float autocorr(const gr_complex *sig, int a, int b, int p)
float cost_func(const gr_complex *sig, int a, int b)