GNU Radio 3.6.5.1 C++ API
ofdm_chanest_vcvc_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio 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  * GNU Radio 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 GNU Radio; 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_DIGITAL_OFDM_CHANEST_VCVC_IMPL_H
24 #define INCLUDED_DIGITAL_OFDM_CHANEST_VCVC_IMPL_H
25 
27 
28 namespace gr {
29  namespace digital {
30 
32  {
33  private:
34  int d_fft_len; //! FFT length
35  int d_n_data_syms; //! Number of data symbols following the sync symbol(s)
36  int d_n_sync_syms; //! Number of sync symbols (1 or 2)
37  //! 0 if no noise reduction is done for the initial channel state estimation. Otherwise, the maximum length of the channel delay in samples.
38  int d_eq_noise_red_len;
39  //! Is sync_symbol1 if d_n_sync_syms == 1, otherwise sync_symbol2. Used as a reference symbol to estimate the channel.
40  std::vector<gr_complex> d_ref_sym;
41  //! If d_n_sync_syms == 2 this is used as a differential correlation vector (called 'v' in [1]).
42  std::vector<gr_complex> d_corr_v;
43  //! If d_n_sync_syms == 1 we use this instead of d_corr_v to estimate the coarse freq. offset
44  std::vector<float> d_known_symbol_diffs;
45  //! If d_n_sync_syms == 1 we use this instead of d_corr_v to estimate the coarse freq. offset (temp. variable)
46  std::vector<float> d_new_symbol_diffs;
47  //! The index of the first carrier with data (index 0 is not DC here, but the lowest frequency)
48  int d_first_active_carrier;
49  //! The index of the last carrier with data
50  int d_last_active_carrier;
51  //! If true, the channel estimation must be interpolated
52  bool d_interpolate;
53  //! Maximum carrier offset (negative value!)
54  int d_max_neg_carr_offset;
55  //! Maximum carrier offset (positive value!)
56  int d_max_pos_carr_offset;
57 
58  //! Calculate the coarse frequency offset in number of carriers
59  int get_carr_offset(const gr_complex *sync_sym1, const gr_complex *sync_sym2);
60  //! Estimate the channel (phase and amplitude offset per carrier)
61  void get_chan_taps(const gr_complex *sync_sym1, const gr_complex *sync_sym2, int carr_offset, std::vector<gr_complex> &taps);
62 
63  public:
64  ofdm_chanest_vcvc_impl(const std::vector<gr_complex> &sync_symbol1, const std::vector<gr_complex> &sync_symbol2, int n_data_symbols, int eq_noise_red_len, int max_carr_offset, bool force_one_sync_symbol);
66 
67  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
68  int general_work(int noutput_items,
69  gr_vector_int &ninput_items,
70  gr_vector_const_void_star &input_items,
71  gr_vector_void_star &output_items);
72  };
73 
74  } // namespace digital
75 } // namespace gr
76 
77 #endif /* INCLUDED_DIGITAL_OFDM_CHANEST_VCVC_IMPL_H */
78