GNU Radio's BLOCKSTREAM Package
frame_sync_fast_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3 * Copyright 2017 <+YOU OR YOUR COMPANY+>.
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_BLOCKSAT_FRAME_SYNC_FAST_IMPL_H
22 #define INCLUDED_BLOCKSAT_FRAME_SYNC_FAST_IMPL_H
23 
25 
26 namespace gr {
27  namespace blocksat {
28 
30  {
31  private:
32  float d_threshold;
33  int d_preamble_len;
34  int d_payload_len;
35  int d_frame_len;
36  int d_equalize;
37  int d_fix_phase;
38  int d_verbosity;
39  int d_fw_preamble;
40  float d_eq_gain;
41  gr_complex d_phase_rot;
42  float d_last_max;
43  float d_last_mag_peak;
44  float d_timing_metric_mov_max;
45  gr_complex d_pmf_at_last_max;
46  int d_i_last_max;
47  int d_i_after_peak;
48  int d_i_sym;
49  int d_n_peak_found;
50  bool d_is_first_sym_after_lock;
51  int d_i_scheduled_peak;
52  int d_peak_cnt;
53  int d_i_prev_peak;
54  int d_correct_dist_peak_cnt;
55  int d_unmatched_pmf_peak_cnt;
56  int d_frame_lock;
57  int d_const_order;
58  float d_avg_peak_dist;
59  float d_var_peak_dist;
60  float d_timing_metric_sum;
61  float d_n_timing_metric;
62  std::vector<gr_complex> d_delay_line;
63  std::vector<int> d_peak_dist_hist;
64  std::vector<float> d_central_diff;
65 
66  // Internal processing
67  void mov_max_timing_metric(float timing_metric, gr_complex norm_c_pmf);
68  int is_corr_peak(float timing_metric, gr_complex norm_c_pmf);
69  int postprocess_peak(int is_peak_in, int offset_prev_peak);
70  int check_frame_part(int is_peak);
71  int verify_frame_acquisition(int d_peak);
72  int verify_frame_lock_loss(int is_pmf_peak);
73  gr_complex resolve_phase(float pmf_peak_re, float pmf_peak_im);
74 
75 
76  public:
77  frame_sync_fast_impl(float treshold, int preamble_len, int payload_len, int equalize, int fix_phase, int const_order, int d_fw_preamble, int verbosity);
79 
80  // Where all the action really happens
81  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
82 
83  // Public getters
84  float get_avg_timing_metric();
86  int get_state();
87 
88  int general_work(int noutput_items,
89  gr_vector_int &ninput_items,
90  gr_vector_const_void_star &input_items,
91  gr_vector_void_star &output_items);
92 
93  };
94  } // namespace blocksat
95  } // namespace gr
96 
97  #endif /* INCLUDED_BLOCKSAT_FRAME_SYNC_FAST_IMPL_H */
&lt;+description of block+&gt;
Definition: frame_sync_fast.h:36
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
Definition: frame_sync_fast_impl.h:29
frame_sync_fast_impl(float treshold, int preamble_len, int payload_len, int equalize, int fix_phase, int const_order, int d_fw_preamble, int verbosity)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)