GNU Radio's SATELLITES Package
costas_loop_8apsk_cc_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2022 Daniel Estevez <daniel@destevez.net>
4  *
5  * This file is part of gr-satellites
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_SATELLITES_COSTAS_LOOP_8APSK_CC_IMPL_H
12 #define INCLUDED_SATELLITES_COSTAS_LOOP_8APSK_CC_IMPL_H
13 
14 #include <gnuradio/math.h>
16 
17 namespace gr {
18 namespace satellites {
19 
21 {
22 private:
23  float d_error;
24 
25  float phase_detector(gr_complex sample) const
26  {
27  if (sample.real() * sample.real() + sample.imag() * sample.imag() < 0.25) {
28  return 0;
29  }
30  float phase = gr::fast_atan2f(sample.imag(), sample.real());
31  return fmodf(phase + GR_M_PI, 2.0 * GR_M_PI / 7.0) - GR_M_PI / 7.0;
32  }
33 
34 public:
35  costas_loop_8apsk_cc_impl(float loop_bw);
37 
38  float error() const override { return d_error; };
39 
40  int work(int noutput_items,
41  gr_vector_const_void_star& input_items,
42  gr_vector_void_star& output_items);
43 };
44 
45 } // namespace satellites
46 } // namespace gr
47 
48 #endif /* INCLUDED_SATELLITES_COSTAS_LOOP_8APSK_CC_IMPL_H */
Definition: costas_loop_8apsk_cc_impl.h:20
Definition: ax100_decode.h:17
8APSK Costas Loop
Definition: costas_loop_8apsk_cc.h:26
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
float error() const override
Definition: costas_loop_8apsk_cc_impl.h:38