summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshwini2015-03-10 17:25:45 +0530
committerAshwini2015-03-10 17:25:45 +0530
commitd00a8dd67dcdc3650f344396425933424813baba (patch)
tree7840d8a5a5f4681c49971615cc5b83fe0e70cec7
parent92326794e39e1753f5fcb20715c57ea0f537752e (diff)
downloadgnuradio-d00a8dd67dcdc3650f344396425933424813baba.tar.gz
gnuradio-d00a8dd67dcdc3650f344396425933424813baba.tar.bz2
gnuradio-d00a8dd67dcdc3650f344396425933424813baba.zip
Plot sink added
-rw-r--r--gr-input/CMakeLists.txt55
-rw-r--r--gr-input/doc/CMakeLists.txt23
-rw-r--r--gr-input/doc/README.input2
-rw-r--r--gr-input/doc/input.dox29
-rw-r--r--gr-input/grc/CMakeLists.txt77
-rw-r--r--gr-input/grc/Calculation_Calculator.xml65
-rw-r--r--gr-input/grc/Calculation_Roots.xml34
-rw-r--r--gr-input/grc/Transfer_Function_Denominator.xml33
-rw-r--r--gr-input/grc/Transfer_Function_Numerator.xml33
-rw-r--r--gr-input/grc/Transfer_Function_Transfer_Function.xml66
-rw-r--r--gr-input/grc/Transfer_function_Denominator.xml49
-rw-r--r--gr-input/grc/Transfer_function_Numerator.xml48
-rw-r--r--gr-input/grc/Transfer_function_Response.xml80
-rwxr-xr-xgr-input/grc/plot_sink.xml112
-rw-r--r--gr-input/grc/plzr_plot.xml37
-rw-r--r--gr-input/grc/ramp_source.xml87
-rw-r--r--gr-input/grc/step_source.xml88
-rw-r--r--gr-input/python/CMakeLists.txt128
-rw-r--r--gr-input/python/Calculator.py99
-rw-r--r--gr-input/python/Denominator.py91
-rw-r--r--gr-input/python/Numerator.py90
-rw-r--r--gr-input/python/Response.py98
-rw-r--r--gr-input/python/Roots.py126
-rw-r--r--gr-input/python/Transfer_Function.py100
-rw-r--r--gr-input/python/__init__.py53
-rw-r--r--gr-input/python/gr_ramp_source.py46
-rw-r--r--gr-input/python/gr_step_source.py43
-rwxr-xr-xgr-input/python/matplotsink.py312
-rwxr-xr-xgr-input/python/plot_sink.py57
-rw-r--r--gr-input/python/plzr_plot.py71
-rw-r--r--gr-input/python/ramp_hierblock.py19
-rw-r--r--gr-input/python/step_hierblock.py22
32 files changed, 2273 insertions, 0 deletions
diff --git a/gr-input/CMakeLists.txt b/gr-input/CMakeLists.txt
new file mode 100644
index 000000000..50babee29
--- /dev/null
+++ b/gr-input/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Setup dependencies
+########################################################################
+#include(GrBoost)
+
+#find_package(SCIGENW3f)
+
+########################################################################
+# Register component
+########################################################################
+include(GrComponent)
+
+GR_REGISTER_COMPONENT("gr-input" ENABLE_GR_INPUT
+ ENABLE_GRUEL
+ ENABLE_VOLK
+ Boost_FOUND
+ ENABLE_GR_CORE
+)
+
+########################################################################
+# Begin conditional configuration
+########################################################################
+if(ENABLE_GR_INPUT)
+
+########################################################################
+# Add subdirectories
+########################################################################
+if(ENABLE_PYTHON)
+ add_subdirectory(python)
+ add_subdirectory(grc)
+endif(ENABLE_PYTHON)
+#add_subdirectory(examples)
+add_subdirectory(doc)
+
+
+endif(ENABLE_GR_INPUT)
diff --git a/gr-input/doc/CMakeLists.txt b/gr-input/doc/CMakeLists.txt
new file mode 100644
index 000000000..b10223aaf
--- /dev/null
+++ b/gr-input/doc/CMakeLists.txt
@@ -0,0 +1,23 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+install(
+ FILES README.input
+ DESTINATION ${GR_PKG_DOC_DIR}
+)
diff --git a/gr-input/doc/README.input b/gr-input/doc/README.input
new file mode 100644
index 000000000..1bd326897
--- /dev/null
+++ b/gr-input/doc/README.input
@@ -0,0 +1,2 @@
+Serial Python block
+
diff --git a/gr-input/doc/input.dox b/gr-input/doc/input.dox
new file mode 100644
index 000000000..8843d0560
--- /dev/null
+++ b/gr-input/doc/input.dox
@@ -0,0 +1,29 @@
+/*! \page page_fft FFT Signal Processing Blocks
+
+\section Introduction
+
+This is the gr-scigen package. It contains signal processing blocks to
+perform FFTs and FFT-related functionality.
+
+The Python namespace is in gnuradio.fft, which would be normally
+imported as:
+
+\code
+ from gnuradio import scigen
+\endcode
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+\code
+ help(scigen)
+\endcode
+
+\section Dependencies
+
+The scigen blocks require the following dependencies.
+
+\li fftw3f (>= 3.0) http://www.fftw.org/download.html
+
+*/
diff --git a/gr-input/grc/CMakeLists.txt b/gr-input/grc/CMakeLists.txt
new file mode 100644
index 000000000..61b317f77
--- /dev/null
+++ b/gr-input/grc/CMakeLists.txt
@@ -0,0 +1,77 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+install(FILES
+ step_source.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+install(FILES
+ ramp_source.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+install(FILES
+ Transfer_function_Numerator.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+
+
+install(FILES
+ Transfer_function_Denominator.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+
+install(FILES
+ Transfer_function_Denominator.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+install(FILES
+ Transfer_function_Response.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+install(FILES
+ Calculation_Roots.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+install(FILES
+ Calculation_Calculator.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
+
+install(FILES
+ plot_sink.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "input_python"
+)
+
diff --git a/gr-input/grc/Calculation_Calculator.xml b/gr-input/grc/Calculation_Calculator.xml
new file mode 100644
index 000000000..070712f57
--- /dev/null
+++ b/gr-input/grc/Calculation_Calculator.xml
@@ -0,0 +1,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>
diff --git a/gr-input/grc/Calculation_Roots.xml b/gr-input/grc/Calculation_Roots.xml
new file mode 100644
index 000000000..9871cad5a
--- /dev/null
+++ b/gr-input/grc/Calculation_Roots.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<block>
+ <name>Roots</name>
+ <key>Calculation_Roots</key>
+ <category>Calculation</category>
+ <import>import gnuradio.input.Roots</import>
+ <make>gnuradio.input.Roots.Roots($order)</make>
+
+<param>
+ <name>Order of transfer function</name>
+ <key>order</key>
+ <value>samp_rate</value>
+ <type>real</type>
+
+</param>
+
+ <sink>
+ <name>in</name>
+ <type>float</type>
+ </sink>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink> -->
+
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ <nports>2*$order</nports>
+ </source>
+</block>
diff --git a/gr-input/grc/Transfer_Function_Denominator.xml b/gr-input/grc/Transfer_Function_Denominator.xml
new file mode 100644
index 000000000..5ea581a98
--- /dev/null
+++ b/gr-input/grc/Transfer_Function_Denominator.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<block>
+ <name>Denominator</name>
+ <key>Transfer_Function_Denominator</key>
+ <category>Transfer Function</category>
+ <import>import gnuradio.input.Denominator</import>
+ <make>gnuradio.input.Denominator.Denominator($num_inputs)</make>
+
+<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>
+</block>
diff --git a/gr-input/grc/Transfer_Function_Numerator.xml b/gr-input/grc/Transfer_Function_Numerator.xml
new file mode 100644
index 000000000..8bb367a62
--- /dev/null
+++ b/gr-input/grc/Transfer_Function_Numerator.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<block>
+ <name>Numerator</name>
+ <key>Transfer_Function_Numerator</key>
+ <category>Transfer Function</category>
+ <import>import gnuradio.input.Numerator</import>
+ <make>gnuradio.input.Numerator.Numerator($num_inputs)</make>
+
+<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>
+</block>
diff --git a/gr-input/grc/Transfer_Function_Transfer_Function.xml b/gr-input/grc/Transfer_Function_Transfer_Function.xml
new file mode 100644
index 000000000..203fe4a7b
--- /dev/null
+++ b/gr-input/grc/Transfer_Function_Transfer_Function.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<block>
+ <name>Transfer Function</name>
+ <key>Transfer_Function_Transfer_Function</key>
+ <category>Transfer Function</category>
+ <import>import gnuradio.input.Transfer_Function</import>
+ <make>gnuradio.input.Transfer_Function.Transfer_Function($order,$itype,$tstart,$tstop,$tstep)</make>
+
+<param>
+ <name>Order of transfer function</name>
+ <key>order</key>
+ <value>1</value>
+ <type>real</type>
+
+</param>
+
+
+ <param>
+ <name>Input Types</name>
+ <key>itype</key>
+ <type>enum</type>
+ <option><name>Impulse</name><key>11</key></option>
+ <option><name>Step</name><key>12</key></option>
+ <option><name>Ramp</name><key>13</key></option>
+ </param>
+
+ <param>
+<name>tstart</name>
+<key>tstart</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+<param>
+<name>tstop</name>
+<key>tstop</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+<param>
+<name>tstep</name>
+<key>tstep</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+
+ <sink>
+ <name>in</name>
+ <type>float</type>
+ <nports>2</nports>
+ </sink>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink> -->
+
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ </source>
+</block>
diff --git a/gr-input/grc/Transfer_function_Denominator.xml b/gr-input/grc/Transfer_function_Denominator.xml
new file mode 100644
index 000000000..2ba936580
--- /dev/null
+++ b/gr-input/grc/Transfer_function_Denominator.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<block>
+ <name>Denominator</name>
+ <key>Transfer_function_Denominator</key>
+ <category>Transfer_function</category>
+ <import>import gnuradio.input.Denominator</import>
+ <make>gnuradio.input.Denominator.Denominator($num_inputs)</make>
+
+<param>
+<name>Order of Transfer Function</name>
+<key>num_inputs</key>
+<value>1</value>
+<type>int</type>
+</param>
+
+ <sink>
+ <name>in0</name>
+ <type>float</type>
+ <nports>1+$num_inputs</nports>
+ </sink>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink> -->
+
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ </source>
+
+<doc>
+
+This will take the coefficient values for the Denominator.
+
+in00 = value of the coefficient of s^0
+
+in01 = value of the coefficient of s^1
+
+in02 = value of the coefficient of s^2
+
+and so on..
+
+</doc>
+
+
+</block>
diff --git a/gr-input/grc/Transfer_function_Numerator.xml b/gr-input/grc/Transfer_function_Numerator.xml
new file mode 100644
index 000000000..1ad34f316
--- /dev/null
+++ b/gr-input/grc/Transfer_function_Numerator.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<block>
+ <name>Numerator</name>
+ <key>Transfer_function_Numerator</key>
+ <category>Transfer_function</category>
+ <import>import gnuradio.input.Numerator</import>
+ <make>gnuradio.input.Numerator.Numerator($num_inputs)</make>
+
+<param>
+<name>Order of Transfer Function</name>
+<key>num_inputs</key>
+<value>1</value>
+<type>int</type>
+</param>
+
+ <sink>
+ <name>in0</name>
+ <type>float</type>
+ <nports>1+$num_inputs</nports>
+ </sink>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink> -->
+
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ </source>
+
+<doc>
+
+This will take the coefficient values for the numerator.
+
+in00 = value of the coefficient of s^0
+
+in01 = value of the coefficient of s^1
+
+in02 = value of the coefficient of s^2
+
+and so on..
+
+</doc>
+
+</block>
diff --git a/gr-input/grc/Transfer_function_Response.xml b/gr-input/grc/Transfer_function_Response.xml
new file mode 100644
index 000000000..cb08a4c2a
--- /dev/null
+++ b/gr-input/grc/Transfer_function_Response.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<block>
+ <name>Response</name>
+ <key>Transfer_function_Response</key>
+ <category>Transfer_function</category>
+ <import>import gnuradio.input.Response</import>
+ <make>gnuradio.input.Response.Response($order,$itype,$tstart,$tstop,$tstep)</make>
+
+<param>
+ <name>Order of transfer function</name>
+ <key>order</key>
+ <value>1</value>
+ <type>real</type>
+
+</param>
+
+
+ <param>
+ <name>Input Types</name>
+ <key>itype</key>
+ <type>enum</type>
+ <option><name>Impulse</name><key>11</key></option>
+ <option><name>Step</name><key>12</key></option>
+ <option><name>Ramp</name><key>13</key></option>
+ </param>
+
+ <param>
+<name>tstart</name>
+<key>tstart</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+<param>
+<name>tstop</name>
+<key>tstop</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+<param>
+<name>tstep</name>
+<key>tstep</key>
+<value>0</value>
+<type>real</type>
+</param>
+
+
+ <sink>
+ <name>in</name>
+ <type>float</type>
+ <nports>2</nports>
+ </sink>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink> -->
+
+
+ <source>
+ <name>out</name>
+ <type>float</type>
+ </source>
+
+<doc>
+
+This block can perfrom three types of system responses.
+
+Step, Ramp and Impulse.
+
+in0 = Numerator Equation
+
+in1 = Denominator Equation
+
+</doc>
+
+
+</block>
diff --git a/gr-input/grc/plot_sink.xml b/gr-input/grc/plot_sink.xml
new file mode 100755
index 000000000..07022ea07
--- /dev/null
+++ b/gr-input/grc/plot_sink.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Variable Sink: Custom blks2 block
+###################################################
+ -->
+<block>
+ <name>Plot Sink</name>
+ <key>plot_sink</key>
+ <category>Single Board Heater System</category>
+ <import>import gnuradio.input.plot_sink</import>
+ <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+gnuradio.input.plot_sink.plot_sink_$(type.fcn)(
+ $(parent).GetWin(),
+ title=$title,
+ vlen=$vlen,
+ decim=$decim,
+ gsz=$gsz,
+ zoom=$zoom,
+)
+#if not $grid_pos()
+$(parent).Add(self.$(id).win)
+#else
+$(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
+#end if</make>
+ <callback>set_decim($decim)</callback>
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>fcn:c</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>fcn:f</opt>
+ </option>
+ <option>
+ <name>Int</name>
+ <key>int</key>
+ <opt>fcn:i</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>fcn:s</opt>
+ </option>
+ <option>
+ <name>Byte</name>
+ <key>byte</key>
+ <opt>fcn:b</opt>
+ </option>
+ </param>
+ <param>
+ <name>Title</name>
+ <key>title</key>
+ <value>Scope Plot</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Decimation</name>
+ <key>decim</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Graph size</name>
+ <key>gsz</key>
+ <value>50</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>History Required</name>
+ <key>zoom</key>
+ <value>0</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Grid Position</name>
+ <key>grid_pos</key>
+ <value></value>
+ <type>grid_pos</type>
+ </param>
+ <param>
+ <name>Notebook</name>
+ <key>notebook</key>
+ <value></value>
+ <type>notebook</type>
+ </param>
+
+ <check>$vlen &gt; 0</check>
+ <sink>
+ <name>in</name>
+ <type>$type</type>
+ <vlen>$vlen</vlen>
+ </sink>
+ <doc>
+Read samples from the input stream and \
+plot one in every decimation samples to the plot sink.
+</doc>
+</block>
diff --git a/gr-input/grc/plzr_plot.xml b/gr-input/grc/plzr_plot.xml
new file mode 100644
index 000000000..833149ea5
--- /dev/null
+++ b/gr-input/grc/plzr_plot.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<block>
+ <name>plzr_plot</name>
+ <key>plzr_plot</key>
+ <category>Python_Blocks</category>
+ <import>import gnuradio.plzr_plot</import>
+ <make>gnuradio.plzr_plot.plzr_plot($order)</make>
+
+<param>
+ <name>Order of transfer function</name>
+ <key>order</key>
+ <value>1</value>
+ <type>real</type>
+
+</param>
+
+
+
+ <sink>
+ <name>in</name>
+ <type>float</type>
+ <nports>2</nports>
+ </sink>
+</block>
+<!--
+ <sink>
+ <name>in1</name>
+ <type>float</type>
+ <nports>4</nports>
+ </sink>
+
+
+ <source>
+ <name>in</name>
+ <type>float</type>
+ </source>
+</block>-->
diff --git a/gr-input/grc/ramp_source.xml b/gr-input/grc/ramp_source.xml
new file mode 100644
index 000000000..5cba29ae7
--- /dev/null
+++ b/gr-input/grc/ramp_source.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##
+CSIM Block:
+## all types, 1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+ <name>Ramp Input</name>
+ <key>ramp</key>
+ <category>Sources</category>
+
+ <import>from gnuradio.input import ramp_hierblock as ramp_hierblock</import>
+ <make>ramp_hierblock.HierBlock($S,$H_Off,$W_Off)
+ </make>
+ <param>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option><name>F32_F32</name><key>f32_f32</key></option>
+ <option><name>S32_S32</name><key>s32_s32</key></option>
+ <option><name>S16_S16</name><key>s16_s16</key></option>
+ <option><name>S8_S8</name><key>s8_s8</key></option>
+ </param>
+ <param>
+ <name>Num Inputs</name>
+ <key>num_inputs</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <!--
+ Desimulation options
+ -->
+ <param>
+ <name>slope of ramp</name>
+ <key>S</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>height of offset</name>
+ <key>H_Off</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>width of offset</name>
+ <key>W_Off</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+
+ <!--
+ Check if number of inputs are greater than 0, and if vector length
+ is greater than 0.
+ -->
+ <check>$num_inputs &gt; 0</check>
+ <check>$vlen &gt; 0</check>
+
+ <source>
+ <name>out</name>
+ <type>$(str($type).split('_')[1])</type>
+ <vlen>$vlen</vlen>
+ </source>
+ <doc>
+
+Ramp Input block :
+
+Slope of ramp is the slope of ramp user wants to generate.
+Height of Offset is the height of step user wants to generate as initial signal.
+Width of Offset is the length upto which user wants to see the generated offset be.
+
+Default slope of ramp is 1 unit.
+Default height and width of offset is 1 unit.
+</doc>
+</block>
+
diff --git a/gr-input/grc/step_source.xml b/gr-input/grc/step_source.xml
new file mode 100644
index 000000000..599980030
--- /dev/null
+++ b/gr-input/grc/step_source.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##
+CSIM Block:
+## all types, 1 output, 2 to inf inputs
+###################################################
+ -->
+<block>
+ <name>Step Input</name>
+ <key>step_offset</key>
+ <category>Sources</category>
+
+ <import>from gnuradio.input import step_hierblock as step_hierblock</import>
+ <make>step_hierblock.HierBlock($S,$H_Off,$W_Off)
+ </make>
+ <param>
+ <name>IO Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option><name>F32_F32</name><key>f32_f32</key></option>
+ <option><name>S32_S32</name><key>s32_s32</key></option>
+ <option><name>S16_S16</name><key>s16_s16</key></option>
+ <option><name>S8_S8</name><key>s8_s8</key></option>
+ </param>
+ <param>
+ <name>Num Inputs</name>
+ <key>num_inputs</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
+
+ <!--
+ Desimulation options
+ -->
+ <param>
+ <name>step size</name>
+ <key>S</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>height of offset</name>
+ <key>H_Off</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>width of offset</name>
+ <key>W_Off</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+
+
+ <!--
+ Check if number of inputs are greater than 0, and if vector length
+ is greater than 0.
+ -->
+ <check>$num_inputs &gt; 0</check>
+ <check>$vlen &gt; 0</check>
+
+ <source>
+ <name>out</name>
+ <type>$(str($type).split('_')[1])</type>
+ <vlen>$vlen</vlen>
+ </source>
+ <doc>
+
+Step Input block :
+
+Step size is the height of step user wants to generate.
+Height of Offset is the height of step user wants to generate as initial signal.
+Width of Offset is the length upto which user wants to see the generated offset before starting with the height equivalent to step size.
+
+Default step size is 1 unit.
+Default height and width of offset is 1 unit
+</doc>
+</block>
+
diff --git a/gr-input/python/CMakeLists.txt b/gr-input/python/CMakeLists.txt
new file mode 100644
index 000000000..7c73fc59f
--- /dev/null
+++ b/gr-input/python/CMakeLists.txt
@@ -0,0 +1,128 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+include(GrPython)
+
+GR_PYTHON_INSTALL(
+ FILES
+ __init__.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ gr_ramp_source.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ gr_step_source.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ ramp_hierblock.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ step_hierblock.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ Numerator.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+
+GR_PYTHON_INSTALL(
+ FILES
+ Denominator.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+
+GR_PYTHON_INSTALL(
+ FILES
+ Response.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ Roots.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ Calculator.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ plot_sink.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ matplotsink.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/input
+ COMPONENT "input_python"
+)
+
+
+########################################################################
+# Handle the unit tests
+########################################################################
+if(ENABLE_TESTING)
+
+list(APPEND GR_TEST_PYTHON_DIRS
+ ${CMAKE_BINARY_DIR}/gr-input/python
+)
+list(APPEND GR_TEST_TARGET_DEPS gnuradio-input)
+
+include(GrTest)
+
+
+file(GLOB py_qa_test_files "qa_*.py")
+foreach(py_qa_test_file ${py_qa_test_files})
+ get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
+ GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file})
+endforeach(py_qa_test_file)
+endif(ENABLE_TESTING)
diff --git a/gr-input/python/Calculator.py b/gr-input/python/Calculator.py
new file mode 100644
index 000000000..f2eaf0481
--- /dev/null
+++ b/gr-input/python/Calculator.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+import numpy
+from numpy import log
+from numpy import exp
+from numpy import sqrt
+from gnuradio import gr
+import time
+
+class Calculator(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,num_inputs):
+ number = num_inputs
+ a = []
+ for i in range(0,number):
+ a.append(numpy.float32)
+# print "value of a",a
+ gr.sync_block.__init__(self,
+ name="Calculator",
+ in_sig=a,
+ out_sig=[numpy.float32])
+
+ #print "I am over slept"
+ #print len(self.ret_array)
+ def set_parameters(self,Exp,num_inputs):
+ self.Exp = Exp
+ #print "This is EXP", Exp
+ self.num_inputs = num_inputs
+
+
+ def work(self, input_items, output_items):
+ try:
+ a0 = input_items[0]
+ except IndexError:
+ pass
+ try:
+ a1 = input_items[1]
+ except IndexError:
+ pass
+ try:
+ a2 = input_items[2]
+ except IndexError:
+ pass
+ try:
+ a3 = input_items[3]
+ except IndexError:
+ pass
+ try:
+ a4 = input_items[4]
+ except IndexError:
+ pass
+ try:
+ a5 = input_items[5]
+ except IndexError:
+ pass
+ try:
+ a6 = input_items[6]
+ except IndexError:
+ pass
+ try:
+ a7 = input_items[7]
+ except IndexError:
+ pass
+ try:
+ a8 = input_items[8]
+ except IndexError:
+ pass
+ try:
+ a9 = input_items[9]
+ except IndexError:
+ pass
+ #out = output_items[0][0]
+ print "This is self.Exp\n",self.Exp
+
+ output_items[0][:] = eval(self.Exp)
+ #print "This is the output value\n", output_items[0][0]
+ #print "I am the oputput add python\n", eval(self.Exp)
+ return len(output_items[0])
+
diff --git a/gr-input/python/Denominator.py b/gr-input/python/Denominator.py
new file mode 100644
index 000000000..5d256f136
--- /dev/null
+++ b/gr-input/python/Denominator.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+import time
+import numpy
+from gnuradio import gr
+
+class Denominator(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,num_inputs):
+ number = num_inputs
+ a = []
+ for i in range(0,number):
+ a.append(numpy.float32)
+ gr.sync_block.__init__(self,
+ name="Denominator",
+ in_sig=a,
+ out_sig=[numpy.float32])
+
+ def work(self, input_items, output_items):
+ b=[0,0,0,0,0,0,0,0,0,0]
+ try:
+ b[0] = input_items[0][0]
+ except IndexError:
+ pass
+ try:
+ b[1] = input_items[1][0]
+ except IndexError:
+ pass
+ try:
+ b[2] = input_items[2][0]
+ except IndexError:
+ pass
+ try:
+ b[3] = input_items[3][0]
+ except IndexError:
+ pass
+ try:
+ b[4] = input_items[4][0]
+ except IndexError:
+ pass
+ try:
+ b[5] = input_items[5][0]
+ except IndexError:
+ pass
+ try:
+ b[6] = input_items[6][0]
+ except IndexError:
+ pass
+ try:
+ b[7] = input_items[7][0]
+ except IndexError:
+ pass
+ try:
+ b[8] = input_items[8][0]
+ except IndexError:
+ pass
+ try:
+ b[9] = input_items[9][0]
+ except IndexError:
+ pass
+
+ var = len(input_items)
+ out = output_items[0][:var]
+ out_arr=[]
+ time.sleep(0.001)
+
+ for i in range(0,len(input_items)):
+ out_arr.append(b[i])
+ out[:] = out_arr
+ return len(output_items[0][:])
+
diff --git a/gr-input/python/Numerator.py b/gr-input/python/Numerator.py
new file mode 100644
index 000000000..90b44e285
--- /dev/null
+++ b/gr-input/python/Numerator.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+import time
+import numpy
+from gnuradio import gr
+
+class Numerator(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,num_inputs):
+ number = num_inputs
+ a = []
+ for i in range(0,number):
+ a.append(numpy.float32)
+ gr.sync_block.__init__(self,
+ name="Numerator",
+ in_sig=a,
+ out_sig=[numpy.float32])
+
+ def work(self, input_items, output_items):
+ b=[0,0,0,0,0,0,0,0,0,0]
+ try:
+ b[0] = input_items[0][0]
+ except IndexError:
+ pass
+ try:
+ b[1] = input_items[1][0]
+ except IndexError:
+ pass
+ try:
+ b[2] = input_items[2][0]
+ except IndexError:
+ pass
+ try:
+ b[3] = input_items[3][0]
+ except IndexError:
+ pass
+ try:
+ b[4] = input_items[4][0]
+ except IndexError:
+ pass
+ try:
+ b[5] = input_items[5][0]
+ except IndexError:
+ pass
+ try:
+ b[6] = input_items[6][0]
+ except IndexError:
+ pass
+ try:
+ b[7] = input_items[7][0]
+ except IndexError:
+ pass
+ try:
+ b[8] = input_items[8][0]
+ except IndexError:
+ pass
+ try:
+ b[9] = input_items[9][0]
+ except IndexError:
+ pass
+ var = len(input_items)
+ o1 = output_items[0][:var]
+ out_arr=[]
+ time.sleep(0.001)
+
+ for i in range(0,len(input_items)):
+ out_arr.append(b[i])
+ o1[:] = out_arr
+ return len(output_items[0][:])
+
diff --git a/gr-input/python/Response.py b/gr-input/python/Response.py
new file mode 100644
index 000000000..b895ca77c
--- /dev/null
+++ b/gr-input/python/Response.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+import sys
+import time
+import numpy
+from gnuradio import gr
+import sciscipy
+
+class Response(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,order,itype,tstart,tstop,tstep):
+ sys.setrecursionlimit(2000)
+ a = []
+ self.b = [0.0,0.0,0.0,0.0,0.0,0.0]
+ [float(i) for i in self.b]
+ self.c = [0,0,0,0,0,0]
+ [float(i) for i in self.c]
+ self.i = 0
+ self.order=int(order)+1
+ self.itype = itype
+ self.tstart = tstart
+ self.tstop = tstop
+ self.tstep = tstep
+ gr.sync_block.__init__(self,
+ name="Response",
+ in_sig=[numpy.float32,numpy.float32],
+ out_sig=[numpy.float32])
+
+ def find_resp(self,b,c):
+ if (self.itype == 11):
+ typo = "'imp'"
+ elif (self.itype == 12):
+ typo = "'step'"
+ else:
+ typo = "t"
+ string1 = "s=%s; h=syslin('c',"
+ string2 = str(b[4])+"*s^4+"+str(b[3])+"*s^3+"+str(b[2])+"*s^2+"+str(b[1])+"*s+"+str(b[0])+","
+ string3 = str(c[4])+"*s^4+"+str(c[3])+"*s^3+"+str(c[2])+"*s^2+"+str(c[1])+"*s+"+str(c[0])+");"
+ string4 = "t="+str(self.tstart)+":"+str(self.tstep)+":"+str(self.tstop)+";"
+ string5 = "deff('u=input(t)','u=50');"
+ string6 = "r=tf2ss(h); a=csim("+typo+",t,r);"
+ string = string1+string2+string3+string4+string5+string6
+ sciscipy.eval(string)
+ self.a = sciscipy.read("a")
+
+ def work(self, input_items, output_items):
+ #sys.setrecursionlimit(1500)
+ k = self.order
+
+ for i in range(0,k):
+
+ self.b[i] = input_items[0][i]
+ for n,i in enumerate(self.b):
+ if i == 'nan':
+ self.b[n] = 0
+
+
+ print "I am value of b\n",self.b
+
+
+ for j in range(0,k):
+ self.c[j] = input_items[1][j]
+
+ for m,i in enumerate (self.c):
+ if n == 'nan':
+ self.c[m] = 0
+
+ print "I am vlaue of c\n", self.c
+ self.find_resp(self.b,self.c)
+
+
+ out = output_items[0]
+ self.i+=1
+ if self.i >= len(self.a):
+ self.i = 0
+ out[:] = numpy.float32(self.a[self.i])
+ return len(output_items[0])
+
+
diff --git a/gr-input/python/Roots.py b/gr-input/python/Roots.py
new file mode 100644
index 000000000..1057c8d76
--- /dev/null
+++ b/gr-input/python/Roots.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+import time
+import numpy
+from gnuradio import gr
+import sciscipy
+
+class Roots(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,order):
+ self.out = [0,0,0,0,0,0,0,0,0,0]
+ a = []
+ self.b = [0,0,0,0,0,0]
+ self.order=int(order)+1
+ self.number = int(order)*2
+ for i in range(0,self.number):
+ a.append(numpy.float32)
+ gr.sync_block.__init__(self,
+ name="Roots",
+ in_sig=[numpy.float32],
+ out_sig=a)
+
+ def find_roots(self,n):
+ string1 = "s=%s;"
+ string2 = "h2="+str(n[3])+"*s^3+"+str(n[2])+"*s^2+"+str(n[1])+"*s+"+str(n[0])+";[E1]=roots(h2);a11=real(E1(1));a12=imag(E1(1));b11 = real(E1(2));b12 = imag(E1(2));c11 = real(E1(3));c12 = imag(E1(3)); d11 = real(E1(4)); d12 = imag(E1(4)); e11 = real(E1(5)); e12 = imag(E1(5));"
+ string = string1+string2
+ print "This is string\n", string
+ sciscipy.eval(string)
+
+
+ try:
+ self.a11 = sciscipy.read("a11")
+ print "I am a11", self.a11
+ except TypeError:
+ self.a11 = 0
+ try:
+ self.a12 = sciscipy.read("a12")
+ print "I am a12", self.a12
+ except TypeError:
+ self.a12 = 0
+ try:
+ self.b11 = sciscipy.read("b11")
+ print "I am b11", self.b11
+ except TypeError:
+ self.b11 = 0
+ try:
+ self.b12 = sciscipy.read("b12")
+ except TypeError:
+ self.b12 = 0
+ try:
+ self.c11 = sciscipy.read("c11")
+ print "I am c11\n", self.c11
+ except TypeError:
+ self.c11 = 0
+ try:
+ self.c12 = sciscipy.read("c12")
+ print "I am c12\n", self.c12
+ except TypeError:
+ self.c12 = 0
+ try:
+ self.d11 = sciscipy.read("d11")
+ print "I am d11\n", self.d11
+ except TypeError:
+ self.d11 = 0
+ try:
+ self.d12 = sciscipy.read("d12")
+ except TypeError:
+ self.d12 = 0
+ try:
+ self.e11 = sciscipy.read("e11")
+ except TypeError:
+ self.e11 = 0
+ try:
+ self.e12 = sciscipy.read("e12")
+ except TypeError:
+ self.e12 = 0
+
+ def work(self, input_items, output_items):
+
+# print "I am here\n", output_items
+ k = self.order
+ for i in range(0,k):
+ self.b[i] = input_items[0][i]
+
+ self.find_roots(self.b)
+
+
+ self.out[0] = numpy.float32(self.a11)
+ self.out[1] = numpy.float32(self.b11)
+ self.out[2] = numpy.float32(self.a12)
+ self.out[3] = numpy.float32(self.b12)
+ self.out[4] = numpy.float32(self.c11)
+ self.out[5] = numpy.float32(self.c12)
+ self.out[6] = numpy.float32(self.d11)
+ self.out[7] = numpy.float32(self.d12)
+ self.out[8] = numpy.float32(self.e11)
+ self.out[9] = numpy.float32(self.e12)
+
+
+ for i in range (0,self.number):
+ output_items[i][:]= self.out[i]
+ print "I am out item",output_items
+
+ return len(output_items[0])
+
+
diff --git a/gr-input/python/Transfer_Function.py b/gr-input/python/Transfer_Function.py
new file mode 100644
index 000000000..d53c55e48
--- /dev/null
+++ b/gr-input/python/Transfer_Function.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+import time
+import numpy
+from gnuradio import gr
+import sciscipy
+
+class Transfer_Function(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,order,itype,tstart,tstop,tstep):
+ a = []
+ self.b = [0,0,0,0,0,0]
+ self.c = [0,0,0,0,0,0]
+ self.i = 0
+ self.order=int(order)+1
+ self.itype = itype
+ self.tstart = tstart
+ self.tstop = tstop
+ self.tstep = tstep
+ gr.sync_block.__init__(self,
+ name="tf_rises",
+ in_sig=[numpy.float32,numpy.float32],
+ out_sig=[numpy.float32])
+
+ #print "I am over slept"
+ #print len(self.ret_array)
+
+ def find_resp(self,b,c):
+ if (self.itype == 11):
+ typo = "'imp'"
+ elif (self.itype == 12):
+ typo = "'step'"
+ else:
+ typo = "t"
+# print "self b",self.b
+ string1 = "s=%s; h=syslin('c',"
+ string2 = str(b[4])+"*s^4+"+str(b[3])+"*s^3+"+str(b[2])+"*s^2+"+str(b[1])+"*s+"+str(b[0])+","
+ string3 = str(c[4])+"*s^4+"+str(c[3])+"*s^3+"+str(c[2])+"*s^2+"+str(c[1])+"*s+"+str(c[0])+");"
+ string4 = "t="+str(self.tstart)+":"+str(self.tstep)+":"+str(self.tstop)+";"
+ string5 = "deff('u=input(t)','u=50');"
+ string6 = "r=tf2ss(h); a=csim("+typo+",t,r);"
+ string = string1+string2+string3+string4+string5+string6
+ print "I am strin g",string
+ sciscipy.eval(string)
+ self.a = sciscipy.read("a")
+ print "value of a\n",self.a
+
+
+
+
+
+ def work(self, input_items, output_items):
+
+ print "input value:\n",input_items
+ for i in range(0,5):
+ self.b[i] = input_items[0][i]
+ # print "I am b[i]", b[i]
+ #print "I am BBBBB", self.b
+
+ for j in range(0,5):
+ self.c[j] = input_items[1][j]
+ #print "I am c[j]", c[j]
+ #print "I am CCCCC", self.c
+ self.find_resp(self.b,self.c)
+
+
+ out = output_items[0]
+ self.i+=1
+ print "I am self i\n",self.i
+ if self.i >= len(self.a):
+ self.i = 0
+ print "len of out\n",len(out)
+ #time.sleep(0.125)
+ out[:] = numpy.float32(self.a[self.i])
+ #print
+ print "i am out\n",out
+
+ return len(output_items[0])
+
+
diff --git a/gr-input/python/__init__.py b/gr-input/python/__init__.py
new file mode 100644
index 000000000..6e8ef1f55
--- /dev/null
+++ b/gr-input/python/__init__.py
@@ -0,0 +1,53 @@
+#
+# Copyright 2008,2009 Free Software Foundation, Inc.
+#
+# This application is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This application is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+# The presence of this file turns this directory into a Python package
+
+'''
+This is the GNU Radio SCIGEN module. Place your Python package
+description here (python/__init__.py).
+'''
+
+# ----------------------------------------------------------------
+# Temporary workaround for ticket:181 (swig+python problem)
+import sys
+_RTLD_GLOBAL = 0
+try:
+ from dl import RTLD_GLOBAL as _RTLD_GLOBAL
+except ImportError:
+ try:
+ from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
+ except ImportError:
+ pass
+
+if _RTLD_GLOBAL != 0:
+ _dlopenflags = sys.getdlopenflags()
+ sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL)
+# ----------------------------------------------------------------
+
+
+# import any pure python here
+import serial
+
+#
+
+# ----------------------------------------------------------------
+# Tail of workaround
+if _RTLD_GLOBAL != 0:
+ sys.setdlopenflags(_dlopenflags) # Restore original flags
+# ----------------------------------------------------------------
diff --git a/gr-input/python/gr_ramp_source.py b/gr-input/python/gr_ramp_source.py
new file mode 100644
index 000000000..574f9f70b
--- /dev/null
+++ b/gr-input/python/gr_ramp_source.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+import gras
+import numpy
+# Serial is imported in __init__
+class ramp(gras.Block):
+
+
+ def __init__(self):
+ gras.Block.__init__(self,
+ name="ser",
+ in_sig=[numpy.float32],
+ out_sig=[numpy.float32])
+ self.i = 0
+ self.flag=True
+
+ def set_parameters(self, ramp_slope, height_Offset, width_Offset):
+ self.slope = ramp_slope
+ self.width = width_Offset
+ self.offset = height_Offset
+
+ def work(self, input_items, output_items):
+
+ out = output_items[0][0:1]
+ input_stream = input_items[0][0]
+
+ if self.flag:
+ for j in range(self.width):
+ out = self.offset
+ print "OUT", out
+
+ self.produce(0,1) # Produce from port 0 output_items
+ self.consume(0,1) # Consume from port 0 input_items
+
+ self.flag = False
+
+ else:
+
+ self.i = self.i + 1
+ out[:1] =self.offset + self.i*input_stream*self.slope
+
+ print "OUT", out
+
+ self.produce(0,1) # Produce from port 0 output_items
+ self.consume(0,1) # Consume from port 0 input_items
+
diff --git a/gr-input/python/gr_step_source.py b/gr-input/python/gr_step_source.py
new file mode 100644
index 000000000..904f89292
--- /dev/null
+++ b/gr-input/python/gr_step_source.py
@@ -0,0 +1,43 @@
+#!/usr/bin/python
+
+import gras
+import numpy
+# Serial is imported in __init__
+class step(gras.Block):
+
+
+ def __init__(self):
+ gras.Block.__init__(self,
+ name="ser",
+ in_sig=[numpy.float32],
+ out_sig=[numpy.float32])
+ self.flag=True
+
+ def set_parameters(self, step_size, offset, width):
+ self.step_size = step_size
+ self.width = width
+ self.offset = offset
+
+ def work(self, input_items, output_items):
+
+ out = output_items[0][0:1]
+ input_stream = input_items[0][0]
+
+ if self.flag:
+ for i in range(self.width):
+ out[:1] = self.offset
+ print "OUT", out
+
+ self.produce(0,1) # Produce from port 0 output_items
+ self.consume(0,1) # Consume from port 0 input_items
+
+ self.flag = False
+
+ else:
+ out[:1] = self.offset + input_stream*self.step_size
+
+ print "OUT", out
+
+ self.produce(0,1) # Produce from port 0 output_items
+ self.consume(0,1) # Consume from port 0 input_items
+
diff --git a/gr-input/python/matplotsink.py b/gr-input/python/matplotsink.py
new file mode 100755
index 000000000..105009b4d
--- /dev/null
+++ b/gr-input/python/matplotsink.py
@@ -0,0 +1,312 @@
+"""
+$$
+
+Modified for working as a GNU Radio block
+Rakesh Peter (rakesh.peter@gmail.com)
+Last modified: 07.05.2010
+
+$$
+
+This demo demonstrates how to draw a dynamic mpl (matplotlib)
+plot in a wxPython application.
+
+It allows "live" plotting as well as manual zooming to specific
+regions.
+
+Both X and Y axes allow "auto" or "manual" settings. For Y, auto
+mode sets the scaling of the graph to see all the data points.
+For X, auto mode makes the graph "follow" the data. Set it X min
+to manual 0 to always see the whole data from the beginning.
+
+Note: press Enter in the 'manual' text box to make a new value
+affect the plot.
+
+Eli Bendersky (eliben@gmail.com)
+License: this code is in the public domain
+Last modified: 31.07.2008
+"""
+
+import os
+import pprint
+import random
+import sys
+import wx
+import gnuradio.grc.gui
+from gnuradio.grc.gui import Actions,ActionHandler
+# The recommended way to use wx with mpl is with the WXAgg
+# backend.
+#
+import matplotlib
+import matplotlib.pyplot as plt
+import matplotlib.animation as animation
+#matplotlib.use('WXAgg')
+from matplotlib.figure import Figure
+from matplotlib.backends.backend_wxagg import \
+ FigureCanvasWxAgg as FigCanvas, \
+ NavigationToolbar2WxAgg as NavigationToolbar
+import numpy as np
+import pylab
+
+
+class DataGen(object):
+ """ A silly class that generates pseudo-random data for
+ display in the plot.
+ """
+ def __init__(self, init=50):
+ self.data = self.init = init
+
+ def next(self):
+ self._recalc_data()
+ #return self.data
+ return [0.0,1.1,2.2,3.3]
+
+ def _recalc_data(self):
+ delta = random.uniform(-0.5, 0.5)
+ r = random.random()
+
+ if r > 0.9:
+ self.data += delta * 15
+ elif r > 0.8:
+ # attraction to the initial value
+ delta += (0.5 if self.init > self.data else -0.5)
+ self.data += delta
+ else:
+ self.data += delta
+
+
+
+class matplotsink(wx.Panel):
+
+ def __init__(self, parent, title, queue,gsz,zoom):
+ wx.Panel.__init__(self, parent, wx.SIMPLE_BORDER)
+
+ self.gsz = gsz
+ self.parent = parent
+ self.title = title
+ self.q = queue
+ self.zoom=zoom
+ self.paused = False
+
+# self.create_menu()
+# self.create_status_bar()
+ self.create_main_panel()
+
+
+ def create_menu(self):
+ self.menubar = wx.MenuBar()
+
+ menu_file = wx.Menu()
+ m_expt = menu_file.Append(-1, "&Save plot\tCtrl-S", "Save plot to file")
+ self.Bind(wx.EVT_MENU, self.on_save_plot, m_expt)
+ menu_file.AppendSeparator()
+ m_exit = menu_file.Append(-1, "E&xit\tCtrl-X", "Exit")
+ self.Bind(wx.EVT_MENU, self.on_exit, m_exit)
+ self.menubar.Append(menu_file, "&File")
+ self.SetMenuBar(self.menubar)
+
+
+ def create_main_panel(self):
+ self.panel = self
+
+ self.init_plot()
+ self.canvas = FigCanvas(self.panel, -1, self.fig)
+ self.scroll_range = 400
+ self.canvas.SetScrollbar(wx.HORIZONTAL,0,5,self.scroll_range)
+ self.canvas.Bind(wx.EVT_SCROLLWIN,self.OnScrollEvt)
+
+
+ self.pause_button = wx.Button(self.panel, -1, "Pause")
+ self.Bind(wx.EVT_BUTTON, self.on_pause_button, self.pause_button)
+ self.Bind(wx.EVT_UPDATE_UI, self.on_update_pause_button, self.pause_button)
+
+ self.cb_grid = wx.CheckBox(self.panel, -1,
+ "Show Grid",
+ style=wx.ALIGN_RIGHT)
+ self.Bind(wx.EVT_CHECKBOX, self.on_cb_grid, self.cb_grid)
+ self.cb_grid.SetValue(True)
+
+ self.cb_xlab = wx.CheckBox(self.panel, -1,
+ "Show X labels",
+ style=wx.ALIGN_RIGHT)
+ self.Bind(wx.EVT_CHECKBOX, self.on_cb_xlab, self.cb_xlab)
+ self.cb_xlab.SetValue(True)
+
+ self.hbox1 = wx.BoxSizer(wx.HORIZONTAL)
+ self.hbox1.Add(self.pause_button, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+ self.hbox1.AddSpacer(20)
+ self.hbox1.Add(self.cb_grid, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+ self.hbox1.AddSpacer(10)
+ self.hbox1.Add(self.cb_xlab, border=5, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL)
+
+
+ self.vbox = wx.BoxSizer(wx.VERTICAL)
+ self.vbox.Add(self.canvas, 1, flag=wx.LEFT | wx.TOP | wx.GROW)
+ self.vbox.Add(self.hbox1, 0, flag=wx.ALIGN_LEFT | wx.TOP)
+
+ self.panel.SetSizer(self.vbox)
+ self.vbox.Fit(self)
+ self.ani=animation.FuncAnimation(self.fig,self.draw_plot,interval=100)
+
+ def OnScrollEvt(self,event):
+ self.i_start = event.GetPosition()
+ self.i_end = self.i_window + event.GetPosition()
+ self.draw_plot(0)
+
+ def create_status_bar(self):
+ self.statusbar = self.CreateStatusBar()
+
+ def draw_test(self,event):
+ self.xar=np.arange(len(self.q.queue))
+ self.yar=np.array(self.q.queue)
+ self.axes.plot(self.xar,self.yar)
+
+ def init_plot(self):
+ self.dpi = 100
+ self.fig = Figure((3.0, 3.0), dpi=self.dpi)
+ self.fig.set_size_inches(7.0,4.0)
+ self.fig.set_dpi(self.dpi)
+
+ self.axes = self.fig.add_subplot(111)
+ self.axes.set_axis_bgcolor('black')
+ self.axes.set_title(self.title, size=12)
+
+ pylab.setp(self.axes.get_xticklabels(), fontsize=8)
+ pylab.setp(self.axes.get_yticklabels(), fontsize=8)
+ self.i_window = self.gsz
+ self.i_start = 0
+ self.i_end = self.i_start + self.i_window
+ # plot the data as a line series, and save the reference
+ # to the plotted line series
+ #
+ self.plot_data = self.axes.plot(
+ [],
+ linewidth=1,
+ color=(1, 1, 0),
+ )[0]
+
+
+ def draw_plot(self,event):
+ """ Redraws the plot
+ """
+ if len(list(self.q.queue))>1 and not self.paused:
+
+ if self.zoom:
+ xmax = len(list(self.q.queue)) if len(list(self.q.queue)) > 50 else 50
+
+ xmin = xmax - 50
+ # for ymin and ymax, find the minimal and maximal values
+ # in the data set and add a mininal margin.
+ #
+ # note that it's easy to change this scheme to the
+ # minimal/maximal value in the current display, and not
+ # the whole data set.
+ #
+ ymin = round(min(list(self.q.queue)), 0) - 1
+
+ ymax = round(max(list(self.q.queue)), 0) + 1
+
+ self.axes.set_xbound(lower=xmin, upper=xmax)
+ self.axes.set_ybound(lower=ymin, upper=ymax)
+
+ # anecdote: axes.grid assumes b=True if any other flag is
+ # given even if b is set to False.
+ # so just passing the flag into the first statement won't
+ # work.
+ #
+ if self.cb_grid.IsChecked():
+ self.axes.grid(True, color='gray')
+ else:
+ self.axes.grid(False)
+
+ # Using setp here is convenient, because get_xticklabels
+ # returns a list over which one needs to explicitly
+ # iterate, and setp already handles this.
+ #
+ pylab.setp(self.axes.get_xticklabels(),
+ visible=self.cb_xlab.IsChecked())
+
+
+ self.plot_data.set_xdata(np.arange(len(list(self.q.queue))))
+ self.plot_data.set_ydata(np.array(list(self.q.queue)))
+ self.canvas.draw()
+
+ else:
+ if self.cb_grid.IsChecked():
+ self.axes.grid(True, color='gray')
+ else:
+ self.axes.grid(False)
+
+ # Using setp here is convenient, because get_xticklabels
+ # returns a list over which one needs to explicitly
+ # iterate, and setp already handles this.
+
+ pylab.setp(self.axes.get_xticklabels(),
+ visible=self.cb_xlab.IsChecked())
+
+ self.plot_data.set_xdata(np.arange(len(list(self.q.queue)))[self.i_start:self.i_end])
+ self.plot_data.set_ydata(np.array(list(self.q.queue))[self.i_start:self.i_end])
+ self.axes.set_xlim(min(np.arange(len(list(self.q.queue)))[self.i_start:self.i_end]),max(np.arange(len(list(self.q.queue)))[self.i_start:self.i_end]))
+ # if self.zoom:
+ self.axes.set_ylim(min(np.array(list(self.q.queue))),max(np.array(list(self.q.queue))))
+
+ self.canvas.draw()
+
+
+
+ def on_pause_button(self, event):
+ self.paused = not self.paused
+
+ def on_update_pause_button(self, event):
+ label = "Resume" if self.paused else "Pause"
+ self.pause_button.SetLabel(label)
+
+ def on_cb_grid(self, event):
+ self.draw_plot(0)
+
+ def on_cb_xlab(self, event):
+ self.draw_plot(0)
+
+ def on_save_plot(self, event):
+ file_choices = "PNG (*.png)|*.png"
+
+ dlg = wx.FileDialog(
+ self,
+ message="Save plot as...",
+ defaultDir=os.getcwd(),
+ defaultFile="plot.png",
+ wildcard=file_choices,
+ style=wx.SAVE)
+
+ if dlg.ShowModal() == wx.ID_OK:
+ path = dlg.GetPath()
+ self.canvas.print_figure(path, dpi=self.dpi)
+ self.flash_status_message("Saved to %s" % path)
+
+ def on_redraw_timer(self, event):
+ # if paused do not add data, but still redraw the plot
+ # (to respond to scale modifications, grid change, etc.)
+ #
+ if not self.paused:
+ self.data += self.datagen.next()
+ self.draw_plot(0)
+
+
+ def on_exit(self, event):
+ self.Destroy()
+
+ def flash_status_message(self, msg, flash_len_ms=1500):
+ self.statusbar.SetStatusText(msg)
+ self.timeroff = wx.Timer(self)
+ self.Bind(
+ wx.EVT_TIMER,
+ self.on_flash_status_off,
+ self.timeroff)
+ self.timeroff.Start(flash_len_ms, oneShot=True)
+
+ def on_flash_status_off(self, event):
+ self.statusbar.SetStatusText('')
+
+
+
+
+
diff --git a/gr-input/python/plot_sink.py b/gr-input/python/plot_sink.py
new file mode 100755
index 000000000..1c1def3fc
--- /dev/null
+++ b/gr-input/python/plot_sink.py
@@ -0,0 +1,57 @@
+# Hacked from blks2/variable_sink.py
+# Requires modified Matplotsink code
+
+from gnuradio import gr
+import threading
+import numpy
+import matplotsink
+import Queue
+
+class _plot_sink_base(gr.hier_block2, threading.Thread):
+ """
+ The thread polls the message queue for values and writes to matplotsink callback
+ """
+
+ def __init__(self, parent, title, vlen, decim,gsz,zoom):
+ self._vlen = vlen
+ self._parent = parent
+ self._title = title
+ print "Initing block: %s" % title
+
+ self.plotQueue = Queue.Queue()
+ self.win = matplotsink.matplotsink(parent,title, self.plotQueue,gsz,zoom)
+
+ self._item_size = self._size*self._vlen
+ #init hier block
+ gr.hier_block2.__init__(
+ self, 'plot_sink',
+ gr.io_signature(1, 1, self._item_size),
+ gr.io_signature(0, 0, 0),
+ )
+ #create blocks
+ self._msgq = gr.msg_queue(2)
+ message_sink = gr.message_sink(self._item_size, self._msgq, False)
+ #connect
+ self.connect(self, message_sink)
+ #setup thread
+ threading.Thread.__init__(self)
+ self.setDaemon(True)
+ self.start()
+
+ def set_decim(self, decim): self._decimator.set_n(decim)
+
+ def run(self):
+ while True: #truncate to item size, convert to array, callback
+ msg = self._msgq.delete_head().to_string()[-self._item_size:]
+ arr = map(self._cast, numpy.fromstring(msg, self._numpy))
+ print "Sending value:" , arr
+ self.plotQueue.put(self._vlen > 1 and arr or arr[0])
+
+ def print_callback(self, array):
+ print array
+
+class plot_sink_b(_plot_sink_base): _numpy, _size, _cast = numpy.int8, gr.sizeof_char, int
+class plot_sink_s(_plot_sink_base): _numpy, _size, _cast = numpy.int16, gr.sizeof_short, int
+class plot_sink_i(_plot_sink_base): _numpy, _size, _cast = numpy.int32, gr.sizeof_int, int
+class plot_sink_f(_plot_sink_base): _numpy, _size, _cast = numpy.float32, gr.sizeof_float, float
+class plot_sink_c(_plot_sink_base): _numpy, _size, _cast = numpy.complex64, gr.sizeof_gr_complex, complex
diff --git a/gr-input/python/plzr_plot.py b/gr-input/python/plzr_plot.py
new file mode 100644
index 000000000..e1b0ff3fc
--- /dev/null
+++ b/gr-input/python/plzr_plot.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 <+YOU OR YOUR COMPANY+>.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+import sys
+import time
+import numpy
+from gnuradio import gr
+import sciscipy
+
+class plzr_plot(gr.sync_block):
+ """
+ docstring for block add_python
+ """
+ def __init__(self,order):
+ sys.setrecursionlimit(2000)
+ a = []
+# self.flag = 0
+ self.b = [0,0,0,0,0,0]
+ self.c = [0,0,0,0,0,0]
+ self.i = 0
+ self.order=int(order)+1
+ gr.sync_block.__init__(self,
+ name="plzr_plot",
+ in_sig=[numpy.float32,numpy.float32],
+ out_sig=None)
+
+ def plot(self,b,c):
+ string1 = "s=%s; h=syslin('c',"
+ string2 = str(b[4])+"*s^4+"+str(b[3])+"*s^3+"+str(b[2])+"*s^2+"+str(b[1])+"*s+"+str(b[0])+","
+ string3 = str(c[4])+"*s^4+"+str(c[3])+"*s^3+"+str(c[2])+"*s^2+"+str(c[1])+"*s+"+str(c[0])+");"
+ string4 = "plzr(h);"
+
+ string = string1 + string2 +string3 + string4
+ sciscipy.eval(string)
+
+
+
+ def work(self, input_items, output_items):
+ print "I am input", input_items
+ print "I am output", output_items
+ k = self.order
+ for i in range(0,k):
+ self.b[i] = input_items[0][i]
+ print "I am value of b\n",self.b
+
+
+ for j in range(0,k):
+ self.c[j] = input_items[1][j]
+ print "I am vlaue of c\n", self.c
+
+ self.plot(self.b,self.c)
+ in0 = input_items[0]
+ # <+signal processing here+>
+ return len(input_items[0])
+
diff --git a/gr-input/python/ramp_hierblock.py b/gr-input/python/ramp_hierblock.py
new file mode 100644
index 000000000..950615142
--- /dev/null
+++ b/gr-input/python/ramp_hierblock.py
@@ -0,0 +1,19 @@
+import gras
+import numpy
+from gnuradio import gr
+from gnuradio import blocks
+
+# Source block1 import
+import gr_ramp_source
+from gnuradio import blocks
+
+class HierBlock(gr.hier_block2):
+ def __init__(self,ramp_slope, height_Offset, width_Offset):
+ gr.hier_block2.__init__(self,"HierBlock",gr.io_signature(1,1,gr.sizeof_float), gr.io_signature(1,2,gr.sizeof_float))
+ #constant_block initialized
+ self.constant_block = gr.sig_source_f(0,gr.GR_CONST_WAVE,0,0,1)
+ #ramp_source block initialized
+ self.ramp_source=gr_ramp_source.ramp()
+ self.ramp_source.set_parameters(ramp_slope, height_Offset, width_Offset)
+ self.connect(self,(self.constant_block,0),(self.ramp_source,0),self)
+
diff --git a/gr-input/python/step_hierblock.py b/gr-input/python/step_hierblock.py
new file mode 100644
index 000000000..4243606d6
--- /dev/null
+++ b/gr-input/python/step_hierblock.py
@@ -0,0 +1,22 @@
+import gras
+import numpy
+from gnuradio import gr
+from gnuradio import blocks
+
+# Source block1 import
+import gr_step_source
+from gnuradio import blocks
+
+class HierBlock(gr.hier_block2):
+ def __init__(self, step_size, H_Off, W_Off):
+ gr.hier_block2.__init__(self, "HierBlock",
+ gr.io_signature(1,1,gr.sizeof_float),
+ gr.io_signature(1,2,gr.sizeof_float))
+
+ # constant_block initialized
+ self.constant_block = gr.sig_source_f(0, gr.GR_CONST_WAVE,0,0,1)
+ # step_source block initialized
+ self.step_source = gr_step_source.step()
+ self.step_source.set_parameters(step_size, H_Off, W_Off)
+ self.connect(self, (self.constant_block,0) , (self.step_source,0), self)
+