GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
exponentiate_const_cci.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2017 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef INCLUDED_BLOCKS_EXPONENTIATE_CONST_CCI_H
13 #define INCLUDED_BLOCKS_EXPONENTIATE_CONST_CCI_H
14 
15 #include <gnuradio/blocks/api.h>
16 #include <gnuradio/sync_block.h>
17 
18 namespace gr {
19 namespace blocks {
20 
21 /*!
22  * \brief Exponentiates a complex stream with an integer exponent
23  * \ingroup blocks
24  *
25  * \details
26  * This block raises a complex stream to an integer exponent. The exponent
27  * must be at least 1. There is a callback function so the exponent can be
28  * changed at runtime.
29  *
30  * NOTE: The algorithm uses iterative multiplication to achieve exponentiation,
31  * hence it is O(exponent). Therefore, this block could be inefficient for large
32  * exponents.
33  */
35 {
36 public:
37  typedef std::shared_ptr<exponentiate_const_cci> sptr;
38 
39  /*
40  * \param exponent Exponent the input stream is raised to, which must be an integer.
41  * The algorithm uses iterative multiplication to achieve exponentiation, hence it is
42  * O(exponent). Therefore, this block could be inefficient for large exponents.
43  * \param vlen Vector length of input/output stream
44  */
45  static sptr make(int exponent, size_t vlen = 1);
46 
47  virtual void set_exponent(int exponent) = 0;
48 };
49 
50 } // namespace blocks
51 } // namespace gr
52 
53 #endif /* INCLUDED_BLOCKS_EXPONENTIATE_CONST_CCI_H */
Exponentiates a complex stream with an integer exponent.
Definition: exponentiate_const_cci.h:35
static sptr make(int exponent, size_t vlen=1)
std::shared_ptr< exponentiate_const_cci > sptr
Definition: exponentiate_const_cci.h:37
virtual void set_exponent(int exponent)=0
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29