GNU Radio's TEST Package
optimize_c.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2013 Sylvain Munaut <tnt@246tNt.com>
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
22#ifndef INCLUDED_IQBALANCE_OPTIMIZE_C_H
23#define INCLUDED_IQBALANCE_OPTIMIZE_C_H
24
26#include <gnuradio/sync_block.h>
27
28namespace gr {
29 namespace iqbalance {
30
31 class IQBALANCE_API optimize_c : public gr::sync_block
32 {
33 private:
34 optimize_c(int period);
35
36 int d_period, d_count;
37 bool d_first;
38 float d_mag, d_phase;
39
40 public:
41 typedef boost::shared_ptr<optimize_c> sptr;
42
43 static sptr make(int period=0);
44
46
47 void set_period(int period) { this->d_period = period; }
48 int period() const { return this->d_period; }
49
50 float mag() const { return this->d_mag; }
51 float phase() const { return this->d_phase; }
52
53 void reset(void) {
54 this->d_first = true;
55 this->d_count = 0;
56 this->d_mag = this->d_phase = 0.0f;
57 }
58
59 void forecast (int noutput_items, gr_vector_int &ninput_items_required);
60
61 int work (int noutput_items,
62 gr_vector_const_void_star &input_items,
63 gr_vector_void_star &output_items);
64 };
65
66 } // namespace iqbalance
67} // namespace gr
68
69#endif /* INCLUDED_IQBALANCE_OPTIMIZE_C_H */
70
#define IQBALANCE_API
Definition: api.h:30
Definition: optimize_c.h:32
static sptr make(int period=0)
float mag() const
Definition: optimize_c.h:50
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
boost::shared_ptr< optimize_c > sptr
Definition: optimize_c.h:41
int period() const
Definition: optimize_c.h:48
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:53
float phase() const
Definition: optimize_c.h:51
void set_period(int period)
Definition: optimize_c.h:47
Definition: fix_cc.h:28