summaryrefslogtreecommitdiff
path: root/gr-input/grc/Calculation_Calculator.xml
blob: 070712f57d7c84f695b32143e11f4afa53a0427a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0"?>
<block>
  <name>Calculator</name>
  <key>Calculation_Calculator</key>
  <category>Calculation</category>
  <import>import gnuradio.input.Calculator</import>
  <make>gnuradio.input.Calculator.Calculator($num_inputs)
self.$(id).set_parameters($Exp,$num_inputs)</make>

<param>
<name>Expression</name>
<key>Exp</key>
<type>string</type>
</param>

<param>
<name>Num inputs</name>
<key>num_inputs</key>
<value>1</value>
<type>int</type>
</param>

  <sink>
    <name>in0</name>
    <type>float</type>
    <nports>$num_inputs</nports>
  </sink>
<!--
  <sink>
  <name>in1</name>
  <type>float</type>
  <nports>4</nports>
  </sink> -->

  
  <source>
    <name>out</name>
    <type>float</type>
  </source>

<doc>

Variable names must be a0,a1,a2 and so on.

You can use maximum 10 variables per block.

Example to add 5 variables:

"a0+a1+a2+a3+a4"

To perform Exponential(power) calculations on operators use the following:

a0**a1 

To perform calculations like sqrt, log or exp use the following:

sqrt(a4)

log(a2)

exp(a8)

</doc>

</block>