GNU Radio's SATELLITES Package
phase_unwrap_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 #ifndef INCLUDED_SATELLITES_PHASE_UNWRAP_IMPL_H
11 #define INCLUDED_SATELLITES_PHASE_UNWRAP_IMPL_H
12 
13 #include <gnuradio/math.h>
15 #include <cstdint>
16 
17 namespace gr {
18 namespace satellites {
19 
21 {
22 private:
23  int64_t d_integer_cycles;
24  float d_last_phase;
25 
26  // Implementation taken from gr::block::control_loop but modified to yield
27  // values in [0, 2pi).
28  inline float phase_wrap(float phase) const
29  {
30  while (phase > (2 * GR_M_PI))
31  phase -= 2 * GR_M_PI;
32  while (phase < 0)
33  phase += 2 * GR_M_PI;
34  return phase;
35  }
36 
37 public:
40 
41  int work(int noutput_items,
42  gr_vector_const_void_star& input_items,
43  gr_vector_void_star& output_items);
44 };
45 
46 } // namespace satellites
47 } // namespace gr
48 
49 #endif /* INCLUDED_SATELLITES_PHASE_UNWRAP_IMPL_H */
Definition: phase_unwrap_impl.h:21
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Unwraps a phase time series.
Definition: phase_unwrap.h:31
Definition: ax100_decode.h:17