GNU Radio's LFAST Package
costas2_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2017 ghostop14.
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_LFAST_COSTAS2_IMPL_H
22 #define INCLUDED_LFAST_COSTAS2_IMPL_H
23 
24 #include <lfast/costas2.h>
25 
26 namespace gr {
27  namespace lfast {
28 
29  class costas2_impl : public costas2
30  {
31  private:
32  int d_order;
33  float d_error;
34  float d_noise;
35 
36  bool d_genSignalPDUs;
37 
38  float
39  phase_detector_2(gr_complex sample) const
40  {
41  return (sample.real()*sample.imag());
42  }
43 
44  float (costas2_impl::*d_phase_detector)(gr_complex sample) const;
45 
46  public:
47  costas2_impl(float loop_bw, int order, bool genPDUs);
48  ~costas2_impl();
49 
50  float error() const;
51 
52  // void printSineError();
53 
54  void handle_set_noise(pmt::pmt_t msg);
55 
56  void handleMsgIn(pmt::pmt_t msg);
57 
58  // Where all the action really happens
59  int work(int noutput_items,
60  gr_vector_const_void_star &input_items,
61  gr_vector_void_star &output_items);
62  int work_original(int noutput_items,
63  gr_vector_const_void_star &input_items,
64  gr_vector_void_star &output_items);
65  int work_test(int noutput_items,
66  gr_vector_const_void_star &input_items,
67  gr_vector_void_star &output_items);
68  };
69 
70  } // namespace lfast
71 } // namespace gr
72 
73 #endif /* INCLUDED_LFAST_COSTAS2_IMPL_H */
74 
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: costas2_impl.h:29
void handle_set_noise(pmt::pmt_t msg)
costas2_impl(float loop_bw, int order, bool genPDUs)
int work_original(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
void handleMsgIn(pmt::pmt_t msg)
Definition: agc.h:30
int work_test(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition: costas2.h:37