GNU Radio's TEST Package
optimize_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011-2020 Free Software Foundation, Inc.
4  * Copyright 2013-2021 Sylvain Munaut <tnt@246tNt.com>
5  *
6  * This file is part of gr-iqbalance
7  *
8  * SPDX-License-Identifier: GPL-3.0-or-later
9  */
10 
11 #pragma once
12 
13 #include <gnuradio/iqbalance/api.h>
14 #include <gnuradio/sync_block.h>
15 
16 namespace gr {
17  namespace iqbalance {
18 
19  class IQBALANCE_API optimize_c : public gr::sync_block
20  {
21  private:
22  optimize_c(int period);
23 
24  int d_period, d_count;
25  bool d_first;
26  float d_mag, d_phase;
27 
28  public:
29  typedef std::shared_ptr<optimize_c> sptr;
30 
31  static sptr make(int period=0);
32 
34 
35  void set_period(int period) { this->d_period = period; }
36  int period() const { return this->d_period; }
37 
38  float mag() const { return this->d_mag; }
39  float phase() const { return this->d_phase; }
40 
41  void reset(void) {
42  this->d_first = true;
43  this->d_count = 0;
44  this->d_mag = this->d_phase = 0.0f;
45  }
46 
47  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
48 
49  int work (int noutput_items,
50  gr_vector_const_void_star &input_items,
51  gr_vector_void_star &output_items);
52  };
53 
54  } // namespace iqbalance
55 } // namespace gr
#define IQBALANCE_API
Definition: api.h:17
Definition: optimize_c.h:20
static sptr make(int period=0)
std::shared_ptr< optimize_c > sptr
Definition: optimize_c.h:29
float mag() const
Definition: optimize_c.h:38
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
int period() const
Definition: optimize_c.h:36
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
void reset(void)
Definition: optimize_c.h:41
float phase() const
Definition: optimize_c.h:39
void set_period(int period)
Definition: optimize_c.h:35
Definition: fix_cc.h:16