The Inspector (GNU Radio module gr-inspector)
ofdm_bouzegzi_c_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 Free Software Foundation, Inc..
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 #ifndef INCLUDED_INSPECTOR_OFDM_BOUZEGZI_C_IMPL_H
22 #define INCLUDED_INSPECTOR_OFDM_BOUZEGZI_C_IMPL_H
23 
24 #include <gnuradio/fft/fft.h>
26 
27 namespace gr {
28 namespace inspector {
29 
31 {
32 private:
33  int d_Nb, d_len;
34  double d_samp_rate;
35  float *d_x1, *d_y1, *d_x2, *d_y2, *d_tmp1, *d_tmp2, *d_real_pre, *d_imag_pre,
36  *d_osc_vec;
37  gr_complex *d_sig_shift, *d_res;
38  std::vector<int> d_alpha, d_beta;
39  fft::fft_complex* d_fft;
40 
41 public:
42  ofdm_bouzegzi_c_impl(double samp_rate,
43  int Nb,
44  const std::vector<int>& alpha,
45  const std::vector<int>& beta);
46 
48 
49  void rescale_fft(bool forward);
50  void do_fft(const gr_complex* in, gr_complex* out);
51 
52  float autocorr(const gr_complex* sig, int a, int b, int p);
53  gr_complex autocorr_orig(const gr_complex* sig, int a, int b, int p);
54  float cost_func(const gr_complex* sig, int a, int b);
55 
56  // Where all the action really happens
57  int work(int noutput_items,
58  gr_vector_const_void_star& input_items,
59  gr_vector_void_star& output_items);
60 };
61 
62 } // namespace inspector
63 } // namespace gr
64 
65 #endif /* INCLUDED_INSPECTOR_OFDM_BOUZEGZI_C_IMPL_H */
OFDM parameter estimator (Bouzegzi algorithm)
Definition: ofdm_bouzegzi_c.h:38
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:30
Definition: inspector_form.h:40
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)