summaryrefslogtreecommitdiff
path: root/gr-fec
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-05-16 15:58:47 -0400
committerTom Rondeau <tom@trondeau.com>2014-05-17 17:45:17 -0400
commit15ef5ba664896481faba85c39dc3539f5a4ee5aa (patch)
treebcaa2b1cb4011b5e06a6594ea51f5bb8f71b87c6 /gr-fec
parentbbc5882fb9ac4b1a9815c9c634d977e8776d73fa (diff)
fec: wip: adding extended encoder for async version.
not quite working yet, needs work on the message-passing hier_block and added async puncturing block.
Diffstat (limited to 'gr-fec')
-rw-r--r--gr-fec/grc/fec_block_tree.xml1
-rw-r--r--gr-fec/grc/fec_extended_async_encoder.xml38
-rw-r--r--gr-fec/lib/CMakeLists.txt2
-rw-r--r--gr-fec/python/fec/CMakeLists.txt1
-rw-r--r--gr-fec/python/fec/__init__.py1
-rw-r--r--gr-fec/python/fec/extended_async_encoder.py67
6 files changed, 110 insertions, 0 deletions
diff --git a/gr-fec/grc/fec_block_tree.xml b/gr-fec/grc/fec_block_tree.xml
index 93b282903c..c229be2e4a 100644
--- a/gr-fec/grc/fec_block_tree.xml
+++ b/gr-fec/grc/fec_block_tree.xml
@@ -22,6 +22,7 @@
<block>variable_dummy_encoder_def</block>
</cat>
<block>fec_extended_encoder</block>
+ <block>fec_extended_async_encoder</block>
<block>fec_extended_decoder</block>
<block>fec_generic_encoder</block>
<block>fec_generic_decoder</block>
diff --git a/gr-fec/grc/fec_extended_async_encoder.xml b/gr-fec/grc/fec_extended_async_encoder.xml
new file mode 100644
index 0000000000..e61696bcc4
--- /dev/null
+++ b/gr-fec/grc/fec_extended_async_encoder.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<block>
+ <name>FEC Extended Async Encoder</name>
+ <key>fec_extended_async_encoder</key>
+ <import>from gnuradio import fec</import>
+ <make>fec.extended_async_encoder(encoder_obj_list=$encoder_list, puncpat=$puncpat)</make>
+
+ <param>
+ <name>Encoder Objects</name>
+ <key>encoder_list</key>
+ <value>encoder_variable</value>
+ <type>raw</type>
+ </param>
+
+ <param>
+ <name>Puncture Pattern</name>
+ <key>puncpat</key>
+ <value>'11'</value>
+ <type>string</type>
+ </param>
+
+ <sink>
+ <name>in</name>
+ <type>message</type>
+ <optional>1</optional>
+ </sink>
+
+ <source>
+ <name>out</name>
+ <type>message</type>
+ <optional>1</optional>
+ </source>
+
+ <doc>
+
+ </doc>
+
+</block>
diff --git a/gr-fec/lib/CMakeLists.txt b/gr-fec/lib/CMakeLists.txt
index 16f47c8ab8..1fba94e74e 100644
--- a/gr-fec/lib/CMakeLists.txt
+++ b/gr-fec/lib/CMakeLists.txt
@@ -29,6 +29,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${GR_FEC_INCLUDE_DIRS}
+ ${GR_BLOCKS_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${VOLK_INCLUDE_DIRS}
${LOG4CPP_INCLUDE_DIRS}
@@ -89,6 +90,7 @@ if(MSVC)
endif(MSVC)
list(APPEND gnuradio_fec_libs
+ gnuradio-blocks
gnuradio-runtime
volk
${Boost_LIBRARIES}
diff --git a/gr-fec/python/fec/CMakeLists.txt b/gr-fec/python/fec/CMakeLists.txt
index 2e435ba784..d810237761 100644
--- a/gr-fec/python/fec/CMakeLists.txt
+++ b/gr-fec/python/fec/CMakeLists.txt
@@ -30,6 +30,7 @@ GR_PYTHON_INSTALL(
capillary_threaded_encoder.py
threaded_decoder.py
threaded_encoder.py
+ extended_async_encoder.py
fec_test.py
bercurve_generator.py
DESTINATION ${GR_PYTHON_DIR}/gnuradio/fec
diff --git a/gr-fec/python/fec/__init__.py b/gr-fec/python/fec/__init__.py
index 96be81ce1c..11f9c29f83 100644
--- a/gr-fec/python/fec/__init__.py
+++ b/gr-fec/python/fec/__init__.py
@@ -38,6 +38,7 @@ from threaded_encoder import threaded_encoder
from threaded_decoder import threaded_decoder
from capillary_threaded_decoder import capillary_threaded_decoder
from capillary_threaded_encoder import capillary_threaded_encoder
+from extended_async_encoder import extended_async_encoder
from fec_test import fec_test
diff --git a/gr-fec/python/fec/extended_async_encoder.py b/gr-fec/python/fec/extended_async_encoder.py
new file mode 100644
index 0000000000..fffe64aeb8
--- /dev/null
+++ b/gr-fec/python/fec/extended_async_encoder.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+#
+# Copyright 2014 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.
+#
+
+from gnuradio import gr
+import fec_swig as fec
+from bitflip import read_bitlist
+import weakref
+
+class extended_async_encoder(gr.hier_block2):
+ def __init__(self, encoder_obj_list, puncpat=None):
+ gr.hier_block2.__init__(self, "extended_async_encoder",
+ gr.io_signature(0, 0, 0),
+ gr.io_signature(0, 0, 0))
+
+ # Set us up as a message passing block
+ self.message_port_register_hier_in('in')
+ self.message_port_register_hier_out('out')
+
+ self.puncpat=puncpat
+
+ # If it's a list of encoders, take the first one, unless it's
+ # a list of lists of encoders.
+ if(type(encoder_obj_list) == list):
+ # This block doesn't handle parallelism of > 1
+ if(type(encoder_obj_list[0]) == list):
+ gr.log.info("fec.extended_encoder: Parallelism must be 0 or 1.")
+ raise AttributeError
+
+ encoder_obj = encoder_obj_list[0]
+
+ # Otherwise, just take it as is
+ else:
+ encoder_obj = encoder_obj_list
+
+ self.encoder = fec.async_encoder(encoder_obj)
+
+ #self.puncture = None
+ #if self.puncpat != '11':
+ # self.puncture = fec.puncture_bb(len(puncpat), read_bitlist(puncpat), 0)
+
+ self.msg_connect(weakref.proxy(self), "in", self.encoder, "in")
+
+ #if(self.puncture):
+ # self.msg_connect(self.encoder, "out", self.puncture, "in")
+ # self.msg_connect(self.puncture, "out", weakref.proxy(self), "out")
+ #else:
+ # self.msg_connect(self.encoder, "out", weakref.proxy(self), "out")
+ self.msg_connect(self.encoder, "out", weakref.proxy(self), "out")