diff options
355 files changed, 39147 insertions, 1587 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 404ce04347..935669d6d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,6 +194,11 @@ add_custom_target(uninstall ) ######################################################################## +# Setup Boost for global use (within this build) +######################################################################## +include(GrBoost) + +######################################################################## # Enable python component ######################################################################## find_package(PythonLibs 2) diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake index 7b642046e6..62caab4b51 100644 --- a/cmake/Modules/GrTest.cmake +++ b/cmake/Modules/GrTest.cmake @@ -66,7 +66,7 @@ function(GR_ADD_TEST test_name) file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? - set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") + set(environs "VOLK_GENERIC=1" "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") list(APPEND environs ${GR_TEST_ENVIRONS}) #http://www.cmake.org/pipermail/cmake/2009-May/029464.html diff --git a/docs/exploring-gnuradio/fm_rx.grc b/docs/exploring-gnuradio/fm_rx.grc index 1d1472a5b5..5cf0d655df 100644 --- a/docs/exploring-gnuradio/fm_rx.grc +++ b/docs/exploring-gnuradio/fm_rx.grc @@ -319,7 +319,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -386,7 +386,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -473,7 +473,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -630,7 +630,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -717,7 +717,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -804,7 +804,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> diff --git a/docs/exploring-gnuradio/fm_tx.grc b/docs/exploring-gnuradio/fm_tx.grc index a156c1a3e0..2f047bf09b 100644 --- a/docs/exploring-gnuradio/fm_tx.grc +++ b/docs/exploring-gnuradio/fm_tx.grc @@ -344,7 +344,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -431,7 +431,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -498,7 +498,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -585,7 +585,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt index d5a04e9f57..75410abbb0 100644 --- a/gnuradio-runtime/CMakeLists.txt +++ b/gnuradio-runtime/CMakeLists.txt @@ -60,6 +60,13 @@ GR_SET_GLOBAL(GNURADIO_RUNTIME_PYTHONPATH ${GNURADIO_RUNTIME_PYTHONPATH}) # Register controlport component ######################################################################## +if(ENABLE_STATIC_LIBS) + set(NOT_STATIC_LIBS False) + message(STATUS "ControlPort is incompatible with static library builds. Disabling.") +else(ENABLE_STATIC_LIBS) + set(NOT_STATIC_LIBS True) +endif(ENABLE_STATIC_LIBS) + FIND_PACKAGE(ICE-3.5) # check for ICE 3.5 if(NOT ICE_FOUND) message(STATUS "ICE 3.5 not found. Looking for 3.4") @@ -68,21 +75,22 @@ endif(NOT ICE_FOUND) FIND_PACKAGE(SWIG) if(SWIG_FOUND) - set(SWIG_VERSION_CHECK FALSE) - if("${SWIG_VERSION}" VERSION_GREATER "2.0.0") - set(SWIG_VERSION_CHECK TRUE) - else("${SWIG_VERSION}" VERSION_GREATER "2.0.0") - message(STATUS "") - message(STATUS "Ctrlport requires SWIG version >= 2.0") - endif() + set(SWIG_VERSION_CHECK FALSE) + if("${SWIG_VERSION}" VERSION_GREATER "2.0.0") + set(SWIG_VERSION_CHECK TRUE) + else("${SWIG_VERSION}" VERSION_GREATER "2.0.0") + message(STATUS "") + message(STATUS "Ctrlport requires SWIG version >= 2.0") + endif() endif(SWIG_FOUND) GR_REGISTER_COMPONENT("gr-ctrlport" ENABLE_GR_CTRLPORT - Boost_FOUND - SWIG_FOUND - SWIG_VERSION_CHECK - ICE_FOUND - ENABLE_GNURADIO_RUNTIME + Boost_FOUND + SWIG_FOUND + SWIG_VERSION_CHECK + ICE_FOUND + ENABLE_GNURADIO_RUNTIME + NOT_STATIC_LIBS ) ######################################################################## diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h b/gnuradio-runtime/include/gnuradio/basic_block.h index 69775865ee..b413274ded 100644 --- a/gnuradio-runtime/include/gnuradio/basic_block.h +++ b/gnuradio-runtime/include/gnuradio/basic_block.h @@ -144,14 +144,41 @@ namespace gr { virtual ~basic_block(); long unique_id() const { return d_unique_id; } long symbolic_id() const { return d_symbolic_id; } + + /*! The name of the block */ std::string name() const { return d_name; } + + /*! + * The sybolic name of the block, which is used in the + * block_registry. The name is assigned by the block's constructor + * and never changes during the life of the block. + */ std::string symbol_name() const { return d_symbol_name; } + gr::io_signature::sptr input_signature() const { return d_input_signature; } gr::io_signature::sptr output_signature() const { return d_output_signature; } basic_block_sptr to_basic_block(); // Needed for Python type coercion + + /*! + * True if the block has an alias (see set_block_alias). + */ bool alias_set() { return !d_symbol_alias.empty(); } + + /*! + * Returns the block's alias as a string. + */ std::string alias(){ return alias_set()?d_symbol_alias:symbol_name(); } + + /*! + * Returns the block's alias as PMT. + */ pmt::pmt_t alias_pmt(){ return pmt::intern(alias()); } + + /*! + * Set's a new alias for the block; also adds an entry into the + * block_registry to get the block using either the alias or the + * original symbol name. + */ void set_block_alias(std::string name); // ** Message passing interface ** @@ -248,6 +275,10 @@ namespace gr { } return false; } + + const msg_queue_map_t& get_msg_map(void) const { + return msg_queue; + } #ifdef GR_CTRLPORT /*! diff --git a/gnuradio-runtime/include/gnuradio/block_registry.h b/gnuradio-runtime/include/gnuradio/block_registry.h index 31a4eab51b..86e5528dd1 100644 --- a/gnuradio-runtime/include/gnuradio/block_registry.h +++ b/gnuradio-runtime/include/gnuradio/block_registry.h @@ -44,6 +44,7 @@ namespace gr { std::string register_symbolic_name(basic_block* block); void register_symbolic_name(basic_block* block, std::string name); + void update_symbolic_name(basic_block* block, std::string name); basic_block_sptr block_lookup(pmt::pmt_t symbol); diff --git a/gnuradio-runtime/include/gnuradio/logger.h.in b/gnuradio-runtime/include/gnuradio/logger.h.in index 2ba0b62851..8e8cd2fb1e 100644 --- a/gnuradio-runtime/include/gnuradio/logger.h.in +++ b/gnuradio-runtime/include/gnuradio/logger.h.in @@ -330,7 +330,7 @@ namespace gr { * This is a singleton that cna launch a thread to wathc a config file for changes * \ingroup logging */ - class logger_config + class GR_RUNTIME_API logger_config { private: /*! \brief filename of logger config file */ @@ -710,7 +710,7 @@ namespace gr { * \ingroup logging * */ - class logger + class GR_RUNTIME_API logger { private: /*! \brief logger pointer to logger associated wiith this wrapper class */ diff --git a/gnuradio-runtime/include/gnuradio/prefs.h b/gnuradio-runtime/include/gnuradio/prefs.h index b675c83491..a9a28586ab 100644 --- a/gnuradio-runtime/include/gnuradio/prefs.h +++ b/gnuradio-runtime/include/gnuradio/prefs.h @@ -46,7 +46,6 @@ namespace gr { { public: static prefs *singleton(); - static void set_singleton(prefs *p); prefs(); virtual ~prefs(); diff --git a/gnuradio-runtime/include/pmt/pmt.h b/gnuradio-runtime/include/pmt/pmt.h index 5929975a29..3e17571b23 100644 --- a/gnuradio-runtime/include/pmt/pmt.h +++ b/gnuradio-runtime/include/pmt/pmt.h @@ -249,7 +249,8 @@ PMT_API std::complex<double> to_complex(pmt_t z); * ------------------------------------------------------------------------ */ -extern PMT_API const pmt_t PMT_NIL; //< the empty list +#define PMT_NIL get_PMT_NIL() +PMT_API pmt_t get_PMT_NIL(); //! Return true if \p x is the empty list, otherwise return false. PMT_API bool is_null(const pmt_t& x); diff --git a/gnuradio-runtime/include/pmt/pmt_sugar.h b/gnuradio-runtime/include/pmt/pmt_sugar.h index 870b81902e..424f85cb01 100644 --- a/gnuradio-runtime/include/pmt/pmt_sugar.h +++ b/gnuradio-runtime/include/pmt/pmt_sugar.h @@ -51,10 +51,16 @@ namespace pmt { return from_long(x); } - //! Make pmt long + //! Make pmt uint64 + static inline pmt_t + mp(long unsigned x){ + return from_uint64(x); + } + + //! Make pmt uint64 static inline pmt_t mp(long long unsigned x){ - return from_long(x); + return from_uint64(x); } //! Make pmt long diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt index cd7f0c7549..a3f0d4cb55 100644 --- a/gnuradio-runtime/lib/CMakeLists.txt +++ b/gnuradio-runtime/lib/CMakeLists.txt @@ -198,6 +198,21 @@ add_dependencies(gnuradio-runtime pmt_generated runtime_generated_includes ) +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-runtime_static STATIC ${gnuradio_runtime_sources}) + + add_dependencies(gnuradio-runtime_static gnuradio_runtime) + + if(NOT WIN32) + set_target_properties(gnuradio-runtime_static + PROPERTIES OUTPUT_NAME gnuradio-runtime) + endif(NOT WIN32) + + install(TARGETS gnuradio-runtime_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "runtime_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + ######################################################################## # Setup tests ######################################################################## @@ -239,4 +254,3 @@ target_link_libraries(gr_runtime_test test-gnuradio-runtime) GR_ADD_TEST(gr-runtime-test gr_runtime_test) endif(ENABLE_TESTING) - diff --git a/gnuradio-runtime/lib/basic_block.cc b/gnuradio-runtime/lib/basic_block.cc index 3cd23c8996..686c1d6e65 100644 --- a/gnuradio-runtime/lib/basic_block.cc +++ b/gnuradio-runtime/lib/basic_block.cc @@ -72,7 +72,16 @@ namespace gr { void basic_block::set_block_alias(std::string name) { - global_block_registry.register_symbolic_name(this, name); + // Only keep one alias'd name around for each block. If we don't + // have an alias, add it; if we do, update the entry in the + // registry. + if(alias_set()) + global_block_registry.update_symbolic_name(this, name); + else + global_block_registry.register_symbolic_name(this, name); + + // set the block's alias + d_symbol_alias = name; } // ** Message passing interface ** diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc index 9e4fcf5cca..6309bca9b1 100644 --- a/gnuradio-runtime/lib/block.cc +++ b/gnuradio-runtime/lib/block.cc @@ -111,7 +111,7 @@ namespace gr { block::~block() { - global_block_registry.unregister_primitive(alias()); + global_block_registry.unregister_primitive(symbol_name()); } unsigned diff --git a/gnuradio-runtime/lib/block_registry.cc b/gnuradio-runtime/lib/block_registry.cc index c4dc7647d6..5241ef9922 100644 --- a/gnuradio-runtime/lib/block_registry.cc +++ b/gnuradio-runtime/lib/block_registry.cc @@ -90,6 +90,26 @@ namespace gr { d_ref_map = pmt::dict_add(d_ref_map, pmt::intern(name), pmt::make_any(block)); } + void + block_registry::update_symbolic_name(basic_block* block, std::string name) + { + gr::thread::scoped_lock guard(d_mutex); + + if(pmt::dict_has_key(d_ref_map, pmt::intern(name))) { + throw std::runtime_error("symbol already exists, can not re-use!"); + } + + // If we don't already have an alias, don't try and delete it. + if(block->alias_set()) { + // And make sure that the registry has the alias key. + // We test both in case the block's and registry ever get out of sync. + if(pmt::dict_has_key(d_ref_map, block->alias_pmt())) { + d_ref_map = pmt::dict_delete(d_ref_map, block->alias_pmt()); + } + } + d_ref_map = pmt::dict_add(d_ref_map, pmt::intern(name), pmt::make_any(block)); + } + basic_block_sptr block_registry::block_lookup(pmt::pmt_t symbol) { diff --git a/gnuradio-runtime/lib/flowgraph.cc b/gnuradio-runtime/lib/flowgraph.cc index 3d8dfea65a..abe51f741d 100644 --- a/gnuradio-runtime/lib/flowgraph.cc +++ b/gnuradio-runtime/lib/flowgraph.cc @@ -155,8 +155,14 @@ namespace gr { if(FLOWGRAPH_DEBUG) std::cout << "check_valid_port( " << e.block() << ", " << e.port() << ")\n"; - if(!e.block()->has_msg_port(e.port())) + if(!e.block()->has_msg_port(e.port())) { + const gr::basic_block::msg_queue_map_t& msg_map = e.block()->get_msg_map(); + std::cout << "Could not find port: " << e.port() << " in:" << std::endl; + for (gr::basic_block::msg_queue_map_t::const_iterator it = msg_map.begin(); it != msg_map.end(); ++it) + std::cout << it->first << std::endl; + std::cout << std::endl; throw std::invalid_argument("invalid msg port in connect() or disconnect()"); + } } void diff --git a/gnuradio-runtime/lib/pmt/CMakeLists.txt b/gnuradio-runtime/lib/pmt/CMakeLists.txt index dc4fe1be46..32c0e57a6a 100644 --- a/gnuradio-runtime/lib/pmt/CMakeLists.txt +++ b/gnuradio-runtime/lib/pmt/CMakeLists.txt @@ -114,6 +114,21 @@ add_dependencies(gnuradio-pmt pmt_generated ) +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-pmt_static STATIC ${pmt_sources}) + + add_dependencies(gnuradio-pmt_static pmt_generated) + + if(NOT WIN32) + set_target_properties(gnuradio-pmt_static + PROPERTIES OUTPUT_NAME gnuradio-pmt) + endif(NOT WIN32) + + install(TARGETS gnuradio-pmt_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "runtime_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + ######################################################################## # Setup tests ######################################################################## diff --git a/gnuradio-runtime/lib/pmt/generate_unv.py b/gnuradio-runtime/lib/pmt/generate_unv.py index 7562df46f8..6218099fc1 100755 --- a/gnuradio-runtime/lib/pmt/generate_unv.py +++ b/gnuradio-runtime/lib/pmt/generate_unv.py @@ -76,6 +76,7 @@ includes = """ #endif #include <vector> #include <pmt/pmt.h> +#include <boost/lexical_cast.hpp> #include "pmt_int.h" """ diff --git a/gnuradio-runtime/lib/pmt/pmt.cc b/gnuradio-runtime/lib/pmt/pmt.cc index e3b93255bc..082b98a80d 100644 --- a/gnuradio-runtime/lib/pmt/pmt.cc +++ b/gnuradio-runtime/lib/pmt/pmt.cc @@ -160,9 +160,14 @@ _any(pmt_t x) const pmt_t PMT_T = pmt_t(new pmt_bool()); // singleton const pmt_t PMT_F = pmt_t(new pmt_bool()); // singleton -const pmt_t PMT_NIL = pmt_t(new pmt_null()); // singleton const pmt_t PMT_EOF = cons(PMT_NIL, PMT_NIL); // singleton +pmt_t get_PMT_NIL() +{ + static pmt_t NIL = pmt_t(new pmt_null()); + return NIL; +} + //////////////////////////////////////////////////////////////////////////// // Booleans //////////////////////////////////////////////////////////////////////////// diff --git a/gnuradio-runtime/lib/pmt/pmt_int.h b/gnuradio-runtime/lib/pmt/pmt_int.h index ca90c5a475..49bde52063 100644 --- a/gnuradio-runtime/lib/pmt/pmt_int.h +++ b/gnuradio-runtime/lib/pmt/pmt_int.h @@ -239,6 +239,7 @@ public: virtual void *uniform_writable_elements(size_t &len) = 0; virtual size_t length() const = 0; virtual size_t itemsize() const = 0; + virtual const std::string string_ref(size_t k) const { return std::string("not implemented"); } }; #include "pmt_unv_int.h" diff --git a/gnuradio-runtime/lib/pmt/pmt_io.cc b/gnuradio-runtime/lib/pmt/pmt_io.cc index 17bdee408f..e63bae4994 100644 --- a/gnuradio-runtime/lib/pmt/pmt_io.cc +++ b/gnuradio-runtime/lib/pmt/pmt_io.cc @@ -110,9 +110,16 @@ write(pmt_t obj, std::ostream &port) port << "#<dict>"; } else if (is_uniform_vector(obj)){ - // FIXME - // port << "#<uniform-vector " << obj << ">"; - port << "#<uniform-vector>"; + port << "#["; + size_t len = length(obj); + if (len) + { + pmt_uniform_vector *uv = static_cast<pmt_uniform_vector*>(obj.get()); + port << uv->string_ref(0); + for (size_t i = 1; i < len; i++) + port << " " << uv->string_ref(i); + } + port << "]"; } else { error: diff --git a/gnuradio-runtime/lib/pmt/unv_template.cc.t b/gnuradio-runtime/lib/pmt/unv_template.cc.t index 0342367f7e..c8020e7de2 100644 --- a/gnuradio-runtime/lib/pmt/unv_template.cc.t +++ b/gnuradio-runtime/lib/pmt/unv_template.cc.t @@ -90,7 +90,7 @@ init_@TAG@vector(size_t k, const @TYPE@ *data) pmt_t init_@TAG@vector(size_t k, const std::vector< @TYPE@ > &data) { - + return pmt_t(new pmt_@TAG@vector(k, &data[0])); } @@ -138,4 +138,10 @@ const std::vector< @TYPE@ > return _@TAG@vector(vector)->writable_elements(len); } +const std::string +pmt_@TAG@vector::string_ref(size_t k) const +{ + return boost::lexical_cast< std::string, @TYPE@ > (ref(k)); +} + } /* namespace pmt */ diff --git a/gnuradio-runtime/lib/pmt/unv_template.h.t b/gnuradio-runtime/lib/pmt/unv_template.h.t index 93ca684463..ab5c163570 100644 --- a/gnuradio-runtime/lib/pmt/unv_template.h.t +++ b/gnuradio-runtime/lib/pmt/unv_template.h.t @@ -21,4 +21,5 @@ public: @TYPE@ *writable_elements(size_t &len); const void *uniform_elements(size_t &len); void *uniform_writable_elements(size_t &len); + virtual const std::string string_ref(size_t k) const; }; diff --git a/gnuradio-runtime/lib/prefs.cc b/gnuradio-runtime/lib/prefs.cc index d03c6777eb..b7fcaada9d 100644 --- a/gnuradio-runtime/lib/prefs.cc +++ b/gnuradio-runtime/lib/prefs.cc @@ -36,22 +36,12 @@ namespace fs = boost::filesystem; namespace gr { - /* - * Stub implementations - */ - static prefs s_default_singleton; - static prefs *s_singleton = &s_default_singleton; - prefs * prefs::singleton() { - return s_singleton; - } - - void - prefs::set_singleton(prefs *p) - { - s_singleton = p; + static prefs instance; // Guaranteed to be destroyed. + // Instantiated on first use. + return &instance; } prefs::prefs() diff --git a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt index 9d6f4dd718..ddad2c448a 100644 --- a/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt +++ b/gnuradio-runtime/python/gnuradio/gr/CMakeLists.txt @@ -23,6 +23,7 @@ include(GrPython) GR_PYTHON_INSTALL(FILES __init__.py tag_utils.py + packet_utils.py gateway.py gr_threading.py gr_threading_23.py diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py b/gnuradio-runtime/python/gnuradio/gr/__init__.py index 94a5c9ec2b..4fc55c68b2 100644 --- a/gnuradio-runtime/python/gnuradio/gr/__init__.py +++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py @@ -48,3 +48,11 @@ from gateway import basic_block, sync_block, decim_block, interp_block # Force the preference database to be initialized prefs = prefs.singleton + +log = gr.logger("log") +log.add_console_appender(prefs().get_string("LOG", "log_level", "off"), 'gr::log %d :%p: %m%n') +log.set_level(prefs().get_string("LOG", "log_level", "notset")) + +log_debug = gr.logger("log_debug") +log_debug.add_console_appender(prefs().get_string("LOG", "debug_level", "off"), 'gr::debug %d :%p: %m%n') +log_debug.set_level(prefs().get_string("LOG", "debug_level", "notset")) diff --git a/gnuradio-runtime/python/gnuradio/gr/packet_utils.py b/gnuradio-runtime/python/gnuradio/gr/packet_utils.py new file mode 100644 index 0000000000..7ae42e88e3 --- /dev/null +++ b/gnuradio-runtime/python/gnuradio/gr/packet_utils.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python +# +# Copyright 2013 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 pmt + +def make_lengthtags(lengths, offsets, tagname='length', vlen=1): + tags = [] + assert(len(offsets) == len(lengths)) + for offset, length in zip(offsets, lengths): + tag = gr.tag_t() + tag.offset = offset/vlen + tag.key = pmt.string_to_symbol(tagname) + tag.value = pmt.from_long(length/vlen) + tags.append(tag) + return tags + +def string_to_vector(string): + v = [] + for s in string: + v.append(ord(s)) + return v + +def strings_to_vectors(strings, tsb_tag_key): + vs = [string_to_vector(string) for string in strings] + return packets_to_vectors(vs, tsb_tag_key) + +def vector_to_string(v): + s = [] + for d in v: + s.append(chr(d)) + return ''.join(s) + +def vectors_to_strings(data, tags, tsb_tag_key): + packets = vectors_to_packets(data, tags, tsb_tag_key) + return [vector_to_string(packet) for packet in packets] + +def count_bursts(data, tags, tsb_tag_key, vlen=1): + lengthtags = [t for t in tags + if pmt.symbol_to_string(t.key) == tsb_tag_key] + lengths = {} + for tag in lengthtags: + if tag.offset in lengths: + raise ValueError( + "More than one tags with key {0} with the same offset={1}." + .format(tsb_tag_key, tag.offset)) + lengths[tag.offset] = pmt.to_long(tag.value)*vlen + in_burst = False + in_packet = False + packet_length = None + packet_pos = None + burst_count = 0 + for pos in range(len(data)): + if pos in lengths: + if in_packet: + print("Got tag at pos {0} current packet_pos is {1}".format(pos, packet_pos)) + raise StandardError("Received packet tag while in packet.") + packet_pos = -1 + packet_length = lengths[pos] + in_packet = True + if not in_burst: + burst_count += 1 + in_burst = True + elif not in_packet: + in_burst = False + if in_packet: + packet_pos += 1 + if packet_pos == packet_length-1: + in_packet = False + packet_pos = None + return burst_count + +def vectors_to_packets(data, tags, tsb_tag_key, vlen=1): + lengthtags = [t for t in tags + if pmt.symbol_to_string(t.key) == tsb_tag_key] + lengths = {} + for tag in lengthtags: + if tag.offset in lengths: + raise ValueError( + "More than one tags with key {0} with the same offset={1}." + .format(tsb_tag_key, tag.offset)) + lengths[tag.offset] = pmt.to_long(tag.value)*vlen + if 0 not in lengths: + raise ValueError("There is no tag with key {0} and an offset of 0" + .format(tsb_tag_key)) + pos = 0 + packets = [] + while pos < len(data): + if pos not in lengths: + raise ValueError("There is no tag with key {0} and an offset of {1}." + "We were expecting one." + .format(tsb_tag_key, pos)) + length = lengths[pos] + if length == 0: + raise ValueError("Packets cannot have zero length.") + if pos+length > len(data): + raise ValueError("The final packet is incomplete.") + packets.append(data[pos: pos+length]) + pos += length + return packets + +def packets_to_vectors(packets, tsb_tag_key, vlen=1): + """ Returns a single data vector and a set of tags. + If used with blocks.vector_source_X, this set of data + and tags will produced a correct tagged stream. """ + tags = [] + data = [] + offset = 0 + for packet in packets: + data.extend(packet) + tag = gr.tag_t() + tag.offset = offset/vlen + tag.key = pmt.string_to_symbol(tsb_tag_key) + tag.value = pmt.from_long(len(packet)/vlen) + tags.append(tag) + offset = offset + len(packet) + return data, tags + diff --git a/gnuradio-runtime/python/gnuradio/gr/prefs.py b/gnuradio-runtime/python/gnuradio/gr/prefs.py deleted file mode 100644 index 17f5bfb54c..0000000000 --- a/gnuradio-runtime/python/gnuradio/gr/prefs.py +++ /dev/null @@ -1,127 +0,0 @@ -# -# Copyright 2006,2009 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. -# - -import gnuradio_runtime as gsp -_prefs_base = gsp.prefs - - -import ConfigParser -import os -import os.path -import sys -import glob - - -def _user_prefs_filename(): - return os.path.expanduser('~/.gnuradio/config.conf') - -def _sys_prefs_dirname(): - return gsp.prefsdir() - -def _bool(x): - """ - Try to coerce obj to a True or False - """ - if isinstance(x, bool): - return x - if isinstance(x, (float, int)): - return bool(x) - raise TypeError, x - - -class _prefs(_prefs_base): - """ - Derive our 'real class' from the stubbed out base class that has support - for SWIG directors. This allows C++ code to magically and transparently - invoke the methods in this python class. - """ - def __init__(self): - _prefs_base.__init__(self) - self.cp = ConfigParser.RawConfigParser() - self.__getattr__ = lambda self, name: getattr(self.cp, name) - - def _sys_prefs_filenames(self): - dir = _sys_prefs_dirname() - try: - fnames = glob.glob(os.path.join(dir, '*.conf')) - except (IOError, OSError): - return [] - fnames.sort() - return fnames - - def _read_files(self): - filenames = self._sys_prefs_filenames() - filenames.append(_user_prefs_filename()) - #print "filenames: ", filenames - self.cp.read(filenames) - - # ---------------------------------------------------------------- - # These methods override the C++ virtual methods of the same name - # ---------------------------------------------------------------- - def has_section(self, section): - return self.cp.has_section(section) - - def has_option(self, section, option): - return self.cp.has_option(section, option) - - def get_string(self, section, option, default_val): - try: - return self.cp.get(section, option) - except: - return default_val - - def get_bool(self, section, option, default_val): - try: - return self.cp.getboolean(section, option) - except: - return default_val - - def get_long(self, section, option, default_val): - try: - return self.cp.getint(section, option) - except: - return default_val - - def get_double(self, section, option, default_val): - try: - return self.cp.getfloat(section, option) - except: - return default_val - # ---------------------------------------------------------------- - # End override of C++ virtual methods - # ---------------------------------------------------------------- - - -_prefs_db = _prefs() - -# if GR_DONT_LOAD_PREFS is set, don't load them. -# (make check uses this to avoid interactions.) -if os.getenv("GR_DONT_LOAD_PREFS", None) is None: - _prefs_db._read_files() - - -_prefs_base.set_singleton(_prefs_db) # tell C++ what instance to use - -def prefs(): - """ - Return the global preference data base - """ - return _prefs_db diff --git a/gnuradio-runtime/python/pmt/__init__.py b/gnuradio-runtime/python/pmt/__init__.py index 00940e4cc1..1c7db73322 100644 --- a/gnuradio-runtime/python/pmt/__init__.py +++ b/gnuradio-runtime/python/pmt/__init__.py @@ -48,6 +48,9 @@ except ImportError: __path__.append(os.path.join(dirname, "..", "..", "swig")) from pmt_swig import * +# due to changes in the PMT_NIL singleton for static builds, we force +# this into Python here. +PMT_NIL = get_PMT_NIL() + from pmt_to_python import pmt_to_python as to_python from pmt_to_python import python_to_pmt as to_pmt - diff --git a/gnuradio-runtime/python/pmt/pmt_to_python.py b/gnuradio-runtime/python/pmt/pmt_to_python.py index 3344eba163..e08b7265de 100644 --- a/gnuradio-runtime/python/pmt/pmt_to_python.py +++ b/gnuradio-runtime/python/pmt/pmt_to_python.py @@ -21,6 +21,10 @@ try: import pmt_swig as pmt except: import pmt import numpy +# SWIG isn't taking in the #define PMT_NIL; +# getting the singleton locally. +PMT_NIL = pmt.get_PMT_NIL() + #define missing def pmt_to_tuple(p): elems = list() @@ -41,7 +45,7 @@ def pmt_to_vector(p): return v def pmt_from_vector(p): - v = pmt.make_vector(len(p), pmt.PMT_NIL) + v = pmt.make_vector(len(p), PMT_NIL) for i, elem in enumerate(p): pmt.vector_set(v, i, python_to_pmt(elem)) return v @@ -99,7 +103,7 @@ def uvector_to_numpy(uvector): raise ValueError("unsupported uvector data type for conversion to numpy array %s"%(uvector)) type_mappings = ( #python type, check pmt type, to python, from python - (None, pmt.is_null, lambda x: None, lambda x: pmt.PMT_NIL), + (None, pmt.is_null, lambda x: None, lambda x: PMT_NIL), (bool, pmt.is_bool, pmt.to_bool, pmt.from_bool), (str, pmt.is_symbol, pmt.symbol_to_string, pmt.string_to_symbol), (unicode, lambda x: False, None, lambda x: pmt.string_to_symbol(x.encode('utf-8'))), @@ -110,12 +114,17 @@ type_mappings = ( #python type, check pmt type, to python, from python (tuple, pmt.is_tuple, pmt_to_tuple, pmt_from_tuple), (list, pmt.is_vector, pmt_to_vector, pmt_from_vector), (dict, pmt.is_dict, pmt_to_dict, pmt_from_dict), + (tuple, pmt.is_pair, lambda x: (pmt_to_python(pmt.car(x)), pmt_to_python(pmt.cdr(x))), lambda x: pmt.cons(python_to_pmt(x[0]), python_to_pmt(x[1]))), (numpy.ndarray, pmt.is_uniform_vector, uvector_to_numpy, numpy_to_uvector), ) def pmt_to_python(p): for python_type, pmt_check, to_python, from_python in type_mappings: - if pmt_check(p): return to_python(p) + if pmt_check(p): + try: + return to_python(p) + except: + pass raise ValueError("can't convert %s type to pmt (%s)"%(type(p),p)) def python_to_pmt(p): @@ -124,4 +133,3 @@ def python_to_pmt(p): if p == None: return from_python(p) elif isinstance(p, python_type): return from_python(p) raise ValueError("can't convert %s type to pmt (%s)"%(type(p),p)) - diff --git a/gnuradio-runtime/swig/pmt_swig.i b/gnuradio-runtime/swig/pmt_swig.i index 25178e3ba2..e54b544977 100644 --- a/gnuradio-runtime/swig/pmt_swig.i +++ b/gnuradio-runtime/swig/pmt_swig.i @@ -83,9 +83,11 @@ namespace pmt{ extern const pmt_t PMT_T; extern const pmt_t PMT_F; - extern const pmt_t PMT_NIL; extern const pmt_t PMT_EOF; + pmt_t get_PMT_NIL(); + #define PMT_NIL get_PMT_NIL() + bool is_bool(pmt_t obj); bool is_true(pmt_t obj); bool is_false(pmt_t obj); diff --git a/gnuradio-runtime/swig/prefs.i b/gnuradio-runtime/swig/prefs.i index f56c7910ee..ac5fab7adc 100644 --- a/gnuradio-runtime/swig/prefs.i +++ b/gnuradio-runtime/swig/prefs.i @@ -24,7 +24,6 @@ class gr::prefs { public: static gr::prefs *singleton(); - static void set_singleton(gr::prefs *p); virtual ~prefs(); @@ -60,4 +59,3 @@ public: const std::string &option, double val); }; - diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index a1161fca03..34a852fdb3 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -169,6 +169,22 @@ target_link_libraries(gnuradio-analog ${analog_libs}) GR_LIBRARY_FOO(gnuradio-analog RUNTIME_COMPONENT "analog_runtime" DEVEL_COMPONENT "analog_devel") add_dependencies(gnuradio-analog analog_generated_includes analog_generated_swigs gnuradio-filter) +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-analog_static STATIC ${analog_sources}) + + add_dependencies(gnuradio-analog_static + analog_generated_includes + gnuradio-filter_static) + + if(NOT WIN32) + set_target_properties(gnuradio-analog_static + PROPERTIES OUTPUT_NAME gnuradio-analog) + endif(NOT WIN32) + + install(TARGETS gnuradio-analog_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "analog_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) ######################################################################## # QA C++ Code for gr-filter diff --git a/gr-atsc/lib/CMakeLists.txt b/gr-atsc/lib/CMakeLists.txt index 22ea35c09e..5ac14fa118 100644 --- a/gr-atsc/lib/CMakeLists.txt +++ b/gr-atsc/lib/CMakeLists.txt @@ -127,6 +127,19 @@ add_library(gnuradio-atsc SHARED ${gr_atsc_sources}) target_link_libraries(gnuradio-atsc ${atsc_libs}) GR_LIBRARY_FOO(gnuradio-atsc RUNTIME_COMPONENT "atsc_runtime" DEVEL_COMPONENT "atsc_devel") +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-atsc_static STATIC ${gr_atsc_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-atsc_static + PROPERTIES OUTPUT_NAME gnuradio-atsc) + endif(NOT WIN32) + + install(TARGETS gnuradio-atsc_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "atsc_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + ######################################################################## # Build and register unit test ######################################################################## diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt index f07373def9..2ae7c41e56 100644 --- a/gr-audio/lib/CMakeLists.txt +++ b/gr-audio/lib/CMakeLists.txt @@ -185,3 +185,16 @@ target_link_libraries(gnuradio-audio ${gr_audio_libs}) GR_LIBRARY_FOO(gnuradio-audio RUNTIME_COMPONENT "audio_runtime" DEVEL_COMPONENT "audio_devel") install(FILES ${gr_audio_confs} DESTINATION ${GR_PREFSDIR} COMPONENT "audio_runtime") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-audio_static STATIC ${gr_audio_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-audio_static + PROPERTIES OUTPUT_NAME gnuradio-audio) + endif(NOT WIN32) + + install(TARGETS gnuradio-audio_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "audio_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-blocks/examples/ctrlport/pfb_sync_test-qt.grc b/gr-blocks/examples/ctrlport/pfb_sync_test-qt.grc index c28ed6d71a..0c397351cc 100644 --- a/gr-blocks/examples/ctrlport/pfb_sync_test-qt.grc +++ b/gr-blocks/examples/ctrlport/pfb_sync_test-qt.grc @@ -378,7 +378,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-blocks/examples/metadata/file_metadata_source.grc b/gr-blocks/examples/metadata/file_metadata_source.grc index 5d0a0417a8..55d52a9a2d 100644 --- a/gr-blocks/examples/metadata/file_metadata_source.grc +++ b/gr-blocks/examples/metadata/file_metadata_source.grc @@ -181,7 +181,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-blocks/grc/blocks_copy.xml b/gr-blocks/grc/blocks_copy.xml index 55c4b343d3..4d505d9e7f 100644 --- a/gr-blocks/grc/blocks_copy.xml +++ b/gr-blocks/grc/blocks_copy.xml @@ -67,6 +67,11 @@ self.$(id).set_enabled($enabled)</make> <type>$type</type> <vlen>$vlen</vlen> </sink> + <sink> + <name>en</name> + <type>message</type> + <optional>1</optional> + </sink> <source> <name>out</name> <type>$type</type> diff --git a/gr-blocks/grc/blocks_deinterleave.xml b/gr-blocks/grc/blocks_deinterleave.xml index e3970bd326..4ada49dc38 100644 --- a/gr-blocks/grc/blocks_deinterleave.xml +++ b/gr-blocks/grc/blocks_deinterleave.xml @@ -5,63 +5,70 @@ ################################################### --> <block> - <name>Deinterleave</name> - <key>blocks_deinterleave</key> - <import>from gnuradio import blocks</import> - <make>blocks.deinterleave($type.size*$vlen)</make> - <param> - <name>IO Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - <param> - <name>Num Streams</name> - <key>num_streams</key> - <value>2</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$num_streams > 0</check> - <check>$vlen >= 1</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - </sink> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_streams</nports> - </source> + <name>Deinterleave</name> + <key>blocks_deinterleave</key> + <import>from gnuradio import blocks</import> + <make>blocks.deinterleave($type.size*$vlen, $blocksize)</make> + <param> + <name>IO Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + <param> + <name>Num Streams</name> + <key>num_streams</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Block Size</name> + <key>blocksize</key> + <value>1</value> + <type>int</type> + <hide>part</hide> + </param> + <param> + <name>Vec Length</name> + <key>vlen</key> + <value>1</value> + <type>int</type> + </param> + <check>$num_streams > 0</check> + <check>$vlen >= 1</check> + <sink> + <name>in</name> + <type>$type</type> + <vlen>$vlen</vlen> + </sink> + <source> + <name>out</name> + <type>$type</type> + <vlen>$vlen</vlen> + <nports>$num_streams</nports> + </source> </block> diff --git a/gr-blocks/grc/blocks_head.xml b/gr-blocks/grc/blocks_head.xml index 8b6e67820c..dc8e826d54 100644 --- a/gr-blocks/grc/blocks_head.xml +++ b/gr-blocks/grc/blocks_head.xml @@ -9,6 +9,7 @@ <key>blocks_head</key> <import>from gnuradio import blocks</import> <make>blocks.head($type.size*$vlen, $num_items)</make> + <callback>set_length($num_items)</callback> <param> <name>Type</name> <key>type</key> diff --git a/gr-blocks/grc/blocks_interleave.xml b/gr-blocks/grc/blocks_interleave.xml index f01a3be6d5..69fb15e2cf 100644 --- a/gr-blocks/grc/blocks_interleave.xml +++ b/gr-blocks/grc/blocks_interleave.xml @@ -5,63 +5,70 @@ ################################################### --> <block> - <name>Interleave</name> - <key>blocks_interleave</key> - <import>from gnuradio import blocks</import> - <make>blocks.interleave($type.size*$vlen)</make> - <param> - <name>IO Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - <param> - <name>Num Streams</name> - <key>num_streams</key> - <value>2</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$num_streams > 0</check> - <check>$vlen >= 1</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_streams</nports> - </sink> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - </source> + <name>Interleave</name> + <key>blocks_interleave</key> + <import>from gnuradio import blocks</import> + <make>blocks.interleave($type.size*$vlen, $blocksize)</make> + <param> + <name>IO Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + <param> + <name>Num Streams</name> + <key>num_streams</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Block Size</name> + <key>blocksize</key> + <value>1</value> + <type>int</type> + <hide>part</hide> + </param> + <param> + <name>Vec Length</name> + <key>vlen</key> + <value>1</value> + <type>int</type> + </param> + <check>$num_streams > 0</check> + <check>$vlen >= 1</check> + <sink> + <name>in</name> + <type>$type</type> + <vlen>$vlen</vlen> + <nports>$num_streams</nports> + </sink> + <source> + <name>out</name> + <type>$type</type> + <vlen>$vlen</vlen> + </source> </block> diff --git a/gr-blocks/grc/blocks_interleaved_short_to_complex.xml b/gr-blocks/grc/blocks_interleaved_short_to_complex.xml index 712ba3a7ad..2c4e153854 100644 --- a/gr-blocks/grc/blocks_interleaved_short_to_complex.xml +++ b/gr-blocks/grc/blocks_interleaved_short_to_complex.xml @@ -8,7 +8,8 @@ <name>IShort To Complex</name> <key>blocks_interleaved_short_to_complex</key> <import>from gnuradio import blocks</import> - <make>blocks.interleaved_short_to_complex($vector_input)</make> + <make>blocks.interleaved_short_to_complex($vector_input, $swap)</make> + <callback>set_swap($swap)</callback> <param> <name>Vector Input</name> <key>vector_input</key> @@ -25,6 +26,21 @@ <opt>vlen:2</opt> </option> </param> + <param> + <name>Swap</name> + <key>swap</key> + <value>False</value> + <type>enum</type> + <hide>part</hide> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> <sink> <name>in</name> <type>short</type> diff --git a/gr-blocks/include/gnuradio/blocks/CMakeLists.txt b/gr-blocks/include/gnuradio/blocks/CMakeLists.txt index 5fed7670db..fa3c354d97 100644 --- a/gr-blocks/include/gnuradio/blocks/CMakeLists.txt +++ b/gr-blocks/include/gnuradio/blocks/CMakeLists.txt @@ -86,6 +86,7 @@ expand_h(probe_signal_X b s i f c) expand_h(probe_signal_vX b s i f c) expand_h(sample_and_hold_XX bb ss ii ff) expand_h(sub_XX ss ii ff cc) +expand_h(tsb_vector_sink_X b s i f c) expand_h(xor_XX bb ss ii) expand_h(packed_to_unpacked_XX bb ss ii) expand_h(unpacked_to_packed_XX bb ss ii) @@ -109,7 +110,9 @@ install(FILES lfsr_15_1_0.h lfsr_32k.h log2_const.h + pack_k_bits.h rotator.h + unpack_k_bits.h wavfile.h add_ff.h annotator_1to1.h diff --git a/gr-blocks/include/gnuradio/blocks/copy.h b/gr-blocks/include/gnuradio/blocks/copy.h index 151ab090ac..a953b413af 100644 --- a/gr-blocks/include/gnuradio/blocks/copy.h +++ b/gr-blocks/include/gnuradio/blocks/copy.h @@ -36,6 +36,12 @@ namespace gr { * \details * When enabled (default), this block copies its input to its * output. When disabled, this block drops its input on the floor. + * + * Message Ports: + * + * - en (input): + * Receives a PMT bool message to either enable to disable + * copy. */ class BLOCKS_API copy : virtual public block { diff --git a/gr-blocks/include/gnuradio/blocks/deinterleave.h b/gr-blocks/include/gnuradio/blocks/deinterleave.h index 45452089e5..a3b5480089 100644 --- a/gr-blocks/include/gnuradio/blocks/deinterleave.h +++ b/gr-blocks/include/gnuradio/blocks/deinterleave.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,16 +24,39 @@ #define INCLUDED_BLOCKS_DEINTERLEAVE_H #include <gnuradio/blocks/api.h> -#include <gnuradio/sync_decimator.h> +#include <gnuradio/block.h> namespace gr { namespace blocks { /*! - * \brief deinterleave a single input into N outputs + * \brief deinterleave an input block of samples into N outputs. * \ingroup stream_operators_blk + * + * \details + * This block deinterleaves blocks of samples. For each output + * connection, the input stream will be deinterleaved successively + * to the output connections. By default, the block deinterleaves + * a single input to each output unless blocksize is given in the + * constructor. + * + * \code + * blocksize = 1 + * connections = 2 + * input = [a, b, c, d, e, f, g, h] + * output[0] = [a, c, e, g] + * output[1] = [b, d, f, h] + * \endcode + * + * \code + * blocksize = 2 + * connections = 2 + * input = [a, b, c, d, e, f, g, h] + * output[0] = [a, b, e, f] + * output[1] = [c, d, g, h] + * \endcode */ - class BLOCKS_API deinterleave : virtual public sync_decimator + class BLOCKS_API deinterleave : virtual public block { public: // gr::blocks::deinterleave::sptr @@ -43,8 +66,9 @@ namespace gr { * Make a deinterleave block. * * \param itemsize stream itemsize + * \param blocksize size of block to deinterleave */ - static sptr make(size_t itemsize); + static sptr make(size_t itemsize, unsigned int blocksize = 1); }; } /* namespace blocks */ diff --git a/gr-blocks/include/gnuradio/blocks/interleave.h b/gr-blocks/include/gnuradio/blocks/interleave.h index 7c28d54c53..7f7587d267 100644 --- a/gr-blocks/include/gnuradio/blocks/interleave.h +++ b/gr-blocks/include/gnuradio/blocks/interleave.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,7 +24,7 @@ #define INCLUDED_BLOCKS_INTERLEAVE_H #include <gnuradio/blocks/api.h> -#include <gnuradio/sync_interpolator.h> +#include <gnuradio/block.h> namespace gr { namespace blocks { @@ -32,8 +32,32 @@ namespace gr { /*! * \brief interleave N inputs into a single output * \ingroup stream_operators_blk + * + * \details + * + * This block interleaves blocks of samples. For each input + * connection, the samples are interleaved successively to the + * output connection. By default, the block interleaves a single + * sample from eahc input to the output unless blocksize is given + * in the constructor. + * + * \code + * blocksize = 1 + * connections = 2 + * input[0] = [a, c, e, g] + * input[1] = [b, d, f, h] + * output = [a, b, c, d, e, f, g, h] + * \endcode + * + * \code + * blocksize = 2 + * connections = 2 + * input[0] = [a, b, e, f] + * input[1] = [c, d, g, h] + * output = [a, b, c, d, e, f, g, h] + * \endcode */ - class BLOCKS_API interleave : virtual public sync_interpolator + class BLOCKS_API interleave : virtual public block { public: // gr::blocks::interleave::sptr @@ -43,8 +67,9 @@ namespace gr { * Make a stream interleave block. * * \param itemsize stream itemsize + * \param blocksize size of block of samples to interleave */ - static sptr make(size_t itemsize); + static sptr make(size_t itemsize, unsigned int blocksize = 1); }; } /* namespace blocks */ diff --git a/gr-blocks/include/gnuradio/blocks/interleaved_short_to_complex.h b/gr-blocks/include/gnuradio/blocks/interleaved_short_to_complex.h index 4f89e4d05c..39304e8088 100644 --- a/gr-blocks/include/gnuradio/blocks/interleaved_short_to_complex.h +++ b/gr-blocks/include/gnuradio/blocks/interleaved_short_to_complex.h @@ -42,7 +42,9 @@ namespace gr { /*! * Build an interleaved short to complex block. */ - static sptr make(bool vector_input=false); + static sptr make(bool vector_input=false, bool swap=false); + + virtual void set_swap(bool swap)=0; }; } /* namespace blocks */ diff --git a/gr-blocks/include/gnuradio/blocks/pack_k_bits.h b/gr-blocks/include/gnuradio/blocks/pack_k_bits.h new file mode 100644 index 0000000000..ed1971de2b --- /dev/null +++ b/gr-blocks/include/gnuradio/blocks/pack_k_bits.h @@ -0,0 +1,85 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_GR_BLOCKS_PACK_K_BITS_H +#define INCLUDED_GR_BLOCKS_PACK_K_BITS_H + +#include <gnuradio/blocks/api.h> +#include <vector> + +namespace gr { + namespace blocks { + namespace kernel { + + /*! + * \brief Converts a vector of bytes with 1 bit in the LSB to a + * byte with k relevent bits. + * + * Example: + * k = 4 + * in = [0,1,0,1, 0x81,0x00,0x00,0x00] + * out = [0x05, 0x08] + * + * k = 8 + * in = [1,1,1,1, 0,1,0,1, 0,0,0,0, 1,0,0,0] + * out = [0xf5, 0x08] + * \ingroup byte_operators_blk + */ + class BLOCKS_API pack_k_bits + { + public: + /*! + * \brief Make a pack_k_bits object. + * \param k number of bits to be packed. + */ + pack_k_bits(unsigned k); + ~pack_k_bits(); + + /*! + * \brief Perform the packing. + * + * This block performs no bounds checking. It assumes that the + * input, \p in, has of length k*nbytes and that the output + * vector, \p out, has \p nbytes available for writing. + * + * \param bytes output vector (k-bits per byte) of the unpacked data + * \param bits The input vector of bits to pack + * \param nbytes The number of output bytes + */ + void pack(unsigned char *bytes, const unsigned char *bits, int nbytes) const; + + /*! + * Same as pack() but reverses the bits. + */ + void pack_rev(unsigned char *bytes, const unsigned char *bits, int nbytes) const; + + int k() const; + + private: + unsigned d_k; + }; + + } /* namespace kernel */ + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_BLOCKS_PACK_K_BITS_H */ diff --git a/gr-blocks/include/gnuradio/blocks/tsb_vector_sink_X.h.t b/gr-blocks/include/gnuradio/blocks/tsb_vector_sink_X.h.t new file mode 100644 index 0000000000..ec7c7d4c3f --- /dev/null +++ b/gr-blocks/include/gnuradio/blocks/tsb_vector_sink_X.h.t @@ -0,0 +1,63 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include <gnuradio/blocks/api.h> +#include <gnuradio/tagged_stream_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief A vector sink for tagged streams. + * + * Unlike a gr::blocks::vector_sink_f, this only works with tagged streams. + * + * \ingroup blocks + */ + class BLOCKS_API @NAME@ : virtual public gr::tagged_stream_block + { + public: + typedef boost::shared_ptr<@NAME@> sptr; + + virtual void reset() = 0; + virtual std::vector<std::vector<@TYPE@> > data() const = 0; + /*! Doesn't include the TSB tags. + */ + virtual std::vector<tag_t> tags() const = 0; + + /*! + * \param vlen Vector length + * \param tsb_key Tagged Stream Key + */ + static sptr make(int vlen=1, const std::string &tsb_key="ts_last"); + }; + + } // namespace blocks +} // namespace gr + +#endif /* @GUARD_NAME@ */ + diff --git a/gr-blocks/include/gnuradio/blocks/unpack_k_bits.h b/gr-blocks/include/gnuradio/blocks/unpack_k_bits.h new file mode 100644 index 0000000000..389579a2f8 --- /dev/null +++ b/gr-blocks/include/gnuradio/blocks/unpack_k_bits.h @@ -0,0 +1,86 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_GR_BLOCKS_UNPACK_K_BITS_H +#define INCLUDED_GR_BLOCKS_UNPACK_K_BITS_H + +#include <gnuradio/blocks/api.h> +#include <vector> + +namespace gr { + namespace blocks { + namespace kernel { + + /*! + * \brief Converts a byte with k relevent bits to k output bytes with 1 bit in the LSB. + * + * This is the algorithm kernel for the gr::blocks::unpack_k_bits_bb block. + * + * Example: + * k = 4 + * in = [0xf5, 0x08] + * out = [0,1,0,1, 1,0,0,0] + * + * k = 8 + * in = [0xf5, 0x08] + * out = [1,1,1,1, 0,1,0,1, 0,0,0,0, 1,0,0,0] + * \ingroup byte_operators_blk + */ + class BLOCKS_API unpack_k_bits + { + public: + /*! + * \brief Make an unpack_k_bits object. + * \param k number of bits to unpack. + */ + unpack_k_bits(unsigned k); + ~unpack_k_bits(); + + /*! + * \brief Perform the unpacking. + * + * This function performs no bounds checking. It assumes that the + * input, \p in, has of length \p nbytes and that the output + * vector, \p out, has k*nbytes available for writing. + * + * \param bits output vector (1-bit per byte) of the unpacked data + * \param bytes The input vector of bytes to unpack + * \param nbytes The number of input bytes + */ + void unpack(unsigned char *bits, const unsigned char *bytes, int nbytes) const; + + /*! + * Unpacks in reverse order from unpack(). + */ + void unpack_rev(unsigned char *bits, const unsigned char *bytes, int nbytes) const; + + int k() const; + + private: + unsigned d_k; + }; + + } /* namespace kernel */ + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_BLOCKS_UNPACK_K_BITS_BB_H */ diff --git a/gr-blocks/lib/CMakeLists.txt b/gr-blocks/lib/CMakeLists.txt index f41eac7bc9..7702e4bf1d 100644 --- a/gr-blocks/lib/CMakeLists.txt +++ b/gr-blocks/lib/CMakeLists.txt @@ -111,6 +111,7 @@ expand_cc_h_impl(peak_detector_XX fb ib sb) expand_cc_h_impl(probe_signal_X b s i f c) expand_cc_h_impl(probe_signal_vX b s i f c) expand_cc_h_impl(sample_and_hold_XX bb ss ii ff) +expand_cc_h_impl(tsb_vector_sink_X b s i f c) expand_cc_h_impl(sub_XX ss ii ff cc) expand_cc_h_impl(xor_XX bb ss ii) expand_cc_h_impl(packed_to_unpacked_XX bb ss ii) @@ -147,6 +148,8 @@ list(APPEND gr_blocks_sources control_loop.cc count_bits.cc file_sink_base.cc + pack_k_bits.cc + unpack_k_bits.cc wavfile.cc add_ff_impl.cc annotator_1to1_impl.cc @@ -300,6 +303,21 @@ add_dependencies(gnuradio-blocks blocks_generated_includes) target_link_libraries(gnuradio-blocks ${blocks_libs}) GR_LIBRARY_FOO(gnuradio-blocks RUNTIME_COMPONENT "blocks_runtime" DEVEL_COMPONENT "blocks_devel") +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-blocks_static STATIC ${gr_blocks_sources}) + + add_dependencies(gnuradio-blocks_static blocks_generated_includes) + + if(NOT WIN32) + set_target_properties(gnuradio-blocks_static + PROPERTIES OUTPUT_NAME gnuradio-blocks) + endif(NOT WIN32) + + install(TARGETS gnuradio-blocks_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "blocks_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + ######################################################################## # QA C++ Code for gr-blocks ######################################################################## diff --git a/gr-blocks/lib/copy_impl.cc b/gr-blocks/lib/copy_impl.cc index 564ea09ef4..02848369d1 100644 --- a/gr-blocks/lib/copy_impl.cc +++ b/gr-blocks/lib/copy_impl.cc @@ -45,6 +45,9 @@ namespace gr { d_itemsize(itemsize), d_enabled(true) { + message_port_register_in(pmt::mp("en")); + set_msg_handler(pmt::mp("en"), + boost::bind(©_impl::handle_enable, this, _1)); } copy_impl::~copy_impl() @@ -52,6 +55,15 @@ namespace gr { } void + copy_impl::handle_enable(pmt::pmt_t msg) + { + if(pmt::is_bool(msg)) { + bool en = pmt::to_bool(msg); + d_enabled = en; + } + } + + void copy_impl::forecast(int noutput_items, gr_vector_int &ninput_items_required) { unsigned ninputs = ninput_items_required.size(); diff --git a/gr-blocks/lib/copy_impl.h b/gr-blocks/lib/copy_impl.h index 5f3c81a306..925efb2153 100644 --- a/gr-blocks/lib/copy_impl.h +++ b/gr-blocks/lib/copy_impl.h @@ -41,6 +41,8 @@ namespace gr { void forecast(int noutput_items, gr_vector_int &ninput_items_required); bool check_topology(int ninputs, int noutputs); + void handle_enable(pmt::pmt_t msg); + void set_enabled(bool enable) { d_enabled = enable; } bool enabled() const { return d_enabled;} diff --git a/gr-blocks/lib/deinterleave_impl.cc b/gr-blocks/lib/deinterleave_impl.cc index b63260d1f5..5e1cc5221d 100644 --- a/gr-blocks/lib/deinterleave_impl.cc +++ b/gr-blocks/lib/deinterleave_impl.cc @@ -30,47 +30,44 @@ namespace gr { namespace blocks { - deinterleave::sptr deinterleave::make(size_t itemsize) + deinterleave::sptr deinterleave::make(size_t itemsize, unsigned int blocksize) { - return gnuradio::get_initial_sptr(new deinterleave_impl(itemsize)); + return gnuradio::get_initial_sptr(new deinterleave_impl(itemsize, blocksize)); } - - deinterleave_impl::deinterleave_impl(size_t itemsize) - : sync_decimator("deinterleave", - io_signature::make (1, 1, itemsize), - io_signature::make (1, io_signature::IO_INFINITE, itemsize), - 1), - d_itemsize(itemsize) + + deinterleave_impl::deinterleave_impl(size_t itemsize, unsigned int blocksize) + : block("deinterleave", + io_signature::make (1, 1, itemsize), + io_signature::make (1, io_signature::IO_INFINITE, itemsize)), + d_itemsize(itemsize), d_blocksize(blocksize), d_current_output(0) { + set_output_multiple(blocksize); } bool deinterleave_impl::check_topology(int ninputs, int noutputs) { - set_decimation(noutputs); + set_relative_rate((double)noutputs); + d_noutputs = noutputs; return true; } - + int - deinterleave_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + deinterleave_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { - size_t nchan = output_items.size(); - size_t itemsize = d_itemsize; - const char *in = (const char *)input_items[0]; - char **out = (char **)&output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - for (unsigned int n = 0; n < nchan; n++){ - memcpy(out[n], in, itemsize); - out[n] += itemsize; - in += itemsize; - } - } - - return noutput_items; + const char *in = (const char*)input_items[0]; + char **out = (char**)&output_items[0]; + + memcpy(out[d_current_output], in, d_itemsize * d_blocksize); + consume_each(d_blocksize); + produce(d_current_output, d_blocksize); + d_current_output = (d_current_output + 1) % d_noutputs; + return WORK_CALLED_PRODUCE; } - + + } /* namespace blocks */ } /* namespace gr */ diff --git a/gr-blocks/lib/deinterleave_impl.h b/gr-blocks/lib/deinterleave_impl.h index 87932c8139..a7a9e0a8fa 100644 --- a/gr-blocks/lib/deinterleave_impl.h +++ b/gr-blocks/lib/deinterleave_impl.h @@ -30,20 +30,27 @@ namespace gr { class BLOCKS_API deinterleave_impl : public deinterleave { + size_t d_itemsize; + unsigned int d_blocksize; + unsigned int d_current_output; + unsigned int d_noutputs; + public: - deinterleave_impl(size_t itemsize); + deinterleave_impl(size_t itemsize, unsigned int blocksize); bool check_topology(int ninputs, int noutputs); - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; } /* namespace blocks */ } /* namespace gr */ - + #endif /* INCLUDED_DEINTERLEAVE_IMPL_H */ diff --git a/gr-blocks/lib/interleave_impl.cc b/gr-blocks/lib/interleave_impl.cc index 9dbfa88076..22d6488f7a 100644 --- a/gr-blocks/lib/interleave_impl.cc +++ b/gr-blocks/lib/interleave_impl.cc @@ -29,48 +29,76 @@ namespace gr { namespace blocks { - - interleave::sptr interleave::make(size_t itemsize) + + interleave::sptr interleave::make(size_t itemsize, unsigned int blocksize) { - return gnuradio::get_initial_sptr(new interleave_impl(itemsize)); + return gnuradio::get_initial_sptr(new interleave_impl(itemsize, blocksize)); } - - interleave_impl::interleave_impl(size_t itemsize) - : sync_interpolator("interleave", - io_signature::make (1, io_signature::IO_INFINITE, itemsize), - io_signature::make (1, 1, itemsize), - 1), - d_itemsize(itemsize) + + interleave_impl::interleave_impl(size_t itemsize, unsigned int blocksize) + : block("interleave", + io_signature::make (1, io_signature::IO_INFINITE, itemsize), + io_signature::make (1, 1, itemsize)), + d_itemsize(itemsize), d_blocksize(blocksize) { + set_fixed_rate(true); + set_output_multiple(d_blocksize); } bool interleave_impl::check_topology(int ninputs, int noutputs) { - set_interpolation(ninputs); + set_relative_rate((double)ninputs); + d_ninputs = ninputs; + set_output_multiple(d_blocksize * d_ninputs); return true; } - + + int - interleave_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) + interleave_impl::fixed_rate_ninput_to_noutput(int ninput) { - size_t nchan = input_items.size(); - size_t itemsize = d_itemsize; - const char **in = (const char **)&input_items[0]; - char *out = (char *)output_items[0]; + return ninput * d_ninputs; + } - for (int i = 0; i < noutput_items; i += nchan) { - for (unsigned int n = 0; n < nchan; n++) { - memcpy (out, in[n], itemsize); - out += itemsize; - in[n] += itemsize; - } + int + interleave_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int) ((noutput / d_ninputs) + .5); + } + + void + interleave_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + for(unsigned int i = 0; i < ninput_items_required.size(); ++i) { + ninput_items_required[i] = (int) ((noutput_items / ninput_items_required.size()) + .5); } + } + int + interleave_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + size_t noutput_blocks = (size_t) ((noutput_items/d_blocksize) + .5); + const char **in = (const char**)&input_items[0]; + char *out = (char*)output_items[0]; + + for (unsigned int i = 0; i < noutput_blocks; i += d_ninputs) { + for (unsigned int n = 0; n < d_ninputs; n++){ + memcpy(out, in[n], d_itemsize * d_blocksize); + out += d_itemsize * d_blocksize; + in[n] += d_itemsize * d_blocksize; + } + } + consume_each((int)((noutput_items/d_ninputs) + .5)); return noutput_items; } + + + } /* namespace blocks */ } /* namespace gr */ diff --git a/gr-blocks/lib/interleave_impl.h b/gr-blocks/lib/interleave_impl.h index f0f79c107d..c74127fca5 100644 --- a/gr-blocks/lib/interleave_impl.h +++ b/gr-blocks/lib/interleave_impl.h @@ -31,12 +31,26 @@ namespace gr { class BLOCKS_API interleave_impl : public interleave { size_t d_itemsize; + unsigned int d_blocksize; + unsigned int d_ninputs; public: - interleave_impl(size_t itemsize); + interleave_impl(size_t itemsize, unsigned int blocksize); bool check_topology(int ninputs, int noutputs); + int fixed_rate_ninput_to_noutput(int ninput); + + int fixed_rate_noutput_to_ninput(int noutput); + + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); @@ -44,6 +58,6 @@ namespace gr { } /* namespace blocks */ } /* namespace gr */ - + #endif /* INCLUDED_INTERLEAVE_IMPL_H */ diff --git a/gr-blocks/lib/interleaved_short_to_complex_impl.cc b/gr-blocks/lib/interleaved_short_to_complex_impl.cc index 23301b05d1..bb1e229bf1 100644 --- a/gr-blocks/lib/interleaved_short_to_complex_impl.cc +++ b/gr-blocks/lib/interleaved_short_to_complex_impl.cc @@ -31,19 +31,24 @@ namespace gr { namespace blocks { - interleaved_short_to_complex::sptr interleaved_short_to_complex::make(bool vector_input) + interleaved_short_to_complex::sptr interleaved_short_to_complex::make(bool vector_input, bool swap) { - return gnuradio::get_initial_sptr(new interleaved_short_to_complex_impl(vector_input)); + return gnuradio::get_initial_sptr(new interleaved_short_to_complex_impl(vector_input, swap)); } - interleaved_short_to_complex_impl::interleaved_short_to_complex_impl(bool vector_input) + interleaved_short_to_complex_impl::interleaved_short_to_complex_impl(bool vector_input, bool swap) : sync_decimator("interleaved_short_to_complex", gr::io_signature::make (1, 1, (vector_input?2:1)*sizeof(short)), gr::io_signature::make (1, 1, sizeof(gr_complex)), vector_input?1:2), - d_vector_input(vector_input) + d_vector_input(vector_input), d_swap(swap) { } + + void interleaved_short_to_complex_impl::set_swap(bool swap) + { + d_swap = swap; + } int interleaved_short_to_complex_impl::work(int noutput_items, @@ -52,9 +57,18 @@ namespace gr { { const short *in = (const short *) input_items[0]; gr_complex *out = (gr_complex *) output_items[0]; - + interleaved_short_array_to_complex (in, out, 2 * noutput_items); - + + if (d_swap) { + float* p = (float*)output_items[0]; + for (int i = 0; i < noutput_items; ++i) { + float f = p[2*i+1]; + p[2*i+1] = p[2*i+0]; + p[2*i+0] = f; + } + } + return noutput_items; } diff --git a/gr-blocks/lib/interleaved_short_to_complex_impl.h b/gr-blocks/lib/interleaved_short_to_complex_impl.h index 0ee094fca5..c7669f1896 100644 --- a/gr-blocks/lib/interleaved_short_to_complex_impl.h +++ b/gr-blocks/lib/interleaved_short_to_complex_impl.h @@ -32,8 +32,11 @@ namespace gr { { private: bool d_vector_input; + bool d_swap; public: - interleaved_short_to_complex_impl(bool vector_input=false); + interleaved_short_to_complex_impl(bool vector_input=false, bool swap=false); + + void set_swap(bool swap); int work(int noutput_items, gr_vector_const_void_star &input_items, @@ -42,6 +45,6 @@ namespace gr { } /* namespace blocks */ } /* namespace gr */ - + #endif /* INCLUDED_INTERLEAVED_SHORT_TO_COMPLEX_IMPL_H */ diff --git a/gr-blocks/lib/pack_k_bits.cc b/gr-blocks/lib/pack_k_bits.cc new file mode 100644 index 0000000000..ad6e78ae18 --- /dev/null +++ b/gr-blocks/lib/pack_k_bits.cc @@ -0,0 +1,70 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/blocks/pack_k_bits.h> +#include <stdexcept> +#include <iostream> + +namespace gr { + namespace blocks { + namespace kernel { + + pack_k_bits::pack_k_bits(unsigned k) + : d_k(k) + { + if(d_k == 0) + throw std::out_of_range("pack_k_bits: k must be > 0"); + } + + pack_k_bits::~pack_k_bits() + { + } + + void + pack_k_bits::pack(unsigned char *bytes, const unsigned char *bits, int nbytes) const + { + for(int i = 0; i < nbytes; i++) { + bytes[i] = 0x00; + for(unsigned int j = 0; j < d_k; j++) { + bytes[i] |= (0x01 & bits[i*d_k+j])<<(d_k-j-1); + } + } + } + + void + pack_k_bits::pack_rev(unsigned char *bytes, const unsigned char *bits, int nbytes) const + { + for(int i = 0; i < nbytes; i++) { + bytes[i] = 0x00; + for(unsigned int j = 0; j < d_k; j++) { + bytes[i] |= (0x01 & bits[i*d_k+j])<<j; + } + } + } + + } /* namespace kernel */ + } /* namespace blocks */ +} /* namespace gr */ diff --git a/gr-blocks/lib/pack_k_bits_bb_impl.cc b/gr-blocks/lib/pack_k_bits_bb_impl.cc index 95a3e7ff08..889e0d29f4 100644 --- a/gr-blocks/lib/pack_k_bits_bb_impl.cc +++ b/gr-blocks/lib/pack_k_bits_bb_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012-2013 Free Software Foundation, Inc. + * Copyright 2012-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -43,15 +43,14 @@ namespace gr { : sync_decimator("pack_k_bits_bb", io_signature::make(1, 1, sizeof(unsigned char)), io_signature::make(1, 1, sizeof(unsigned char)), - k), - d_k(k) + k) { - if(d_k == 0) - throw std::out_of_range("interpolation must be > 0"); + d_pack = new kernel::pack_k_bits(k); } pack_k_bits_bb_impl::~pack_k_bits_bb_impl() { + delete d_pack; } int @@ -62,12 +61,7 @@ namespace gr { const unsigned char *in = (const unsigned char *)input_items[0]; unsigned char *out = (unsigned char *)output_items[0]; - for(int i = 0; i < noutput_items; i++) { - out[i] = 0x00; - for(unsigned int j = 0; j < d_k; j++) { - out[i] |= (0x01 & in[i*d_k+j])<<(d_k-j-1); - } - } + d_pack->pack(out, in, noutput_items); return noutput_items; } diff --git a/gr-blocks/lib/pack_k_bits_bb_impl.h b/gr-blocks/lib/pack_k_bits_bb_impl.h index 65ce435879..38cf1e7517 100644 --- a/gr-blocks/lib/pack_k_bits_bb_impl.h +++ b/gr-blocks/lib/pack_k_bits_bb_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012-2013 Free Software Foundation, Inc. + * Copyright 2012-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #define INCLUDED_GR_PACK_K_BITS_BB_IMPL_H #include <gnuradio/blocks/pack_k_bits_bb.h> +#include <gnuradio/blocks/pack_k_bits.h> namespace gr { namespace blocks { @@ -32,6 +33,7 @@ namespace gr { { private: unsigned d_k; // number of relevent bits to pack from k input bytes + kernel::pack_k_bits *d_pack; public: pack_k_bits_bb_impl(unsigned k); diff --git a/gr-blocks/lib/tsb_vector_sink_X_impl.cc.t b/gr-blocks/lib/tsb_vector_sink_X_impl.cc.t new file mode 100644 index 0000000000..450339ac5e --- /dev/null +++ b/gr-blocks/lib/tsb_vector_sink_X_impl.cc.t @@ -0,0 +1,85 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +// @WARNING@ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/io_signature.h> +#include "@NAME_IMPL@.h" + +namespace gr { + namespace blocks { + + @NAME@::sptr + @NAME@::make(int vlen, const std::string &tsb_key) + { + return gnuradio::get_initial_sptr + (new @NAME_IMPL@(vlen, tsb_key)); + } + + @NAME_IMPL@::@NAME_IMPL@(int vlen, const std::string &tsb_key) + : gr::tagged_stream_block("@NAME@", + gr::io_signature::make(1, 1, vlen * sizeof(@TYPE@)), + gr::io_signature::make(0, 0, 0), tsb_key), + d_vlen(vlen) + {} + + @NAME_IMPL@::~@NAME_IMPL@() + { + } + + std::vector<std::vector<@TYPE@> > + @NAME_IMPL@::data() const + { + return d_data; + } + + std::vector<tag_t> + @NAME_IMPL@::tags() const + { + return d_tags; + } + + int + @NAME_IMPL@::work (int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const @TYPE@ *in = (const @TYPE@ *) input_items[0]; + + std::vector<@TYPE@> new_data(in, in + (ninput_items[0] * d_vlen)); + d_data.push_back(new_data); + + std::vector<tag_t> tags; + get_tags_in_window(tags, 0, 0, ninput_items[0]); + d_tags.insert(d_tags.end(), tags.begin(), tags.end()); + + return ninput_items[0]; + } + + } /* namespace blocks */ +} /* namespace gr */ + diff --git a/gr-blocks/lib/tsb_vector_sink_X_impl.h.t b/gr-blocks/lib/tsb_vector_sink_X_impl.h.t new file mode 100644 index 0000000000..8a97378ab2 --- /dev/null +++ b/gr-blocks/lib/tsb_vector_sink_X_impl.h.t @@ -0,0 +1,58 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME_IMPL@ +#define @GUARD_NAME_IMPL@ + +#include <gnuradio/blocks/@NAME@.h> + +namespace gr { + namespace blocks { + + class @NAME_IMPL@ : public @NAME@ + { + private: + std::vector<std::vector<@TYPE@> > d_data; + std::vector<tag_t> d_tags; + int d_vlen; + + public: + @NAME_IMPL@(int vlen, const std::string &tsb_key); + ~@NAME_IMPL@(); + + void reset() { d_data.clear(); } + std::vector<std::vector<@TYPE@> > data() const; + std::vector<tag_t> tags() const; + + int work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; + + } // namespace blocks +} // namespace gr + +#endif /* @GUARD_NAME_IMPL@ */ + diff --git a/gr-blocks/lib/unpack_k_bits.cc b/gr-blocks/lib/unpack_k_bits.cc new file mode 100644 index 0000000000..967d7e17d9 --- /dev/null +++ b/gr-blocks/lib/unpack_k_bits.cc @@ -0,0 +1,77 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/blocks/unpack_k_bits.h> +#include <gnuradio/io_signature.h> +#include <stdexcept> +#include <iostream> + +namespace gr { + namespace blocks { + namespace kernel { + + unpack_k_bits::unpack_k_bits(unsigned k) + : d_k(k) + { + if(d_k == 0) + throw std::out_of_range("unpack_k_bits: k must be > 0"); + } + + unpack_k_bits::~unpack_k_bits() + { + } + + void + unpack_k_bits::unpack(unsigned char *bits, const unsigned char *bytes, int nbytes) const + { + int n = 0; + for(int i = 0; i < nbytes; i++) { + unsigned int t = bytes[i]; + for(int j = d_k - 1; j >= 0; j--) + bits[n++] = (t >> j) & 0x01; + } + } + + void + unpack_k_bits::unpack_rev(unsigned char *bits, const unsigned char *bytes, int nbytes) const + { + int n = 0; + for(int i = 0; i < nbytes; i++) { + unsigned int t = bytes[i]; + for(unsigned int j = 0; j < d_k; j++) + bits[n++] = (t >> j) & 0x01; + } + } + + int + unpack_k_bits::k() const + { + return d_k; + } + + } /* namespace kernel */ + } /* namespace blocks */ +} /* namespace gr */ diff --git a/gr-blocks/lib/unpack_k_bits_bb_impl.cc b/gr-blocks/lib/unpack_k_bits_bb_impl.cc index 7bbfd0b1d3..caf3d059d6 100644 --- a/gr-blocks/lib/unpack_k_bits_bb_impl.cc +++ b/gr-blocks/lib/unpack_k_bits_bb_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010,2013 Free Software Foundation, Inc. + * Copyright 2005,2010,2013-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -41,17 +41,16 @@ namespace gr { unpack_k_bits_bb_impl::unpack_k_bits_bb_impl(unsigned k) : sync_interpolator("unpack_k_bits_bb", - io_signature::make(1, 1, sizeof(unsigned char)), - io_signature::make(1, 1, sizeof(unsigned char)), - k), - d_k(k) + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char)), + k) { - if(d_k == 0) - throw std::out_of_range("interpolation must be > 0"); + d_unpack = new kernel::unpack_k_bits(k); } unpack_k_bits_bb_impl::~unpack_k_bits_bb_impl() { + delete d_unpack; } int @@ -62,14 +61,8 @@ namespace gr { const unsigned char *in = (const unsigned char *)input_items[0]; unsigned char *out = (unsigned char *)output_items[0]; - int n = 0; - for(unsigned int i = 0; i < noutput_items/d_k; i++) { - unsigned int t = in[i]; - for(int j = d_k - 1; j >= 0; j--) - out[n++] = (t >> j) & 0x01; - } + d_unpack->unpack(out, in, noutput_items/d_unpack->k()); - assert(n == noutput_items); return noutput_items; } diff --git a/gr-blocks/lib/unpack_k_bits_bb_impl.h b/gr-blocks/lib/unpack_k_bits_bb_impl.h index 7355d235c5..246c4ea724 100644 --- a/gr-blocks/lib/unpack_k_bits_bb_impl.h +++ b/gr-blocks/lib/unpack_k_bits_bb_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2013 Free Software Foundation, Inc. + * Copyright 2006,2013-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #define INCLUDED_GR_UNPACK_K_BITS_BB_IMPL_H #include <gnuradio/blocks/unpack_k_bits_bb.h> +#include <gnuradio/blocks/unpack_k_bits.h> namespace gr { namespace blocks { @@ -31,7 +32,7 @@ namespace gr { class unpack_k_bits_bb_impl : public unpack_k_bits_bb { private: - unsigned d_k; // number of relevent bits to unpack into k output bytes + kernel::unpack_k_bits *d_unpack; public: unpack_k_bits_bb_impl(unsigned k); diff --git a/gr-blocks/python/blocks/qa_interleave.py b/gr-blocks/python/blocks/qa_interleave.py index 9eaf87c83c..526e4a4e6f 100755 --- a/gr-blocks/python/blocks/qa_interleave.py +++ b/gr-blocks/python/blocks/qa_interleave.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc. +# Copyright 2004,2007,2010,2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -49,6 +49,37 @@ class test_interleave (gr_unittest.TestCase): result_data = dst.data () self.assertFloatTuplesAlmostEqual (expected_result, result_data) + def test_int_002 (self): + blksize = 4 + lenx = 64 + plusup_big = lambda a: a + (blksize * 4) + plusup_little = lambda a: a + blksize + a_vec = range(0,blksize) + for i in range(0,(lenx/(4 * blksize)) - 1): + a_vec += map(plusup_big, a_vec[len(a_vec) - blksize:]) + + b_vec = map(plusup_little, a_vec) + c_vec = map(plusup_little, b_vec) + d_vec = map(plusup_little, c_vec) + + src0 = blocks.vector_source_f (a_vec) + src1 = blocks.vector_source_f (b_vec) + src2 = blocks.vector_source_f (c_vec) + src3 = blocks.vector_source_f (d_vec) + op = blocks.interleave (gr.sizeof_float, blksize) + dst = blocks.vector_sink_f () + + self.tb.connect (src0, (op, 0)) + self.tb.connect (src1, (op, 1)) + self.tb.connect (src2, (op, 2)) + self.tb.connect (src3, (op, 3)) + self.tb.connect (op, dst) + self.tb.run () + expected_result = tuple (range (lenx)) + result_data = dst.data () + + self.assertFloatTuplesAlmostEqual (expected_result, result_data) + def test_deint_001 (self): lenx = 64 src = blocks.vector_source_f (range (lenx)) @@ -75,6 +106,42 @@ class test_interleave (gr_unittest.TestCase): self.assertFloatTuplesAlmostEqual (expected_result2, dst2.data ()) self.assertFloatTuplesAlmostEqual (expected_result3, dst3.data ()) + def test_deint_002 (self): + blksize = 4 + lenx = 64 + src = blocks.vector_source_f (range (lenx)) + op = blocks.deinterleave (gr.sizeof_float, blksize) + dst0 = blocks.vector_sink_f () + dst1 = blocks.vector_sink_f () + dst2 = blocks.vector_sink_f () + dst3 = blocks.vector_sink_f () + + self.tb.connect (src, op) + self.tb.connect ((op, 0), dst0) + self.tb.connect ((op, 1), dst1) + self.tb.connect ((op, 2), dst2) + self.tb.connect ((op, 3), dst3) + self.tb.run () + + plusup_big = lambda a: a + (blksize * 4) + plusup_little = lambda a: a + blksize + a_vec = range(0,blksize) + for i in range(0,(lenx/(4 * blksize)) - 1): + a_vec += map(plusup_big, a_vec[len(a_vec) - blksize:]) + + b_vec = map(plusup_little, a_vec) + c_vec = map(plusup_little, b_vec) + d_vec = map(plusup_little, c_vec) + + expected_result0 = tuple (a_vec) + expected_result1 = tuple (b_vec) + expected_result2 = tuple (c_vec) + expected_result3 = tuple (d_vec) + + self.assertFloatTuplesAlmostEqual (expected_result0, dst0.data ()) + self.assertFloatTuplesAlmostEqual (expected_result1, dst1.data ()) + self.assertFloatTuplesAlmostEqual (expected_result2, dst2.data ()) + self.assertFloatTuplesAlmostEqual (expected_result3, dst3.data ()) + if __name__ == '__main__': gr_unittest.run(test_interleave, "test_interleave.xml") - diff --git a/gr-blocks/python/blocks/qa_keep_one_in_n.py b/gr-blocks/python/blocks/qa_keep_one_in_n.py index 2a5d936cce..d8251fe611 100755 --- a/gr-blocks/python/blocks/qa_keep_one_in_n.py +++ b/gr-blocks/python/blocks/qa_keep_one_in_n.py @@ -36,7 +36,6 @@ class test_keep_one_in_n(gr_unittest.TestCase): src = blocks.vector_source_b(src_data); op = blocks.keep_one_in_n(gr.sizeof_char, 5) dst = blocks.vector_sink_b() - print "HERE" self.tb.connect(src, op, dst) self.tb.run() self.assertEqual(dst.data(), expected_data) diff --git a/gr-blocks/python/blocks/qa_repack_bits_bb.py b/gr-blocks/python/blocks/qa_repack_bits_bb.py index d9bbfe4fac..10880b196a 100755 --- a/gr-blocks/python/blocks/qa_repack_bits_bb.py +++ b/gr-blocks/python/blocks/qa_repack_bits_bb.py @@ -28,6 +28,7 @@ class qa_repack_bits_bb (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "length" def tearDown (self): self.tb = None @@ -77,24 +78,18 @@ class qa_repack_bits_bb (gr_unittest.TestCase): expected_data = (0b101,) + (0b111,) * 4 + (0b001,) k = 8 l = 3 - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(src_data)) - src = blocks.vector_source_b(src_data, False, 1, (tag,)) - repack = blocks.repack_bits_bb(k, l, tag_name) - sink = blocks.vector_sink_b() - self.tb.connect(src, repack, sink) + src = blocks.vector_source_b(src_data, False, 1) + repack = blocks.repack_bits_bb(k, l, self.tsb_key) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(src_data), self.tsb_key), + repack, + sink + ) self.tb.run () - self.assertEqual(sink.data(), expected_data) - try: - out_tag = sink.tags()[0] - except: - self.assertFail() - self.assertEqual(out_tag.offset, 0) - self.assertEqual(pmt.symbol_to_string(out_tag.key), tag_name) - self.assertEqual(pmt.to_long(out_tag.value), len(expected_data)) + self.assertEqual(len(sink.data()), 1) + self.assertEqual(sink.data()[0], expected_data) def test_005_three_with_tags_trailing (self): """ 3 -> 8, trailing bits """ @@ -102,24 +97,18 @@ class qa_repack_bits_bb (gr_unittest.TestCase): expected_data = (0b11111101, 0b11111111) k = 3 l = 8 - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(src_data)) - src = blocks.vector_source_b(src_data, False, 1, (tag,)) - repack = blocks.repack_bits_bb(k, l, tag_name, True) - sink = blocks.vector_sink_b() - self.tb.connect(src, repack, sink) + src = blocks.vector_source_b(src_data, False, 1) + repack = blocks.repack_bits_bb(k, l, self.tsb_key, True) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(src_data), self.tsb_key), + repack, + sink + ) self.tb.run () - self.assertEqual(sink.data(), expected_data) - try: - out_tag = sink.tags()[0] - except: - self.assertFail() - self.assertEqual(out_tag.offset, 0) - self.assertEqual(pmt.symbol_to_string(out_tag.key), tag_name) - self.assertEqual(pmt.to_long(out_tag.value), len(expected_data)) + self.assertEqual(len(sink.data()), 1) + self.assertEqual(sink.data()[0], expected_data) if __name__ == '__main__': gr_unittest.run(qa_repack_bits_bb, "qa_repack_bits_bb.xml") diff --git a/gr-blocks/python/blocks/qa_tagged_stream_mux.py b/gr-blocks/python/blocks/qa_tagged_stream_mux.py index 749fda3c32..6f1c1c538a 100755 --- a/gr-blocks/python/blocks/qa_tagged_stream_mux.py +++ b/gr-blocks/python/blocks/qa_tagged_stream_mux.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,87 +20,62 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest, blocks -import pmt import numpy +import pmt +from gnuradio import gr, gr_unittest, blocks +from gnuradio.gr import packet_utils -def make_len_tags(tupl, key): - tags = [] - tag = gr.tag_t() - tag.key = pmt.string_to_symbol(key) - n_read = 0 - for element in tupl: - tag.offset = n_read - n_read += len(element) - tag.value = pmt.to_pmt(len(element)) - tags.append(tag) - return tags - -def make_len_tag(offset, key, value): +def make_tag(key, value, offset, srcid=None): tag = gr.tag_t() - tag.offset = offset tag.key = pmt.string_to_symbol(key) tag.value = pmt.to_pmt(value) + tag.offset = offset + if srcid is not None: + tag.srcid = pmt.to_pmt(srcid) return tag - class qa_tagged_stream_mux (gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() + self.tsb_key = "tsb_key" def tearDown(self): self.tb = None - def test_1(self): - datas = ( - 0, 1, 2, 5, 6, 10, 14, 15, 16, - 3, 4, 7, 8, 9, 11, 12, 13, 17 + def setup_data_tags(self, data): + return packet_utils.packets_to_vectors( + data, + self.tsb_key ) - expected = tuple(range(18)) - tagname = "packet_length" - len_tags_0 = ( - make_len_tag(0, tagname, 3), - make_len_tag(3, tagname, 2), - make_len_tag(5, tagname, 1), - make_len_tag(6, tagname, 3) + def test_1(self): + packets0 = ( + (0, 1, 2), (5, 6), (10,), (14, 15, 16,) ) - len_tags_1 = ( - make_len_tag(0, tagname, 2), - make_len_tag(2, tagname, 3), - make_len_tag(5, tagname, 3), - make_len_tag(8, tagname, 1) + packets1 = ( + (3, 4), (7, 8, 9), (11, 12, 13), (17,) ) - test_tag_0 = gr.tag_t() - test_tag_0.key = pmt.string_to_symbol('spam') - test_tag_0.offset = 4 # On the second '1' - test_tag_0.value = pmt.to_pmt(42) - test_tag_1 = gr.tag_t() - test_tag_1.key = pmt.string_to_symbol('eggs') - test_tag_1.offset = 3 # On the first '3' of the 2nd stream - test_tag_1.value = pmt.to_pmt(23) - - src0 = blocks.vector_source_b(datas[0:9], False, 1, len_tags_0 + (test_tag_0,)) - src1 = blocks.vector_source_b(datas[9:], False, 1, len_tags_1 + (test_tag_1,)) - tagged_stream_mux = blocks.tagged_stream_mux(gr.sizeof_char, tagname) - snk = blocks.vector_sink_b() + expected = ((0, 1, 2, 3, 4), (5, 6, 7, 8, 9), (10, 11, 12, 13), (14, 15, 16, 17)) + data0, tags0 = self.setup_data_tags(packets0) + data1, tags1 = self.setup_data_tags(packets1) + tags0.append(make_tag('spam', 42, 4)) + tags1.append(make_tag('eggs', 23, 3)) + src0 = blocks.vector_source_b(data0, tags=tags0) + src1 = blocks.vector_source_b(data1, tags=tags1) + tagged_stream_mux = blocks.tagged_stream_mux(gr.sizeof_char, self.tsb_key) + snk = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) self.tb.connect(src0, (tagged_stream_mux, 0)) self.tb.connect(src1, (tagged_stream_mux, 1)) self.tb.connect(tagged_stream_mux, snk) self.tb.run() - + # Check self.assertEqual(expected, snk.data()) - tags = [gr.tag_to_python(x) for x in snk.tags()] tags = sorted([(x.offset, x.key, x.value) for x in tags]) tags_expected = [ - (0, 'packet_length', 5), - (5, 'packet_length', 5), (6, 'spam', 42), (8, 'eggs', 23), - (10, 'packet_length', 4), - (14, 'packet_length', 4) ] self.assertEqual(tags, tags_expected) @@ -108,35 +83,35 @@ class qa_tagged_stream_mux (gr_unittest.TestCase): """ Test the 'preserve head position' function. This will add a 'special' tag to item 0 on stream 1. It should be on item 0 of the output stream. """ - special_tag = gr.tag_t() - special_tag.key = pmt.string_to_symbol('spam') - special_tag.offset = 0 - special_tag.value = pmt.to_pmt('eggs') - len_tag_key = "length" - packet_len_1 = 5 - packet_len_2 = 3 - mux = blocks.tagged_stream_mux(gr.sizeof_float, len_tag_key, 1) - sink = blocks.vector_sink_f() + packet_len_0 = 5 + data0 = range(packet_len_0) + packet_len_1 = 3 + data1 = range(packet_len_1) + mux = blocks.tagged_stream_mux( + gr.sizeof_float, + self.tsb_key, + 1 # Mark port 1 as carrying special tags on the head position + ) + sink = blocks.tsb_vector_sink_f(tsb_key=self.tsb_key) self.tb.connect( - blocks.vector_source_f(range(packet_len_1)), - blocks.stream_to_tagged_stream(gr.sizeof_float, 1, packet_len_1, len_tag_key), + blocks.vector_source_f(data0), + blocks.stream_to_tagged_stream(gr.sizeof_float, 1, packet_len_0, self.tsb_key), (mux, 0) ) self.tb.connect( - blocks.vector_source_f(range(packet_len_2), False, 1, (special_tag,)), - blocks.stream_to_tagged_stream(gr.sizeof_float, 1, packet_len_2, len_tag_key), + blocks.vector_source_f(range(packet_len_1), tags=(make_tag('spam', 'eggs', 0),)), + blocks.stream_to_tagged_stream(gr.sizeof_float, 1, packet_len_1, self.tsb_key), (mux, 1) ) self.tb.connect(mux, sink) self.tb.run() - self.assertEqual(sink.data(), tuple(range(packet_len_1) + range(packet_len_2))) - tags = [gr.tag_to_python(x) for x in sink.tags()] - tags = sorted([(x.offset, x.key, x.value) for x in tags]) - tags_expected = [ - (0, 'length', packet_len_1 + packet_len_2), - (0, 'spam', 'eggs'), - ] - self.assertEqual(tags, tags_expected) + self.assertEqual(len(sink.data()), 1) + self.assertEqual(sink.data()[0], tuple(data0 + data1)) + self.assertEqual(len(sink.tags()), 1) + tag = gr.tag_to_python(sink.tags()[0]) + tag = (tag.offset, tag.key, tag.value) + tag_expected = (0, 'spam', 'eggs') + self.assertEqual(tag, tag_expected) if __name__ == '__main__': diff --git a/gr-blocks/python/blocks/qa_tsb_vector_sink_X.py b/gr-blocks/python/blocks/qa_tsb_vector_sink_X.py new file mode 100755 index 0000000000..aa7154e6a5 --- /dev/null +++ b/gr-blocks/python/blocks/qa_tsb_vector_sink_X.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# 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. +# + +import pmt +from gnuradio import gr, gr_unittest +from gnuradio import blocks + +class qa_tsb_vector_sink (gr_unittest.TestCase): + + def setUp (self): + self.tb = gr.top_block () + self.tsb_key = "tsb" + + def tearDown (self): + self.tb = None + + def test_001_t (self): + packet_len = 4 + data = range(2 * packet_len) + tag = gr.tag_t() + tag.key = pmt.intern("foo") + tag.offset = 5 + tag.value = pmt.intern("bar") + src = blocks.vector_source_f(data, tags=(tag,)) + sink = blocks.tsb_vector_sink_f(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_float, 1, packet_len, self.tsb_key), + sink + ) + self.tb.run() + self.assertEqual((tuple(data[0:packet_len]), tuple(data[packet_len:])), sink.data()) + self.assertEqual(len(sink.tags()), 1) + self.assertEqual(sink.tags()[0].offset, tag.offset) + + +if __name__ == '__main__': + gr_unittest.run(qa_tsb_vector_sink, "qa_tsb_vector_sink.xml") diff --git a/gr-blocks/swig/blocks_swig1.i b/gr-blocks/swig/blocks_swig1.i index c87b4df03e..24483fcf91 100644 --- a/gr-blocks/swig/blocks_swig1.i +++ b/gr-blocks/swig/blocks_swig1.i @@ -36,6 +36,11 @@ #include "gnuradio/blocks/streams_to_vector.h" #include "gnuradio/blocks/tag_debug.h" #include "gnuradio/blocks/tagged_file_sink.h" +#include "gnuradio/blocks/tsb_vector_sink_b.h" +#include "gnuradio/blocks/tsb_vector_sink_c.h" +#include "gnuradio/blocks/tsb_vector_sink_f.h" +#include "gnuradio/blocks/tsb_vector_sink_i.h" +#include "gnuradio/blocks/tsb_vector_sink_s.h" #include "gnuradio/blocks/throttle.h" #include "gnuradio/blocks/vector_map.h" #include "gnuradio/blocks/vector_to_stream.h" @@ -68,6 +73,11 @@ %include "gnuradio/blocks/streams_to_vector.h" %include "gnuradio/blocks/tag_debug.h" %include "gnuradio/blocks/tagged_file_sink.h" +%include "gnuradio/blocks/tsb_vector_sink_b.h" +%include "gnuradio/blocks/tsb_vector_sink_c.h" +%include "gnuradio/blocks/tsb_vector_sink_f.h" +%include "gnuradio/blocks/tsb_vector_sink_i.h" +%include "gnuradio/blocks/tsb_vector_sink_s.h" %include "gnuradio/blocks/throttle.h" %include "gnuradio/blocks/vector_map.h" %include "gnuradio/blocks/vector_to_stream.h" @@ -99,6 +109,11 @@ GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_stream); GR_SWIG_BLOCK_MAGIC2(blocks, streams_to_vector); GR_SWIG_BLOCK_MAGIC2(blocks, tag_debug); GR_SWIG_BLOCK_MAGIC2(blocks, tagged_file_sink); +GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_b); +GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_c); +GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_f); +GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_i); +GR_SWIG_BLOCK_MAGIC2(blocks, tsb_vector_sink_s); GR_SWIG_BLOCK_MAGIC2(blocks, throttle); GR_SWIG_BLOCK_MAGIC2(blocks, vector_map); GR_SWIG_BLOCK_MAGIC2(blocks, vector_to_stream); diff --git a/gr-blocks/swig/blocks_swig5.i b/gr-blocks/swig/blocks_swig5.i index 0d68dc7819..497388c7ba 100644 --- a/gr-blocks/swig/blocks_swig5.i +++ b/gr-blocks/swig/blocks_swig5.i @@ -61,6 +61,7 @@ #include "gnuradio/blocks/uchar_to_float.h" #include "gnuradio/blocks/udp_sink.h" #include "gnuradio/blocks/udp_source.h" +#include "gnuradio/blocks/unpack_k_bits.h" #include "gnuradio/blocks/unpack_k_bits_bb.h" #include "gnuradio/blocks/unpacked_to_packed_bb.h" #include "gnuradio/blocks/unpacked_to_packed_ss.h" @@ -102,6 +103,7 @@ %include "gnuradio/blocks/uchar_to_float.h" %include "gnuradio/blocks/udp_sink.h" %include "gnuradio/blocks/udp_source.h" +%include "gnuradio/blocks/unpack_k_bits.h" %include "gnuradio/blocks/unpack_k_bits_bb.h" %include "gnuradio/blocks/unpacked_to_packed_bb.h" %include "gnuradio/blocks/unpacked_to_packed_ss.h" diff --git a/gr-channels/examples/channel_tone_response.grc b/gr-channels/examples/channel_tone_response.grc index 37e2171eb2..c9a24b1799 100644 --- a/gr-channels/examples/channel_tone_response.grc +++ b/gr-channels/examples/channel_tone_response.grc @@ -86,7 +86,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -262,7 +262,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> diff --git a/gr-channels/examples/demo_gmsk.grc b/gr-channels/examples/demo_gmsk.grc index a5531fb46b..16f8d9b5af 100644 --- a/gr-channels/examples/demo_gmsk.grc +++ b/gr-channels/examples/demo_gmsk.grc @@ -294,7 +294,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -384,7 +384,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-channels/examples/demo_ofdm.grc b/gr-channels/examples/demo_ofdm.grc index f3c3a80e0e..bc84ef0ee8 100644 --- a/gr-channels/examples/demo_ofdm.grc +++ b/gr-channels/examples/demo_ofdm.grc @@ -521,7 +521,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -1100,7 +1100,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-channels/examples/demo_qam.grc b/gr-channels/examples/demo_qam.grc index d4c56d7d1a..bc9b2d0de8 100644 --- a/gr-channels/examples/demo_qam.grc +++ b/gr-channels/examples/demo_qam.grc @@ -498,7 +498,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -686,7 +686,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-channels/examples/demo_quantization.grc b/gr-channels/examples/demo_quantization.grc index 134e224e7f..958645b7c7 100644 --- a/gr-channels/examples/demo_quantization.grc +++ b/gr-channels/examples/demo_quantization.grc @@ -601,7 +601,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -864,7 +864,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-channels/lib/CMakeLists.txt b/gr-channels/lib/CMakeLists.txt index 46bb38b270..c74e3386df 100644 --- a/gr-channels/lib/CMakeLists.txt +++ b/gr-channels/lib/CMakeLists.txt @@ -81,3 +81,23 @@ GR_LIBRARY_FOO(gnuradio-channels RUNTIME_COMPONENT "channels_runtime" DEVEL_COMP add_dependencies(gnuradio-channels channels_generated_includes channels_generated_swigs gnuradio-runtime gnuradio-filter gnuradio-analog gnuradio-blocks) + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-channels_static STATIC ${channels_sources}) + + add_dependencies(gnuradio-channels_static + channels_generated_includes + gnuradio-runtime_static + gnuradio-filter_static + gnuradio-analog_static + gnuradio-blocks_static) + + if(NOT WIN32) + set_target_properties(gnuradio-channels_static + PROPERTIES OUTPUT_NAME gnuradio-channels) + endif(NOT WIN32) + + install(TARGETS gnuradio-channels_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "channels_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-comedi/lib/CMakeLists.txt b/gr-comedi/lib/CMakeLists.txt index 57b4df11a4..206ddb3e55 100644 --- a/gr-comedi/lib/CMakeLists.txt +++ b/gr-comedi/lib/CMakeLists.txt @@ -56,3 +56,16 @@ list(APPEND comedi_libs add_library(gnuradio-comedi SHARED ${comedi_sources}) target_link_libraries(gnuradio-comedi ${comedi_libs}) GR_LIBRARY_FOO(gnuradio-comedi RUNTIME_COMPONENT "comedi_runtime" DEVEL_COMPONENT "comedi_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-comedi_static STATIC ${comedi_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-comedi_static + PROPERTIES OUTPUT_NAME gnuradio-comedi) + endif(NOT WIN32) + + install(TARGETS gnuradio-comedi_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "comedi_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-digital/examples/demod/gfsk_loopback.grc b/gr-digital/examples/demod/gfsk_loopback.grc index 179a8102f3..b9a7a0725e 100644 --- a/gr-digital/examples/demod/gfsk_loopback.grc +++ b/gr-digital/examples/demod/gfsk_loopback.grc @@ -200,7 +200,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -489,7 +489,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-digital/examples/demod/gmsk_loopback.grc b/gr-digital/examples/demod/gmsk_loopback.grc index 710070e908..7fb1a5f528 100644 --- a/gr-digital/examples/demod/gmsk_loopback.grc +++ b/gr-digital/examples/demod/gmsk_loopback.grc @@ -200,7 +200,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -446,7 +446,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-digital/examples/demod/mpsk_demod.grc b/gr-digital/examples/demod/mpsk_demod.grc index e6fc8a9d3e..f1f0e2fd6d 100644 --- a/gr-digital/examples/demod/mpsk_demod.grc +++ b/gr-digital/examples/demod/mpsk_demod.grc @@ -318,7 +318,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -377,7 +377,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> diff --git a/gr-digital/examples/demod/test_corr_and_sync.grc b/gr-digital/examples/demod/test_corr_and_sync.grc index 496a0be356..71dca83c9a 100644 --- a/gr-digital/examples/demod/test_corr_and_sync.grc +++ b/gr-digital/examples/demod/test_corr_and_sync.grc @@ -1559,7 +1559,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -1925,7 +1925,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -2256,7 +2256,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -2626,7 +2626,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-digital/examples/demod/uhd_corr_and_sync_rx.grc b/gr-digital/examples/demod/uhd_corr_and_sync_rx.grc index c7b72441f1..fd3eaa62f1 100644 --- a/gr-digital/examples/demod/uhd_corr_and_sync_rx.grc +++ b/gr-digital/examples/demod/uhd_corr_and_sync_rx.grc @@ -337,7 +337,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -459,7 +459,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -546,7 +546,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml index 9eca98ddb1..c77876f16e 100644 --- a/gr-digital/grc/digital_block_tree.xml +++ b/gr-digital/grc/digital_block_tree.xml @@ -67,7 +67,9 @@ <cat> <name>Packet Operators</name> <block>digital_correlate_access_code_tag_bb</block> + <block>digital_correlate_access_code_xx_ts</block> <block>digital_crc32_bb</block> + <block>digital_crc32_async_bb</block> <block>digital_framer_sink_1</block> <block>digital_header_payload_demux</block> <block>digital_packet_headergenerator_bb</block> diff --git a/gr-digital/grc/digital_constellation_receiver_cb.xml b/gr-digital/grc/digital_constellation_receiver_cb.xml index ffda8b85bb..134e027759 100644 --- a/gr-digital/grc/digital_constellation_receiver_cb.xml +++ b/gr-digital/grc/digital_constellation_receiver_cb.xml @@ -33,6 +33,19 @@ <name>in</name> <type>complex</type> </sink> + + <sink> + <name>set_constellation</name> + <type>message</type> + <optional>1</optional> + </sink> + + <sink> + <name>rotate_phase</name> + <type>message</type> + <optional>1</optional> + </sink> + <source> <name>out</name> <type>byte</type> diff --git a/gr-digital/grc/digital_correlate_access_code_xx_ts.xml b/gr-digital/grc/digital_correlate_access_code_xx_ts.xml new file mode 100644 index 0000000000..467c2c84d9 --- /dev/null +++ b/gr-digital/grc/digital_correlate_access_code_xx_ts.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- +################################################### +## Correlate Access Code - to tag stream +################################################### + --> +<block> + <name>Correlate Access Code - Tag Stream</name> + <key>digital_correlate_access_code_xx_ts</key> + <import>from gnuradio import digital</import> + <make>digital.correlate_access_code_$(type.fcn)_ts($access_code, + $threshold, $tagname)</make> + + <param> + <name>IO Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Float</name> + <key>float</key> + <opt>fcn:ff</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>fcn:bb</opt> + </option> + </param> + + <param> + <name>Access Code</name> + <key>access_code</key> + <value>101010</value> + <type>string</type> + </param> + + <param> + <name>Threshold</name> + <key>threshold</key> + <type>int</type> + </param> + + <param> + <name>Tag Name</name> + <key>tagname</key> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>$type</type> + </sink> + + <source> + <name>out</name> + <type>$type</type> + </source> +</block> diff --git a/gr-digital/grc/digital_crc32_async_bb.xml b/gr-digital/grc/digital_crc32_async_bb.xml new file mode 100644 index 0000000000..84c60e60ab --- /dev/null +++ b/gr-digital/grc/digital_crc32_async_bb.xml @@ -0,0 +1,32 @@ +<block> + <name>Async CRC32</name> + <key>digital_crc32_async_bb</key> + <import>from gnuradio import digital</import> + <make>digital.crc32_async_bb($check)</make> + + <param> + <name>Mode</name> + <key>check</key> + <type>enum</type> + <option> + <name>Generate CRC</name> + <key>False</key> + </option> + <option> + <name>Check CRC</name> + <key>True</key> + </option> + </param> + + <sink> + <name>in</name> + <type>message</type> + <optional>1</optional> + </sink> + + <source> + <name>out</name> + <type>message</type> + <optional>1</optional> + </source> +</block> diff --git a/gr-digital/include/gnuradio/digital/CMakeLists.txt b/gr-digital/include/gnuradio/digital/CMakeLists.txt index 63b65b9c77..0d958e867f 100644 --- a/gr-digital/include/gnuradio/digital/CMakeLists.txt +++ b/gr-digital/include/gnuradio/digital/CMakeLists.txt @@ -47,7 +47,7 @@ macro(expand_h root) string(REGEX REPLACE "X+" ${sig} name ${root}) list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h) endforeach(sig) - + #create a command to generate the files add_custom_command( OUTPUT ${expanded_files_h} @@ -87,11 +87,14 @@ install(FILES constellation_soft_decoder_cf.h correlate_access_code_bb.h correlate_access_code_tag_bb.h + correlate_access_code_bb_ts.h + correlate_access_code_ff_ts.h correlate_and_sync_cc.h costas_loop_cc.h cpmmod_bc.h crc32.h crc32_bb.h + crc32_async_bb.h descrambler_bb.h diff_decoder_bb.h diff_encoder_bb.h @@ -144,4 +147,3 @@ install(FILES DESTINATION ${GR_INCLUDE_DIR}/gnuradio/digital COMPONENT "digital_devel" ) - diff --git a/gr-digital/include/gnuradio/digital/binary_slicer_fb.h b/gr-digital/include/gnuradio/digital/binary_slicer_fb.h index 7a05e87a62..0670ca09c6 100644 --- a/gr-digital/include/gnuradio/digital/binary_slicer_fb.h +++ b/gr-digital/include/gnuradio/digital/binary_slicer_fb.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006,2011,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, @@ -28,7 +28,7 @@ namespace gr { namespace digital { - + /*! * \brief Slice float binary symbol producing 1 bit output * \ingroup symbol_coding_blk diff --git a/gr-digital/include/gnuradio/digital/constellation_receiver_cb.h b/gr-digital/include/gnuradio/digital/constellation_receiver_cb.h index b380ba6109..36cfd5774f 100644 --- a/gr-digital/include/gnuradio/digital/constellation_receiver_cb.h +++ b/gr-digital/include/gnuradio/digital/constellation_receiver_cb.h @@ -41,6 +41,18 @@ namespace gr { * loop that finds the error of the incoming signal point compared * to its nearest constellation point. The frequency and phase of * the NCO are updated according to this error. + * + * Message Ports: + * + * set_constellation (input): + * Receives a PMT any containing a new gr::digital::constellation object. + * The PMT is cast back to a gr::digital::constellation_sptr + * and passes this to set_constellation. + * + * rotate_phase (input): + * Receives a PMT double to update the phase. + * The phase value passed in the message is added to the + * current phase of the receiver. */ class DIGITAL_API constellation_receiver_cb : virtual public block @@ -59,7 +71,7 @@ namespace gr { * \param fmin minimum normalized frequency value the loop can achieve * \param fmax maximum normalized frequency value the loop can achieve */ - static sptr make(constellation_sptr constellation, + static sptr make(constellation_sptr constellation, float loop_bw, float fmin, float fmax); virtual void phase_error_tracking(float phase_error) = 0; diff --git a/gr-digital/include/gnuradio/digital/correlate_access_code_bb_ts.h b/gr-digital/include/gnuradio/digital/correlate_access_code_bb_ts.h new file mode 100644 index 0000000000..d311dda3c3 --- /dev/null +++ b/gr-digital/include/gnuradio/digital/correlate_access_code_bb_ts.h @@ -0,0 +1,71 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H +#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H + +#include <gnuradio/digital/api.h> +#include <gnuradio/block.h> +#include <string> + +namespace gr { + namespace digital { + + /*! + * \brief Examine input for specified access code, one bit at a time. + * \ingroup packet_operators_blk + * + * \details + * input: stream of bits, 1 bit per input byte (data in LSB) + * output: unaltered stream of bits (plus tags) + * + * This block annotates the input stream with tags. The tags have + * key name [tag_name], specified in the constructor. Used for + * searching an input data stream for preambles, etc. + */ + class DIGITAL_API correlate_access_code_bb_ts : virtual public block + { + public: + // gr::digital::correlate_access_code_bb_ts::sptr + typedef boost::shared_ptr<correlate_access_code_bb_ts> sptr; + + /*! + * \param access_code is represented with 1 byte per bit, + * e.g., "010101010111000100" + * \param threshold maximum number of bits that may be wrong + * \param tag_name key of the tag inserted into the tag stream + */ + static sptr make(const std::string &access_code, + int threshold, + const std::string &tag_name); + + /*! + * \param access_code is represented with 1 byte per bit, + * e.g., "010101010111000100" + */ + virtual bool set_access_code(const std::string &access_code) = 0; + }; + + } /* namespace digital */ +} /* namespace gr */ + +#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_H */ diff --git a/gr-digital/include/gnuradio/digital/correlate_access_code_ff_ts.h b/gr-digital/include/gnuradio/digital/correlate_access_code_ff_ts.h new file mode 100644 index 0000000000..b0485b1d90 --- /dev/null +++ b/gr-digital/include/gnuradio/digital/correlate_access_code_ff_ts.h @@ -0,0 +1,77 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_H +#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_H + +#include <gnuradio/digital/api.h> +#include <gnuradio/block.h> +#include <string> + +namespace gr { + namespace digital { + + /*! + * \brief Examine input for specified access code, one bit at a time. + * \ingroup packet_operators_blk + * + * \details + * input: stream of floats (generally, soft decisions) + * output: unaltered stream of floats in a tagged stream + * + * This block searches for the given access code by slicing the + * soft decision symbol inputs. Once found, it expects the + * following 32 samples to contain a header that includes the + * frame length. It decodes the header to get the frame length in + * order to set up the the tagged stream key information. + * + * The output of this block is appropriate for use with tagged + * stream blocks. + */ + class DIGITAL_API correlate_access_code_ff_ts : virtual public block + { + public: + // gr::digital::correlate_access_code_ff_ts::sptr + typedef boost::shared_ptr<correlate_access_code_ff_ts> sptr; + + /*! + * \param access_code is represented with 1 byte per bit, + * e.g., "010101010111000100" + * \param threshold maximum number of bits that may be wrong + * \param tag_name key of the tag inserted into the tag stream + */ + static sptr make(const std::string &access_code, + int threshold, + const std::string &tag_name); + + /*! + * \param access_code is represented with 1 byte per bit, + * e.g., "010101010111000100" + */ + virtual bool set_access_code(const std::string &access_code) = 0; + virtual unsigned long long access_code() const = 0; + }; + + } /* namespace digital */ +} /* namespace gr */ + +#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_H */ diff --git a/gr-digital/include/gnuradio/digital/crc32_async_bb.h b/gr-digital/include/gnuradio/digital/crc32_async_bb.h new file mode 100644 index 0000000000..335ac20438 --- /dev/null +++ b/gr-digital/include/gnuradio/digital/crc32_async_bb.h @@ -0,0 +1,70 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + + +#ifndef INCLUDED_DIGITAL_CRC32_ASYNC_BB_H +#define INCLUDED_DIGITAL_CRC32_ASYNC_BB_H + +#include <gnuradio/digital/api.h> +#include <gnuradio/block.h> + +namespace gr { + namespace digital { + + /*! + * \brief Byte-stream CRC block for async messages + * \ingroup packet_operators_blk + * + * \details + * + * Processes packets (as async PDU messages) for CRC32. The \p + * check parameter determines if the block acts to check and strip + * the CRC or to calculate and append the CRC32. + * + * The input PDU is expected to be a message of packet bytes. + * + * When using check mode, if the CRC passes, the output is a + * payload of the message with the CRC stripped, so the output + * will be 4 bytes smaller than the input. + * + * When using calculate mode (check == false), then the CRC is + * calculated on the PDU and appended to it. The output is then 4 + * bytes longer than the input. + * + * This block implements the CRC32 using the Boost crc_optimal + * class for 32-bit CRCs with the standard generator 0x04C11DB7. + */ + class DIGITAL_API crc32_async_bb : virtual public block + { + public: + typedef boost::shared_ptr<crc32_async_bb> sptr; + + /*! + * \param check Set to true if you want to check CRC, false to create CRC. + */ + static sptr make(bool check=false); + }; + + } // namespace digital +} // namespace gr + +#endif /* INCLUDED_DIGITAL_CRC32_ASYNC_BB_H */ diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt index 00200d1dc3..4ba821a307 100644 --- a/gr-digital/lib/CMakeLists.txt +++ b/gr-digital/lib/CMakeLists.txt @@ -72,7 +72,7 @@ macro(expand_cc root) list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc) list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h) endforeach(sig) - + #create a command to generate the source files add_custom_command( OUTPUT ${expanded_files_cc} @@ -90,15 +90,15 @@ macro(expand_cc root) ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py ${root} ${root}.h.t ${ARGN} ) - + #make source files depends on headers to force generation set_source_files_properties(${expanded_files_cc} PROPERTIES OBJECT_DEPENDS "${expanded_files_h}" ) - + #install rules for the generated cc files - list(APPEND generated_sources ${expanded_files_cc}) - list(APPEND generated_headers ${expanded_files_h}) + list(APPEND generated_sources ${expanded_files_cc}) + list(APPEND generated_headers ${expanded_files_h}) endmacro(expand_cc) @@ -123,11 +123,14 @@ list(APPEND digital_sources constellation_soft_decoder_cf_impl.cc correlate_access_code_bb_impl.cc correlate_access_code_tag_bb_impl.cc + correlate_access_code_bb_ts_impl.cc + correlate_access_code_ff_ts_impl.cc correlate_and_sync_cc_impl.cc costas_loop_cc_impl.cc cpmmod_bc_impl.cc crc32.cc crc32_bb_impl.cc + crc32_async_bb_impl.cc descrambler_bb_impl.cc diff_decoder_bb_impl.cc diff_encoder_bb_impl.cc @@ -214,3 +217,23 @@ add_dependencies( gnuradio-analog gnuradio-blocks ) + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-digital_static STATIC ${digital_sources}) + + add_dependencies(gnuradio-digital_static + digital_generated_includes + gnuradio-runtime_static + gnuradio-filter_static + gnuradio-analog_static + gnuradio-blocks_static) + + if(NOT WIN32) + set_target_properties(gnuradio-digital_static + PROPERTIES OUTPUT_NAME gnuradio-digital) + endif(NOT WIN32) + + install(TARGETS gnuradio-digital_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "digital_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-digital/lib/binary_slicer_fb_impl.cc b/gr-digital/lib/binary_slicer_fb_impl.cc index 335e2e549a..565f751ec6 100644 --- a/gr-digital/lib/binary_slicer_fb_impl.cc +++ b/gr-digital/lib/binary_slicer_fb_impl.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006,2010-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, @@ -30,7 +30,7 @@ namespace gr { namespace digital { - + binary_slicer_fb::sptr binary_slicer_fb::make() { return gnuradio::get_initial_sptr(new binary_slicer_fb_impl()); @@ -58,7 +58,7 @@ namespace gr { for(int i = 0; i < noutput_items; i++) { out[i] = gr::binary_slicer(in[i]); } - + return noutput_items; } diff --git a/gr-digital/lib/binary_slicer_fb_impl.h b/gr-digital/lib/binary_slicer_fb_impl.h index c3ae16c7d5..cb95a17f98 100644 --- a/gr-digital/lib/binary_slicer_fb_impl.h +++ b/gr-digital/lib/binary_slicer_fb_impl.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2006,2011,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, diff --git a/gr-digital/lib/constellation_receiver_cb_impl.cc b/gr-digital/lib/constellation_receiver_cb_impl.cc index 927df2c748..01a920174c 100644 --- a/gr-digital/lib/constellation_receiver_cb_impl.cc +++ b/gr-digital/lib/constellation_receiver_cb_impl.cc @@ -38,7 +38,7 @@ namespace gr { #define VERBOSE_MM 0 // Used for debugging symbol timing loop #define VERBOSE_COSTAS 0 // Used for debugging phase and frequency tracking - constellation_receiver_cb::sptr + constellation_receiver_cb::sptr constellation_receiver_cb::make(constellation_sptr constell, float loop_bw, float fmin, float fmax) { @@ -49,7 +49,7 @@ namespace gr { static int ios[] = {sizeof(char), sizeof(float), sizeof(float), sizeof(float), sizeof(gr_complex)}; static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int)); - constellation_receiver_cb_impl::constellation_receiver_cb_impl(constellation_sptr constellation, + constellation_receiver_cb_impl::constellation_receiver_cb_impl(constellation_sptr constellation, float loop_bw, float fmin, float fmax) : block("constellation_receiver_cb", io_signature::make(1, 1, sizeof(gr_complex)), @@ -60,11 +60,17 @@ namespace gr { { if(d_constellation->dimensionality() != 1) throw std::runtime_error("This receiver only works with constellations of dimension 1."); + message_port_register_in(pmt::mp("set_constellation")); set_msg_handler( pmt::mp("set_constellation"), boost::bind(&constellation_receiver_cb_impl::handle_set_constellation, this, _1)); + + message_port_register_in(pmt::mp("rotate_phase")); + set_msg_handler(pmt::mp("rotate_phase"), + boost::bind(&constellation_receiver_cb_impl::handle_rotate_phase, + this, _1)); } constellation_receiver_cb_impl::~constellation_receiver_cb_impl() @@ -77,10 +83,10 @@ namespace gr { advance_loop(phase_error); phase_wrap(); frequency_limit(); - + #if VERBOSE_COSTAS printf("cl: phase_error: %f phase: %f freq: %f sample: %f+j%f constellation: %f+j%f\n", - phase_error, d_phase, d_freq, sample.real(), sample.imag(), + phase_error, d_phase, d_freq, sample.real(), sample.imag(), d_constellation->points()[d_current_const_point].real(), d_constellation->points()[d_current_const_point].imag()); #endif @@ -96,13 +102,23 @@ namespace gr { void constellation_receiver_cb_impl::handle_set_constellation(pmt::pmt_t constellation_pmt) { - boost::any constellation_any = pmt::any_ref(constellation_pmt); - constellation_sptr constellation = boost::any_cast<constellation_sptr>( - constellation_any); - set_constellation(constellation); + if(pmt::is_any(constellation_pmt)) { + boost::any constellation_any = pmt::any_ref(constellation_pmt); + constellation_sptr constellation = boost::any_cast<constellation_sptr>( + constellation_any); + set_constellation(constellation); + } + } + + void + constellation_receiver_cb_impl::handle_rotate_phase(pmt::pmt_t rotation) + { + if(pmt::is_real(rotation)) { + double phase = pmt::to_double(rotation); + d_phase += phase; + } } - void constellation_receiver_cb_impl::set_constellation(constellation_sptr constellation) { @@ -145,16 +161,16 @@ namespace gr { tag_t tag = tags_now[j]; dispatch_msg(tag.key, tag.value); } - + sample = in[i]; nco = gr_expj(d_phase); // get the NCO value for derotating the current sample sample = nco*sample; // get the downconverted symbol - + sym_value = d_constellation->decision_maker_pe(&sample, &phase_error); phase_error_tracking(phase_error); // corrects phase and frequency offsets - + out[i] = sym_value; - + if(output_items.size() == 5) { out_err[i] = phase_error; out_phase[i] = d_phase; @@ -162,7 +178,7 @@ namespace gr { out_symbol[i] = sample; } i++; - + } consume_each(i); @@ -197,7 +213,7 @@ namespace gr { pmt::mp(0.0f), pmt::mp(2.0f), pmt::mp(0.0f), "", "Loop bandwidth", RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP))); - + // Setters add_rpc_variable( rpcbasic_sptr(new rpcbasic_register_set<control_loop, float>( @@ -208,8 +224,7 @@ namespace gr { RPC_PRIVLVL_MIN, DISPNULL))); #endif /* GR_CTRLPORT */ } - + } /* namespace digital */ } /* namespace gr */ - diff --git a/gr-digital/lib/constellation_receiver_cb_impl.h b/gr-digital/lib/constellation_receiver_cb_impl.h index ccbbf83657..90482e2cc5 100644 --- a/gr-digital/lib/constellation_receiver_cb_impl.h +++ b/gr-digital/lib/constellation_receiver_cb_impl.h @@ -35,7 +35,7 @@ namespace gr { : public constellation_receiver_cb, blocks::control_loop { public: - constellation_receiver_cb_impl(constellation_sptr constell, + constellation_receiver_cb_impl(constellation_sptr constell, float loop_bw, float fmin, float fmax); ~constellation_receiver_cb_impl(); @@ -58,18 +58,31 @@ namespace gr { //! Typically used when we receive a tag with values for these. void set_phase_freq(float phase, float freq); + /*! + * Message handler port to receiver a new constellation. + * constellation_pmt is a pmt_any; constellation objects have + * an as_pmt function that can be used for this purpose. + */ void handle_set_constellation(pmt::pmt_t constellation_pmt); + /*! + * Message handler port to update the phase of the rotator. The + * phase should be a real number (float or double) that is added + * to the current phase. So we can rotate the constellation by + * 90 degress by passing a value of pmt::from_double(M_PI/2). + */ + void handle_rotate_phase(pmt::pmt_t rotation); + //! Set the constellation used. //! Typically used when we receive a tag with a value for this. void set_constellation(constellation_sptr constellation); //! delay line length. static const unsigned int DLLEN = 8; - + //! delay line plus some length for overflow protection __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN]; - + //! index to delay line unsigned int d_dl_idx; }; diff --git a/gr-digital/lib/correlate_access_code_bb_impl.cc b/gr-digital/lib/correlate_access_code_bb_impl.cc index dea831dfbc..532871a407 100644 --- a/gr-digital/lib/correlate_access_code_bb_impl.cc +++ b/gr-digital/lib/correlate_access_code_bb_impl.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2004,2006,2010-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, @@ -97,7 +97,7 @@ namespace gr { t |= ((d_data_reg >> 63) & 0x1) << 0; t |= ((d_flag_reg >> 63) & 0x1) << 1; // flag bit out[i] = t; - + // compute hamming distance between desired access code and current data unsigned long long wrong_bits = 0; unsigned int nwrong = d_threshold+1; @@ -128,6 +128,6 @@ namespace gr { return noutput_items; } - + } /* namespace digital */ } /* namespace gr */ diff --git a/gr-digital/lib/correlate_access_code_bb_ts_impl.cc b/gr-digital/lib/correlate_access_code_bb_ts_impl.cc new file mode 100644 index 0000000000..e2fe02be4b --- /dev/null +++ b/gr-digital/lib/correlate_access_code_bb_ts_impl.cc @@ -0,0 +1,168 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "correlate_access_code_bb_ts_impl.h" +#include <gnuradio/io_signature.h> +#include <stdexcept> +#include <volk/volk.h> +#include <cstdio> +#include <iostream> + +namespace gr { + namespace digital { + +#define VERBOSE 0 + + correlate_access_code_bb_ts::sptr + correlate_access_code_bb_ts::make(const std::string &access_code, + int threshold, + const std::string &tag_name) + { + return gnuradio::get_initial_sptr + (new correlate_access_code_bb_ts_impl(access_code, + threshold, tag_name)); + } + + + correlate_access_code_bb_ts_impl::correlate_access_code_bb_ts_impl( + const std::string &access_code, int threshold, const std::string &tag_name) + : block("correlate_access_code_bb_ts", + io_signature::make(1, 1, sizeof(char)), + io_signature::make(1, 1, sizeof(char))), + d_data_reg(0), d_mask(0), + d_threshold(threshold), d_len(0) + { + set_tag_propagation_policy(TPP_DONT); + + if(!set_access_code(access_code)) { + throw std::out_of_range ("access_code is > 64 bits"); + } + + std::stringstream str; + str << name() << unique_id(); + d_me = pmt::string_to_symbol(str.str()); + d_key = pmt::string_to_symbol(tag_name); + + // READ IN AS ARGS; MAKE SETTERS/GETTERS + d_pkt_key = pmt::string_to_symbol("pkt_len"); + d_pkt_len = 120*8; + d_pkt_count = 0; + } + + correlate_access_code_bb_ts_impl::~correlate_access_code_bb_ts_impl() + { + } + + bool + correlate_access_code_bb_ts_impl::set_access_code( + const std::string &access_code) + { + d_len = access_code.length(); // # of bytes in string + if(d_len > 64) + return false; + + // set len top bits to 1. + d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len); + + d_access_code = 0; + for(unsigned i=0; i < d_len; i++){ + d_access_code = (d_access_code << 1) | (access_code[i] & 1); + } + if(VERBOSE) { + std::cerr << "Access code: " << std::hex << d_access_code << std::dec << std::endl; + std::cerr << "Mask: " << std::hex << d_mask << std::dec << std::endl; + } + + return true; + } + + int + correlate_access_code_bb_ts_impl::general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const unsigned char *in = (const unsigned char*)input_items[0]; + unsigned char *out = (unsigned char*)output_items[0]; + + uint64_t abs_out_sample_cnt = nitems_written(0); + + int nprod = 0; + + for(int i = 0; i < noutput_items; i++) { + if(d_pkt_count > 0) { + out[nprod] = in[i]; + d_pkt_count--; + nprod++; + + if(d_pkt_count == 0) { + add_item_tag(0, + abs_out_sample_cnt + i, + pmt::intern("STOP"), + pmt::from_long(abs_out_sample_cnt + nprod), + d_me); + } + } + else { + + // compute hamming distance between desired access code and current data + uint64_t wrong_bits = 0; + uint64_t nwrong = d_threshold+1; + + wrong_bits = (d_data_reg ^ d_access_code) & d_mask; + volk_64u_popcnt(&nwrong, wrong_bits); + + // shift in new data + d_data_reg = (d_data_reg << 1) | (in[i] & 0x1); + if(nwrong <= d_threshold) { + if(VERBOSE) + std::cerr << "writing tag at sample " << abs_out_sample_cnt + i << std::endl; + add_item_tag(0, // stream ID + abs_out_sample_cnt + nprod, // sample + d_key, // frame info + pmt::from_long(nwrong), // data (number wrong) + d_me); // block src id + + // MAKE A TAG OUT OF THIS AND UPDATE OFFSET + add_item_tag(0, // stream ID + abs_out_sample_cnt + nprod, // sample + d_pkt_key, // length key + pmt::from_long(d_pkt_len), // length data + d_me); // block src id + d_pkt_count = d_pkt_len; + d_data_reg = 0; + } + } + } + + //std::cerr << "Producing data: " << nprod << std::endl; + consume_each(noutput_items); + return nprod; + } + + } /* namespace digital */ +} /* namespace gr */ + diff --git a/gr-digital/lib/correlate_access_code_bb_ts_impl.h b/gr-digital/lib/correlate_access_code_bb_ts_impl.h new file mode 100644 index 0000000000..e829fc9e99 --- /dev/null +++ b/gr-digital/lib/correlate_access_code_bb_ts_impl.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_IMPL_H +#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_IMPL_H + +#include <gnuradio/digital/correlate_access_code_bb_ts.h> + +namespace gr { + namespace digital { + + class correlate_access_code_bb_ts_impl : + public correlate_access_code_bb_ts + { + private: + unsigned long long d_access_code; // access code to locate start of packet + // access code is left justified in the word + unsigned long long d_data_reg; // used to look for access_code + unsigned long long d_mask; // masks access_code bits (top N bits are set where + // N is the number of bits in the access code) + unsigned int d_threshold; // how many bits may be wrong in sync vector + unsigned int d_len; // the length of the access code + + pmt::pmt_t d_key, d_me; //d_key is the tag name, d_me is the block name + unique ID + pmt::pmt_t d_pkt_key; + int d_pkt_len, d_pkt_count; + + public: + correlate_access_code_bb_ts_impl(const std::string &access_code, + int threshold, + const std::string &tag_name); + ~correlate_access_code_bb_ts_impl(); + + int general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + + bool set_access_code(const std::string &access_code); + }; + + } /* namespace digital */ +} /* namespace gr */ + +#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_TS_IMPL_H */ diff --git a/gr-digital/lib/correlate_access_code_ff_ts_impl.cc b/gr-digital/lib/correlate_access_code_ff_ts_impl.cc new file mode 100644 index 0000000000..86bbb686d5 --- /dev/null +++ b/gr-digital/lib/correlate_access_code_ff_ts_impl.cc @@ -0,0 +1,227 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "correlate_access_code_ff_ts_impl.h" +#include <gnuradio/io_signature.h> +#include <gnuradio/math.h> +#include <stdexcept> +#include <volk/volk.h> +#include <cstdio> +#include <iostream> + +namespace gr { + namespace digital { + +#define VERBOSE 0 + + correlate_access_code_ff_ts::sptr + correlate_access_code_ff_ts::make(const std::string &access_code, + int threshold, + const std::string &tag_name) + { + return gnuradio::get_initial_sptr + (new correlate_access_code_ff_ts_impl(access_code, + threshold, tag_name)); + } + + correlate_access_code_ff_ts_impl::correlate_access_code_ff_ts_impl( + const std::string &access_code, int threshold, const std::string &tag_name) + : block("correlate_access_code_ff_ts", + io_signature::make(1, 1, sizeof(float)), + io_signature::make(1, 1, sizeof(float))), + d_data_reg(0), d_mask(0), + d_threshold(threshold), d_len(0) + { + set_tag_propagation_policy(TPP_DONT); + + if(!set_access_code(access_code)) { + throw std::out_of_range ("access_code is > 64 bits"); + } + + std::stringstream str; + str << name() << unique_id(); + d_me = pmt::string_to_symbol(str.str()); + d_key = pmt::string_to_symbol(tag_name); + + d_state = STATE_SYNC_SEARCH; + d_pkt_len = 0; + d_pkt_count = 0; + d_hdr_reg = 0; + d_hdr_count = 0; + } + + correlate_access_code_ff_ts_impl::~correlate_access_code_ff_ts_impl() + { + } + + bool + correlate_access_code_ff_ts_impl::set_access_code(const std::string &access_code) + { + d_len = access_code.length(); // # of bytes in string + if(d_len > 64) + return false; + + // set len top bits to 1. + d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len); + + d_access_code = 0; + for(unsigned i=0; i < d_len; i++){ + d_access_code = (d_access_code << 1) | (access_code[i] & 1); + } + if(VERBOSE) { + std::cerr << "Access code: " << std::hex << d_access_code << std::dec << std::endl; + std::cerr << "Mask: " << std::hex << d_mask << std::dec << std::endl; + } + + return true; + } + + unsigned long long + correlate_access_code_ff_ts_impl::access_code() const + { + return d_access_code; + } + + inline void + correlate_access_code_ff_ts_impl::enter_search() + { + d_state = STATE_SYNC_SEARCH; + } + + inline void + correlate_access_code_ff_ts_impl::enter_have_sync() + { + d_state = STATE_HAVE_SYNC; + d_hdr_reg = 0; + d_hdr_count = 0; + } + + inline void + correlate_access_code_ff_ts_impl::enter_have_header(int payload_len) + { + d_state = STATE_HAVE_HEADER; + d_pkt_len = 8*payload_len; + d_pkt_count = 0; + } + + bool + correlate_access_code_ff_ts_impl::header_ok() + { + // confirm that two copies of header info are identical + return ((d_hdr_reg >> 16) ^ (d_hdr_reg & 0xffff)) == 0; + } + + int + correlate_access_code_ff_ts_impl::header_payload() + { + return (d_hdr_reg >> 16) & 0x0fff; + } + + int + correlate_access_code_ff_ts_impl::general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const float *in = (const float*)input_items[0]; + float *out = (float*)output_items[0]; + + uint64_t abs_out_sample_cnt = nitems_written(0); + + int nprod = 0; + + int count = 0; + while(count < noutput_items) { + switch(d_state) { + case STATE_SYNC_SEARCH: // Look for the access code correlation + + while(count < noutput_items) { + // shift in new data + d_data_reg = (d_data_reg << 1) | (gr::branchless_binary_slicer(in[count++]) & 0x1); + + // compute hamming distance between desired access code and current data + uint64_t wrong_bits = 0; + uint64_t nwrong = d_threshold+1; + + wrong_bits = (d_data_reg ^ d_access_code) & d_mask; + volk_64u_popcnt(&nwrong, wrong_bits); + + if(nwrong <= d_threshold) { + enter_have_sync(); + break; + } + } + break; + + case STATE_HAVE_SYNC: + while(count < noutput_items) { // Shift bits one at a time into header + d_hdr_reg = (d_hdr_reg << 1) | (gr::branchless_binary_slicer(in[count++]) & 0x1); + d_hdr_count++; + + if(d_hdr_count == 32) { + // we have a full header, check to see if it has been received properly + if(header_ok()) { + int payload_len = header_payload(); + enter_have_header(payload_len); + } + else { + enter_search(); // bad header + } + break; + } + } + break; + + case STATE_HAVE_HEADER: + if(d_pkt_count == 0) { + // MAKE A TAG OUT OF THIS AND UPDATE OFFSET + add_item_tag(0, // stream ID + abs_out_sample_cnt + nprod, // sample + d_key, // length key + pmt::from_long(d_pkt_len), // length data + d_me); // block src id + } + + while(count < noutput_items) { + if(d_pkt_count < d_pkt_len) { + out[nprod++] = in[count++]; + d_pkt_count++; + } + else { + enter_search(); + break; + } + } + break; + } + } + + consume_each(noutput_items); + return nprod; + } + + } /* namespace digital */ +} /* namespace gr */ diff --git a/gr-digital/lib/correlate_access_code_ff_ts_impl.h b/gr-digital/lib/correlate_access_code_ff_ts_impl.h new file mode 100644 index 0000000000..ac540f6b7f --- /dev/null +++ b/gr-digital/lib/correlate_access_code_ff_ts_impl.h @@ -0,0 +1,79 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_IMPL_H +#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_IMPL_H + +#include <gnuradio/digital/correlate_access_code_ff_ts.h> + +namespace gr { + namespace digital { + + class correlate_access_code_ff_ts_impl : + public correlate_access_code_ff_ts + { + private: + enum state_t {STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER}; + + state_t d_state; + + unsigned long long d_access_code; // access code to locate start of packet + // access code is left justified in the word + unsigned long long d_data_reg; // used to look for access_code + unsigned long long d_mask; // masks access_code bits (top N bits are set where + // N is the number of bits in the access code) + unsigned int d_threshold; // how many bits may be wrong in sync vector + unsigned int d_len; // the length of the access code + + unsigned long long d_hdr_reg; // used to look for header + int d_hdr_count; + + pmt::pmt_t d_key, d_me; // d_key is the tag name, d_me is the block name + unique ID + int d_pkt_len, d_pkt_count; + + + void enter_search(); + void enter_have_sync(); + void enter_have_header(int payload_len); + + bool header_ok(); + int header_payload(); + + public: + correlate_access_code_ff_ts_impl(const std::string &access_code, + int threshold, + const std::string &tag_name); + ~correlate_access_code_ff_ts_impl(); + + int general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + + bool set_access_code(const std::string &access_code); + unsigned long long access_code() const; + }; + + } /* namespace digital */ +} /* namespace gr */ + +#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_FF_TS_IMPL_H */ diff --git a/gr-digital/lib/correlate_access_code_tag_bb_impl.cc b/gr-digital/lib/correlate_access_code_tag_bb_impl.cc index f6574dd517..31ae6d9282 100644 --- a/gr-digital/lib/correlate_access_code_tag_bb_impl.cc +++ b/gr-digital/lib/correlate_access_code_tag_bb_impl.cc @@ -27,7 +27,6 @@ #include "correlate_access_code_tag_bb_impl.h" #include <gnuradio/io_signature.h> #include <stdexcept> -//#include <gnuradio/blocks/count_bits.h> #include <volk/volk.h> #include <cstdio> #include <iostream> @@ -78,8 +77,8 @@ namespace gr { if(d_len > 64) return false; - // set d_len bottom bits to 1. - d_mask = (1ULL << d_len) - 1; + // set len top bits to 1. + d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len); d_access_code = 0; for(unsigned i=0; i < d_len; i++){ @@ -113,7 +112,7 @@ namespace gr { wrong_bits = (d_data_reg ^ d_access_code) & d_mask; volk_64u_popcnt(&nwrong, wrong_bits); - // shift in new data and new flag + // shift in new data d_data_reg = (d_data_reg << 1) | (in[i] & 0x1); if(nwrong <= d_threshold) { if(VERBOSE) @@ -132,4 +131,3 @@ namespace gr { } /* namespace digital */ } /* namespace gr */ - diff --git a/gr-digital/lib/correlate_and_sync_cc_impl.cc b/gr-digital/lib/correlate_and_sync_cc_impl.cc index 562c88d687..80aee56d33 100644 --- a/gr-digital/lib/correlate_and_sync_cc_impl.cc +++ b/gr-digital/lib/correlate_and_sync_cc_impl.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2013 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, @@ -74,8 +74,7 @@ namespace gr { d_center_first_symbol = (padding.size() + 0.5) * d_sps; - //d_filter = new kernel::fft_filter_ccc(1, d_symbols); - d_filter = new kernel::fir_filter_ccc(1, d_symbols); + d_filter = new kernel::fft_filter_ccc(1, d_symbols); set_history(d_filter->ntaps()); @@ -83,7 +82,7 @@ namespace gr { volk_get_alignment() / sizeof(gr_complex); set_alignment(std::max(1,alignment_multiple)); } - + correlate_and_sync_cc_impl::~correlate_and_sync_cc_impl() { delete d_filter; @@ -118,9 +117,8 @@ namespace gr { memcpy(out, in, sizeof(gr_complex)*noutput_items); // Calculate the correlation with the known symbol - //d_filter->filter(noutput_items, in, corr); - d_filter->filterN(corr, in, noutput_items); - + d_filter->filter(noutput_items, in, corr); + // Find the magnitude squared of the correlation std::vector<float> corr_mag(noutput_items); volk_32fc_magnitude_squared_32f(&corr_mag[0], corr, noutput_items); @@ -139,9 +137,18 @@ namespace gr { double center = nom / den; center = (center - 2.0); - int index = i; + // Adjust the results of the fft filter by moving back the + // length of the filter offset by the number of sps. + int index = i - d_symbols.size() + d_sps + 1; + // Calculate the phase offset of the incoming signal; always + // adjust it based on the proper rotation of the expected + // known word; rotate by pi is the real part is < 0 since + // the atan doesn't understand the ambiguity. float phase = fast_atan2f(corr[index].imag(), corr[index].real()); + if(corr[index].real() < 0.0) + phase += M_PI; + add_item_tag(0, nitems_written(0) + index, pmt::intern("phase_est"), pmt::from_double(phase), pmt::intern(alias())); add_item_tag(0, nitems_written(0) + index, pmt::intern("time_est"), diff --git a/gr-digital/lib/correlate_and_sync_cc_impl.h b/gr-digital/lib/correlate_and_sync_cc_impl.h index e9cc983148..d95ec517f8 100644 --- a/gr-digital/lib/correlate_and_sync_cc_impl.h +++ b/gr-digital/lib/correlate_and_sync_cc_impl.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ -/* +/* * Copyright 2013 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, @@ -24,7 +24,6 @@ #define INCLUDED_DIGITAL_CORRELATE_AND_SYNC_CC_IMPL_H #include <gnuradio/digital/correlate_and_sync_cc.h> -#include <gnuradio/filter/fir_filter.h> #include <gnuradio/filter/fft_filter.h> using namespace gr::filter; @@ -39,11 +38,10 @@ namespace gr { unsigned int d_sps; float d_center_first_symbol; float d_thresh; - kernel::fir_filter_ccc *d_filter; - //kernel::fft_filter_ccc *d_filter; + kernel::fft_filter_ccc *d_filter; int d_last_index; - + public: correlate_and_sync_cc_impl(const std::vector<gr_complex> &symbols, const std::vector<float> &filter, diff --git a/gr-digital/lib/crc32_async_bb_impl.cc b/gr-digital/lib/crc32_async_bb_impl.cc new file mode 100644 index 0000000000..0c3bdf70cc --- /dev/null +++ b/gr-digital/lib/crc32_async_bb_impl.cc @@ -0,0 +1,123 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include "crc32_async_bb_impl.h" + +namespace gr { + namespace digital { + + crc32_async_bb::sptr + crc32_async_bb::make(bool check) + { + return gnuradio::get_initial_sptr + (new crc32_async_bb_impl(check)); + } + + crc32_async_bb_impl::crc32_async_bb_impl(bool check) + : block("crc32_async_bb", + io_signature::make(0, 0, 0), + io_signature::make(0, 0, 0)), + d_check(check), d_npass(0), d_nfail(0) + { + d_in_port = pmt::mp("in"); + d_out_port = pmt::mp("out"); + + message_port_register_in(d_in_port); + message_port_register_out(d_out_port); + + if(check) + set_msg_handler(d_in_port, boost::bind(&crc32_async_bb_impl::check, this ,_1) ); + else + set_msg_handler(d_in_port, boost::bind(&crc32_async_bb_impl::calc, this ,_1) ); + } + + crc32_async_bb_impl::~crc32_async_bb_impl() + { + } + + void + crc32_async_bb_impl::calc(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bytes(pmt::cdr(msg)); + + unsigned int crc; + size_t pkt_len(0); + const uint8_t* bytes_in = pmt::u8vector_elements(bytes, pkt_len); + uint8_t* bytes_out = (uint8_t*)volk_malloc(4 + pkt_len*sizeof(uint8_t), + volk_get_alignment()); + + d_crc_impl.reset(); + d_crc_impl.process_bytes(bytes_in, pkt_len); + crc = d_crc_impl(); + memcpy((void*)bytes_out, (const void*)bytes_in, pkt_len); + memcpy((void*)(bytes_out + pkt_len), &crc, 4); // FIXME big-endian/little-endian, this might be wrong + + pmt::pmt_t output = pmt::init_u8vector(pkt_len+4, bytes_out); // this copies the values from bytes_out into the u8vector + pmt::pmt_t msg_pair = pmt::cons(meta, output); + message_port_pub(d_out_port, msg_pair); + volk_free(bytes_out); + } + + void + crc32_async_bb_impl::check(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bytes(pmt::cdr(msg)); + + unsigned int crc; + size_t pkt_len(0); + const uint8_t* bytes_in = pmt::u8vector_elements(bytes, pkt_len); + + d_crc_impl.reset(); + d_crc_impl.process_bytes(bytes_in, pkt_len-4); + crc = d_crc_impl(); + if(crc != *(unsigned int*)(bytes_in+pkt_len-4)) { // Drop package + d_nfail++; + return; + } + d_npass++; + + pmt::pmt_t output = pmt::init_u8vector(pkt_len-4, bytes_in); + pmt::pmt_t msg_pair = pmt::cons(meta, output); + message_port_pub(d_out_port, msg_pair); + } + + int + crc32_async_bb_impl::general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + return noutput_items; + } + + } /* namespace digital */ +} /* namespace gr */ diff --git a/gr-digital/lib/crc32_async_bb_impl.h b/gr-digital/lib/crc32_async_bb_impl.h new file mode 100644 index 0000000000..6ec0e8ee50 --- /dev/null +++ b/gr-digital/lib/crc32_async_bb_impl.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_DIGITAL_CRC32_ASYNC_BB_IMPL_H +#define INCLUDED_DIGITAL_CRC32_ASYNC_BB_IMPL_H + +#include <gnuradio/digital/crc32_async_bb.h> +#include <boost/crc.hpp> + +namespace gr { + namespace digital { + + class crc32_async_bb_impl : public crc32_async_bb + { + private: + bool d_check; + boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true> d_crc_impl; + + pmt::pmt_t d_in_port; + pmt::pmt_t d_out_port; + + void calc(pmt::pmt_t msg); + void check(pmt::pmt_t msg); + + public: + crc32_async_bb_impl(bool check); + ~crc32_async_bb_impl(); + + int general_work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + + uint64_t d_npass; + uint64_t d_nfail; + }; + + } // namespace digital +} // namespace gr + +#endif /* INCLUDED_DIGITAL_CRC32_ASYNC_BB_IMPL_H */ diff --git a/gr-digital/python/digital/generic_mod_demod.py b/gr-digital/python/digital/generic_mod_demod.py index 9cec8d8b63..f34994fa7b 100644 --- a/gr-digital/python/digital/generic_mod_demod.py +++ b/gr-digital/python/digital/generic_mod_demod.py @@ -1,23 +1,23 @@ # # Copyright 2005,2006,2007,2009,2011 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. -# +# # See gnuradio-examples/python/digital for examples @@ -54,7 +54,7 @@ _def_log = False # Frequency correction _def_freq_bw = 2*math.pi/100.0 -# Symbol timing recovery +# Symbol timing recovery _def_timing_bw = 2*math.pi/100.0 _def_timing_max_dev = 1.5 # Fine frequency / Phase correction @@ -82,7 +82,7 @@ def add_common_options(parser): % (', '.join(mod_codes.codes),)) parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw, help="set RRC excess bandwith factor [default=%default]") - + # ///////////////////////////////////////////////////////////////////////////// # Generic modulator @@ -91,7 +91,7 @@ def add_common_options(parser): class generic_mod(gr.hier_block2): """ Hierarchical block for RRC-filtered differential generic modulation. - + The input is a byte stream (unsigned char) and the output is the complex modulated signal at baseband. @@ -126,9 +126,9 @@ class generic_mod(gr.hier_block2): if self._samples_per_symbol < 2: raise TypeError, ("sps must be >= 2, is %f" % self._samples_per_symbol) - + arity = pow(2,self.bits_per_symbol()) - + # turn bytes into k-bit vectors self.bytes2chunks = \ blocks.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST) @@ -164,10 +164,10 @@ class generic_mod(gr.hier_block2): if verbose: self._print_verbage() - + if log: self._setup_logging() - + def samples_per_symbol(self): return self._samples_per_symbol @@ -209,7 +209,7 @@ class generic_mod(gr.hier_block2): blocks.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.32fc")) self.connect(self.rrc_filter, blocks.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.32fc")) - + # ///////////////////////////////////////////////////////////////////////////// # Generic demodulator @@ -221,10 +221,10 @@ class generic_mod(gr.hier_block2): class generic_demod(gr.hier_block2): """ Hierarchical block for RRC-filtered differential generic demodulation. - + The input is the complex modulated signal at baseband. The output is a stream of bits packed 1 bit per byte (LSB) - + Args: constellation: determines the modulation type (gnuradio.digital.digital_constellation) samples_per_symbol: samples per baud >= 2 (float) @@ -248,11 +248,11 @@ class generic_demod(gr.hier_block2): phase_bw=_def_phase_bw, verbose=_def_verbose, log=_def_log): - + gr.hier_block2.__init__(self, "generic_demod", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_char)) # Output signature - + self._constellation = constellation self._samples_per_symbol = samples_per_symbol self._excess_bw = excess_bw @@ -310,7 +310,7 @@ class generic_demod(gr.hier_block2): if log: self._setup_logging() - + # Connect and Initialize base class self._blocks = [self, self.agc, self.freq_recov, self.time_recov, self.receiver] @@ -371,7 +371,7 @@ class generic_demod(gr.hier_block2): blocks.file_sink(gr.sizeof_char, "rx_symbol_mapper.8b")) self.connect(self.unpack, blocks.file_sink(gr.sizeof_char, "rx_unpack.8b")) - + def add_options(parser): """ Adds generic demodulation options to the standard parser @@ -386,7 +386,7 @@ class generic_demod(gr.hier_block2): parser.add_option("", "--timing-bw", type="float", default=_def_timing_bw, help="set timing symbol sync loop gain lock-in bandwidth [default=%default]") add_options=staticmethod(add_options) - + def extract_kwargs_from_options(cls, options): """ Given command line options, create dictionary suitable for passing to __init__ diff --git a/gr-digital/python/digital/packet_utils.py b/gr-digital/python/digital/packet_utils.py index d7aa4e66ca..de7e2988da 100644 --- a/gr-digital/python/digital/packet_utils.py +++ b/gr-digital/python/digital/packet_utils.py @@ -1,23 +1,23 @@ # # Copyright 2005,2006,2007 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. -# +# import struct import numpy @@ -47,7 +47,7 @@ def conv_1_0_string_to_packed_binary_string(s): """ if not is_1_0_string(s): raise ValueError, "Input must be a string containing only 0's and 1's" - + # pad to multiple of 8 padded = False rem = len(s) % 8 @@ -67,7 +67,7 @@ def conv_1_0_string_to_packed_binary_string(s): r.append(chr(t)) i += 8 return (''.join(r), padded) - + default_access_code = \ conv_packed_binary_string_to_1_0_string('\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC') @@ -103,7 +103,8 @@ def make_header(payload_len, whitener_offset=0): def make_packet(payload, samples_per_symbol, bits_per_symbol, preamble=default_preamble, access_code=default_access_code, - pad_for_usrp=True, whitener_offset=0, whitening=True): + pad_for_usrp=True, whitener_offset=0, whitening=True, + calc_crc=True): """ Build a packet, given access code, payload, and whitener offset @@ -116,7 +117,8 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol, pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples(512 bytes) whitener_offset: offset into whitener string to use [0-16) whitening: Whether to turn on data whitening(scrambling) (boolean) - + calc_crc: Whether to calculate CRC32 or not (boolean) + Packet will have access code at the beginning, followed by length, payload and finally CRC-32. """ @@ -131,8 +133,11 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol, (packed_access_code, padded) = conv_1_0_string_to_packed_binary_string(access_code) (packed_preamble, ignore) = conv_1_0_string_to_packed_binary_string(preamble) - - payload_with_crc = crc.gen_and_append_crc32(payload) + + if(calc_crc): + payload_with_crc = crc.gen_and_append_crc32(payload) + else: + payload_with_crc = payload #print "outbound crc =", string_to_hex_list(payload_with_crc[-4:]) L = len(payload_with_crc) @@ -175,14 +180,18 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol): if r == 0: return 0 return byte_modulus - r - -def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True): + +def unmake_packet(whitened_payload_with_crc, whitener_offset=0, + dewhitening=True, check_crc=True): """ Return (ok, payload) Args: whitened_payload_with_crc: string + whitener_offset: integer offset into whitener table + dewhitening: True if we should run this through the dewhitener + check_crc: True if we should check the CRC of the packet """ if dewhitening: @@ -190,274 +199,278 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True else: payload_with_crc = (whitened_payload_with_crc) - ok, payload = crc.check_crc32(payload_with_crc) + if check_crc: + ok, payload = crc.check_crc32(payload_with_crc) + else: + payload = payload_with_crc + ok = True if 0: print "payload_with_crc =", string_to_hex_list(payload_with_crc) print "ok = %r, len(payload) = %d" % (ok, len(payload)) print "payload =", string_to_hex_list(payload) + print "" return ok, payload # FYI, this PN code is the output of a 15-bit LFSR random_mask_tuple = ( - 255, 63, 0, 16, 0, 12, 0, 5, 192, 3, 16, 1, 204, 0, 85, 192, - 63, 16, 16, 12, 12, 5, 197, 195, 19, 17, 205, 204, 85, 149, 255, 47, - 0, 28, 0, 9, 192, 6, 208, 2, 220, 1, 153, 192, 106, 208, 47, 28, - 28, 9, 201, 198, 214, 210, 222, 221, 152, 89, 170, 186, 255, 51, 0, 21, - 192, 15, 16, 4, 12, 3, 69, 193, 243, 16, 69, 204, 51, 21, 213, 207, - 31, 20, 8, 15, 70, 132, 50, 227, 85, 137, 255, 38, 192, 26, 208, 11, - 28, 7, 73, 194, 182, 209, 182, 220, 118, 217, 230, 218, 202, 219, 23, 27, - 78, 139, 116, 103, 103, 106, 170, 175, 63, 60, 16, 17, 204, 12, 85, 197, - 255, 19, 0, 13, 192, 5, 144, 3, 44, 1, 221, 192, 89, 144, 58, 236, - 19, 13, 205, 197, 149, 147, 47, 45, 220, 29, 153, 201, 170, 214, 255, 30, - 192, 8, 80, 6, 188, 2, 241, 193, 132, 80, 99, 124, 41, 225, 222, 200, - 88, 86, 186, 190, 243, 48, 69, 212, 51, 31, 85, 200, 63, 22, 144, 14, - 236, 4, 77, 195, 117, 145, 231, 44, 74, 157, 247, 41, 134, 158, 226, 232, - 73, 142, 182, 228, 118, 203, 102, 215, 106, 222, 175, 24, 124, 10, 161, 199, - 56, 82, 146, 189, 173, 177, 189, 180, 113, 183, 100, 118, 171, 102, 255, 106, - 192, 47, 16, 28, 12, 9, 197, 198, 211, 18, 221, 205, 153, 149, 170, 239, - 63, 12, 16, 5, 204, 3, 21, 193, 207, 16, 84, 12, 63, 69, 208, 51, - 28, 21, 201, 207, 22, 212, 14, 223, 68, 88, 51, 122, 149, 227, 47, 9, - 220, 6, 217, 194, 218, 209, 155, 28, 107, 73, 239, 118, 204, 38, 213, 218, - 223, 27, 24, 11, 74, 135, 119, 34, 166, 153, 186, 234, 243, 15, 5, 196, - 3, 19, 65, 205, 240, 85, 132, 63, 35, 80, 25, 252, 10, 193, 199, 16, - 82, 140, 61, 165, 209, 187, 28, 115, 73, 229, 246, 203, 6, 215, 66, 222, - 177, 152, 116, 106, 167, 111, 58, 172, 19, 61, 205, 209, 149, 156, 111, 41, - 236, 30, 205, 200, 85, 150, 191, 46, 240, 28, 68, 9, 243, 70, 197, 242, - 211, 5, 157, 195, 41, 145, 222, 236, 88, 77, 250, 181, 131, 55, 33, 214, - 152, 94, 234, 184, 79, 50, 180, 21, 183, 79, 54, 180, 22, 247, 78, 198, - 180, 82, 247, 125, 134, 161, 162, 248, 121, 130, 162, 225, 185, 136, 114, 230, - 165, 138, 251, 39, 3, 90, 129, 251, 32, 67, 88, 49, 250, 148, 67, 47, - 113, 220, 36, 89, 219, 122, 219, 99, 27, 105, 203, 110, 215, 108, 94, 173, - 248, 125, 130, 161, 161, 184, 120, 114, 162, 165, 185, 187, 50, 243, 85, 133, - 255, 35, 0, 25, 192, 10, 208, 7, 28, 2, 137, 193, 166, 208, 122, 220, - 35, 25, 217, 202, 218, 215, 27, 30, 139, 72, 103, 118, 170, 166, 255, 58, - 192, 19, 16, 13, 204, 5, 149, 195, 47, 17, 220, 12, 89, 197, 250, 211, - 3, 29, 193, 201, 144, 86, 236, 62, 205, 208, 85, 156, 63, 41, 208, 30, - 220, 8, 89, 198, 186, 210, 243, 29, 133, 201, 163, 22, 249, 206, 194, 212, - 81, 159, 124, 104, 33, 238, 152, 76, 106, 181, 239, 55, 12, 22, 133, 206, - 227, 20, 73, 207, 118, 212, 38, 223, 90, 216, 59, 26, 147, 75, 45, 247, - 93, 134, 185, 162, 242, 249, 133, 130, 227, 33, 137, 216, 102, 218, 170, 219, - 63, 27, 80, 11, 124, 7, 97, 194, 168, 81, 190, 188, 112, 113, 228, 36, - 75, 91, 119, 123, 102, 163, 106, 249, 239, 2, 204, 1, 149, 192, 111, 16, - 44, 12, 29, 197, 201, 147, 22, 237, 206, 205, 148, 85, 175, 127, 60, 32, - 17, 216, 12, 90, 133, 251, 35, 3, 89, 193, 250, 208, 67, 28, 49, 201, - 212, 86, 223, 126, 216, 32, 90, 152, 59, 42, 147, 95, 45, 248, 29, 130, - 137, 161, 166, 248, 122, 194, 163, 17, 185, 204, 114, 213, 229, 159, 11, 40, - 7, 94, 130, 184, 97, 178, 168, 117, 190, 167, 48, 122, 148, 35, 47, 89, - 220, 58, 217, 211, 26, 221, 203, 25, 151, 74, 238, 183, 12, 118, 133, 230, - 227, 10, 201, 199, 22, 210, 142, 221, 164, 89, 187, 122, 243, 99, 5, 233, - 195, 14, 209, 196, 92, 83, 121, 253, 226, 193, 137, 144, 102, 236, 42, 205, - 223, 21, 152, 15, 42, 132, 31, 35, 72, 25, 246, 138, 198, 231, 18, 202, - 141, 151, 37, 174, 155, 60, 107, 81, 239, 124, 76, 33, 245, 216, 71, 26, - 178, 139, 53, 167, 87, 58, 190, 147, 48, 109, 212, 45, 159, 93, 168, 57, - 190, 146, 240, 109, 132, 45, 163, 93, 185, 249, 178, 194, 245, 145, 135, 44, - 98, 157, 233, 169, 142, 254, 228, 64, 75, 112, 55, 100, 22, 171, 78, 255, - 116, 64, 39, 112, 26, 164, 11, 59, 71, 83, 114, 189, 229, 177, 139, 52, - 103, 87, 106, 190, 175, 48, 124, 20, 33, 207, 88, 84, 58, 191, 83, 48, - 61, 212, 17, 159, 76, 104, 53, 238, 151, 12, 110, 133, 236, 99, 13, 233, - 197, 142, 211, 36, 93, 219, 121, 155, 98, 235, 105, 143, 110, 228, 44, 75, - 93, 247, 121, 134, 162, 226, 249, 137, 130, 230, 225, 138, 200, 103, 22, 170, - 142, 255, 36, 64, 27, 112, 11, 100, 7, 107, 66, 175, 113, 188, 36, 113, - 219, 100, 91, 107, 123, 111, 99, 108, 41, 237, 222, 205, 152, 85, 170, 191, - 63, 48, 16, 20, 12, 15, 69, 196, 51, 19, 85, 205, 255, 21, 128, 15, - 32, 4, 24, 3, 74, 129, 247, 32, 70, 152, 50, 234, 149, 143, 47, 36, - 28, 27, 73, 203, 118, 215, 102, 222, 170, 216, 127, 26, 160, 11, 56, 7, - 82, 130, 189, 161, 177, 184, 116, 114, 167, 101, 186, 171, 51, 63, 85, 208, - 63, 28, 16, 9, 204, 6, 213, 194, 223, 17, 152, 12, 106, 133, 239, 35, - 12, 25, 197, 202, 211, 23, 29, 206, 137, 148, 102, 239, 106, 204, 47, 21, - 220, 15, 25, 196, 10, 211, 71, 29, 242, 137, 133, 166, 227, 58, 201, 211, - 22, 221, 206, 217, 148, 90, 239, 123, 12, 35, 69, 217, 243, 26, 197, 203, - 19, 23, 77, 206, 181, 148, 119, 47, 102, 156, 42, 233, 223, 14, 216, 4, - 90, 131, 123, 33, 227, 88, 73, 250, 182, 195, 54, 209, 214, 220, 94, 217, - 248, 90, 194, 187, 17, 179, 76, 117, 245, 231, 7, 10, 130, 135, 33, 162, - 152, 121, 170, 162, 255, 57, 128, 18, 224, 13, 136, 5, 166, 131, 58, 225, - 211, 8, 93, 198, 185, 146, 242, 237, 133, 141, 163, 37, 185, 219, 50, 219, - 85, 155, 127, 43, 96, 31, 104, 8, 46, 134, 156, 98, 233, 233, 142, 206, - 228, 84, 75, 127, 119, 96, 38, 168, 26, 254, 139, 0, 103, 64, 42, 176, - 31, 52, 8, 23, 70, 142, 178, 228, 117, 139, 103, 39, 106, 154, 175, 43, - 60, 31, 81, 200, 60, 86, 145, 254, 236, 64, 77, 240, 53, 132, 23, 35, - 78, 153, 244, 106, 199, 111, 18, 172, 13, 189, 197, 177, 147, 52, 109, 215, - 109, 158, 173, 168, 125, 190, 161, 176, 120, 116, 34, 167, 89, 186, 186, 243, - 51, 5, 213, 195, 31, 17, 200, 12, 86, 133, 254, 227, 0, 73, 192, 54, - 208, 22, 220, 14, 217, 196, 90, 211, 123, 29, 227, 73, 137, 246, 230, 198, - 202, 210, 215, 29, 158, 137, 168, 102, 254, 170, 192, 127, 16, 32, 12, 24, - 5, 202, 131, 23, 33, 206, 152, 84, 106, 191, 111, 48, 44, 20, 29, 207, - 73, 148, 54, 239, 86, 204, 62, 213, 208, 95, 28, 56, 9, 210, 134, 221, - 162, 217, 185, 154, 242, 235, 5, 143, 67, 36, 49, 219, 84, 91, 127, 123, - 96, 35, 104, 25, 238, 138, 204, 103, 21, 234, 143, 15, 36, 4, 27, 67, - 75, 113, 247, 100, 70, 171, 114, 255, 101, 128, 43, 32, 31, 88, 8, 58, - 134, 147, 34, 237, 217, 141, 154, 229, 171, 11, 63, 71, 80, 50, 188, 21, - 177, 207, 52, 84, 23, 127, 78, 160, 52, 120, 23, 98, 142, 169, 164, 126, - 251, 96, 67, 104, 49, 238, 148, 76, 111, 117, 236, 39, 13, 218, 133, 155, - 35, 43, 89, 223, 122, 216, 35, 26, 153, 203, 42, 215, 95, 30, 184, 8, - 114, 134, 165, 162, 251, 57, 131, 82, 225, 253, 136, 65, 166, 176, 122, 244, - 35, 7, 89, 194, 186, 209, 179, 28, 117, 201, 231, 22, 202, 142, 215, 36, - 94, 155, 120, 107, 98, 175, 105, 188, 46, 241, 220, 68, 89, 243, 122, 197, - 227, 19, 9, 205, 198, 213, 146, 223, 45, 152, 29, 170, 137, 191, 38, 240, - 26, 196, 11, 19, 71, 77, 242, 181, 133, 183, 35, 54, 153, 214, 234, 222, - 207, 24, 84, 10, 191, 71, 48, 50, 148, 21, 175, 79, 60, 52, 17, 215, - 76, 94, 181, 248, 119, 2, 166, 129, 186, 224, 115, 8, 37, 198, 155, 18, - 235, 77, 143, 117, 164, 39, 59, 90, 147, 123, 45, 227, 93, 137, 249, 166, - 194, 250, 209, 131, 28, 97, 201, 232, 86, 206, 190, 212, 112, 95, 100, 56, - 43, 82, 159, 125, 168, 33, 190, 152, 112, 106, 164, 47, 59, 92, 19, 121, - 205, 226, 213, 137, 159, 38, 232, 26, 206, 139, 20, 103, 79, 106, 180, 47, - 55, 92, 22, 185, 206, 242, 212, 69, 159, 115, 40, 37, 222, 155, 24, 107, - 74, 175, 119, 60, 38, 145, 218, 236, 91, 13, 251, 69, 131, 115, 33, 229, - 216, 75, 26, 183, 75, 54, 183, 86, 246, 190, 198, 240, 82, 196, 61, 147, - 81, 173, 252, 125, 129, 225, 160, 72, 120, 54, 162, 150, 249, 174, 194, 252, - 81, 129, 252, 96, 65, 232, 48, 78, 148, 52, 111, 87, 108, 62, 173, 208, - 125, 156, 33, 169, 216, 126, 218, 160, 91, 56, 59, 82, 147, 125, 173, 225, - 189, 136, 113, 166, 164, 122, 251, 99, 3, 105, 193, 238, 208, 76, 92, 53, - 249, 215, 2, 222, 129, 152, 96, 106, 168, 47, 62, 156, 16, 105, 204, 46, - 213, 220, 95, 25, 248, 10, 194, 135, 17, 162, 140, 121, 165, 226, 251, 9, - 131, 70, 225, 242, 200, 69, 150, 179, 46, 245, 220, 71, 25, 242, 138, 197, - 167, 19, 58, 141, 211, 37, 157, 219, 41, 155, 94, 235, 120, 79, 98, 180, - 41, 183, 94, 246, 184, 70, 242, 178, 197, 181, 147, 55, 45, 214, 157, 158, - 233, 168, 78, 254, 180, 64, 119, 112, 38, 164, 26, 251, 75, 3, 119, 65, - 230, 176, 74, 244, 55, 7, 86, 130, 190, 225, 176, 72, 116, 54, 167, 86, - 250, 190, 195, 48, 81, 212, 60, 95, 81, 248, 60, 66, 145, 241, 172, 68, - 125, 243, 97, 133, 232, 99, 14, 169, 196, 126, 211, 96, 93, 232, 57, 142, - 146, 228, 109, 139, 109, 167, 109, 186, 173, 179, 61, 181, 209, 183, 28, 118, - 137, 230, 230, 202, 202, 215, 23, 30, 142, 136, 100, 102, 171, 106, 255, 111, - 0, 44, 0, 29, 192, 9, 144, 6, 236, 2, 205, 193, 149, 144, 111, 44, - 44, 29, 221, 201, 153, 150, 234, 238, 207, 12, 84, 5, 255, 67, 0, 49, - 192, 20, 80, 15, 124, 4, 33, 195, 88, 81, 250, 188, 67, 49, 241, 212, - 68, 95, 115, 120, 37, 226, 155, 9, 171, 70, 255, 114, 192, 37, 144, 27, - 44, 11, 93, 199, 121, 146, 162, 237, 185, 141, 178, 229, 181, 139, 55, 39, - 86, 154, 190, 235, 48, 79, 84, 52, 63, 87, 80, 62, 188, 16, 113, 204, - 36, 85, 219, 127, 27, 96, 11, 104, 7, 110, 130, 172, 97, 189, 232, 113, - 142, 164, 100, 123, 107, 99, 111, 105, 236, 46, 205, 220, 85, 153, 255, 42, - 192, 31, 16, 8, 12, 6, 133, 194, 227, 17, 137, 204, 102, 213, 234, 223, - 15, 24, 4, 10, 131, 71, 33, 242, 152, 69, 170, 179, 63, 53, 208, 23, - 28, 14, 137, 196, 102, 211, 106, 221, 239, 25, 140, 10, 229, 199, 11, 18, - 135, 77, 162, 181, 185, 183, 50, 246, 149, 134, 239, 34, 204, 25, 149, 202, - 239, 23, 12, 14, 133, 196, 99, 19, 105, 205, 238, 213, 140, 95, 37, 248, - 27, 2, 139, 65, 167, 112, 122, 164, 35, 59, 89, 211, 122, 221, 227, 25, - 137, 202, 230, 215, 10, 222, 135, 24, 98, 138, 169, 167, 62, 250, 144, 67, - 44, 49, 221, 212, 89, 159, 122, 232, 35, 14, 153, 196, 106, 211, 111, 29, - 236, 9, 141, 198, 229, 146, 203, 45, 151, 93, 174, 185, 188, 114, 241, 229, - 132, 75, 35, 119, 89, 230, 186, 202, 243, 23, 5, 206, 131, 20, 97, 207, - 104, 84, 46, 191, 92, 112, 57, 228, 18, 203, 77, 151, 117, 174, 167, 60, - 122, 145, 227, 44, 73, 221, 246, 217, 134, 218, 226, 219, 9, 155, 70, 235, - 114, 207, 101, 148, 43, 47, 95, 92, 56, 57, 210, 146, 221, 173, 153, 189, - 170, 241, 191, 4, 112, 3, 100, 1, 235, 64, 79, 112, 52, 36, 23, 91, - 78, 187, 116, 115, 103, 101, 234, 171, 15, 63, 68, 16, 51, 76, 21, 245, - 207, 7, 20, 2, 143, 65, 164, 48, 123, 84, 35, 127, 89, 224, 58, 200, - 19, 22, 141, 206, 229, 148, 75, 47, 119, 92, 38, 185, 218, 242, 219, 5, - 155, 67, 43, 113, 223, 100, 88, 43, 122, 159, 99, 40, 41, 222, 158, 216, - 104, 90, 174, 187, 60, 115, 81, 229, 252, 75, 1, 247, 64, 70, 176, 50, - 244, 21, 135, 79, 34, 180, 25, 183, 74, 246, 183, 6, 246, 130, 198, 225, - 146, 200, 109, 150, 173, 174, 253, 188, 65, 177, 240, 116, 68, 39, 115, 90, - 165, 251, 59, 3, 83, 65, 253, 240, 65, 132, 48, 99, 84, 41, 255, 94, - 192, 56, 80, 18, 188, 13, 177, 197, 180, 83, 55, 125, 214, 161, 158, 248, - 104, 66, 174, 177, 188, 116, 113, 231, 100, 74, 171, 119, 63, 102, 144, 42, - 236, 31, 13, 200, 5, 150, 131, 46, 225, 220, 72, 89, 246, 186, 198, 243, - 18, 197, 205, 147, 21, 173, 207, 61, 148, 17, 175, 76, 124, 53, 225, 215, - 8, 94, 134, 184, 98, 242, 169, 133, 190, 227, 48, 73, 212, 54, 223, 86, - 216, 62, 218, 144, 91, 44, 59, 93, 211, 121, 157, 226, 233, 137, 142, 230, - 228, 74, 203, 119, 23, 102, 142, 170, 228, 127, 11, 96, 7, 104, 2, 174, - 129, 188, 96, 113, 232, 36, 78, 155, 116, 107, 103, 111, 106, 172, 47, 61, - 220, 17, 153, 204, 106, 213, 239, 31, 12, 8, 5, 198, 131, 18, 225, 205, - 136, 85, 166, 191, 58, 240, 19, 4, 13, 195, 69, 145, 243, 44, 69, 221, - 243, 25, 133, 202, 227, 23, 9, 206, 134, 212, 98, 223, 105, 152, 46, 234, - 156, 79, 41, 244, 30, 199, 72, 82, 182, 189, 182, 241, 182, 196, 118, 211, - 102, 221, 234, 217, 143, 26, 228, 11, 11, 71, 71, 114, 178, 165, 181, 187, - 55, 51, 86, 149, 254, 239, 0, 76, 0, 53, 192, 23, 16, 14, 140, 4, - 101, 195, 107, 17, 239, 76, 76, 53, 245, 215, 7, 30, 130, 136, 97, 166, - 168, 122, 254, 163, 0, 121, 192, 34, 208, 25, 156, 10, 233, 199, 14, 210, - 132, 93, 163, 121, 185, 226, 242, 201, 133, 150, 227, 46, 201, 220, 86, 217, - 254, 218, 192, 91, 16, 59, 76, 19, 117, 205, 231, 21, 138, 143, 39, 36, - 26, 155, 75, 43, 119, 95, 102, 184, 42, 242, 159, 5, 168, 3, 62, 129, - 208, 96, 92, 40, 57, 222, 146, 216, 109, 154, 173, 171, 61, 191, 81, 176, - 60, 116, 17, 231, 76, 74, 181, 247, 55, 6, 150, 130, 238, 225, 140, 72, - 101, 246, 171, 6, 255, 66, 192, 49, 144, 20, 108, 15, 109, 196, 45, 147, - 93, 173, 249, 189, 130, 241, 161, 132, 120, 99, 98, 169, 233, 190, 206, 240, - 84, 68, 63, 115, 80, 37, 252, 27, 1, 203, 64, 87, 112, 62, 164, 16, - 123, 76, 35, 117, 217, 231, 26, 202, 139, 23, 39, 78, 154, 180, 107, 55, - 111, 86, 172, 62, 253, 208, 65, 156, 48, 105, 212, 46, 223, 92, 88, 57, - 250, 146, 195, 45, 145, 221, 172, 89, 189, 250, 241, 131, 4, 97, 195, 104, - 81, 238, 188, 76, 113, 245, 228, 71, 11, 114, 135, 101, 162, 171, 57, 191, - 82, 240, 61, 132, 17, 163, 76, 121, 245, 226, 199, 9, 146, 134, 237, 162, - 205, 185, 149, 178, 239, 53, 140, 23, 37, 206, 155, 20, 107, 79, 111, 116, - 44, 39, 93, 218, 185, 155, 50, 235, 85, 143, 127, 36, 32, 27, 88, 11, - 122, 135, 99, 34, 169, 217, 190, 218, 240, 91, 4, 59, 67, 83, 113, 253, - 228, 65, 139, 112, 103, 100, 42, 171, 95, 63, 120, 16, 34, 140, 25, 165, - 202, 251, 23, 3, 78, 129, 244, 96, 71, 104, 50, 174, 149, 188, 111, 49, - 236, 20, 77, 207, 117, 148, 39, 47, 90, 156, 59, 41, 211, 94, 221, 248, - 89, 130, 186, 225, 179, 8, 117, 198, 167, 18, 250, 141, 131, 37, 161, 219, - 56, 91, 82, 187, 125, 179, 97, 181, 232, 119, 14, 166, 132, 122, 227, 99, - 9, 233, 198, 206, 210, 212, 93, 159, 121, 168, 34, 254, 153, 128, 106, 224, - 47, 8, 28, 6, 137, 194, 230, 209, 138, 220, 103, 25, 234, 138, 207, 39, - 20, 26, 143, 75, 36, 55, 91, 86, 187, 126, 243, 96, 69, 232, 51, 14, - 149, 196, 111, 19, 108, 13, 237, 197, 141, 147, 37, 173, 219, 61, 155, 81, - 171, 124, 127, 97, 224, 40, 72, 30, 182, 136, 118, 230, 166, 202, 250, 215, - 3, 30, 129, 200, 96, 86, 168, 62, 254, 144, 64, 108, 48, 45, 212, 29, - 159, 73, 168, 54, 254, 150, 192, 110, 208, 44, 92, 29, 249, 201, 130, 214, - 225, 158, 200, 104, 86, 174, 190, 252, 112, 65, 228, 48, 75, 84, 55, 127, - 86, 160, 62, 248, 16, 66, 140, 49, 165, 212, 123, 31, 99, 72, 41, 246, - 158, 198, 232, 82, 206, 189, 148, 113, 175, 100, 124, 43, 97, 223, 104, 88, - 46, 186, 156, 115, 41, 229, 222, 203, 24, 87, 74, 190, 183, 48, 118, 148, - 38, 239, 90, 204, 59, 21, 211, 79, 29, 244, 9, 135, 70, 226, 178, 201, - 181, 150, 247, 46, 198, 156, 82, 233, 253, 142, 193, 164, 80, 123, 124, 35, - 97, 217, 232, 90, 206, 187, 20, 115, 79, 101, 244, 43, 7, 95, 66, 184, - 49, 178, 148, 117, 175, 103, 60, 42, 145, 223, 44, 88, 29, 250, 137, 131, - 38, 225, 218, 200, 91, 22, 187, 78, 243, 116, 69, 231, 115, 10, 165, 199, - 59, 18, 147, 77, 173, 245, 189, 135, 49, 162, 148, 121, 175, 98, 252, 41, - 129, 222, 224, 88, 72, 58, 182, 147, 54, 237, 214, 205, 158, 213, 168, 95, - 62, 184, 16, 114, 140, 37, 165, 219, 59, 27, 83, 75, 125, 247, 97, 134, - 168, 98, 254, 169, 128, 126, 224, 32, 72, 24, 54, 138, 150, 231, 46, 202, - 156, 87, 41, 254, 158, 192, 104, 80, 46, 188, 28, 113, 201, 228, 86, 203, - 126, 215, 96, 94, 168, 56, 126, 146, 160, 109, 184, 45, 178, 157, 181, 169, - 183, 62, 246, 144, 70, 236, 50, 205, 213, 149, 159, 47, 40, 28, 30, 137, - 200, 102, 214, 170, 222, 255, 24, 64, 10, 176, 7, 52, 2, 151, 65, 174, - 176, 124, 116, 33, 231, 88, 74, 186, 183, 51, 54, 149, 214, 239, 30, 204, - 8, 85, 198, 191, 18, 240, 13, 132, 5, 163, 67, 57, 241, 210, 196, 93, - 147, 121, 173, 226, 253, 137, 129, 166, 224, 122, 200, 35, 22, 153, 206, 234, - 212, 79, 31, 116, 8, 39, 70, 154, 178, 235, 53, 143, 87, 36, 62, 155, - 80, 107, 124, 47, 97, 220, 40, 89, 222, 186, 216, 115, 26, 165, 203, 59, - 23, 83, 78, 189, 244, 113, 135, 100, 98, 171, 105, 191, 110, 240, 44, 68, - 29, 243, 73, 133, 246, 227, 6, 201, 194, 214, 209, 158, 220, 104, 89, 238, - 186, 204, 115, 21, 229, 207, 11, 20, 7, 79, 66, 180, 49, 183, 84, 118, - 191, 102, 240, 42, 196, 31, 19, 72, 13, 246, 133, 134, 227, 34, 201, 217, - 150, 218, 238, 219, 12, 91, 69, 251, 115, 3, 101, 193, 235, 16, 79, 76, - 52, 53, 215, 87, 30, 190, 136, 112, 102, 164, 42, 251, 95, 3, 120, 1, - 226, 128, 73, 160, 54, 248, 22, 194, 142, 209, 164, 92, 123, 121, 227, 98, - 201, 233, 150, 206, 238, 212, 76, 95, 117, 248, 39, 2, 154, 129, 171, 32, - 127, 88, 32, 58, 152, 19, 42, 141, 223, 37, 152, 27, 42, 139, 95, 39, - 120, 26, 162, 139, 57, 167, 82, 250, 189, 131, 49, 161, 212, 120, 95, 98, - 184, 41, 178, 158, 245, 168, 71, 62, 178, 144, 117, 172, 39, 61, 218, 145, - 155, 44, 107, 93, 239, 121, 140, 34, 229, 217, 139, 26, 231, 75, 10, 183, - 71, 54, 178, 150, 245, 174, 199, 60, 82, 145, 253, 172, 65, 189, 240, 113, - 132, 36, 99, 91, 105, 251, 110, 195, 108, 81, 237, 252, 77, 129, 245, 160, - 71, 56, 50, 146, 149, 173, 175, 61, 188, 17, 177, 204, 116, 85, 231, 127, - 10, 160, 7, 56, 2, 146, 129, 173, 160, 125, 184, 33, 178, 152, 117, 170, - 167, 63, 58, 144, 19, 44, 13, 221, 197, 153, 147, 42, 237, 223, 13, 152, - 5, 170, 131, 63, 33, 208, 24, 92, 10, 185, 199, 50, 210, 149, 157, 175, - 41, 188, 30, 241, 200, 68, 86, 179, 126, 245, 224, 71, 8, 50, 134, 149, - 162, 239, 57, 140, 18, 229, 205, 139, 21, 167, 79, 58, 180, 19, 55, 77, - 214, 181, 158, 247, 40, 70, 158, 178, 232, 117, 142, 167, 36, 122, 155, 99, - 43, 105, 223, 110, 216, 44, 90, 157, 251, 41, 131, 94, 225, 248, 72, 66, - 182, 177, 182, 244, 118, 199, 102, 210, 170, 221, 191, 25, 176, 10, 244, 7, - 7, 66, 130, 177, 161, 180, 120, 119, 98, 166, 169, 186, 254, 243, 0, 69, - 192, 51, 16, 21, 204, 15, 21, 196, 15, 19, 68, 13, 243, 69, 133, 243, - 35, 5, 217, 195, 26, 209, 203, 28, 87, 73, 254, 182, 192, 118, 208, 38, - 220, 26, 217, 203, 26, 215, 75, 30, 183, 72, 118, 182, 166, 246, 250, 198, - 195, 18, 209, 205, 156, 85, 169, 255, 62, 192, 16, 80, 12, 60, 5, 209, - 195, 28, 81, 201, 252, 86, 193, 254, 208, 64, 92, 48, 57, 212, 18, 223, - 77, 152, 53, 170, 151, 63, 46, 144, 28, 108, 9, 237, 198, 205, 146, 213, - 173, 159, 61, 168, 17, 190, 140, 112, 101, 228, 43, 11, 95, 71, 120, 50, - 162, 149, 185, 175, 50, 252, 21, 129, 207, 32, 84, 24, 63, 74, 144, 55, - 44, 22, 157, 206, 233, 148, 78, 239, 116, 76, 39, 117, 218, 167, 27, 58, - 139, 83, 39, 125, 218, 161, 155, 56, 107, 82, 175, 125, 188, 33, 177, 216, - 116, 90, 167, 123, 58, 163, 83, 57, 253, 210, 193, 157, 144, 105, 172, 46, - 253, 220, 65, 153, 240, 106, 196, 47, 19, 92, 13, 249, 197, 130, 211, 33, - 157, 216, 105, 154, 174, 235, 60, 79, 81, 244, 60, 71, 81, 242, 188, 69, - 177, 243, 52, 69, 215, 115, 30, 165, 200, 123, 22, 163, 78, 249, 244, 66, - 199, 113, 146, 164, 109, 187, 109, 179, 109, 181, 237, 183, 13, 182, 133, 182, + 255, 63, 0, 16, 0, 12, 0, 5, 192, 3, 16, 1, 204, 0, 85, 192, + 63, 16, 16, 12, 12, 5, 197, 195, 19, 17, 205, 204, 85, 149, 255, 47, + 0, 28, 0, 9, 192, 6, 208, 2, 220, 1, 153, 192, 106, 208, 47, 28, + 28, 9, 201, 198, 214, 210, 222, 221, 152, 89, 170, 186, 255, 51, 0, 21, + 192, 15, 16, 4, 12, 3, 69, 193, 243, 16, 69, 204, 51, 21, 213, 207, + 31, 20, 8, 15, 70, 132, 50, 227, 85, 137, 255, 38, 192, 26, 208, 11, + 28, 7, 73, 194, 182, 209, 182, 220, 118, 217, 230, 218, 202, 219, 23, 27, + 78, 139, 116, 103, 103, 106, 170, 175, 63, 60, 16, 17, 204, 12, 85, 197, + 255, 19, 0, 13, 192, 5, 144, 3, 44, 1, 221, 192, 89, 144, 58, 236, + 19, 13, 205, 197, 149, 147, 47, 45, 220, 29, 153, 201, 170, 214, 255, 30, + 192, 8, 80, 6, 188, 2, 241, 193, 132, 80, 99, 124, 41, 225, 222, 200, + 88, 86, 186, 190, 243, 48, 69, 212, 51, 31, 85, 200, 63, 22, 144, 14, + 236, 4, 77, 195, 117, 145, 231, 44, 74, 157, 247, 41, 134, 158, 226, 232, + 73, 142, 182, 228, 118, 203, 102, 215, 106, 222, 175, 24, 124, 10, 161, 199, + 56, 82, 146, 189, 173, 177, 189, 180, 113, 183, 100, 118, 171, 102, 255, 106, + 192, 47, 16, 28, 12, 9, 197, 198, 211, 18, 221, 205, 153, 149, 170, 239, + 63, 12, 16, 5, 204, 3, 21, 193, 207, 16, 84, 12, 63, 69, 208, 51, + 28, 21, 201, 207, 22, 212, 14, 223, 68, 88, 51, 122, 149, 227, 47, 9, + 220, 6, 217, 194, 218, 209, 155, 28, 107, 73, 239, 118, 204, 38, 213, 218, + 223, 27, 24, 11, 74, 135, 119, 34, 166, 153, 186, 234, 243, 15, 5, 196, + 3, 19, 65, 205, 240, 85, 132, 63, 35, 80, 25, 252, 10, 193, 199, 16, + 82, 140, 61, 165, 209, 187, 28, 115, 73, 229, 246, 203, 6, 215, 66, 222, + 177, 152, 116, 106, 167, 111, 58, 172, 19, 61, 205, 209, 149, 156, 111, 41, + 236, 30, 205, 200, 85, 150, 191, 46, 240, 28, 68, 9, 243, 70, 197, 242, + 211, 5, 157, 195, 41, 145, 222, 236, 88, 77, 250, 181, 131, 55, 33, 214, + 152, 94, 234, 184, 79, 50, 180, 21, 183, 79, 54, 180, 22, 247, 78, 198, + 180, 82, 247, 125, 134, 161, 162, 248, 121, 130, 162, 225, 185, 136, 114, 230, + 165, 138, 251, 39, 3, 90, 129, 251, 32, 67, 88, 49, 250, 148, 67, 47, + 113, 220, 36, 89, 219, 122, 219, 99, 27, 105, 203, 110, 215, 108, 94, 173, + 248, 125, 130, 161, 161, 184, 120, 114, 162, 165, 185, 187, 50, 243, 85, 133, + 255, 35, 0, 25, 192, 10, 208, 7, 28, 2, 137, 193, 166, 208, 122, 220, + 35, 25, 217, 202, 218, 215, 27, 30, 139, 72, 103, 118, 170, 166, 255, 58, + 192, 19, 16, 13, 204, 5, 149, 195, 47, 17, 220, 12, 89, 197, 250, 211, + 3, 29, 193, 201, 144, 86, 236, 62, 205, 208, 85, 156, 63, 41, 208, 30, + 220, 8, 89, 198, 186, 210, 243, 29, 133, 201, 163, 22, 249, 206, 194, 212, + 81, 159, 124, 104, 33, 238, 152, 76, 106, 181, 239, 55, 12, 22, 133, 206, + 227, 20, 73, 207, 118, 212, 38, 223, 90, 216, 59, 26, 147, 75, 45, 247, + 93, 134, 185, 162, 242, 249, 133, 130, 227, 33, 137, 216, 102, 218, 170, 219, + 63, 27, 80, 11, 124, 7, 97, 194, 168, 81, 190, 188, 112, 113, 228, 36, + 75, 91, 119, 123, 102, 163, 106, 249, 239, 2, 204, 1, 149, 192, 111, 16, + 44, 12, 29, 197, 201, 147, 22, 237, 206, 205, 148, 85, 175, 127, 60, 32, + 17, 216, 12, 90, 133, 251, 35, 3, 89, 193, 250, 208, 67, 28, 49, 201, + 212, 86, 223, 126, 216, 32, 90, 152, 59, 42, 147, 95, 45, 248, 29, 130, + 137, 161, 166, 248, 122, 194, 163, 17, 185, 204, 114, 213, 229, 159, 11, 40, + 7, 94, 130, 184, 97, 178, 168, 117, 190, 167, 48, 122, 148, 35, 47, 89, + 220, 58, 217, 211, 26, 221, 203, 25, 151, 74, 238, 183, 12, 118, 133, 230, + 227, 10, 201, 199, 22, 210, 142, 221, 164, 89, 187, 122, 243, 99, 5, 233, + 195, 14, 209, 196, 92, 83, 121, 253, 226, 193, 137, 144, 102, 236, 42, 205, + 223, 21, 152, 15, 42, 132, 31, 35, 72, 25, 246, 138, 198, 231, 18, 202, + 141, 151, 37, 174, 155, 60, 107, 81, 239, 124, 76, 33, 245, 216, 71, 26, + 178, 139, 53, 167, 87, 58, 190, 147, 48, 109, 212, 45, 159, 93, 168, 57, + 190, 146, 240, 109, 132, 45, 163, 93, 185, 249, 178, 194, 245, 145, 135, 44, + 98, 157, 233, 169, 142, 254, 228, 64, 75, 112, 55, 100, 22, 171, 78, 255, + 116, 64, 39, 112, 26, 164, 11, 59, 71, 83, 114, 189, 229, 177, 139, 52, + 103, 87, 106, 190, 175, 48, 124, 20, 33, 207, 88, 84, 58, 191, 83, 48, + 61, 212, 17, 159, 76, 104, 53, 238, 151, 12, 110, 133, 236, 99, 13, 233, + 197, 142, 211, 36, 93, 219, 121, 155, 98, 235, 105, 143, 110, 228, 44, 75, + 93, 247, 121, 134, 162, 226, 249, 137, 130, 230, 225, 138, 200, 103, 22, 170, + 142, 255, 36, 64, 27, 112, 11, 100, 7, 107, 66, 175, 113, 188, 36, 113, + 219, 100, 91, 107, 123, 111, 99, 108, 41, 237, 222, 205, 152, 85, 170, 191, + 63, 48, 16, 20, 12, 15, 69, 196, 51, 19, 85, 205, 255, 21, 128, 15, + 32, 4, 24, 3, 74, 129, 247, 32, 70, 152, 50, 234, 149, 143, 47, 36, + 28, 27, 73, 203, 118, 215, 102, 222, 170, 216, 127, 26, 160, 11, 56, 7, + 82, 130, 189, 161, 177, 184, 116, 114, 167, 101, 186, 171, 51, 63, 85, 208, + 63, 28, 16, 9, 204, 6, 213, 194, 223, 17, 152, 12, 106, 133, 239, 35, + 12, 25, 197, 202, 211, 23, 29, 206, 137, 148, 102, 239, 106, 204, 47, 21, + 220, 15, 25, 196, 10, 211, 71, 29, 242, 137, 133, 166, 227, 58, 201, 211, + 22, 221, 206, 217, 148, 90, 239, 123, 12, 35, 69, 217, 243, 26, 197, 203, + 19, 23, 77, 206, 181, 148, 119, 47, 102, 156, 42, 233, 223, 14, 216, 4, + 90, 131, 123, 33, 227, 88, 73, 250, 182, 195, 54, 209, 214, 220, 94, 217, + 248, 90, 194, 187, 17, 179, 76, 117, 245, 231, 7, 10, 130, 135, 33, 162, + 152, 121, 170, 162, 255, 57, 128, 18, 224, 13, 136, 5, 166, 131, 58, 225, + 211, 8, 93, 198, 185, 146, 242, 237, 133, 141, 163, 37, 185, 219, 50, 219, + 85, 155, 127, 43, 96, 31, 104, 8, 46, 134, 156, 98, 233, 233, 142, 206, + 228, 84, 75, 127, 119, 96, 38, 168, 26, 254, 139, 0, 103, 64, 42, 176, + 31, 52, 8, 23, 70, 142, 178, 228, 117, 139, 103, 39, 106, 154, 175, 43, + 60, 31, 81, 200, 60, 86, 145, 254, 236, 64, 77, 240, 53, 132, 23, 35, + 78, 153, 244, 106, 199, 111, 18, 172, 13, 189, 197, 177, 147, 52, 109, 215, + 109, 158, 173, 168, 125, 190, 161, 176, 120, 116, 34, 167, 89, 186, 186, 243, + 51, 5, 213, 195, 31, 17, 200, 12, 86, 133, 254, 227, 0, 73, 192, 54, + 208, 22, 220, 14, 217, 196, 90, 211, 123, 29, 227, 73, 137, 246, 230, 198, + 202, 210, 215, 29, 158, 137, 168, 102, 254, 170, 192, 127, 16, 32, 12, 24, + 5, 202, 131, 23, 33, 206, 152, 84, 106, 191, 111, 48, 44, 20, 29, 207, + 73, 148, 54, 239, 86, 204, 62, 213, 208, 95, 28, 56, 9, 210, 134, 221, + 162, 217, 185, 154, 242, 235, 5, 143, 67, 36, 49, 219, 84, 91, 127, 123, + 96, 35, 104, 25, 238, 138, 204, 103, 21, 234, 143, 15, 36, 4, 27, 67, + 75, 113, 247, 100, 70, 171, 114, 255, 101, 128, 43, 32, 31, 88, 8, 58, + 134, 147, 34, 237, 217, 141, 154, 229, 171, 11, 63, 71, 80, 50, 188, 21, + 177, 207, 52, 84, 23, 127, 78, 160, 52, 120, 23, 98, 142, 169, 164, 126, + 251, 96, 67, 104, 49, 238, 148, 76, 111, 117, 236, 39, 13, 218, 133, 155, + 35, 43, 89, 223, 122, 216, 35, 26, 153, 203, 42, 215, 95, 30, 184, 8, + 114, 134, 165, 162, 251, 57, 131, 82, 225, 253, 136, 65, 166, 176, 122, 244, + 35, 7, 89, 194, 186, 209, 179, 28, 117, 201, 231, 22, 202, 142, 215, 36, + 94, 155, 120, 107, 98, 175, 105, 188, 46, 241, 220, 68, 89, 243, 122, 197, + 227, 19, 9, 205, 198, 213, 146, 223, 45, 152, 29, 170, 137, 191, 38, 240, + 26, 196, 11, 19, 71, 77, 242, 181, 133, 183, 35, 54, 153, 214, 234, 222, + 207, 24, 84, 10, 191, 71, 48, 50, 148, 21, 175, 79, 60, 52, 17, 215, + 76, 94, 181, 248, 119, 2, 166, 129, 186, 224, 115, 8, 37, 198, 155, 18, + 235, 77, 143, 117, 164, 39, 59, 90, 147, 123, 45, 227, 93, 137, 249, 166, + 194, 250, 209, 131, 28, 97, 201, 232, 86, 206, 190, 212, 112, 95, 100, 56, + 43, 82, 159, 125, 168, 33, 190, 152, 112, 106, 164, 47, 59, 92, 19, 121, + 205, 226, 213, 137, 159, 38, 232, 26, 206, 139, 20, 103, 79, 106, 180, 47, + 55, 92, 22, 185, 206, 242, 212, 69, 159, 115, 40, 37, 222, 155, 24, 107, + 74, 175, 119, 60, 38, 145, 218, 236, 91, 13, 251, 69, 131, 115, 33, 229, + 216, 75, 26, 183, 75, 54, 183, 86, 246, 190, 198, 240, 82, 196, 61, 147, + 81, 173, 252, 125, 129, 225, 160, 72, 120, 54, 162, 150, 249, 174, 194, 252, + 81, 129, 252, 96, 65, 232, 48, 78, 148, 52, 111, 87, 108, 62, 173, 208, + 125, 156, 33, 169, 216, 126, 218, 160, 91, 56, 59, 82, 147, 125, 173, 225, + 189, 136, 113, 166, 164, 122, 251, 99, 3, 105, 193, 238, 208, 76, 92, 53, + 249, 215, 2, 222, 129, 152, 96, 106, 168, 47, 62, 156, 16, 105, 204, 46, + 213, 220, 95, 25, 248, 10, 194, 135, 17, 162, 140, 121, 165, 226, 251, 9, + 131, 70, 225, 242, 200, 69, 150, 179, 46, 245, 220, 71, 25, 242, 138, 197, + 167, 19, 58, 141, 211, 37, 157, 219, 41, 155, 94, 235, 120, 79, 98, 180, + 41, 183, 94, 246, 184, 70, 242, 178, 197, 181, 147, 55, 45, 214, 157, 158, + 233, 168, 78, 254, 180, 64, 119, 112, 38, 164, 26, 251, 75, 3, 119, 65, + 230, 176, 74, 244, 55, 7, 86, 130, 190, 225, 176, 72, 116, 54, 167, 86, + 250, 190, 195, 48, 81, 212, 60, 95, 81, 248, 60, 66, 145, 241, 172, 68, + 125, 243, 97, 133, 232, 99, 14, 169, 196, 126, 211, 96, 93, 232, 57, 142, + 146, 228, 109, 139, 109, 167, 109, 186, 173, 179, 61, 181, 209, 183, 28, 118, + 137, 230, 230, 202, 202, 215, 23, 30, 142, 136, 100, 102, 171, 106, 255, 111, + 0, 44, 0, 29, 192, 9, 144, 6, 236, 2, 205, 193, 149, 144, 111, 44, + 44, 29, 221, 201, 153, 150, 234, 238, 207, 12, 84, 5, 255, 67, 0, 49, + 192, 20, 80, 15, 124, 4, 33, 195, 88, 81, 250, 188, 67, 49, 241, 212, + 68, 95, 115, 120, 37, 226, 155, 9, 171, 70, 255, 114, 192, 37, 144, 27, + 44, 11, 93, 199, 121, 146, 162, 237, 185, 141, 178, 229, 181, 139, 55, 39, + 86, 154, 190, 235, 48, 79, 84, 52, 63, 87, 80, 62, 188, 16, 113, 204, + 36, 85, 219, 127, 27, 96, 11, 104, 7, 110, 130, 172, 97, 189, 232, 113, + 142, 164, 100, 123, 107, 99, 111, 105, 236, 46, 205, 220, 85, 153, 255, 42, + 192, 31, 16, 8, 12, 6, 133, 194, 227, 17, 137, 204, 102, 213, 234, 223, + 15, 24, 4, 10, 131, 71, 33, 242, 152, 69, 170, 179, 63, 53, 208, 23, + 28, 14, 137, 196, 102, 211, 106, 221, 239, 25, 140, 10, 229, 199, 11, 18, + 135, 77, 162, 181, 185, 183, 50, 246, 149, 134, 239, 34, 204, 25, 149, 202, + 239, 23, 12, 14, 133, 196, 99, 19, 105, 205, 238, 213, 140, 95, 37, 248, + 27, 2, 139, 65, 167, 112, 122, 164, 35, 59, 89, 211, 122, 221, 227, 25, + 137, 202, 230, 215, 10, 222, 135, 24, 98, 138, 169, 167, 62, 250, 144, 67, + 44, 49, 221, 212, 89, 159, 122, 232, 35, 14, 153, 196, 106, 211, 111, 29, + 236, 9, 141, 198, 229, 146, 203, 45, 151, 93, 174, 185, 188, 114, 241, 229, + 132, 75, 35, 119, 89, 230, 186, 202, 243, 23, 5, 206, 131, 20, 97, 207, + 104, 84, 46, 191, 92, 112, 57, 228, 18, 203, 77, 151, 117, 174, 167, 60, + 122, 145, 227, 44, 73, 221, 246, 217, 134, 218, 226, 219, 9, 155, 70, 235, + 114, 207, 101, 148, 43, 47, 95, 92, 56, 57, 210, 146, 221, 173, 153, 189, + 170, 241, 191, 4, 112, 3, 100, 1, 235, 64, 79, 112, 52, 36, 23, 91, + 78, 187, 116, 115, 103, 101, 234, 171, 15, 63, 68, 16, 51, 76, 21, 245, + 207, 7, 20, 2, 143, 65, 164, 48, 123, 84, 35, 127, 89, 224, 58, 200, + 19, 22, 141, 206, 229, 148, 75, 47, 119, 92, 38, 185, 218, 242, 219, 5, + 155, 67, 43, 113, 223, 100, 88, 43, 122, 159, 99, 40, 41, 222, 158, 216, + 104, 90, 174, 187, 60, 115, 81, 229, 252, 75, 1, 247, 64, 70, 176, 50, + 244, 21, 135, 79, 34, 180, 25, 183, 74, 246, 183, 6, 246, 130, 198, 225, + 146, 200, 109, 150, 173, 174, 253, 188, 65, 177, 240, 116, 68, 39, 115, 90, + 165, 251, 59, 3, 83, 65, 253, 240, 65, 132, 48, 99, 84, 41, 255, 94, + 192, 56, 80, 18, 188, 13, 177, 197, 180, 83, 55, 125, 214, 161, 158, 248, + 104, 66, 174, 177, 188, 116, 113, 231, 100, 74, 171, 119, 63, 102, 144, 42, + 236, 31, 13, 200, 5, 150, 131, 46, 225, 220, 72, 89, 246, 186, 198, 243, + 18, 197, 205, 147, 21, 173, 207, 61, 148, 17, 175, 76, 124, 53, 225, 215, + 8, 94, 134, 184, 98, 242, 169, 133, 190, 227, 48, 73, 212, 54, 223, 86, + 216, 62, 218, 144, 91, 44, 59, 93, 211, 121, 157, 226, 233, 137, 142, 230, + 228, 74, 203, 119, 23, 102, 142, 170, 228, 127, 11, 96, 7, 104, 2, 174, + 129, 188, 96, 113, 232, 36, 78, 155, 116, 107, 103, 111, 106, 172, 47, 61, + 220, 17, 153, 204, 106, 213, 239, 31, 12, 8, 5, 198, 131, 18, 225, 205, + 136, 85, 166, 191, 58, 240, 19, 4, 13, 195, 69, 145, 243, 44, 69, 221, + 243, 25, 133, 202, 227, 23, 9, 206, 134, 212, 98, 223, 105, 152, 46, 234, + 156, 79, 41, 244, 30, 199, 72, 82, 182, 189, 182, 241, 182, 196, 118, 211, + 102, 221, 234, 217, 143, 26, 228, 11, 11, 71, 71, 114, 178, 165, 181, 187, + 55, 51, 86, 149, 254, 239, 0, 76, 0, 53, 192, 23, 16, 14, 140, 4, + 101, 195, 107, 17, 239, 76, 76, 53, 245, 215, 7, 30, 130, 136, 97, 166, + 168, 122, 254, 163, 0, 121, 192, 34, 208, 25, 156, 10, 233, 199, 14, 210, + 132, 93, 163, 121, 185, 226, 242, 201, 133, 150, 227, 46, 201, 220, 86, 217, + 254, 218, 192, 91, 16, 59, 76, 19, 117, 205, 231, 21, 138, 143, 39, 36, + 26, 155, 75, 43, 119, 95, 102, 184, 42, 242, 159, 5, 168, 3, 62, 129, + 208, 96, 92, 40, 57, 222, 146, 216, 109, 154, 173, 171, 61, 191, 81, 176, + 60, 116, 17, 231, 76, 74, 181, 247, 55, 6, 150, 130, 238, 225, 140, 72, + 101, 246, 171, 6, 255, 66, 192, 49, 144, 20, 108, 15, 109, 196, 45, 147, + 93, 173, 249, 189, 130, 241, 161, 132, 120, 99, 98, 169, 233, 190, 206, 240, + 84, 68, 63, 115, 80, 37, 252, 27, 1, 203, 64, 87, 112, 62, 164, 16, + 123, 76, 35, 117, 217, 231, 26, 202, 139, 23, 39, 78, 154, 180, 107, 55, + 111, 86, 172, 62, 253, 208, 65, 156, 48, 105, 212, 46, 223, 92, 88, 57, + 250, 146, 195, 45, 145, 221, 172, 89, 189, 250, 241, 131, 4, 97, 195, 104, + 81, 238, 188, 76, 113, 245, 228, 71, 11, 114, 135, 101, 162, 171, 57, 191, + 82, 240, 61, 132, 17, 163, 76, 121, 245, 226, 199, 9, 146, 134, 237, 162, + 205, 185, 149, 178, 239, 53, 140, 23, 37, 206, 155, 20, 107, 79, 111, 116, + 44, 39, 93, 218, 185, 155, 50, 235, 85, 143, 127, 36, 32, 27, 88, 11, + 122, 135, 99, 34, 169, 217, 190, 218, 240, 91, 4, 59, 67, 83, 113, 253, + 228, 65, 139, 112, 103, 100, 42, 171, 95, 63, 120, 16, 34, 140, 25, 165, + 202, 251, 23, 3, 78, 129, 244, 96, 71, 104, 50, 174, 149, 188, 111, 49, + 236, 20, 77, 207, 117, 148, 39, 47, 90, 156, 59, 41, 211, 94, 221, 248, + 89, 130, 186, 225, 179, 8, 117, 198, 167, 18, 250, 141, 131, 37, 161, 219, + 56, 91, 82, 187, 125, 179, 97, 181, 232, 119, 14, 166, 132, 122, 227, 99, + 9, 233, 198, 206, 210, 212, 93, 159, 121, 168, 34, 254, 153, 128, 106, 224, + 47, 8, 28, 6, 137, 194, 230, 209, 138, 220, 103, 25, 234, 138, 207, 39, + 20, 26, 143, 75, 36, 55, 91, 86, 187, 126, 243, 96, 69, 232, 51, 14, + 149, 196, 111, 19, 108, 13, 237, 197, 141, 147, 37, 173, 219, 61, 155, 81, + 171, 124, 127, 97, 224, 40, 72, 30, 182, 136, 118, 230, 166, 202, 250, 215, + 3, 30, 129, 200, 96, 86, 168, 62, 254, 144, 64, 108, 48, 45, 212, 29, + 159, 73, 168, 54, 254, 150, 192, 110, 208, 44, 92, 29, 249, 201, 130, 214, + 225, 158, 200, 104, 86, 174, 190, 252, 112, 65, 228, 48, 75, 84, 55, 127, + 86, 160, 62, 248, 16, 66, 140, 49, 165, 212, 123, 31, 99, 72, 41, 246, + 158, 198, 232, 82, 206, 189, 148, 113, 175, 100, 124, 43, 97, 223, 104, 88, + 46, 186, 156, 115, 41, 229, 222, 203, 24, 87, 74, 190, 183, 48, 118, 148, + 38, 239, 90, 204, 59, 21, 211, 79, 29, 244, 9, 135, 70, 226, 178, 201, + 181, 150, 247, 46, 198, 156, 82, 233, 253, 142, 193, 164, 80, 123, 124, 35, + 97, 217, 232, 90, 206, 187, 20, 115, 79, 101, 244, 43, 7, 95, 66, 184, + 49, 178, 148, 117, 175, 103, 60, 42, 145, 223, 44, 88, 29, 250, 137, 131, + 38, 225, 218, 200, 91, 22, 187, 78, 243, 116, 69, 231, 115, 10, 165, 199, + 59, 18, 147, 77, 173, 245, 189, 135, 49, 162, 148, 121, 175, 98, 252, 41, + 129, 222, 224, 88, 72, 58, 182, 147, 54, 237, 214, 205, 158, 213, 168, 95, + 62, 184, 16, 114, 140, 37, 165, 219, 59, 27, 83, 75, 125, 247, 97, 134, + 168, 98, 254, 169, 128, 126, 224, 32, 72, 24, 54, 138, 150, 231, 46, 202, + 156, 87, 41, 254, 158, 192, 104, 80, 46, 188, 28, 113, 201, 228, 86, 203, + 126, 215, 96, 94, 168, 56, 126, 146, 160, 109, 184, 45, 178, 157, 181, 169, + 183, 62, 246, 144, 70, 236, 50, 205, 213, 149, 159, 47, 40, 28, 30, 137, + 200, 102, 214, 170, 222, 255, 24, 64, 10, 176, 7, 52, 2, 151, 65, 174, + 176, 124, 116, 33, 231, 88, 74, 186, 183, 51, 54, 149, 214, 239, 30, 204, + 8, 85, 198, 191, 18, 240, 13, 132, 5, 163, 67, 57, 241, 210, 196, 93, + 147, 121, 173, 226, 253, 137, 129, 166, 224, 122, 200, 35, 22, 153, 206, 234, + 212, 79, 31, 116, 8, 39, 70, 154, 178, 235, 53, 143, 87, 36, 62, 155, + 80, 107, 124, 47, 97, 220, 40, 89, 222, 186, 216, 115, 26, 165, 203, 59, + 23, 83, 78, 189, 244, 113, 135, 100, 98, 171, 105, 191, 110, 240, 44, 68, + 29, 243, 73, 133, 246, 227, 6, 201, 194, 214, 209, 158, 220, 104, 89, 238, + 186, 204, 115, 21, 229, 207, 11, 20, 7, 79, 66, 180, 49, 183, 84, 118, + 191, 102, 240, 42, 196, 31, 19, 72, 13, 246, 133, 134, 227, 34, 201, 217, + 150, 218, 238, 219, 12, 91, 69, 251, 115, 3, 101, 193, 235, 16, 79, 76, + 52, 53, 215, 87, 30, 190, 136, 112, 102, 164, 42, 251, 95, 3, 120, 1, + 226, 128, 73, 160, 54, 248, 22, 194, 142, 209, 164, 92, 123, 121, 227, 98, + 201, 233, 150, 206, 238, 212, 76, 95, 117, 248, 39, 2, 154, 129, 171, 32, + 127, 88, 32, 58, 152, 19, 42, 141, 223, 37, 152, 27, 42, 139, 95, 39, + 120, 26, 162, 139, 57, 167, 82, 250, 189, 131, 49, 161, 212, 120, 95, 98, + 184, 41, 178, 158, 245, 168, 71, 62, 178, 144, 117, 172, 39, 61, 218, 145, + 155, 44, 107, 93, 239, 121, 140, 34, 229, 217, 139, 26, 231, 75, 10, 183, + 71, 54, 178, 150, 245, 174, 199, 60, 82, 145, 253, 172, 65, 189, 240, 113, + 132, 36, 99, 91, 105, 251, 110, 195, 108, 81, 237, 252, 77, 129, 245, 160, + 71, 56, 50, 146, 149, 173, 175, 61, 188, 17, 177, 204, 116, 85, 231, 127, + 10, 160, 7, 56, 2, 146, 129, 173, 160, 125, 184, 33, 178, 152, 117, 170, + 167, 63, 58, 144, 19, 44, 13, 221, 197, 153, 147, 42, 237, 223, 13, 152, + 5, 170, 131, 63, 33, 208, 24, 92, 10, 185, 199, 50, 210, 149, 157, 175, + 41, 188, 30, 241, 200, 68, 86, 179, 126, 245, 224, 71, 8, 50, 134, 149, + 162, 239, 57, 140, 18, 229, 205, 139, 21, 167, 79, 58, 180, 19, 55, 77, + 214, 181, 158, 247, 40, 70, 158, 178, 232, 117, 142, 167, 36, 122, 155, 99, + 43, 105, 223, 110, 216, 44, 90, 157, 251, 41, 131, 94, 225, 248, 72, 66, + 182, 177, 182, 244, 118, 199, 102, 210, 170, 221, 191, 25, 176, 10, 244, 7, + 7, 66, 130, 177, 161, 180, 120, 119, 98, 166, 169, 186, 254, 243, 0, 69, + 192, 51, 16, 21, 204, 15, 21, 196, 15, 19, 68, 13, 243, 69, 133, 243, + 35, 5, 217, 195, 26, 209, 203, 28, 87, 73, 254, 182, 192, 118, 208, 38, + 220, 26, 217, 203, 26, 215, 75, 30, 183, 72, 118, 182, 166, 246, 250, 198, + 195, 18, 209, 205, 156, 85, 169, 255, 62, 192, 16, 80, 12, 60, 5, 209, + 195, 28, 81, 201, 252, 86, 193, 254, 208, 64, 92, 48, 57, 212, 18, 223, + 77, 152, 53, 170, 151, 63, 46, 144, 28, 108, 9, 237, 198, 205, 146, 213, + 173, 159, 61, 168, 17, 190, 140, 112, 101, 228, 43, 11, 95, 71, 120, 50, + 162, 149, 185, 175, 50, 252, 21, 129, 207, 32, 84, 24, 63, 74, 144, 55, + 44, 22, 157, 206, 233, 148, 78, 239, 116, 76, 39, 117, 218, 167, 27, 58, + 139, 83, 39, 125, 218, 161, 155, 56, 107, 82, 175, 125, 188, 33, 177, 216, + 116, 90, 167, 123, 58, 163, 83, 57, 253, 210, 193, 157, 144, 105, 172, 46, + 253, 220, 65, 153, 240, 106, 196, 47, 19, 92, 13, 249, 197, 130, 211, 33, + 157, 216, 105, 154, 174, 235, 60, 79, 81, 244, 60, 71, 81, 242, 188, 69, + 177, 243, 52, 69, 215, 115, 30, 165, 200, 123, 22, 163, 78, 249, 244, 66, + 199, 113, 146, 164, 109, 187, 109, 179, 109, 181, 237, 183, 13, 182, 133, 182, 227, 54, 201, 214, 214, 222, 222, 216, 88, 90, 186, 187, 51, 51, 255, 63 ) random_mask_vec8 = numpy.array(random_mask_tuple, numpy.uint8) - diff --git a/gr-digital/python/digital/qa_correlate_access_code.py b/gr-digital/python/digital/qa_correlate_access_code.py index 198a254da7..d89b457117 100755 --- a/gr-digital/python/digital/qa_correlate_access_code.py +++ b/gr-digital/python/digital/qa_correlate_access_code.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2010,2011,2013 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, gr_unittest, digital, blocks @@ -74,7 +74,7 @@ class test_correlate_access_code(gr_unittest.TestCase): self.tb.run() result_data = dst.data() self.assertEqual(expected_result, result_data) - + def test_003(self): code = tuple(string_to_1_0_list(default_access_code)) access_code = to_1_0_string(code) @@ -93,4 +93,4 @@ class test_correlate_access_code(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_correlate_access_code, "test_correlate_access_code.xml") - + diff --git a/gr-digital/python/digital/qa_crc32_bb.py b/gr-digital/python/digital/qa_crc32_bb.py index 71ba81ded3..bca19cd418 100755 --- a/gr-digital/python/digital/qa_crc32_bb.py +++ b/gr-digital/python/digital/qa_crc32_bb.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,7 @@ class qa_crc32_bb (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "length" def tearDown (self): self.tb = None @@ -33,36 +34,37 @@ class qa_crc32_bb (gr_unittest.TestCase): def test_001_crc_len (self): """ Make sure the output of a CRC set is 4 bytes longer than the input. """ data = range(16) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(data)) - src = blocks.vector_source_b(data, False, 1, (tag,)) - crc = digital.crc32_bb(False, tag_name) - sink = blocks.vector_sink_b() - self.tb.connect(src, crc, sink) + src = blocks.vector_source_b(data) + crc = digital.crc32_bb(False, self.tsb_key) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(data), self.tsb_key), + crc, + sink + ) self.tb.run() # Check that the packets before crc_check are 4 bytes longer that the input. - self.assertEqual(len(data)+4, len(sink.data())) + self.assertEqual(len(data)+4, len(sink.data()[0])) def test_002_crc_equal (self): """ Go through CRC set / CRC check and make sure the output is the same as the input. """ data = (0, 1, 2, 3, 4, 5, 6, 7, 8) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(data)) - src = blocks.vector_source_b(data, False, 1, (tag,)) - crc = digital.crc32_bb(False, tag_name) - crc_check = digital.crc32_bb(True, tag_name) - sink = blocks.vector_sink_b() - self.tb.connect(src, crc, crc_check, sink) + src = blocks.vector_source_b(data) + crc = digital.crc32_bb(False, self.tsb_key) + crc_check = digital.crc32_bb(True, self.tsb_key) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(data), self.tsb_key), + crc, + crc_check, + sink + ) self.tb.run() # Check that the packets after crc_check are the same as input. - self.assertEqual(data, sink.data()) + self.assertEqual(data, sink.data()[0]) def test_003_crc_correct_lentag (self): tag_name = "length" @@ -88,12 +90,19 @@ class qa_crc32_bb (gr_unittest.TestCase): testtag3.offset = len(packets)-1 testtag3.key = pmt.string_to_symbol("tag3") testtag3.value = pmt.from_long(0) - src = blocks.vector_source_b(packets, False, 1, (tag1, tag2, testtag1, testtag2, testtag3)) - crc = digital.crc32_bb(False, tag_name) - sink = blocks.vector_sink_b() - self.tb.connect(src, crc, sink) + src = blocks.vector_source_b(packets, False, 1, (testtag1, testtag2, testtag3)) + crc = digital.crc32_bb(False, self.tsb_key) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, pack_len, self.tsb_key), + crc, + sink + ) self.tb.run() - self.assertEqual(len(sink.data()), 2*(pack_len+4)) + self.assertEqual(len(sink.data()), 2) + self.assertEqual(len(sink.data()[0]), (pack_len+4)) + self.assertEqual(len(sink.data()[1]), (pack_len+4)) correct_offsets = {'tag1': 1, 'tag2': 12, 'tag3': 19} tags_found = {'tag1': False, 'tag2': False, 'tag3': False} for tag in sink.tags(): @@ -101,45 +110,49 @@ class qa_crc32_bb (gr_unittest.TestCase): if key in correct_offsets.keys(): tags_found[key] = True self.assertEqual(correct_offsets[key], tag.offset) - if key == tag_name: - self.assertTrue(tag.offset == 0 or tag.offset == pack_len+4) self.assertTrue(all(tags_found.values())) def test_004_fail (self): """ Corrupt the data and make sure it fails CRC test. """ data = (0, 1, 2, 3, 4, 5, 6, 7) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(data)) - src = blocks.vector_source_b(data, False, 1, (tag,)) - crc = digital.crc32_bb(False, tag_name) - crc_check = digital.crc32_bb(True, tag_name) + src = blocks.vector_source_b(data) + crc = digital.crc32_bb(False, self.tsb_key) + crc_check = digital.crc32_bb(True, self.tsb_key) corruptor = blocks.add_const_bb(1) - sink = blocks.vector_sink_b() - self.tb.connect(src, crc, corruptor, crc_check, sink) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(data), self.tsb_key), + crc, + corruptor, + crc_check, + sink + ) self.tb.run() # crc_check will drop invalid packets self.assertEqual(len(sink.data()), 0) def test_005_tag_propagation (self): """ Make sure tags on the CRC aren't lost. """ - data = (0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 67, 225, 188) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(data)) + # Data with precalculated CRC + data = ( + 0, 1, 2, 3, 4, 5, 6, 7, 8, + 2, 67, 225, 188 + ) testtag = gr.tag_t() testtag.offset = len(data)-1 testtag.key = pmt.string_to_symbol('tag1') testtag.value = pmt.from_long(0) - src = blocks.vector_source_b(data, False, 1, (tag, testtag)) - crc_check = digital.crc32_bb(True, tag_name) - sink = blocks.vector_sink_b() - self.tb.connect(src, crc_check, sink) + src = blocks.vector_source_b(data, False, 1, (testtag,)) + crc_check = digital.crc32_bb(True, self.tsb_key) + sink = blocks.tsb_vector_sink_b(tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_char, 1, len(data), self.tsb_key), + crc_check, + sink + ) self.tb.run() self.assertEqual([len(data)-5,], [tag.offset for tag in sink.tags() if pmt.symbol_to_string(tag.key) == 'tag1']) diff --git a/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py index b1732fa94a..befb15ac4a 100755 --- a/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py +++ b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,13 +26,14 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "ts_last" def tearDown (self): self.tb = None def test_001_t (self): """ - pretty simple (the carrier allocation is not a practical OFDM configuration!) + pretty simple (the carrier allocation here is not a practical OFDM configuration!) """ fft_len = 6 tx_symbols = (1, 2, 3) @@ -43,21 +44,21 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): sync_word = (range(fft_len),) expected_result = tuple(sync_word[0] + [1j, 0, 0, 1, 2, 3]) # ^ DC carrier - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_symbols)) - src = blocks.vector_source_c(tx_symbols, False, 1, (tag,)) + src = blocks.vector_source_c(tx_symbols, False, 1) alloc = digital.ofdm_carrier_allocator_cvc(fft_len, occupied_carriers, pilot_carriers, pilot_symbols, sync_word, - tag_name) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, alloc, sink) - self.tb.run () - self.assertEqual(sink.data(), expected_result) + self.tsb_key) + sink = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_symbols), self.tsb_key), + alloc, + sink + ) + self.tb.run() + self.assertEqual(sink.data()[0], expected_result) def test_001_t2 (self): """ @@ -71,21 +72,18 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): pilot_symbols = ((1j,),) expected_result = (1j, 0, 1, 2, 3) # ^ DC carrier - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_symbols)) - src = blocks.vector_source_c(tx_symbols, False, 1, (tag,)) - alloc = digital.ofdm_carrier_allocator_cvc(fft_len, - occupied_carriers, - pilot_carriers, - pilot_symbols, (), - tag_name) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, alloc, sink) + src = blocks.vector_source_c(tx_symbols, False, 1) + alloc = digital.ofdm_carrier_allocator_cvc( + fft_len, + occupied_carriers, + pilot_carriers, + pilot_symbols, (), + self.tsb_key + ) + sink = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_symbols), self.tsb_key), alloc, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) + self.assertEqual(sink.data()[0], expected_result) def test_002_t (self): """ @@ -97,21 +95,21 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): occupied_carriers = ((-1, 1, 2),) pilot_carriers = ((3,),) expected_result = (1j, 0, 1, 0, 2, 3) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_symbols)) - src = blocks.vector_source_c(tx_symbols, False, 1, (tag,)) + src = blocks.vector_source_c(tx_symbols, False, 1) alloc = digital.ofdm_carrier_allocator_cvc(fft_len, occupied_carriers, pilot_carriers, pilot_symbols, (), - tag_name) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, alloc, sink) + self.tsb_key) + sink = blocks.tsb_vector_sink_c(fft_len) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_symbols), self.tsb_key), + alloc, + sink + ) self.tb.run () - self.assertEqual(sink.data(), expected_result) + self.assertEqual(sink.data()[0], expected_result) def test_002_t (self): """ @@ -124,11 +122,6 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): occupied_carriers = ((-1, 1, 2),) pilot_carriers = ((3,),) expected_result = sync_word + (1j, 0, 1, 0, 2, 3) + (1j, 0, 4, 0, 5, 6) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_symbols)) special_tag1 = gr.tag_t() special_tag1.offset = 0 special_tag1.key = pmt.string_to_symbol("spam") @@ -139,7 +132,7 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): special_tag2.value = pmt.to_pmt(42) src = blocks.vector_source_c( tx_symbols, False, 1, - (tag, special_tag1, special_tag2) + (special_tag1, special_tag2) ) alloc = digital.ofdm_carrier_allocator_cvc( fft_len, @@ -147,16 +140,15 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): pilot_carriers, pilot_symbols, sync_words=(sync_word,), - len_tag_key=tag_name + len_tag_key=self.tsb_key ) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, alloc, sink) + sink = blocks.tsb_vector_sink_c(fft_len) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_symbols), self.tsb_key), alloc, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) + self.assertEqual(sink.data()[0], expected_result) tags = [gr.tag_to_python(x) for x in sink.tags()] tags = sorted([(x.offset, x.key, x.value) for x in tags]) tags_expected = [ - (0, 'len', 3), (0, 'spam', 23), (2, 'eggs', 42), ] @@ -180,15 +172,6 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): 0, 7, 8, 3j, 9, 0, 0, 0, 0, 0, 0, 10, 4j, 11, 12, 0, 0, 13, 1j, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 2j, 0, 0) fft_len = 16 - tag_name = "len" - tag1 = gr.tag_t() - tag1.offset = 0 - tag1.key = pmt.string_to_symbol(tag_name) - tag1.value = pmt.from_long(len(tx_symbols)) - tag2 = gr.tag_t() - tag2.offset = len(tx_symbols) - tag2.key = pmt.string_to_symbol(tag_name) - tag2.value = pmt.from_long(len(tx_symbols)) testtag1 = gr.tag_t() testtag1.offset = 0 testtag1.key = pmt.string_to_symbol('tag1') @@ -205,18 +188,17 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): testtag4.offset = 2*len(tx_symbols)-1 # Last OFDM symbol of packet 2 testtag4.key = pmt.string_to_symbol('tag4') testtag4.value = pmt.from_long(0) - src = blocks.vector_source_c(tx_symbols * 2, False, 1, - (tag1, tag2, testtag1, testtag2, testtag3, testtag4)) + src = blocks.vector_source_c(tx_symbols * 2, False, 1, (testtag1, testtag2, testtag3, testtag4)) alloc = digital.ofdm_carrier_allocator_cvc(fft_len, occupied_carriers, pilot_carriers, pilot_symbols, (), - tag_name, + self.tsb_key, False) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, alloc, sink) + sink = blocks.tsb_vector_sink_c(fft_len) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_symbols), self.tsb_key), alloc, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result * 2) + self.assertEqual(sink.data()[0], expected_result) tags_found = {'tag1': False, 'tag2': False, 'tag3': False, 'tag4': False} correct_offsets = {'tag1': 0, 'tag2': 1, 'tag3': 3, 'tag4': 5} for tag in sink.tags(): @@ -224,9 +206,6 @@ class qa_digital_carrier_allocator_cvc (gr_unittest.TestCase): if key in tags_found.keys(): tags_found[key] = True self.assertEqual(correct_offsets[key], tag.offset) - if key == tag_name: - self.assertTrue(tag.offset == 0 or tag.offset == 3) - self.assertTrue(pmt.to_long(tag.value) == 3) self.assertTrue(all(tags_found.values())) diff --git a/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py b/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py index c365cf8483..d63b65d018 100755 --- a/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py +++ b/gr-digital/python/digital/qa_ofdm_chanest_vcvc.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,7 +22,6 @@ import sys import numpy import random - import numpy from gnuradio import gr, gr_unittest, blocks, analog, digital @@ -41,7 +40,7 @@ def rand_range(min_val, max_val): return random.random() * (max_val - min_val) + min_val -class qa_ofdm_sync_eqinit_vcvc (gr_unittest.TestCase): +class qa_ofdm_chanest_vcvc (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () @@ -284,5 +283,5 @@ class qa_ofdm_sync_eqinit_vcvc (gr_unittest.TestCase): if __name__ == '__main__': - gr_unittest.run(qa_ofdm_sync_eqinit_vcvc, "qa_ofdm_sync_eqinit_vcvc.xml") + gr_unittest.run(qa_ofdm_chanest_vcvc, "qa_ofdm_chanest_vcvc.xml") diff --git a/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py b/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py index 5cb9fae777..ecc1c426d6 100755 --- a/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py +++ b/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2007,2010,2011,2013 Free Software Foundation, Inc. +# Copyright 2007,2010,2011,2013,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -62,27 +62,22 @@ class test_ofdm_cyclic_prefixer (gr_unittest.TestCase): " With tags and a 2-sample rolloff " fft_len = 8 cp_len = 2 - tag_name = "length" + tag_name = "ts_last" expected_result = (7.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8, # 1.0/2 7.0/2+1.0/2, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1.0/2) - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(2) tag2 = gr.tag_t() tag2.offset = 1 tag2.key = pmt.string_to_symbol("random_tag") tag2.value = pmt.from_long(42) - src = blocks.vector_source_c(range(1, fft_len+1) * 2, False, fft_len, (tag, tag2)) + src = blocks.vector_source_c(range(1, fft_len+1) * 2, False, fft_len, (tag2,)) cp = digital.ofdm_cyclic_prefixer(fft_len, fft_len + cp_len, 2, tag_name) - sink = blocks.vector_sink_c() - self.tb.connect(src, cp, sink) + sink = blocks.tsb_vector_sink_c(tsb_key=tag_name) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, 2, tag_name), cp, sink) self.tb.run() - self.assertEqual(sink.data(), expected_result) + self.assertEqual(sink.data()[0], expected_result) tags = [gr.tag_to_python(x) for x in sink.tags()] tags = sorted([(x.offset, x.key, x.value) for x in tags]) expected_tags = [ - (0, tag_name, len(expected_result)), (fft_len+cp_len, "random_tag", 42) ] self.assertEqual(tags, expected_tags) diff --git a/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py b/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py index 1cdb8ed9a4..c42fb2b907 100755 --- a/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py +++ b/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py @@ -28,6 +28,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "tsb_key" def tearDown (self): self.tb = None @@ -44,12 +45,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): fft_len = 8 equalizer = digital.ofdm_equalizer_static(fft_len) n_syms = 3 - len_tag_key = "frame_len" tx_data = (1,) * fft_len * n_syms - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(n_syms) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") @@ -58,20 +54,24 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): random_tag.offset = 1 random_tag.key = pmt.string_to_symbol("foo") random_tag.value = pmt.from_long(42) - src = blocks.vector_source_c(tx_data, False, fft_len, (len_tag, chan_tag, random_tag)) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, len_tag_key) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(tx_data, False, fft_len, (chan_tag, random_tag)) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key) + sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), + eq, + sink + ) self.tb.run () # Check data - self.assertEqual(tx_data, sink.data()) + self.assertEqual(tx_data, sink.data()[0]) # Check tags tag_dict = dict() for tag in sink.tags(): ptag = gr.tag_to_python(tag) tag_dict[ptag.key] = ptag.value expected_dict = { - 'frame_len': n_syms, 'foo': 42 } self.assertEqual(tag_dict, expected_dict) @@ -83,23 +83,23 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): fft_len = 8 equalizer = digital.ofdm_equalizer_static(fft_len, symbols_skipped=1) n_syms = 3 - len_tag_key = "frame_len" tx_data = (1,) * fft_len * n_syms - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(n_syms) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") chan_tag.value = pmt.init_c32vector(fft_len, (1,) * fft_len) - src = blocks.vector_source_c(tx_data, False, fft_len, (len_tag, chan_tag)) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, len_tag_key) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(tx_data, False, fft_len, (chan_tag,)) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key) + sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), + eq, + sink + ) self.tb.run () # Check data - self.assertEqual(tx_data, sink.data()) + self.assertEqual(tx_data, sink.data()[0]) def test_001c_carrier_offset_no_cp (self): """ @@ -116,11 +116,6 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): # The rx'd signal is shifted rx_expected = (0, 0, 1, 1, 0, 1, 1, 0) * n_syms equalizer = digital.ofdm_equalizer_static(fft_len, occupied_carriers) - len_tag_key = "frame_len" - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(n_syms) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") @@ -130,13 +125,18 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): offset_tag.offset = 0 offset_tag.key = pmt.string_to_symbol("ofdm_sync_carr_offset") offset_tag.value = pmt.from_long(carr_offset) - src = blocks.vector_source_c(tx_data, False, fft_len, (len_tag, chan_tag, offset_tag)) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), cp_len, len_tag_key) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(tx_data, False, fft_len, (chan_tag, offset_tag)) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), cp_len, self.tsb_key) + sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), + eq, + sink + ) self.tb.run () # Check data - self.assertComplexTuplesAlmostEqual(rx_expected, sink.data(), places=4) + self.assertComplexTuplesAlmostEqual(rx_expected, sink.data()[0], places=4) def test_001c_carrier_offset_cp (self): """ @@ -157,11 +157,6 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): # Rx'd signal is corrected rx_expected = (0, 0, 1, 1, 0, 1, 1, 0) * n_syms equalizer = digital.ofdm_equalizer_static(fft_len, occupied_carriers) - len_tag_key = "frame_len" - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(n_syms) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") @@ -170,13 +165,18 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): offset_tag.offset = 0 offset_tag.key = pmt.string_to_symbol("ofdm_sync_carr_offset") offset_tag.value = pmt.from_long(carr_offset) - src = blocks.vector_source_c(tx_data, False, fft_len, (len_tag, chan_tag, offset_tag)) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), cp_len, len_tag_key) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(tx_data, False, fft_len, (chan_tag, offset_tag)) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), cp_len, self.tsb_key) + sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), + eq, + sink + ) self.tb.run () # Check data - self.assertComplexTuplesAlmostEqual(rx_expected, sink.data(), places=4) + self.assertComplexTuplesAlmostEqual(rx_expected, sink.data()[0], places=4) def test_002_static (self): """ @@ -211,21 +211,21 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): ] for idx in range(fft_len, 2*fft_len): channel[idx] = channel[idx-fft_len] * numpy.exp(1j * .1 * numpy.pi * (numpy.random.rand()-.5)) - len_tag_key = "frame_len" - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(4) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") chan_tag.value = pmt.init_c32vector(fft_len, channel[:fft_len]) - src = blocks.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len, (len_tag, chan_tag)) - sink = blocks.vector_sink_c(fft_len) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, len_tag_key, True) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len, (chan_tag,)) + sink = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key, True) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key), + eq, + sink + ) self.tb.run () - rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()] + rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()[0]] # Check data self.assertEqual(tx_data, rx_data) # Check tags @@ -238,7 +238,6 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): else: tag_dict[ptag.key] = pmt.to_python(tag.value) expected_dict = { - 'frame_len': 4, 'ofdm_sync_chan_taps': channel[-fft_len:] } self.assertEqual(tag_dict, expected_dict) @@ -247,7 +246,7 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): """ Same as before, but the input stream has no tag. We specify the frame size in the constructor. We also specify a tag key, so the output stream *should* have - a length tag. + a TSB tag. """ fft_len = 8 n_syms = 4 @@ -274,22 +273,22 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): channel[idx] = channel[idx-fft_len] * numpy.exp(1j * .1 * numpy.pi * (numpy.random.rand()-.5)) idx2 = idx+2*fft_len channel[idx2] = channel[idx2] * numpy.exp(1j * 0 * numpy.pi * (numpy.random.rand()-.5)) - src = gr.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len) - # We do specify a length tag, it should then appear at the output - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, "frame_len", False, n_syms) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key, False, n_syms) + sink = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key), + eq, + sink + ) self.tb.run () - rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()] + rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()[0]] self.assertEqual(tx_data, rx_data) - # Check len tag - tags = sink.tags() - len_tag = dict() - for tag in tags: - ptag = gr.tag_to_python(tag) - if ptag.key == 'frame_len': - len_tag[ptag.key] = ptag.value - self.assertEqual(len_tag, {'frame_len': 4}) + # Check TSB Functionality + packets = sink.data() + self.assertEqual(len(packets), 1) + self.assertEqual(len(packets[0]), len(tx_data)) def test_002_static_wo_tags (self): fft_len = 8 @@ -352,27 +351,26 @@ class qa_ofdm_frame_equalizer_vcvc (gr_unittest.TestCase): channel[idx] = channel[idx-fft_len] * numpy.exp(1j * .1 * numpy.pi * (numpy.random.rand()-.5)) idx2 = idx+2*fft_len channel[idx2] = channel[idx2] * numpy.exp(1j * 0 * numpy.pi * (numpy.random.rand()-.5)) - len_tag_key = "frame_len" - len_tag = gr.tag_t() - len_tag.offset = 0 - len_tag.key = pmt.string_to_symbol(len_tag_key) - len_tag.value = pmt.from_long(4) chan_tag = gr.tag_t() chan_tag.offset = 0 chan_tag.key = pmt.string_to_symbol("ofdm_sync_chan_taps") chan_tag.value = pmt.init_c32vector(fft_len, channel[:fft_len]) - src = blocks.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len, (len_tag, chan_tag)) - eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, len_tag_key, True) - sink = blocks.vector_sink_c(fft_len) - self.tb.connect(src, eq, sink) + src = blocks.vector_source_c(numpy.multiply(tx_signal, channel), False, fft_len, (chan_tag,)) + eq = digital.ofdm_frame_equalizer_vcvc(equalizer.base(), 0, self.tsb_key, True) + sink = blocks.tsb_vector_sink_c(fft_len, tsb_key=self.tsb_key) + self.tb.connect( + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, len(tx_data)/fft_len, self.tsb_key), + eq, + sink + ) self.tb.run () - rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()] + rx_data = [cnst.decision_maker_v((x,)) if x != 0 else -1 for x in sink.data()[0]] self.assertEqual(tx_data, rx_data) - for tag in sink.tags(): - if pmt.symbol_to_string(tag.key) == len_tag_key: - self.assertEqual(pmt.to_long(tag.value), 4) - if pmt.symbol_to_string(tag.key) == "ofdm_sync_chan_taps": - self.assertComplexTuplesAlmostEqual(list(pmt.c32vector_elements(tag.value)), channel[-fft_len:], places=1) + self.assertEqual(len(sink.tags()), 1) + tag = sink.tags()[0] + self.assertEqual(pmt.symbol_to_string(tag.key), "ofdm_sync_chan_taps") + self.assertComplexTuplesAlmostEqual(list(pmt.c32vector_elements(tag.value)), channel[-fft_len:], places=1) if __name__ == '__main__': diff --git a/gr-digital/python/digital/qa_ofdm_serializer_vcc.py b/gr-digital/python/digital/qa_ofdm_serializer_vcc.py index 69997ce981..8a60b97882 100755 --- a/gr-digital/python/digital/qa_ofdm_serializer_vcc.py +++ b/gr-digital/python/digital/qa_ofdm_serializer_vcc.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,6 +29,7 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "ts_last" def tearDown (self): self.tb = None @@ -42,21 +43,12 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): expected_result = tuple(range(1, 16)) + (0, 0, 0) occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),) n_syms = len(tx_symbols)/fft_len - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(n_syms) - src = blocks.vector_source_c(tx_symbols, False, fft_len, (tag,)) - serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, tag_name, "", 0, "", False) - sink = blocks.vector_sink_c() - self.tb.connect(src, serializer, sink) + src = blocks.vector_source_c(tx_symbols, False, fft_len) + serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, self.tsb_key, "", 0, "", False) + sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), serializer, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) - self.assertEqual(len(sink.tags()), 1) - result_tag = sink.tags()[0] - self.assertEqual(pmt.symbol_to_string(result_tag.key), tag_name) - self.assertEqual(pmt.to_long(result_tag.value), n_syms * len(occupied_carriers[0])) + self.assertEqual(sink.data()[0], expected_result) def test_001b_shifted (self): """ Same as before, but shifted, because that's the normal mode in OFDM Rx """ @@ -69,21 +61,12 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): expected_result = tuple(range(18)) occupied_carriers = ((13, 14, 15, 1, 2, 3), (-4, -2, -1, 1, 2, 4),) n_syms = len(tx_symbols)/fft_len - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(n_syms) - src = blocks.vector_source_c(tx_symbols, False, fft_len, (tag,)) - serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, tag_name) - sink = blocks.vector_sink_c() - self.tb.connect(src, serializer, sink) + src = blocks.vector_source_c(tx_symbols, False, fft_len) + serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, self.tsb_key) + sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), serializer, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) - self.assertEqual(len(sink.tags()), 1) - result_tag = sink.tags()[0] - self.assertEqual(pmt.symbol_to_string(result_tag.key), tag_name) - self.assertEqual(pmt.to_long(result_tag.value), n_syms * len(occupied_carriers[0])) + self.assertEqual(sink.data()[0], expected_result) def test_002_with_offset (self): """ Standard test, carrier offset """ @@ -96,32 +79,24 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): expected_result = tuple(range(1, 16)) + (0, 0, 0) occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),) n_syms = len(tx_symbols)/fft_len - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(n_syms) offsettag = gr.tag_t() offsettag.offset = 0 offsettag.key = pmt.string_to_symbol("ofdm_sync_carr_offset") offsettag.value = pmt.from_long(carr_offset) - src = blocks.vector_source_c(tx_symbols, False, fft_len, (tag, offsettag)) - sink = blocks.vector_sink_c() + src = blocks.vector_source_c(tx_symbols, False, fft_len, (offsettag,)) + sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key) serializer = digital.ofdm_serializer_vcc( fft_len, occupied_carriers, - tag_name, + self.tsb_key, "", 0, "ofdm_sync_carr_offset", False ) - self.tb.connect(src, serializer, sink) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), serializer, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) - self.assertEqual(len(sink.tags()), 2) - for tag in sink.tags(): - if pmt.symbol_to_string(tag.key) == tag_name: - self.assertEqual(pmt.to_long(tag.value), n_syms * len(occupied_carriers[0])) + self.assertEqual(sink.data()[0], expected_result) + self.assertEqual(len(sink.tags()), 1) def test_003_connect (self): """ Connect carrier_allocator to ofdm_serializer, @@ -133,19 +108,14 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): pilot_symbols = ((1j,),(-1j,)) #tx_data = tuple([numpy.random.randint(0, 10) for x in range(4 * n_syms)]) tx_data = (1, 2, 3, 4) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_data)) - src = blocks.vector_source_c(tx_data, False, 1, (tag,)) + src = blocks.vector_source_c(tx_data, False, 1) alloc = digital.ofdm_carrier_allocator_cvc( fft_len, occupied_carriers, pilot_carriers, pilot_symbols, (), # No sync word - tag_name, + self.tsb_key, True # Output is shifted (default) ) serializer = digital.ofdm_serializer_vcc( @@ -155,10 +125,10 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): "", # Carrier offset key True # Input is shifted (default) ) - sink = blocks.vector_sink_c() - self.tb.connect(src, alloc, serializer, sink) + sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_data), self.tsb_key), alloc, serializer, sink) self.tb.run () - self.assertEqual(sink.data(), tx_data) + self.assertEqual(sink.data()[0], tx_data) def test_004_connect (self): """ @@ -176,33 +146,30 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): pilot_carriers = ((-3,),(3,)) pilot_symbols = ((1j,),(-1j,)) tx_data = (1, 2, 3, 4) - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(len(tx_data)) offsettag = gr.tag_t() offsettag.offset = 0 offsettag.key = pmt.string_to_symbol("ofdm_sync_carr_offset") offsettag.value = pmt.from_long(carr_offset) - src = blocks.vector_source_c(tx_data, False, 1, (tag, offsettag)) + src = blocks.vector_source_c(tx_data, False, 1, (offsettag,)) alloc = digital.ofdm_carrier_allocator_cvc(fft_len, occupied_carriers, pilot_carriers, pilot_symbols, (), - tag_name) + self.tsb_key) tx_ifft = fft.fft_vcc(fft_len, False, (1.0/fft_len,)*fft_len, True) oscillator = analog.sig_source_c(1.0, analog.GR_COS_WAVE, freq_offset, 1.0) mixer = blocks.multiply_cc() rx_fft = fft.fft_vcc(fft_len, True, (), True) - sink2 = blocks.vector_sink_c(fft_len) + sink2 = blocks.tsb_vector_sink_c(vlen=fft_len, tsb_key=self.tsb_key) self.tb.connect(rx_fft, sink2) serializer = digital.ofdm_serializer_vcc( alloc, "", 0, "ofdm_sync_carr_offset", True ) - sink = blocks.vector_sink_c() + sink = blocks.tsb_vector_sink_c(tsb_key=self.tsb_key) self.tb.connect( - src, alloc, tx_ifft, + src, + blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, 1, len(tx_data), self.tsb_key), + alloc, tx_ifft, blocks.vector_to_stream(gr.sizeof_gr_complex, fft_len), (mixer, 0), blocks.stream_to_vector(gr.sizeof_gr_complex, fft_len), @@ -210,7 +177,7 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): ) self.tb.connect(oscillator, (mixer, 1)) self.tb.run () - self.assertComplexTuplesAlmostEqual(sink.data()[-len(occupied_carriers[0]):], tx_data, places=4) + self.assertComplexTuplesAlmostEqual(sink.data()[0][-len(occupied_carriers[0]):], tx_data, places=4) def test_005_packet_len_tag (self): """ Standard test """ @@ -222,32 +189,23 @@ class qa_ofdm_serializer_vcc (gr_unittest.TestCase): expected_result = tuple(range(1, 16)) occupied_carriers = ((1, 3, 4, 11, 12, 14), (1, 2, 4, 11, 13, 14),) n_syms = len(tx_symbols)/fft_len - tag_name = "len" - tag = gr.tag_t() - tag.offset = 0 - tag.key = pmt.string_to_symbol(tag_name) - tag.value = pmt.from_long(n_syms) + packet_len_tsb_key = "packet_len" tag2 = gr.tag_t() tag2.offset = 0 tag2.key = pmt.string_to_symbol("packet_len") tag2.value = pmt.from_long(len(expected_result)) - src = blocks.vector_source_c(tx_symbols, False, fft_len, (tag, tag2)) - serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, tag_name, "packet_len", 0, "", False) - sink = blocks.vector_sink_c() - self.tb.connect(src, serializer, sink) + src = blocks.vector_source_c(tx_symbols, False, fft_len, (tag2,)) + serializer = digital.ofdm_serializer_vcc(fft_len, occupied_carriers, self.tsb_key, packet_len_tsb_key , 0, "", False) + sink = blocks.tsb_vector_sink_c(tsb_key=packet_len_tsb_key) + self.tb.connect(src, blocks.stream_to_tagged_stream(gr.sizeof_gr_complex, fft_len, n_syms, self.tsb_key), serializer, sink) self.tb.run () - self.assertEqual(sink.data(), expected_result) - self.assertEqual(len(sink.tags()), 1) - result_tag = sink.tags()[0] - self.assertEqual(pmt.symbol_to_string(result_tag.key), "packet_len") - self.assertEqual(pmt.to_long(result_tag.value), len(expected_result)) + self.assertEqual(sink.data()[0], expected_result) def test_099 (self): """ Make sure it fails if it should """ fft_len = 16 - occupied_carriers = ((1, 3, 4, 11, 12, 112),) - tag_name = "len" - self.assertRaises(RuntimeError, digital.ofdm_serializer_vcc, fft_len, occupied_carriers, tag_name) + occupied_carriers = ((1, 3, 4, 11, 12, 112),) # Something invalid + self.assertRaises(RuntimeError, digital.ofdm_serializer_vcc, fft_len, occupied_carriers, self.tsb_key) if __name__ == '__main__': diff --git a/gr-digital/python/digital/qa_packet_headergenerator_bb.py b/gr-digital/python/digital/qa_packet_headergenerator_bb.py index bec0828e4b..d2677ce220 100755 --- a/gr-digital/python/digital/qa_packet_headergenerator_bb.py +++ b/gr-digital/python/digital/qa_packet_headergenerator_bb.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -# Copyright 2012 Free Software Foundation, Inc. +# +#Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -14,40 +15,35 @@ # 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 +# 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, gr_unittest, digital, blocks +from gnuradio.gr import packet_utils import pmt class qa_packet_headergenerator_bb (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () + self.tsb_key = "tsb_key" def tearDown (self): self.tb = None + def setup_data_tags(self, data): + return packet_utils.packets_to_vectors( + data, + self.tsb_key + ) + def test_001_12bits (self): - # 3 PDUs: | | | - data = (1, 2, 3, 4, 1, 2) + tuple(range(25)) - tagname = "packet_len" - tag1 = gr.tag_t() - tag1.offset = 0 - tag1.key = pmt.string_to_symbol(tagname) - tag1.value = pmt.from_long(4) - tag2 = gr.tag_t() - tag2.offset = 4 - tag2.key = pmt.string_to_symbol(tagname) - tag2.value = pmt.from_long(2) - tag3 = gr.tag_t() - tag3.offset = 6 - tag3.key = pmt.string_to_symbol(tagname) - tag3.value = pmt.from_long(25) - src = blocks.vector_source_b(data, False, 1, (tag1, tag2, tag3)) - header = digital.packet_headergenerator_bb(12, tagname) + # 3 packets: | | | + data, tags = self.setup_data_tags(((1, 2, 3, 4), (1, 2), tuple(range(25)))) + src = blocks.vector_source_b(data, tags=tags) + header = digital.packet_headergenerator_bb(12, self.tsb_key) sink = blocks.vector_sink_b() self.tb.connect(src, header, sink) self.tb.run() @@ -58,25 +54,11 @@ class qa_packet_headergenerator_bb (gr_unittest.TestCase): ) self.assertEqual(sink.data(), expected_data) - def test_002_32bits (self): - # 3 PDUs: | | | | - data = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4) - tagname = "packet_len" - tag1 = gr.tag_t() - tag1.offset = 0 - tag1.key = pmt.string_to_symbol(tagname) - tag1.value = pmt.from_long(4) - tag2 = gr.tag_t() - tag2.offset = 4 - tag2.key = pmt.string_to_symbol(tagname) - tag2.value = pmt.from_long(2) - tag3 = gr.tag_t() - tag3.offset = 6 - tag3.key = pmt.string_to_symbol(tagname) - tag3.value = pmt.from_long(4) - src = blocks.vector_source_b(data, False, 1, (tag1, tag2, tag3)) - header = digital.packet_headergenerator_bb(32, tagname) + # 3 packets: | | | | + data, tags = self.setup_data_tags(((1, 2, 3, 4), (1, 2), (1, 2, 3, 4))) + src = blocks.vector_source_b(data, tags=tags) + header = digital.packet_headergenerator_bb(32, self.tsb_key) sink = blocks.vector_sink_b() self.tb.connect(src, header, sink) self.tb.run() @@ -88,26 +70,12 @@ class qa_packet_headergenerator_bb (gr_unittest.TestCase): ) self.assertEqual(sink.data(), expected_data) - def test_003_12bits_formatter_object (self): - # 3 PDUs: | | | | - data = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4) - tagname = "packet_len" - tag1 = gr.tag_t() - tag1.offset = 0 - tag1.key = pmt.string_to_symbol(tagname) - tag1.value = pmt.from_long(4) - tag2 = gr.tag_t() - tag2.offset = 4 - tag2.key = pmt.string_to_symbol(tagname) - tag2.value = pmt.from_long(2) - tag3 = gr.tag_t() - tag3.offset = 6 - tag3.key = pmt.string_to_symbol(tagname) - tag3.value = pmt.from_long(4) - src = blocks.vector_source_b(data, False, 1, (tag1, tag2, tag3)) - formatter_object = digital.packet_header_default(12, tagname) - header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname) + # 3 packets: | | | | + data, tags = self.setup_data_tags(((1, 2, 3, 4), (1, 2), (1, 2, 3, 4))) + src = blocks.vector_source_b(data, tags=tags) + formatter_object = digital.packet_header_default(12, self.tsb_key) + header = digital.packet_headergenerator_bb(formatter_object.formatter(), self.tsb_key) sink = blocks.vector_sink_b() self.tb.connect(src, header, sink) self.tb.run() @@ -120,26 +88,13 @@ class qa_packet_headergenerator_bb (gr_unittest.TestCase): def test_004_8bits_formatter_ofdm (self): occupied_carriers = ((1, 2, 3, 5, 6, 7),) - # 3 PDUs: | | | | - data = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4) - tagname = "packet_len" - tag1 = gr.tag_t() - tag1.offset = 0 - tag1.key = pmt.string_to_symbol(tagname) - tag1.value = pmt.from_long(4) - tag2 = gr.tag_t() - tag2.offset = 4 - tag2.key = pmt.string_to_symbol(tagname) - tag2.value = pmt.from_long(2) - tag3 = gr.tag_t() - tag3.offset = 6 - tag3.key = pmt.string_to_symbol(tagname) - tag3.value = pmt.from_long(4) - src = blocks.vector_source_b(data, False, 1, (tag1, tag2, tag3)) - formatter_object = digital.packet_header_ofdm(occupied_carriers, 1, tagname) + # 3 packets: | | | | + data, tags = self.setup_data_tags(((1, 2, 3, 4), (1, 2), (1, 2, 3, 4))) + src = blocks.vector_source_b(data, tags=tags) + formatter_object = digital.packet_header_ofdm(occupied_carriers, 1, self.tsb_key) self.assertEqual(formatter_object.header_len(), 6) - self.assertEqual(pmt.symbol_to_string(formatter_object.len_tag_key()), tagname) - header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname) + self.assertEqual(pmt.symbol_to_string(formatter_object.len_tag_key()), self.tsb_key) + header = digital.packet_headergenerator_bb(formatter_object.formatter(), self.tsb_key) sink = blocks.vector_sink_b() self.tb.connect(src, header, sink) self.tb.run() diff --git a/gr-digital/python/digital/utils/tagged_streams.py b/gr-digital/python/digital/utils/tagged_streams.py index c7edbf61eb..4b393bfc20 100644 --- a/gr-digital/python/digital/utils/tagged_streams.py +++ b/gr-digital/python/digital/utils/tagged_streams.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +# DEPRECATED -- Marked for removal in 3.8 + from gnuradio import gr import pmt diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i index ab9794af57..43f68a3d6e 100644 --- a/gr-digital/swig/digital_swig.i +++ b/gr-digital/swig/digital_swig.i @@ -1,18 +1,18 @@ /* * Copyright 2011,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, @@ -54,11 +54,14 @@ #include "gnuradio/digital/constellation_soft_decoder_cf.h" #include "gnuradio/digital/correlate_access_code_bb.h" #include "gnuradio/digital/correlate_access_code_tag_bb.h" +#include "gnuradio/digital/correlate_access_code_bb_ts.h" +#include "gnuradio/digital/correlate_access_code_ff_ts.h" #include "gnuradio/digital/correlate_and_sync_cc.h" #include "gnuradio/digital/costas_loop_cc.h" #include "gnuradio/digital/cpmmod_bc.h" #include "gnuradio/digital/crc32.h" #include "gnuradio/digital/crc32_bb.h" +#include "gnuradio/digital/crc32_async_bb.h" #include "gnuradio/digital/descrambler_bb.h" #include "gnuradio/digital/diff_decoder_bb.h" #include "gnuradio/digital/diff_encoder_bb.h" @@ -127,11 +130,14 @@ %include "gnuradio/digital/constellation_soft_decoder_cf.h" %include "gnuradio/digital/correlate_access_code_bb.h" %include "gnuradio/digital/correlate_access_code_tag_bb.h" +%include "gnuradio/digital/correlate_access_code_bb_ts.h" +%include "gnuradio/digital/correlate_access_code_ff_ts.h" %include "gnuradio/digital/correlate_and_sync_cc.h" %include "gnuradio/digital/costas_loop_cc.h" %include "gnuradio/digital/cpmmod_bc.h" %include "gnuradio/digital/crc32.h" %include "gnuradio/digital/crc32_bb.h" +%include "gnuradio/digital/crc32_async_bb.h" %include "gnuradio/digital/descrambler_bb.h" %include "gnuradio/digital/diff_decoder_bb.h" %include "gnuradio/digital/diff_encoder_bb.h" @@ -195,9 +201,12 @@ GR_SWIG_BLOCK_MAGIC2(digital, constellation_receiver_cb); GR_SWIG_BLOCK_MAGIC2(digital, constellation_soft_decoder_cf); GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb); GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_tag_bb); +GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb_ts); +GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_ff_ts); GR_SWIG_BLOCK_MAGIC2(digital, correlate_and_sync_cc); GR_SWIG_BLOCK_MAGIC2(digital, costas_loop_cc); GR_SWIG_BLOCK_MAGIC2(digital, crc32_bb); +GR_SWIG_BLOCK_MAGIC2(digital, crc32_async_bb); GR_SWIG_BLOCK_MAGIC2(digital, cpmmod_bc); GR_SWIG_BLOCK_MAGIC2(digital, descrambler_bb); GR_SWIG_BLOCK_MAGIC2(digital, diff_decoder_bb); diff --git a/gr-fec/CMakeLists.txt b/gr-fec/CMakeLists.txt index b40023766b..393e5423e0 100644 --- a/gr-fec/CMakeLists.txt +++ b/gr-fec/CMakeLists.txt @@ -28,6 +28,7 @@ include(GrBoost) include(GrComponent) GR_REGISTER_COMPONENT("gr-fec" ENABLE_GR_FEC + ENABLE_VOLK Boost_FOUND ENABLE_GNURADIO_RUNTIME ENABLE_GR_BLOCKS @@ -40,6 +41,8 @@ GR_SET_GLOBAL(GR_FEC_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ) +SET(GR_PKG_FEC_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/fec) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -89,7 +92,7 @@ if(ENABLE_PYTHON) add_subdirectory(python/fec) add_subdirectory(grc) endif(ENABLE_PYTHON) -#add_subdirectory(examples) +add_subdirectory(examples) add_subdirectory(doc) ######################################################################## diff --git a/gr-fec/doc/fec.dox b/gr-fec/doc/fec.dox index c8114eeedb..7fbbdda6e3 100644 --- a/gr-fec/doc/fec.dox +++ b/gr-fec/doc/fec.dox @@ -21,4 +21,352 @@ by using: help(fec) \endcode + +\section fec_using Using the FEC API + +FEC is a complex issue to implement in a generic, generally usable +way. To help with these issues, the FEC API operates on two levels: +the coder variables and the coder deployments. The variables implement +the encoding and decoding methods whereas the deployments set up the +variables, make sure the input data is formatted properly, run the +coder variable, and then pass on the data for follow-on processing. + +In a GNU Radio flowgraph, the deployments are GNU Radio blocks that we +insert into the flowgraph. The deployments use the API of the coder +variables to interact with the scheduler and set up the input/output +item buffers that move data between blocks. The intent of the API is +to be able to build the coding variables that are general enough for +easy use in multiple situations. We then construct deployments to +control the interaction between the data and the variable. GNU Radio +provides deployments for a number of situations, but these should not +be considered the only ways to deploy the decoders. + + +\subsection fec_deployments Deployments + +Generally speaking, encoder deployments take in bits and produce +bits (i.e., unpacked bytes with 1 bit per byte). Decoder deployments +take in floats and produce bits. The floats are generally meant to +represent soft decisions. If the demodulator does not produce soft +decisions, an easy alternative is to convert the hard decision 0's and +1's to -1 and +1 floats. The main departure from this model is when +using a PDU-based modulator or demodulator, for which we can look at +using the asynchronous message passing system. In this instance, +passing bits is not natural, so we need to create a deployment that +can handle packed bytes. GNU Radio has the gr::fec::asycn_encoder and +gr::fec::async_decoder deployments that work in this mode. + +Some coding variables handle inputs and outputs differently than the +described deployments. Using the FEC API provides concepts of input +and output conversion properties that help us create deployments to +convert the data streams to the required format of the variable. + +\subsubsection fec_deploy_simple Streaming Deployments + +For the encoder deployments, the gr::fec::encoder block is a +relatively simple deployment for the encoding variables. It uses the +encoding object information about the input/output sizes and +input/output item sizes to set up the interaction with the +scheduler. Typically, a coder will add redundancy to the stream making +the output longer by some amount than the input stream. This block +simply takes in an encoder object, specifically an object that derives +from gr::fec::generic_encoder. It also takes in the input and output +items sizes that the encoder will expect, which we can just ask the +encoder for. Typically, the encodes expect unpacked bytes in and +unpacked bytes out. + +The gr::fec::decoder block is a similarly simple deployment for the +decoding variables. It uses the decoding variable information about +the input/output sizes and input/output item sizes to set up the +interaction with the scheduler. Since a decoder typically uses the +redundancy from the input stream to correct for errors, the input +stream will be longer than the output stream by the rate of the +code. This block simply takes in an decoder object, specifically an +object that derives from gr::fec::generic_decoder. It also takes in +the input and output items sizes that the decoder will expect, which +we can just ask the encoder for. The deployment expects a floating +point stream input, though the decoder variables may take a float +input or a byte. If using a byte format, it could be a hard decision +or a quantized soft decision, depending on how the decoder object +behaves. + +Normally, though, we don't work directly with these simple encoder() +or decoder() deployments but a wrapper around those blocks. GNU +Radio's gr-fec package comes with two Python deployments to make +things easier: fec.extended_encoder and fec.extended_decoder. For one +thing, these extended hier_block2 blocks take care of the puncturing +and depuncturing operations often found in FEC codes. The other thing +that these blocks do for us is read the API of the encoder/decoder +variables to properly convert the data in or out, depending on how the +coding object works. + +For instance, a generic_decoder takes in floating point values (which +should be soft decisions). However, a decoder might instead want to +work on 8-bit quantized soft decisions and so expects unsigned +chars. Specifying 'uchar' as the +gr::fec::generic_decoder::get_input_conversion() of the decoder block tells the +fec.extended_decoder to convert the float to a byte. + +In GRC, we would add an "FEC Extended Encoder" to our transmitter or +an "FEC Extended Decoder" to the receiver. We would then use one of +the encoder or decoder FEC variable blocks to define the parameters of +the particular code we want to use. We can find these codes under the +[Error Coding] category in GRC. The encoders are found under +[Encoders] and similarly the decoders under the [Decoders] +categories. Putting these onto the canvas creates a variable that we +can then pass to the extended encoder or decoder deployment blocks. + +Most of the parameters of the encoder and decoder definitions should +be fairly obvious based on the type of code. See the documentation for +each coding object for more details. In the following section \ref +fec_parallelism, we explain the Parallelism and Dimension properties. + +See fec/fecapi_encoders.grc and fec/fecapi_decoders.grc in the +installed examples for an example of how to work with these +deployments given the three initial FEC coders available. + +\subsubsection fec_deploy_tag_stream Tagged Stream Deployments + +GNU Radio's gr-fec also comes with simple deployments for \ref +page_tagged_stream_blocks blocks. These deployments work similarly to +the normal streaming deployments but fit into a tagged stream system +by setting a tagged stream tag to control the frame size. Like all +tagged stream blocks, they expect the tag to be located in the stream +in order to properly function. + +The simplest form of the tagged stream deployments are just the C++ +blocks gr::fec::tagged_encoder and gr::fec::tagged_decoder. These do +not handle any input or output conversion. They expect the inputs to +be already properly formatted for the encoding/decoding variables, and +the outputs will be whatever the variable naturally produce. + +In the tagged stream deployments, the frame size set for a variable is +no longer the static frame size like we expected in the streaming data +implementations. Instead, we look at the frame size of the +encoder/decoder variable during construction of the deployment as the +maximum frame size, or a maximum transmission unit (MTU). This allows +us to set up some internal memory to handle up to the required maximum +length. When a tagged stream comes into this block, the frame size is +then set based on that tagged stream information. If the frame is +larger than the established MTU, a warning is sent out and the +deployment only handles up to the MTU of the given frame. + +The extended Python tagged deployments, fec.extended_tagged_encoder +and fec.extended_tagged_decoder, offer additional handling of the FEC +API like we saw with the fec.extended_encoder and +fec.extended_decoder. These extended deployments wrap up the +puncturing and depuncturing as well as use the FEC API to do any input +and output translation for the formatting of data streams. The +fec.extended_tagged_encoder expects unpacked bits in and produces +unpacked bits out. The fec.extended_tagged_decoder takes in floats +(generally soft decisions from -1 to 1) and produces unpacked bits. + +See fec/fecapi_tagged_encoders.grc and fec/fecapi_tagged_decoders.grc +in the installed examples for an example of how to work with these +deployments given the three initial FEC coders available. + + + +\subsubsection fec_deploy_async Asynchronous Deployments + +The final standard deployment shipped with GNU Radio is for +asynchronous \ref page_msg_passing and handling PDUs: +gr::fec::async_encoder and gr::fec::async_decoder. + +Unlike the other deployments, these C++ deployments do not also have +an extended Python deployment. Because this deployment uses message +passing, we cannot easily build up a hierarchical block of message +passing blocks to satisfy the input/output translations like we've +done with the other forms of deployment. Instead, the input/output +formatting is taken care of inside this deployment itself. Further, +because this form of moving data anticipates data being moved in +packets, these deployments cannot work with any FEC code that requires +a history (see generic_decoder::get_history). Right now, this means +that the async message passing deployments cannot work with +convolutional codes (gr::fec::code::cc_encoder and +gr::fec::code::cc_decoder) in streaming mode because it would require +data from the next frame to finish off decoding the current frame. + +These deployments also work in two distinct modes. They can work in +unpacked mode where inputs are messages of bits, or they may work in +packed mode where messages are PDUs. The distinction is that the +packed mode PDU's are the standard protocol data units (PDUs) that +encompass full packets of data. This allows these async deployments to +be used easily within PDU-based applications, such as encoding a +packet with a CRC attached. + +When in packed or PDU mode, the encoder deployment has the option of +reversing the bits during unpacking and packing. Like the extended +deployments for the other data modes, these deployments manipulate the +input data to the format expected by the encoding or decoding +variables using calls to the FEC API. Because most of the coders work +off unpacked bits, the incoming PDUs must first be unpacked into bits +and the repacked again into the original PDU. The +gr::blocks::kernel::pack_k_bits and gr::blocks::kernel::unpack_k_bits +kernels are used here, and they can change the direction on how to +pack and unpack. Because different data processing blocks, framing, +deframing, and other operations may arbitrarily set the format of the +bits and the ordering, we provide the options of unpacking and packing +directions in the deployments. However, the gr::fec::async_decoder +still expects the input to be soft decisions with one decision per +item, so we only say whether this deployment outputs packed PDUs or +not and the packing direction. + +For an example of using the asynchronous in PDU mode, see +fec/fecapi_async_packed_decoders.grc. See +fec/fecapi_async_to_stream.grc for an example of mixing the packed PDU +mode encoder with a tagged stream decoder. This example shows the PDU +input having a CRC32 appended to the uncoded stream that is then +checked after the packet is decoded. + +For an example of the async deployment using unpacked bits, see +fec/fecapi_async_encoders.grc and fec/fecapi_async_decoders.grc. + + +\subsection fec_coding_vars Encoding/Decoding Variables + +GNU Radio currently has a minor subset of coders available: + +Coders: + +\li gr::fec::code::dummy_encoder +\li gr::fec::code::repetition_encoder +\li gr::fec::code::cc_encoder +\li gr::fec::code::ccsds_encoder + +Decoders: +\li gr::fec::code::dummy_decoder +\li gr::fec::code::repetition_decoder +\li gr::fec::code::cc_decoder + + +When building a new FECAPI encoder or decoder variable, the dummy +encoder/decoder block would be a good place to start. This coding set +does no processing on the data. For the encoder, each bit is simply +passed through directly. For the dummy decoder, the input data are +floats, so -1's become 0 and 1's stay as 1, but nothing else is done +to the data. Mainly, these blocks are used for references and to make +it easy to compare implementations with and without codes by easily +dropping in these objects instead of restructuring the entire +flowgraph. The ber_curve_gen.grc example file uses the dummy codes to +show the curve to compare against the actual codes. + +Although mentioned in the convolutional coder and decoder classes, it +is worth another mention. The cc_encoder is a generic convolutional +encoder that can take any value of K, rate, and polynomials to encode +a data stream. However, the cc_decoder is not as general, even though +it is technically parameterized as such. The cc_decoder block +currently <i>only</i> uses K=7, rate=2, and two polynomials (because +the rate is two). We can, in fact, alter the polynomials, but a +default of [109, 79] is typically. Eventually, we will make this block +more generic for different rates and constraint lengths and take this +particular code implementation as the set CCSDS decoder, much like we +have the ccsds_encoder class. + + +\subsection fec_parallelism Parallelism + +The code variables in GNU Radio Companion have the ability to create +multiple encoder/decoder variables by selecting the level of +parallelism. It is up the encoder to understand how to handle the +parallelism. The following discussion explains the difference between +the two levels and how and when to use. Generally, normal applications +will just use a single level of parallelism. + +The GRC variable declarations for the different coders has a setting +for <i>Parallelism</i>, which can be either 1 or 2. If set to 1, then +the resulting variable is a list of coder blocks with the same +settings. If set to 2, then the resulting variable is a list of lists +of coder blocks. The code that accepts these variables must understand +how to handle the parallelism. Most applications would set this to 1. + +The standard fec.extended_encoder ("FEC Extended Encoder" in GRC) and +fec.extended_decoder ("FEC Extended Decoder" in GRC) can handle a +Parallelism of 1. They accept a list of coder variables as defined by +Dimension 1 and can multithread the application based on the +"Threading Type" setting: + +\li <b>None</b>: does no parallel threading of the coders. Even if +Dimension 1 is > 1, the encoder/decoder will ignore this setting and +only use the first object in the list. + +\li <b>Ordinary</b>: all "Dimension 1" number (N) of encoder/decoder +blocks will be used in parallel. The hier_block2 will block +deinterleave the packets into N streams (using +gr::blocks::deinterleave with a value of blocksize as the frame length +and no relative rate changes) and pass these to each of the N coders +to process the frames in parallel. The output of each coder is then +interleaved back together to make a single output stream. + +\li <b>Capillary</b>: all "Dimension 1" number (N) of encoder/decoder +blocks will be used in parallel, much like in the <b>Ordinary</b> +mode. In this mode, however, the frames get split up in a tree-like +fashion, where each branch launches 2 more branches. This means that N +must be a factor of 2 for this mode to work. It tends to handle the +load of the encoders/decoders better than the <b>Ordinary</b> mode. + +Note that the threading modes only work when using constant-length +frames. If using the coders in tagged stream mode where the frame +lengths may change, the <b>Ordinary</b> and <b>Capillary</b> modes are +not available. + +The GRC example "ber_curve_gen.grc" uses a Parallelism of 2. This +creates a list of lists of coders. The first dimension of the list +corresponds to the number of Es/N0 values being used in the BER +simulation. This allows the application to process all values of Es/N0 +simultaneously. Dimension 2 in this case allows the same concept of +parallelism discussed above with the <b>None</b>, <b>Ordinary</b>, and +<b>Capillary</b> models of threading. + + +\section fec_api The API of the FECAPI + +The FECAPI defined by the parent generic_encoder and generic_decoder +classes defines a set of virtual functions, some pure virtual, to +allow the encoders/decoders to interact with the GNU Radio blocks. See +the associated documentation of the generic_encoder and +generic_decoder classes to know more about each of the API functions, +some of which a child class is <i>required</i> to implement. + +The functions of the encoder and decoder are: + +\li double gr::fec::generic_encoder::rate() +\li int gr::fec::generic_encoder::get_input_size() +\li int gr::fec::generic_encoder::get_output_size() +\li int gr::fec::generic_encoder::get_history() +\li float gr::fec::generic_encoder::get_shift() +\li const char* gr::fec::generic_encoder::get_input_conversion() +\li const char* gr::fec::generic_encoder::get_output_conversion() +\li bool gr::fec::generic_encoder::set_frame_size(unsigned int frame_size) + +Note: there is no get_input_item_size (or output) as the encoders +always expect to work on bits. + +\li double gr::fec::generic_decoder::rate() +\li int gr::fec::generic_decoder::get_input_size() +\li int gr::fec::generic_decoder::get_output_size() +\li int gr::fec::generic_decoder::get_history() +\li float gr::fec::generic_decoder::get_shift() +\li int gr::fec::generic_decoder::get_input_item_size() +\li int gr::fec::generic_decoder::get_output_item_size() +\li const char* gr::fec::generic_decoder::get_input_conversion() +\li const char* gr::fec::generic_decoder::get_output_conversion() +\li bool gr::fec::generic_decoder::set_frame_size(unsigned int frame_size) + +Whenever an FECAPI object refers to the frame size, it always means +the number of bits in the uncoded frame. This means the number of bits +going into an encoder and the number of bits coming out of a decoder. + +\section fec_examples FEC Examples + +\li ber_curve_gen.grc +\li ber_test.grc +\li fecapi_decoders.grc +\li fecapi_encoders.grc +\li fecapi_tagged_decoders.grc +\li fecapi_tagged_encoders.grc +\li fecapi_async_decoders.grc +\li fecapi_async_encoders.grc +\li fecapi_async_to_stream.grc + */ diff --git a/gr-fec/examples/CMakeLists.txt b/gr-fec/examples/CMakeLists.txt new file mode 100644 index 0000000000..b203e9cc8b --- /dev/null +++ b/gr-fec/examples/CMakeLists.txt @@ -0,0 +1,36 @@ +# 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. + +include(GrPython) + +install( + FILES + ber_test.grc + ber_curve_gen.grc + fecapi_decoders.grc + fecapi_encoders.grc + fecapi_async_decoders.grc + fecapi_async_encoders.grc + fecapi_async_to_stream.grc + fecapi_async_packed_decoders.grc + fecapi_tagged_decoders.grc + fecapi_tagged_encoders.grc + DESTINATION ${GR_PKG_FEC_EXAMPLES_DIR} + COMPONENT "fec_python" +) diff --git a/gr-fec/examples/ber_curve_gen.grc b/gr-fec/examples/ber_curve_gen.grc new file mode 100644 index 0000000000..455dca4cf5 --- /dev/null +++ b/gr-fec/examples/ber_curve_gen.grc @@ -0,0 +1,1633 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 13 19:32:00 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>ber_curve_gen</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>35000000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 99)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(16, 370)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[79, 109]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(110, 371)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(249, 373)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>framebits</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>4096</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(160, 101)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>esno_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>numpy.arange(0, 8, .5) </value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(13, 193)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(594, 604)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(592, 455)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(301, 455)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(13, 451)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(15, 705)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>2</value> + </param> + <param> + <key>dim1</key> + <value>len(esno_0)</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(301, 626)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_bercurve_generator</key> + <param> + <key>id</key> + <value>fec_bercurve_generator_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>esno</key> + <value>esno_0</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate_0</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_dummy</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_dummy</value> + </param> + <param> + <key>puncpat</key> + <value>'11'</value> + </param> + <param> + <key>threadtype</key> + <value>"capillary"</value> + </param> + <param> + <key>seed</key> + <value>-100</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(481, 9)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <bus_source>1</bus_source> + </block> + <block> + <key>fec_bercurve_generator</key> + <param> + <key>id</key> + <value>fec_bercurve_generator_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>esno</key> + <value>esno_0</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate_0</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_rep</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_rep</value> + </param> + <param> + <key>puncpat</key> + <value>'11'</value> + </param> + <param> + <key>threadtype</key> + <value>"capillary"</value> + </param> + <param> + <key>seed</key> + <value>-100</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(481, 132)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <bus_source>1</bus_source> + </block> + <block> + <key>fec_bercurve_generator</key> + <param> + <key>id</key> + <value>fec_bercurve_generator_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>esno</key> + <value>esno_0</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate_0</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_cc</value> + </param> + <param> + <key>puncpat</key> + <value>'11'</value> + </param> + <param> + <key>threadtype</key> + <value>"capillary"</value> + </param> + <param> + <key>seed</key> + <value>-100</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(481, 260)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <bus_source>1</bus_source> + </block> + <block> + <key>qtgui_bercurve_sink</key> + <param> + <key>id</key> + <value>qtgui_bercurve_sink_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>esno</key> + <value>esno_0</value> + </param> + <param> + <key>berminerrors</key> + <value>1000</value> + </param> + <param> + <key>berlimit</key> + <value>-10</value> + </param> + <param> + <key>num_curves</key> + <value>3</value> + </param> + <param> + <key>curvenames</key> + <value>[]</value> + </param> + <param> + <key>ymin</key> + <value>-10</value> + </param> + <param> + <key>ymax</key> + <value>0</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>label1</key> + <value>None</value> + </param> + <param> + <key>width1</key> + <value>2</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>0</value> + </param> + <param> + <key>alpha1</key> + <value>1</value> + </param> + <param> + <key>label2</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width2</key> + <value>2</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>2</value> + </param> + <param> + <key>marker2</key> + <value>1</value> + </param> + <param> + <key>alpha2</key> + <value>1</value> + </param> + <param> + <key>label3</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width3</key> + <value>2</value> + </param> + <param> + <key>color3</key> + <value>"magenta"</value> + </param> + <param> + <key>style3</key> + <value>5</value> + </param> + <param> + <key>marker3</key> + <value>0</value> + </param> + <param> + <key>alpha3</key> + <value>1</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"red"</value> + </param> + <param> + <key>style4</key> + <value>0</value> + </param> + <param> + <key>marker4</key> + <value>0</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"red"</value> + </param> + <param> + <key>style5</key> + <value>0</value> + </param> + <param> + <key>marker5</key> + <value>0</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"red"</value> + </param> + <param> + <key>style6</key> + <value>0</value> + </param> + <param> + <key>marker6</key> + <value>0</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"red"</value> + </param> + <param> + <key>style7</key> + <value>0</value> + </param> + <param> + <key>marker7</key> + <value>0</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"red"</value> + </param> + <param> + <key>style8</key> + <value>0</value> + </param> + <param> + <key>marker8</key> + <value>0</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"red"</value> + </param> + <param> + <key>style9</key> + <value>0</value> + </param> + <param> + <key>marker9</key> + <value>0</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"red"</value> + </param> + <param> + <key>style10</key> + <value>0</value> + </param> + <param> + <key>marker10</key> + <value>0</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(925, 56)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + <bus_sink>1</bus_sink> + </block> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>1</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>2</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>3</source_key> + <sink_key>3</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>4</source_key> + <sink_key>4</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>5</source_key> + <sink_key>5</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>6</source_key> + <sink_key>6</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>7</source_key> + <sink_key>7</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>8</source_key> + <sink_key>8</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>9</source_key> + <sink_key>9</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>10</source_key> + <sink_key>10</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>11</source_key> + <sink_key>11</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>12</source_key> + <sink_key>12</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>13</source_key> + <sink_key>13</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>14</source_key> + <sink_key>14</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>15</source_key> + <sink_key>15</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>16</source_key> + <sink_key>16</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>17</source_key> + <sink_key>17</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>18</source_key> + <sink_key>18</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>19</source_key> + <sink_key>19</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>20</source_key> + <sink_key>20</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>21</source_key> + <sink_key>21</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>22</source_key> + <sink_key>22</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>23</source_key> + <sink_key>23</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>24</source_key> + <sink_key>24</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>25</source_key> + <sink_key>25</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>26</source_key> + <sink_key>26</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>27</source_key> + <sink_key>27</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>28</source_key> + <sink_key>28</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>29</source_key> + <sink_key>29</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>30</source_key> + <sink_key>30</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>31</source_key> + <sink_key>31</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>32</source_key> + <sink_key>96</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>0</source_key> + <sink_key>32</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>1</source_key> + <sink_key>33</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>2</source_key> + <sink_key>34</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>3</source_key> + <sink_key>35</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>4</source_key> + <sink_key>36</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>5</source_key> + <sink_key>37</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>6</source_key> + <sink_key>38</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>7</source_key> + <sink_key>39</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>8</source_key> + <sink_key>40</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>9</source_key> + <sink_key>41</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>10</source_key> + <sink_key>42</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>11</source_key> + <sink_key>43</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>12</source_key> + <sink_key>44</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>13</source_key> + <sink_key>45</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>14</source_key> + <sink_key>46</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>15</source_key> + <sink_key>47</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>16</source_key> + <sink_key>48</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>17</source_key> + <sink_key>49</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>18</source_key> + <sink_key>50</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>19</source_key> + <sink_key>51</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>20</source_key> + <sink_key>52</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>21</source_key> + <sink_key>53</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>22</source_key> + <sink_key>54</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>23</source_key> + <sink_key>55</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>24</source_key> + <sink_key>56</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>25</source_key> + <sink_key>57</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>26</source_key> + <sink_key>58</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>27</source_key> + <sink_key>59</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>28</source_key> + <sink_key>60</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>29</source_key> + <sink_key>61</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>30</source_key> + <sink_key>62</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>31</source_key> + <sink_key>63</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>32</source_key> + <sink_key>97</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>0</source_key> + <sink_key>64</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>1</source_key> + <sink_key>65</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>2</source_key> + <sink_key>66</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>3</source_key> + <sink_key>67</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>4</source_key> + <sink_key>68</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>5</source_key> + <sink_key>69</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>6</source_key> + <sink_key>70</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>7</source_key> + <sink_key>71</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>8</source_key> + <sink_key>72</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>9</source_key> + <sink_key>73</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>10</source_key> + <sink_key>74</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>11</source_key> + <sink_key>75</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>12</source_key> + <sink_key>76</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>13</source_key> + <sink_key>77</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>14</source_key> + <sink_key>78</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>15</source_key> + <sink_key>79</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>16</source_key> + <sink_key>80</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>17</source_key> + <sink_key>81</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>18</source_key> + <sink_key>82</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>19</source_key> + <sink_key>83</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>20</source_key> + <sink_key>84</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>21</source_key> + <sink_key>85</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>22</source_key> + <sink_key>86</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>23</source_key> + <sink_key>87</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>24</source_key> + <sink_key>88</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>25</source_key> + <sink_key>89</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>26</source_key> + <sink_key>90</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>27</source_key> + <sink_key>91</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>28</source_key> + <sink_key>92</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>29</source_key> + <sink_key>93</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>30</source_key> + <sink_key>94</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>31</source_key> + <sink_key>95</sink_key> + </connection> + <connection> + <source_block_id>fec_bercurve_generator_0</source_block_id> + <sink_block_id>qtgui_bercurve_sink_0</sink_block_id> + <source_key>32</source_key> + <sink_key>98</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/ber_test.grc b/gr-fec/examples/ber_test.grc new file mode 100644 index 0000000000..3d3a5510db --- /dev/null +++ b/gr-fec/examples/ber_test.grc @@ -0,0 +1,1538 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Mon May 12 21:49:02 2014</timestamp> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(241, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>berminerrs</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>100</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(433, 12)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>noise</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>numpy.sqrt((10.0**(-esno/10.0))/2.0)</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(428, 93)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(337, 12)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>framebits</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>4096</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(155, 89)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>35000000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 91)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[79, 109]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(290, 91)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_unpacked_to_packed_xx</key> + <param> + <key>id</key> + <value>blocks_unpacked_to_packed_xx_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>bits_per_chunk</key> + <value>1</value> + </param> + <param> + <key>endianness</key> + <value>gr.GR_LSB_FIRST</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(932, 412)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_decoder</key> + <param> + <key>id</key> + <value>fec_extended_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>None</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1026, 258)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1125, 194)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(942, 194)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc</value> + </param> + <param> + <key>threadtype</key> + <value>capillary</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>None</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(628, 163)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(90, 337)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(402, 194)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_fastnoise_source_x</key> + <param> + <key>id</key> + <value>analog_fastnoise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>seed</key> + <value>0</value> + </param> + <param> + <key>samples</key> + <value>8192</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(963, 29)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_add_xx</key> + <param> + <key>id</key> + <value>blocks_add_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1358, 162)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_number_sink</key> + <param> + <key>id</key> + <value>qtgui_number_sink_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>autoscale</key> + <value>True</value> + </param> + <param> + <key>avg</key> + <value>0</value> + </param> + <param> + <key>graph_type</key> + <value>qtgui.NUM_GRAPH_HORIZ</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>min</key> + <value>-10</value> + </param> + <param> + <key>max</key> + <value>10</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>label1</key> + <value>BER</value> + </param> + <param> + <key>color1</key> + <value>("blue", "red")</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>color2</key> + <value>("black", "black")</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>color3</key> + <value>("black", "black")</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>color4</key> + <value>("black", "black")</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>color5</key> + <value>("black", "black")</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>color6</key> + <value>("black", "black")</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>color7</key> + <value>("black", "black")</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>color8</key> + <value>("black", "black")</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>color9</key> + <value>("black", "black")</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>color10</key> + <value>("black", "black")</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1504, 446)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value>QT GUI Plot</value> + </param> + <param> + <key>size</key> + <value>1024</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1.25</value> + </param> + <param> + <key>ymax</key> + <value>1.25</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>3</value> + </param> + <param> + <key>marker1</key> + <value>0</value> + </param> + <param> + <key>alpha1</key> + <value>0.5</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1515, 115)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_ber_bf</key> + <param> + <key>id</key> + <value>fec_ber_bf_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>test_mode</key> + <value>False</value> + </param> + <param> + <key>berminerrors</key> + <value>berminerrs</value> + </param> + <param> + <key>berlimit</key> + <value>-7.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1244, 455)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(89, 186)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(28, 419)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>framebits</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(318, 419)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_qtgui_range</key> + <param> + <key>id</key> + <value>esno</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>EsN0</value> + </param> + <param> + <key>value</key> + <value>15</value> + </param> + <param> + <key>start</key> + <value>0</value> + </param> + <param> + <key>stop</key> + <value>15</value> + </param> + <param> + <key>step</key> + <value>0.25</value> + </param> + <param> + <key>widget</key> + <value>counter_slider</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(614, 535)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>options</key> + <param> + <key>id</key> + <value>ber_test</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_decoder_0</source_block_id> + <sink_block_id>blocks_unpacked_to_packed_xx_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_add_xx_0</source_block_id> + <sink_block_id>fec_extended_decoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>fec_ber_bf_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpacked_to_packed_xx_0_0</source_block_id> + <sink_block_id>fec_ber_bf_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_fastnoise_source_x_0</source_block_id> + <sink_block_id>blocks_add_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_add_xx_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_ber_bf_0</source_block_id> + <sink_block_id>qtgui_number_sink_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_async_decoders.grc b/gr-fec/examples/fecapi_async_decoders.grc new file mode 100644 index 0000000000..42429ec6c7 --- /dev/null +++ b/gr-fec/examples/fecapi_async_decoders.grc @@ -0,0 +1,2153 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 20 15:23:14 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_async_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(264, 535)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(308, 600)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 536)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(785, 473)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(171, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(282, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(366, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(109, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(599, 538)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(598, 636)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(364, 143)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(69, 281)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(411, 239)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1,1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(409, 311)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(781, 538)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(781, 651)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(137, 354)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(420, 430)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>512</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Decoded</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Input</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1059, 368)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_decoder</key> + <param> + <key>id</key> + <value>fec_async_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>decoder</key> + <value>dec_cc</value> + </param> + <param> + <key>packed</key> + <value>False</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(852, 142)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(860, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(865, 308)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(601, 375)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(60, 140)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(50, 502)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(401, 510)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(401, 687)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_ccsds_encoder_def</key> + <param> + <key>id</key> + <value>enc_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(992, 537)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_encoder</key> + <param> + <key>id</key> + <value>fec_async_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder</key> + <value>enc_ccsds</value> + </param> + <param> + <key>packed</key> + <value>False</value> + </param> + <param> + <key>rev_unpack</key> + <value>True</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(600, 143)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>1024</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>1</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(639, 250)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(408, 375)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_async_decoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0_0</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id> + <sink_block_id>fec_async_encoder_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_1</source_block_id> + <sink_block_id>fec_async_decoder_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>fec_async_encoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_async_encoders.grc b/gr-fec/examples/fecapi_async_encoders.grc new file mode 100644 index 0000000000..3dd0d0f8fe --- /dev/null +++ b/gr-fec/examples/fecapi_async_encoders.grc @@ -0,0 +1,1591 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Mon May 19 16:19:57 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_async_encoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(421, 102)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(396, 166)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(354, 102)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(171, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(282, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(366, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(61, 140)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(577, 297)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value>QT GUI Plot</value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>1</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>2</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1226, 359)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(950, 400)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(43, 436)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(57, 219)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(58, 273)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(100, 345)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(378, 490)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(575, 490)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(575, 570)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(686, 148)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_STREAMING</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(489, 69)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(686, 69)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_encoder</key> + <param> + <key>id</key> + <value>fec_async_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder</key> + <value>enc_cc</value> + </param> + <param> + <key>packed</key> + <value>False</value> + </param> + <param> + <key>rev_unpack</key> + <value>True</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(349, 296)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(804, 273)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1034, 297)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(331, 376)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(553, 384)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id> + <sink_block_id>fec_async_encoder_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_0</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>fec_async_encoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_async_packed_decoders.grc b/gr-fec/examples/fecapi_async_packed_decoders.grc new file mode 100644 index 0000000000..8d1affe628 --- /dev/null +++ b/gr-fec/examples/fecapi_async_packed_decoders.grc @@ -0,0 +1,1839 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 20 15:19:00 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_async_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(785, 473)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 536)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(308, 600)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(264, 535)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(171, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(282, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(366, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(109, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(50, 502)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(60, 140)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(781, 538)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(781, 651)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(865, 308)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(860, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(93, 328)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(362, 429)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(408, 190)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(544, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1,1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(379, 280)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(583, 367)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>512</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>140</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Decoded</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Input</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1059, 368)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(598, 636)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(599, 538)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(401, 510)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(402, 687)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(363, 112)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(372, 367)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_ccsds_encoder_def</key> + <param> + <key>id</key> + <value>enc_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1032, 503)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_encoder</key> + <param> + <key>id</key> + <value>fec_async_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder</key> + <value>enc_cc</value> + </param> + <param> + <key>packed</key> + <value>True</value> + </param> + <param> + <key>rev_unpack</key> + <value>True</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(599, 112)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_decoder</key> + <param> + <key>id</key> + <value>fec_async_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>decoder</key> + <value>dec_cc</value> + </param> + <param> + <key>packed</key> + <value>True</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(851, 111)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>note</key> + <param> + <key>id</key> + <value>note_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>note</key> + <value>When using CCSDS encoder, turn Rev. Unpacking to Off/False in the Async Decoder</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1034, 617)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_async_decoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_1</source_block_id> + <sink_block_id>fec_async_decoder_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>fec_async_encoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id> + <sink_block_id>fec_async_encoder_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_async_to_stream.grc b/gr-fec/examples/fecapi_async_to_stream.grc new file mode 100644 index 0000000000..78a6e50c84 --- /dev/null +++ b/gr-fec/examples/fecapi_async_to_stream.grc @@ -0,0 +1,2081 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 20 15:21:44 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_async_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(264, 535)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(308, 600)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 536)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(171, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(282, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(366, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(61, 140)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(109, 224)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(83, 279)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_tagged_stream_to_pdu</key> + <param> + <key>id</key> + <value>blocks_tagged_stream_to_pdu_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(83, 369)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>digital_crc32_async_bb</key> + <param> + <key>id</key> + <value>digital_crc32_async_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>check</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(101, 441)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(50, 502)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1,1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(713, 279)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(452, 354)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_pdu_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_pdu_to_tagged_stream_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>tag</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(400, 252)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(598, 509)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(598, 588)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(780, 509)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(782, 603)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>512</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>140</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Input</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Dummy</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1364, 167)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(707, 188)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>5120</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-2</value> + </param> + <param> + <key>ymax</key> + <value>2</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Input</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Dummy</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(865, 58)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_decoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_cc</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(875, 164)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(400, 684)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>8000</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(401, 510)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>1</value> + </param> + <param> + <key>l</key> + <value>8</value> + </param> + <param> + <key>len_tag_key</key> + <value>pkt_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(925, 309)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1200, 191)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_crc32_bb</key> + <param> + <key>id</key> + <value>digital_crc32_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>check</key> + <value>True</value> + </param> + <param> + <key>lengthtagname</key> + <value>pkt_len</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1214, 332)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_async_encoder</key> + <param> + <key>id</key> + <value>fec_async_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder</key> + <value>enc_cc</value> + </param> + <param> + <key>packed</key> + <value>True</value> + </param> + <param> + <key>rev_unpack</key> + <value>True</value> + </param> + <param> + <key>rev_pack</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(429, 148)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_tagged_stream_to_pdu_0</source_block_id> + <sink_block_id>digital_crc32_async_bb_0</sink_block_id> + <source_key>pdus</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>digital_crc32_async_bb_0</source_block_id> + <sink_block_id>fec_async_encoder_0</sink_block_id> + <source_key>out</source_key> + <sink_key>in</sink_key> + </connection> + <connection> + <source_block_id>fec_async_encoder_0</source_block_id> + <sink_block_id>blocks_pdu_to_tagged_stream_0</sink_block_id> + <source_key>out</source_key> + <sink_key>pdus</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_tagged_stream_to_pdu_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_crc32_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_pdu_to_tagged_stream_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>fec_extended_tagged_decoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_decoder_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0_0</source_block_id> + <sink_block_id>digital_crc32_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_cc_decoders.grc b/gr-fec/examples/fecapi_cc_decoders.grc new file mode 100644 index 0000000000..26f5b03a91 --- /dev/null +++ b/gr-fec/examples/fecapi_cc_decoders.grc @@ -0,0 +1,1316 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Mon May 12 22:11:14 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_cc_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>3000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(9, 95)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>value</key> + <value>[79, 109]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(363, 697)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(304, 615)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(221, 700)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(405, 612)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(420, 9)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(102, 328)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(57, 525)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[1, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(59, 200)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>60</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(249, 7)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>threadtype</key> + <value>ordinary</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>None</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(425, 399)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_decoder</key> + <param> + <key>id</key> + <value>fec_extended_decoder_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_cc</value> + </param> + <param> + <key>threadtype</key> + <value>capillary</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>None</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1153, 391)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(923, 430)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(740, 429)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1462, 432)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(552, 13)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value>QT GUI Plot</value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Dummy Code</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CCSDS</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1763, 317)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(501, 616)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(797, 614)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(105, 430)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(450, 299)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_decoder_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>fec_extended_decoder_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_decoders.grc b/gr-fec/examples/fecapi_decoders.grc new file mode 100644 index 0000000000..5b4f323f77 --- /dev/null +++ b/gr-fec/examples/fecapi_decoders.grc @@ -0,0 +1,1983 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 20 13:32:56 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>3000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 74)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(58, 562)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(123, 562)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(98, 623)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(171, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(280, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(361, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(553, 562)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TAILBITING</value> + </param> + <param> + <key>padding</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(174, 688)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_ccsds_encoder_def</key> + <param> + <key>id</key> + <value>enc_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TAILBITING</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(189, 562)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_decoder</key> + <param> + <key>id</key> + <value>fec_extended_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_cc</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(842, 401)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_ccsds</value> + </param> + <param> + <key>threadtype</key> + <value>capillary</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(321, 409)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(545, 425)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(684, 425)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_decoder</key> + <param> + <key>id</key> + <value>fec_extended_decoder_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_dummy</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(842, 213)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_1_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_dummy</value> + </param> + <param> + <key>threadtype</key> + <value>capillary</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(321, 221)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(543, 237)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(680, 237)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_decoder</key> + <param> + <key>id</key> + <value>fec_extended_decoder_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_rep</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(842, 306)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(682, 330)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(545, 330)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_rep</value> + </param> + <param> + <key>threadtype</key> + <value>capillary</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(321, 314)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(56, 139)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(116, 371)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(54, 464)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(99, 267)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>4</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(553, 674)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1067, 330)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1064, 237)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1064, 425)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>4</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Input</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Dummy</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value>Rep. (Rate=3)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value>CCSDS</value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1292, 178)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(322, 152)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(371, 562)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(371, 656)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_char_to_float_0_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>3</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_1_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_1_0</source_block_id> + <sink_block_id>digital_map_bb_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_2</source_block_id> + <sink_block_id>fec_extended_decoder_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_2_0</source_block_id> + <sink_block_id>fec_extended_decoder_0_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_1_0_0</source_block_id> + <sink_block_id>digital_map_bb_0_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_0_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_2_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0</source_block_id> + <sink_block_id>fec_extended_decoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_1</source_block_id> + <sink_block_id>digital_map_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_decoder_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_decoder_0_1_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_decoder_0_1</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_encoders.grc b/gr-fec/examples/fecapi_encoders.grc new file mode 100644 index 0000000000..683ff476a7 --- /dev/null +++ b/gr-fec/examples/fecapi_encoders.grc @@ -0,0 +1,1696 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Sat May 17 17:08:36 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_encoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(67, 488)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(92, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(24, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>60</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(170, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(279, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(372, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>(frame_size/15)*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(17, 139)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(52, 221)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(63, 268)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(20, 320)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(158, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_ccsds_encoder_def</key> + <param> + <key>id</key> + <value>enc_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(356, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(549, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>frame_size*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(747, 424)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(567, 231)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(567, 309)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(568, 154)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(347, 293)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_rep</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(347, 138)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_encoder</key> + <param> + <key>id</key> + <value>fec_extended_encoder_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_ccsds</value> + </param> + <param> + <key>threadtype</key> + <value>none</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(347, 215)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>packet_len</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(760, 130)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>2</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>CCSDS</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(762, 250)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_encoder_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_0_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_1</source_block_id> + <sink_block_id>blocks_char_to_float_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_encoder_0</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_tagged_decoders.grc b/gr-fec/examples/fecapi_tagged_decoders.grc new file mode 100644 index 0000000000..8bae5bd249 --- /dev/null +++ b/gr-fec/examples/fecapi_tagged_decoders.grc @@ -0,0 +1,2106 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Tue May 20 15:45:42 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_tagged_decoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>3000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(72, 584)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(97, 520)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>length_tag</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"packet_len"</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(101, 73)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(30, 520)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(365, 759)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(211, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>MTU</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>MTU</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(291, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(371, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(487, 12)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(12, 142)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>4*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(149, 152)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(365, 168)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 160)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_decoder_def</key> + <param> + <key>id</key> + <value>dec_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(561, 614)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(561, 519)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_decoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_decoder_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_cc</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(991, 440)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1257, 464)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1256, 363)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(813, 443)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(811, 363)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_decoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_dummy</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(990, 238)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>3</value> + </param> + <param> + <key>update_time</key> + <value>0.01</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value></value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_NORM</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.1</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>None</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Rep (Rate=3)</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>label3</key> + <value>CC (K=7, Rate=2)</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1465, 333)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(1258, 262)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(810, 284)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_decoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_decoder_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>fec_extended_decoder</value> + </param> + <param> + <key>decoder_list</key> + <value>dec_rep</value> + </param> + <param> + <key>ann</key> + <value>None</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(991, 339)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(673, 284)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_dummy</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 268)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>packet_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(64, 276)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(674, 363)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>[-1, 1]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(674, 443)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 427)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_rep</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(332, 347)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(362, 519)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>0</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(166, 519)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_decoder_def</key> + <param> + <key>id</key> + <value>dec_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>rep</key> + <value>rep</value> + </param> + <param> + <key>prob</key> + <value>0.5</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(362, 631)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_cc_decoder_def</key> + <param> + <key>id</key> + <value>dec_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>state_end</key> + <value>-1</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>padding</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(166, 693)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_decoder_0_1</source_block_id> + <sink_block_id>blocks_char_to_float_1_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_decoder_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_1</source_block_id> + <sink_block_id>fec_extended_tagged_decoder_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>fec_extended_tagged_decoder_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_decoder_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_2</source_block_id> + <sink_block_id>fec_extended_tagged_decoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_1</source_block_id> + <sink_block_id>blocks_char_to_float_1_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_0</source_block_id> + <sink_block_id>digital_map_bb_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_0_0</source_block_id> + <sink_block_id>digital_map_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_0_1</source_block_id> + <sink_block_id>digital_map_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/examples/fecapi_tagged_encoders.grc b/gr-fec/examples/fecapi_tagged_encoders.grc new file mode 100644 index 0000000000..2617593b26 --- /dev/null +++ b/gr-fec/examples/fecapi_tagged_encoders.grc @@ -0,0 +1,2613 @@ +<?xml version='1.0' encoding='ASCII'?> +<flow_graph> + <timestamp>Sat May 17 17:13:34 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>fecapi_tagged_encoders</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value></value> + </param> + <param> + <key>author</key> + <value></value> + </param> + <param> + <key>description</key> + <value></value> + </param> + <param> + <key>window_size</key> + <value>2000,2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 9)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>k</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>7</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(20, 548)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>2</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(86, 548)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>polys</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>[109, 79]</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(61, 610)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>50000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(11, 72)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>length_tag</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"packet_len"</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(100, 72)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>puncpat</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value></value> + </param> + <param> + <key>value</key> + <value>'11'</value> + </param> + <param> + <key>type</key> + <value>string</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(211, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>MTU</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>MTU</value> + </param> + <param> + <key>value</key> + <value>1000</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(292, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>parameter</key> + <param> + <key>id</key> + <value>frame_size</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Frame Size</value> + </param> + <param> + <key>value</key> + <value>30</value> + </param> + <param> + <key>type</key> + <value>intx</value> + </param> + <param> + <key>short_id</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(373, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_ctrlport_monitor_performance</key> + <param> + <key>id</key> + <value>blocks_ctrlport_monitor_performance_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>en</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(482, 12)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_vector_source_x</key> + <param> + <key>id</key> + <value>blocks_vector_source_x_0_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vector</key> + <value>4*[0, 0, 1, 0, 3, 0, 7, 0, 15, 0, 31, 0, 63, 0, 127]</value> + </param> + <param> + <key>tags</key> + <value>[]</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(65, 137)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(65, 218)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_stream_to_tagged_stream</key> + <param> + <key>id</key> + <value>blocks_stream_to_tagged_stream_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>packet_len</key> + <value>frame_size</value> + </param> + <param> + <key>len_tag_key</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(65, 267)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_repack_bits_bb</key> + <param> + <key>id</key> + <value>blocks_repack_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>l</key> + <value>1</value> + </param> + <param> + <key>len_tag_key</key> + <value>packet_len</value> + </param> + <param> + <key>align_output</key> + <value>False</value> + </param> + <param> + <key>swap</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(71, 333)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_3</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value>3,0,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>packet_len</value> + </param> + <param> + <key>label1</key> + <value>CC</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(819, 378)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value>2,0,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>packet_len</value> + </param> + <param> + <key>label1</key> + <value>CCSDS</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(819, 282)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value>1,0,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>packet_len</value> + </param> + <param> + <key>label1</key> + <value>Rep (Rate=3)</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(819, 185)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(643, 374)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_3</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_cc</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(376, 358)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(643, 295)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_ccsds</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(376, 279)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(642, 216)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_rep</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(376, 200)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_1_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(643, 137)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>fec_extended_tagged_encoder</key> + <param> + <key>id</key> + <value>fec_extended_tagged_encoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>encoder_list</key> + <value>enc_dummy</value> + </param> + <param> + <key>puncpat</key> + <value>puncpat</value> + </param> + <param> + <key>lentagname</key> + <value>length_tag</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(376, 121)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>2048</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-0.5</value> + </param> + <param> + <key>ymax</key> + <value>1.5</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value>0,0,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>packet_len</value> + </param> + <param> + <key>label1</key> + <value>None</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>CC</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>0.6</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(819, 88)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>1000</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(53, 447)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>variable_cc_encoder_def</key> + <param> + <key>id</key> + <value>enc_cc</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>k</key> + <value>k</value> + </param> + <param> + <key>rate</key> + <value>rate</value> + </param> + <param> + <key>polys</key> + <value>polys</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(153, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_repetition_encoder_def</key> + <param> + <key>id</key> + <value>enc_rep</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>rep</key> + <value>3</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(541, 611)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_ccsds_encoder_def</key> + <param> + <key>id</key> + <value>enc_ccsds</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>4</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>state_start</key> + <value>0</value> + </param> + <param> + <key>mode</key> + <value>fec.CC_TERMINATED</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(349, 595)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_dummy_encoder_def</key> + <param> + <key>id</key> + <value>enc_dummy</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>"ok"</value> + </param> + <param> + <key>ndim</key> + <value>1</value> + </param> + <param> + <key>dim1</key> + <value>1</value> + </param> + <param> + <key>dim2</key> + <value>1</value> + </param> + <param> + <key>framebits</key> + <value>MTU*8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(738, 627)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_vector_source_x_0_1_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_stream_to_tagged_stream_0_0</source_block_id> + <sink_block_id>blocks_repack_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_stream_to_tagged_stream_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_3</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_repack_bits_bb_0</source_block_id> + <sink_block_id>fec_extended_tagged_encoder_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_3</source_block_id> + <sink_block_id>blocks_char_to_float_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_2</source_block_id> + <sink_block_id>blocks_char_to_float_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_1</source_block_id> + <sink_block_id>blocks_char_to_float_1_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>fec_extended_tagged_encoder_0</source_block_id> + <sink_block_id>blocks_char_to_float_1_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1</source_block_id> + <sink_block_id>qtgui_time_sink_x_3</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_1_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-fec/grc/fec_async_decoder.xml b/gr-fec/grc/fec_async_decoder.xml new file mode 100644 index 0000000000..30bf0d1f92 --- /dev/null +++ b/gr-fec/grc/fec_async_decoder.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<block> + <name>FEC Async Decoder</name> + <key>fec_async_decoder</key> + <import>from gnuradio import fec</import> + <make>fec.async_decoder($decoder, $packed, $rev_pack)</make> + + <param> + <name>Decoder Obj.</name> + <key>decoder</key> + <type>raw</type> + </param> + + <param> + <name>Packed</name> + <key>packed</key> + <value>False</value> + <type>enum</type> + <hide>part</hide> + <option> + <name>No</name> + <key>False</key> + </option> + <option> + <name>Yes</name> + <key>True</key> + </option> + </param> + + <param> + <name>Rev. Packing</name> + <key>rev_pack</key> + <value>True</value> + <type>enum</type> + <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </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/grc/fec_async_encoder.xml b/gr-fec/grc/fec_async_encoder.xml new file mode 100644 index 0000000000..55b1acd707 --- /dev/null +++ b/gr-fec/grc/fec_async_encoder.xml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<block> + <name>FEC Async Encoder</name> + <key>fec_async_encoder</key> + <import>from gnuradio import fec</import> + <make>fec.async_encoder($encoder, $packed, $rev_unpack, $rev_pack)</make> + + <param> + <name>Encoder Obj.</name> + <key>encoder</key> + <type>raw</type> + </param> + + <param> + <name>Packed</name> + <key>packed</key> + <value>False</value> + <type>enum</type> + <hide>part</hide> + <option> + <name>No</name> + <key>False</key> + </option> + <option> + <name>Yes</name> + <key>True</key> + </option> + </param> + + <param> + <name>Rev. Unpacking</name> + <key>rev_unpack</key> + <value>True</value> + <type>enum</type> + <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + + <param> + <name>Rev. Packing</name> + <key>rev_pack</key> + <value>True</value> + <type>enum</type> + <hide>#if $packed() == 'True' then 'part' else 'all'#</hide> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </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/grc/fec_ber_bf.xml b/gr-fec/grc/fec_ber_bf.xml new file mode 100644 index 0000000000..6d8d85e9ff --- /dev/null +++ b/gr-fec/grc/fec_ber_bf.xml @@ -0,0 +1,54 @@ +<?xml version="1.0"?> +<block> + <name>BER</name> + <key>fec_ber_bf</key> + <import>from gnuradio import fec</import> + <make>fec.ber_bf($test_mode, $berminerrors, $berlimit)</make> + + <param> + <name>Test Mode</name> + <key>test_mode</key> + <value>False</value> + <type>enum</type> + <option> + <name>False</name> + <key>False</key> + </option> + <option> + <name>True</name> + <key>True</key> + </option> + </param> + + <param> + <name>BER Min. Errors</name> + <key>berminerrors</key> + <value>100</value> + <type>int</type> + <hide>#if $test_mode() then 'part' else 'all'#</hide> + </param> + + <param> + <name>BER Limit</name> + <key>berlimit</key> + <value>-7.0</value> + <type>float</type> + <hide>#if $test_mode() then 'part' else 'all'#</hide> + </param> + + <sink> + <name>in0</name> + <type>byte</type> + </sink> + + <sink> + <name>in1</name> + <type>byte</type> + </sink> + + <source> + <name>out</name> + <type>float</type> + </source> + +</block>
\ No newline at end of file diff --git a/gr-fec/grc/fec_bercurve_generator.xml b/gr-fec/grc/fec_bercurve_generator.xml new file mode 100644 index 0000000000..4d0d47e15b --- /dev/null +++ b/gr-fec/grc/fec_bercurve_generator.xml @@ -0,0 +1,95 @@ +<?xml version="1.0"?> +<!-- +################################################### +## BER Curve Generator +################################################### + --> +<block> + <name>BER Curve Gen.</name> + <key>fec_bercurve_generator</key> + <import>from gnuradio import fec</import> + <import>import numpy</import> + <make>fec.bercurve_generator( + $encoder_list, \#size + $decoder_list, \#name + $esno, \#range of esnos + $samp_rate, \#throttle + $threadtype, \#threading mode + $puncpat, \#puncture pattern + $seed \# noise gen. seed +) + </make> + + <param> + <name>Es/N0</name> + <key>esno</key> + <value>numpy.arange(0.0, 4.0, .5)</value> + <type>raw</type> + </param> + + <param> + <name>Sample Rate</name> + <key>samp_rate</key> + <value>3200000</value> + <type>float</type> + </param> + + <param> + <name>Encoder list</name> + <key>encoder_list</key> + <value>0</value> + <type>raw</type> + </param> + + <param> + <name>Decoder list</name> + <key>decoder_list</key> + <value>0</value> + <type>raw</type> + </param> + + <param> + <name>Puncture Pat.</name> + <key>puncpat</key> + <value>'11'</value> + <type>string</type> + </param> + + <param> + <name>Threading Type</name> + <key>threadtype</key> + <type>enum</type> + <hide>part</hide> + <option> + <name>Capillary</name> + <key>"capillary"</key> + </option> + <option> + <name>Ordinary</name> + <key>"ordinary"</key> + </option> + <option> + <name>None</name> + <key>"none"</key> + </option> + </param> + + <param> + <name>Noise Seed</name> + <key>seed</key> + <value>0</value> + <type>int</type> + <hide>part</hide> + </param> + + <bus_source>1</bus_source> + + <source> + <name>out</name> + <type>byte</type> + <nports>len($esno)*2</nports> + </source> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/fec_block_tree.xml b/gr-fec/grc/fec_block_tree.xml index 1a0d2ec985..c674531e3f 100644 --- a/gr-fec/grc/fec_block_tree.xml +++ b/gr-fec/grc/fec_block_tree.xml @@ -1,14 +1,42 @@ <?xml version="1.0"?> <!-- ################################################### -##Block Tree for gr-fec +## Block Tree for gr-fec ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> - <cat> - <name>Error Coding</name> - <block>fec_decode_ccsds_27_fb</block> - <block>fec_encode_ccsds_27_bb</block> - </cat> + <name></name> <!-- Blank for Root Name --> + <cat> + <name>Error Coding</name> + <cat> + <name>Decoders</name> + <block>variable_cc_decoder_def</block> + <block>variable_repetition_decoder_def</block> + <block>variable_dummy_decoder_def</block> + </cat> + <cat> + <name>Encoders</name> + <block>variable_cc_encoder_def</block> + <block>variable_ccsds_encoder_def</block> + <block>variable_repetition_encoder_def</block> + <block>variable_dummy_encoder_def</block> + </cat> + <block>fec_extended_encoder</block> + <block>fec_extended_async_encoder</block> + <block>fec_extended_tagged_encoder</block> + <block>fec_extended_decoder</block> + <block>fec_extended_tagged_decoder</block> + <block>fec_generic_encoder</block> + <block>fec_generic_decoder</block> + <block>fec_tagged_encoder</block> + <block>fec_tagged_decoder</block> + <block>fec_async_encoder</block> + <block>fec_async_decoder</block> + <block>fec_decode_ccsds_27_fb</block> + <block>fec_encode_ccsds_27_bb</block> + <block>fec_puncture_xx</block> + <block>fec_depuncture_bb</block> + <block>fec_ber_bf</block> + <block>fec_bercurve_generator</block> + </cat> </cat> diff --git a/gr-fec/grc/fec_decode_ccsds_27_fb.xml b/gr-fec/grc/fec_decode_ccsds_27_fb.xml index 4ea2a02bf9..f7bd9d3b5c 100644 --- a/gr-fec/grc/fec_decode_ccsds_27_fb.xml +++ b/gr-fec/grc/fec_decode_ccsds_27_fb.xml @@ -5,16 +5,16 @@ ################################################### --> <block> - <name>Decode CCSDS 27</name> - <key>fec_decode_ccsds_27_fb</key> - <import>from gnuradio import fec</import> - <make>fec.decode_ccsds_27_fb()</make> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> + <name>Decode CCSDS 27</name> + <key>fec_decode_ccsds_27_fb</key> + <import>from gnuradio import fec</import> + <make>fec.decode_ccsds_27_fb()</make> + <sink> + <name>in</name> + <type>float</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> </block> diff --git a/gr-fec/grc/fec_decoder.xml b/gr-fec/grc/fec_decoder.xml new file mode 100644 index 0000000000..dd9d08d5f6 --- /dev/null +++ b/gr-fec/grc/fec_decoder.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<block> + <name>FEC Decoder</name> + <key>fec_generic_decoder</key> + <import>from gnuradio import fec</import> + <make>fec.decoder($decoder, $itype.size, $otype.size)</make> + + <param> + <name>Decoder Object</name> + <key>decoder</key> + <value>decoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Input Type</name> + <key>itype</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + + <param> + <name>Output Type</name> + <key>otype</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + + <sink> + <name>in</name> + <type>$itype</type> + </sink> + + <source> + <name>out</name> + <type>$otype</type> + </source> + + <doc> + This is a GNU Radio adaptor for any FEC decoder following the generic_decoder API in the fec module. Input and output are flexible to accomodate decoders that, say, modulate their encoded results into complex or float types. + </doc> + +</block>
\ No newline at end of file diff --git a/gr-fec/grc/fec_depuncture_bb.xml b/gr-fec/grc/fec_depuncture_bb.xml new file mode 100644 index 0000000000..1a7615d176 --- /dev/null +++ b/gr-fec/grc/fec_depuncture_bb.xml @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<block> + <name>Depuncture</name> + <key>fec_depuncture_bb</key> + <import>from gnuradio import fec</import> + <make>fec.depucture_bb($delay, $puncpat, $puncholes, $puncsize, $sym)</make> + + <param> + <name>Puncture Size</name> + <key>puncsize</key> + <type>int</type> + </param> + + <param> + <name>Puncture Pattern</name> + <key>puncpat</key> + <type>int</type> + </param> + + <param> + <name>Delay</name> + <key>delay</key> + <value>0</value> + <type>int</type> + </param> + + <param> + <name>Symbol</name> + <key>sym</key> + <value>127</value> + <type>int</type> + <hide>part</hide> + </param> + + <sink> + <name>in</name> + <type>float</type> + </sink> + + <source> + <name>out</name> + <type>float</type> + </source> + +</block> diff --git a/gr-fec/grc/fec_encoder.xml b/gr-fec/grc/fec_encoder.xml new file mode 100644 index 0000000000..defb7c3b46 --- /dev/null +++ b/gr-fec/grc/fec_encoder.xml @@ -0,0 +1,91 @@ +<?xml version="1.0"?> +<block> + <name>FEC Encoder</name> + <key>fec_generic_encoder</key> + <import>from gnuradio import fec</import> + <make>fec.encoder($encoder, $itype.size, $otype.size)</make> + + <param> + <name>Constituent Encoder</name> + <key>encoder</key> + <value>encoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Input Type</name> + <key>itype</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + + <param> + <name>Output Type</name> + <key>otype</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>complex</key> + <opt>size:gr.sizeof_gr_complex</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + <option> + <name>Int</name> + <key>int</key> + <opt>size:gr.sizeof_int</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>size:gr.sizeof_short</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + </param> + + <sink> + <name>in</name> + <type>$itype</type> + </sink> + + <source> + <name>out</name> + <type>$otype</type> + </source> + + <doc> + This is a GNU Radio adaptor for any FEC encoder following the generic_encoder API in the fec module. Input and output are flexible to accomodate encoders that, say, modulate their encoded results into complex or float types. + </doc> + +</block>
\ No newline at end of file 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/grc/fec_extended_decoder.xml b/gr-fec/grc/fec_extended_decoder.xml new file mode 100644 index 0000000000..4262a395ae --- /dev/null +++ b/gr-fec/grc/fec_extended_decoder.xml @@ -0,0 +1,72 @@ +<?xml version="1.0"?> +<block> + <name>FEC Extended Decoder</name> + <key>fec_extended_decoder</key> + <import>from gnuradio import fec</import> + <make>self.$(id) = $(id) = fec.extended_decoder(decoder_obj_list=$decoder_list, threading=$threadtype.arg, ann=$ann, puncpat=$puncpat, integration_period=10000)</make> + + <param> + <name>fake val</name> + <key>value</key> + <value>fec_extended_decoder</value> + <type>string</type> + <hide>all</hide> + </param> + + <param> + <name>Decoder Objects</name> + <key>decoder_list</key> + <value>decoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Threading Type</name> + <key>threadtype</key> + <type>enum</type> + <option> + <name>Capillary</name> + <key>capillary</key> + <opt>arg:'capillary'</opt> + </option> + <option> + <name>Ordinary</name> + <key>ordinary</key> + <opt>arg:'ordinary'</opt> + </option> + <option> + <name>None</name> + <key>none</key> + <opt>arg: None</opt> + </option> + </param> + + <param> + <name>Annihilator</name> + <key>ann</key> + <value>None</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>float</type> + </sink> + + <source> + <name>out</name> + <type>byte</type> + </source> + + <doc> + + </doc> + +</block> diff --git a/gr-fec/grc/fec_extended_encoder.xml b/gr-fec/grc/fec_extended_encoder.xml new file mode 100644 index 0000000000..d2a3ec87db --- /dev/null +++ b/gr-fec/grc/fec_extended_encoder.xml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> +<block> + <name>FEC Extended Encoder</name> + <key>fec_extended_encoder</key> + <import>from gnuradio import fec</import> + <make>fec.extended_encoder(encoder_obj_list=$encoder_list, threading=$threadtype.arg, puncpat=$puncpat)</make> + + <param> + <name>Encoder Objects</name> + <key>encoder_list</key> + <value>encoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Threading Type</name> + <key>threadtype</key> + <type>enum</type> + <option> + <name>Capillary</name> + <key>capillary</key> + <opt>arg:'capillary'</opt> + </option> + <option> + <name>Ordinary</name> + <key>ordinary</key> + <opt>arg:'ordinary'</opt> + </option> + <option> + <name>None</name> + <key>none</key> + <opt>arg: None</opt> + </option> + </param> + + <param> + <name>Puncture Pattern</name> + <key>puncpat</key> + <value>'11'</value> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>byte</type> + </sink> + + <source> + <name>out</name> + <type>byte</type> + </source> + + <doc> + + </doc> + +</block> diff --git a/gr-fec/grc/fec_extended_tagged_decoder.xml b/gr-fec/grc/fec_extended_tagged_decoder.xml new file mode 100644 index 0000000000..b198da2158 --- /dev/null +++ b/gr-fec/grc/fec_extended_tagged_decoder.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<block> + <name>FEC Extended Tagged Decoder</name> + <key>fec_extended_tagged_decoder</key> + <import>from gnuradio import fec</import> + <make>self.$(id) = $(id) = fec.extended_tagged_decoder(decoder_obj_list=$decoder_list, ann=$ann, puncpat=$puncpat, integration_period=10000, lentagname=$lentagname)</make> + + <param> + <name>fake val</name> + <key>value</key> + <value>fec_extended_decoder</value> + <type>string</type> + <hide>all</hide> + </param> + + <param> + <name>Decoder Objects</name> + <key>decoder_list</key> + <value>decoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Annihilator</name> + <key>ann</key> + <value>None</value> + <type>raw</type> + </param> + + <param> + <name>Puncture Pattern</name> + <key>puncpat</key> + <value>'11'</value> + <type>string</type> + </param> + + <param> + <name>Length Tag Name</name> + <key>lentagname</key> + <value>None</value> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>float</type> + </sink> + + <source> + <name>out</name> + <type>byte</type> + </source> + + <doc> + + </doc> + +</block> diff --git a/gr-fec/grc/fec_extended_tagged_encoder.xml b/gr-fec/grc/fec_extended_tagged_encoder.xml new file mode 100644 index 0000000000..b5253296e7 --- /dev/null +++ b/gr-fec/grc/fec_extended_tagged_encoder.xml @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<block> + <name>FEC Extended Tagged Encoder</name> + <key>fec_extended_tagged_encoder</key> + <import>from gnuradio import fec</import> + <make>fec.extended_tagged_encoder(encoder_obj_list=$encoder_list, puncpat=$puncpat, lentagname=$lentagname)</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> + + <param> + <name>Length Tag Name</name> + <key>lentagname</key> + <value>None</value> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>byte</type> + </sink> + + <source> + <name>out</name> + <type>byte</type> + </source> + + <doc> + + </doc> + +</block> diff --git a/gr-fec/grc/fec_puncture_xx.xml b/gr-fec/grc/fec_puncture_xx.xml new file mode 100644 index 0000000000..8ad9b0c411 --- /dev/null +++ b/gr-fec/grc/fec_puncture_xx.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> +<block> + <name>Puncture</name> + <key>fec_puncture_xx</key> + <import>from gnuradio import fec</import> + <make>fec.puncture_$(type.fcn)($puncsize, $puncpat, $puncholes, $delay)</make> + + <param> + <name>Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Byte</name> + <key>byte</key> + <opt>fcn:bb</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>fcn:ff</opt> + </option> + </param> + + <param> + <name>Puncture Size</name> + <key>puncsize</key> + <type>int</type> + </param> + + <param> + <name>Puncture Pattern</name> + <key>puncpat</key> + <type>int</type> + </param> + + <param> + <name>Delay</name> + <key>delay</key> + <value>0</value> + <type>int</type> + </param> + + <sink> + <name>in</name> + <type>$type</type> + </sink> + + <source> + <name>out</name> + <type>$type</type> + </source> + +</block> diff --git a/gr-fec/grc/fec_tagged_decoder.xml b/gr-fec/grc/fec_tagged_decoder.xml new file mode 100644 index 0000000000..9f8cf255e3 --- /dev/null +++ b/gr-fec/grc/fec_tagged_decoder.xml @@ -0,0 +1,67 @@ +<?xml version="1.0"?> +<block> + <name>FEC Tagged Decoder</name> + <key>fec_tagged_decoder</key> + <import>from gnuradio import fec</import> + <make>fec.tagged_decoder($decoder, $itype.size, $otype.size, $lentagname)</make> + + <param> + <name>Constituent Decoder</name> + <key>decoder</key> + <value>decoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Input Type</name> + <key>itype</key> + <type>enum</type> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + </param> + + <param> + <name>Output Type</name> + <key>otype</key> + <type>enum</type> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + </param> + + <param> + <name>Length Tag Name</name> + <key>lentagname</key> + <value>"pkt_len"</value> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>$itype</type> + </sink> + + <source> + <name>out</name> + <type>$otype</type> + </source> + + <doc> + </doc> + +</block> diff --git a/gr-fec/grc/fec_tagged_encoder.xml b/gr-fec/grc/fec_tagged_encoder.xml new file mode 100644 index 0000000000..300d1866b9 --- /dev/null +++ b/gr-fec/grc/fec_tagged_encoder.xml @@ -0,0 +1,67 @@ +<?xml version="1.0"?> +<block> + <name>FEC Tagged Encoder</name> + <key>fec_tagged_encoder</key> + <import>from gnuradio import fec</import> + <make>fec.tagged_encoder($encoder, $itype.size, $otype.size, $lentagname)</make> + + <param> + <name>Constituent Encoder</name> + <key>encoder</key> + <value>encoder_variable</value> + <type>raw</type> + </param> + + <param> + <name>Input Type</name> + <key>itype</key> + <type>enum</type> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + </param> + + <param> + <name>Output Type</name> + <key>otype</key> + <type>enum</type> + <option> + <name>Byte</name> + <key>byte</key> + <opt>size:gr.sizeof_char</opt> + </option> + <option> + <name>Float</name> + <key>float</key> + <opt>size:gr.sizeof_float</opt> + </option> + </param> + + <param> + <name>Length Tag Name</name> + <key>lentagname</key> + <value>"pkt_len"</value> + <type>string</type> + </param> + + <sink> + <name>in</name> + <type>$itype</type> + </sink> + + <source> + <name>out</name> + <type>$otype</type> + </source> + + <doc> + </doc> + +</block> diff --git a/gr-fec/grc/variable_cc_decoder_def_list.xml b/gr-fec/grc/variable_cc_decoder_def_list.xml new file mode 100644 index 0000000000..7c72757868 --- /dev/null +++ b/gr-fec/grc/variable_cc_decoder_def_list.xml @@ -0,0 +1,146 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC CC DECODER +################################################### + --> +<block> + <name>CC Decoder Definition</name> + <key>variable_cc_decoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding) +#else if int($ndim())==1 # +self.$(id) = $(id) = map( (lambda a: fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding)), range(0,$dim1) ); #slurp +#else +self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.cc_decoder.make($framebits, $k, $rate, $polys, $state_start, $state_end, $mode, $padding)), range(0,$dim2) ) ), range(0,$dim1)); #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value>0</value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <param> + <name>Constraint Length (K)</name> + <key>k</key> + <value>7</value> + <type>int</type> + </param> + + <param> + <name>Rate Inverse (1/R) (1/2) --> 2</name> + <key>rate</key> + <value>2</value> + <type>int</type> + </param> + + <param> + <name>Polynomials</name> + <key>polys</key> + <value>[79,109]</value> + <type>int_vector</type> + </param> + + <param> + <name>Start State</name> + <key>state_start</key> + <value>0</value> + <type>int</type> + </param> + + <param> + <name>End State</name> + <key>state_end</key> + <value>-1</value> + <type>int</type> + </param> + + <param> + <name>Streaming Behavior</name> + <key>mode</key> + <value></value> + <type>enum</type> + <option> + <name>Streaming</name> + <key>fec.CC_STREAMING</key> + </option> + <option> + <name>Terminated</name> + <key>fec.CC_TERMINATED</key> + </option> + <option> + <name>Tailbiting</name> + <key>fec.CC_TAILBITING</key> + </option> + <option> + <name>Truncated</name> + <key>fec.CC_TRUNCATED</key> + </option> + </param> + + <param> + <name>Byte Padding</name> + <key>padding</key> + <value>False</value> + <type>enum</type> + <option> + <name>No</name> + <key>False</key> + </option> + <option> + <name>Yes</name> + <key>True</key> + </option> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_cc_encoder_def_list.xml b/gr-fec/grc/variable_cc_encoder_def_list.xml new file mode 100644 index 0000000000..1e7aa8ad71 --- /dev/null +++ b/gr-fec/grc/variable_cc_encoder_def_list.xml @@ -0,0 +1,139 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC MAKING FOR GREAT JUSTICE +################################################### + --> +<block> + <name>CC Encoder Definition</name> + <key>variable_cc_encoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding) +#else if int($ndim())==1 # +self.$(id) = $(id) = map( (lambda a: fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding)), range(0,$dim1) ); #slurp +#else +self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.cc_encoder_make($framebits, $k, $rate, $polys, $state_start, $mode, $padding)), range(0,$dim2) ) ), range(0,$dim1)); #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value>0</value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <param> + <name>Constraint Length (K)</name> + <key>k</key> + <value>7</value> + <type>int</type> + </param> + + <param> + <name>Rate Inverse (1/R) (1/2) --> 2</name> + <key>rate</key> + <value>2</value> + <type>int</type> + </param> + + <param> + <name>Polynomials</name> + <key>polys</key> + <value>[79,109]</value> + <type>int_vector</type> + </param> + + <param> + <name>Start State</name> + <key>state_start</key> + <value>0</value> + <type>int</type> + </param> + + <param> + <name>Streaming Behavior</name> + <key>mode</key> + <value></value> + <type>enum</type> + <option> + <name>Streaming</name> + <key>fec.CC_STREAMING</key> + </option> + <option> + <name>Terminated</name> + <key>fec.CC_TERMINATED</key> + </option> + <option> + <name>Tailbiting</name> + <key>fec.CC_TAILBITING</key> + </option> + <option> + <name>Truncated</name> + <key>fec.CC_TRUNCATED</key> + </option> + </param> + + <param> + <name>Byte Padding</name> + <key>padding</key> + <value>False</value> + <type>enum</type> + <option> + <name>No</name> + <key>False</key> + </option> + <option> + <name>Yes</name> + <key>True</key> + </option> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_ccsds_encoder_def_list.xml b/gr-fec/grc/variable_ccsds_encoder_def_list.xml new file mode 100644 index 0000000000..fb0cb05a80 --- /dev/null +++ b/gr-fec/grc/variable_ccsds_encoder_def_list.xml @@ -0,0 +1,103 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC MAKING FOR GREAT JUSTICE +################################################### + --> +<block> + <name>CCSDS Encoder Definition</name> + <key>variable_ccsds_encoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.ccsds_encoder_make($framebits, $state_start, $mode) +#else if int($ndim())==1 # +self.$(id) = $(id) = map( (lambda a: fec.ccsds_encoder_make($framebits, $state_start, $mode)), range(0,$dim1) ); #slurp +#else +self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.ccsds_encoder_make($framebits, $state_start, $mode)), range(0,$dim2) ) ), range(0,$dim1)); #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value>0</value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <param> + <name>Start State</name> + <key>state_start</key> + <value>0</value> + <type>int</type> + </param> + + <param> + <name>Streaming Behavior</name> + <key>mode</key> + <value></value> + <type>enum</type> + <option> + <name>Streaming</name> + <key>fec.CC_STREAMING</key> + </option> + <option> + <name>Terminated</name> + <key>fec.CC_TERMINATED</key> + </option> + <option> + <name>Tailbiting</name> + <key>fec.CC_TAILBITING</key> + </option> + <option> + <name>Truncated</name> + <key>fec.CC_TRUNCATED</key> + </option> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_dummy_decoder_def_list.xml b/gr-fec/grc/variable_dummy_decoder_def_list.xml new file mode 100644 index 0000000000..49728d357f --- /dev/null +++ b/gr-fec/grc/variable_dummy_decoder_def_list.xml @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC DUMMY DECODER +################################################### + --> +<block> + <name>Dummy Decoder Definition</name> + <key>variable_dummy_decoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.dummy_decoder.make($framebits) +#else if int($ndim())==1 # +self.$(id) = $(id) = map((lambda a: fec.dummy_decoder.make($framebits)), range(0,$dim1)) #slurp +#else +self.$(id) = $(id) = map((lambda b: map((lambda a: fec.dummy_decoder.make($framebits)), range(0,$dim2))), range(0,$dim1)) #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value></value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_dummy_encoder_def_list.xml b/gr-fec/grc/variable_dummy_encoder_def_list.xml new file mode 100644 index 0000000000..c2c3f3f995 --- /dev/null +++ b/gr-fec/grc/variable_dummy_encoder_def_list.xml @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC DUMMY ENCODER +################################################### + --> +<block> + <name>Dummy Encoder Definition</name> + <key>variable_dummy_encoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.dummy_encoder_make($framebits) +#else if int($ndim())==1 # +self.$(id) = $(id) = map((lambda a: fec.dummy_encoder_make($framebits)), range(0,$dim1)) #slurp +#else +self.$(id) = $(id) = map((lambda b: map((lambda a: fec.dummy_encoder_make($framebits)), range(0,$dim2))), range(0,$dim1)) #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value>0</value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_repetition_decoder_def_list.xml b/gr-fec/grc/variable_repetition_decoder_def_list.xml new file mode 100644 index 0000000000..eba43f9b06 --- /dev/null +++ b/gr-fec/grc/variable_repetition_decoder_def_list.xml @@ -0,0 +1,87 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC REPETITION DECODER +################################################### + --> +<block> + <name>Repetition Decoder Definition</name> + <key>variable_repetition_decoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.repetition_decoder.make($framebits, $rep, $prob) +#else if int($ndim())==1 # +self.$(id) = $(id) = map( (lambda a: fec.repetition_decoder.make($framebits, $rep, $prob)), range(0,$dim1) ) #slurp +#else +self.$(id) = $(id) = map( (lambda b: map( ( lambda a: fec.repetition_decoder.make($framebits, $rep, $prob)), range(0,$dim2) ) ), range(0,$dim1)) #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value></value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <param> + <name>Repetitions</name> + <key>rep</key> + <value>3</value> + <type>int</type> + </param> + + <param> + <name>a prior prob</name> + <key>prob</key> + <value>0.5</value> + <type>float</type> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/grc/variable_repetition_encoder_def_list.xml b/gr-fec/grc/variable_repetition_encoder_def_list.xml new file mode 100644 index 0000000000..e2668b286c --- /dev/null +++ b/gr-fec/grc/variable_repetition_encoder_def_list.xml @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<!-- +################################################### +# FEC REPETITION ENCODER +################################################### + --> +<block> + <name>Repetition Encoder Definition</name> + <key>variable_repetition_encoder_def</key> + <import>from gnuradio import fec</import> + <var_make> +#if int($ndim())==0 # +self.$(id) = $(id) = fec.repetition_encoder_make($framebits, $rep) +#else if int($ndim())==1 # +self.$(id) = $(id) = map((lambda a: fec.repetition_encoder_make($framebits, $rep)), range(0,$dim1)) #slurp +#else +self.$(id) = $(id) = map((lambda b: map((lambda a: fec.repetition_encoder_make($framebits, $rep)), range(0,$dim2))), range(0,$dim1)) #slurp +#end if</var_make> + <make></make> + + <param> + <name>Ignore Me</name> + <key>value</key> + <value>"ok"</value> + <type>raw</type> + <hide>all</hide> + </param> + + <param> + <name>Parallelism</name> + <key>ndim</key> + <value></value> + <type>enum</type> + <option> + <name>0</name> + <key>0</key> + </option> + <option> + <name>1</name> + <key>1</key> + </option> + <option> + <name>2</name> + <key>2</key> + </option> + </param> + + <param> + <name>Dimension 1</name> + <key>dim1</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 1) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Dimension 2</name> + <key>dim2</key> + <value>1</value> + <type>int</type> + <hide>#if (int($ndim()) >= 2) then 'none' else 'all' #</hide> + </param> + + <param> + <name>Frame Bits</name> + <key>framebits</key> + <value>2048</value> + <type>int</type> + </param> + + <param> + <name>Repetitions</name> + <key>rep</key> + <value>3</value> + <type>int</type> + </param> + + <doc> + </doc> +</block> diff --git a/gr-fec/include/gnuradio/fec/CMakeLists.txt b/gr-fec/include/gnuradio/fec/CMakeLists.txt index a669517b3e..a91a68a996 100644 --- a/gr-fec/include/gnuradio/fec/CMakeLists.txt +++ b/gr-fec/include/gnuradio/fec/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -76,10 +76,30 @@ add_custom_target(fec_generated_includes DEPENDS install(FILES ${generated_includes} api.h + generic_decoder.h + generic_encoder.h + decoder.h + encoder.h + tagged_decoder.h + tagged_encoder.h + async_decoder.h + async_encoder.h + cc_decoder.h + cc_encoder.h + ccsds_encoder.h + dummy_encoder.h + dummy_decoder.h + repetition_encoder.h + repetition_decoder.h decode_ccsds_27_fb.h encode_ccsds_27_bb.h rs.h viterbi.h + ber_bf.h + conv_bit_corr_bb.h + puncture_bb.h + puncture_ff.h + depuncture_bb.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/fec COMPONENT "fec_devel" ) diff --git a/gr-fec/include/gnuradio/fec/async_decoder.h b/gr-fec/include/gnuradio/fec/async_decoder.h new file mode 100644 index 0000000000..05eda2fdbf --- /dev/null +++ b/gr-fec/include/gnuradio/fec/async_decoder.h @@ -0,0 +1,103 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_ASYNC_DECODER_H +#define INCLUDED_FEC_ASYNC_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <gnuradio/block.h> +#include <boost/shared_ptr.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief Creates the decoder block for use in GNU Radio + * flowgraphs from a given FEC API object derived from the + * generic_decoder class. + * \ingroup error_coding_blk + * + * \details + * + * Decodes frames received as async messages over a message + * port. This decoder deployment expects messages of soft decision + * symbols in and can produce either packed, PDU messages (\p + * packed = True) or messages full of unpacked bits (\p packed = + * False). + * + * This decoder works off a full message as one frame or block to + * decode. The message length is used to calculate the frame + * length. To support this, the decoder variable used will have + * had its frame_size set. This block treats that initial + * frame_size value as the maximum transmission unit (MTU) and + * will not process frames larger than that after being decoded. + * + * The packed PDU form of this deployment is designed to work well + * with other PDU-based blocks to operate within the processing + * flow of data packets or frames. + * + * Due to differences in how data is packed and processed, this + * block also offers the ability to change the direction of how + * bits are packed. All inputs messages are one soft decision per + * item. By default, the \p rev_pack mode is set to True. Using + * this setup allows the async block to behave with PDUs in the + * same operation and format as the tagged stream decoders. That + * is, putting the same data into both the tagged stream decoder + * deployment and this with the default setting should produce the + * same data. + * + * Because the block handles data as a full frame per message, + * this decoder deployment cannot work with any decoders that + * require history. For example, the gr::fec::code::cc_decoder + * decoder in streaming mode requires an extra rate*(K-1) bits to + * complete the decoding, so it would have to wait for the next + * message to come in and finish processing. Therefore, the + * streaming mode of the CC decoder is not allowed. The other + * three modes will work with this deployment since the frame is + * self-contained for decoding. + */ + class FEC_API async_decoder : virtual public block + { + public: + typedef boost::shared_ptr<async_decoder> sptr; + + /*! + * Build the PDU-based FEC decoder block from an FECAPI decoder object. + * + * \param my_decoder An FECAPI decoder object child of the generic_decoder class. + * \param packed Sets output to packed bytes if true; otherwise, 1 bit per byte. + * \param rev_pack If packing bits, should they be reversed? + */ + static sptr make(generic_decoder::sptr my_decoder, + bool packed=false, bool rev_pack=true); + + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ASYNC_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/async_encoder.h b/gr-fec/include/gnuradio/fec/async_encoder.h new file mode 100644 index 0000000000..0d31bc401d --- /dev/null +++ b/gr-fec/include/gnuradio/fec/async_encoder.h @@ -0,0 +1,99 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_ASYNC_ENCODER_H +#define INCLUDED_FEC_ASYNC_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_encoder.h> +#include <gnuradio/block.h> +#include <boost/shared_ptr.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief Creates the encoder block for use in GNU Radio + * flowgraphs with async message from a given FEC API object + * derived from the generic_encoder class. + * \ingroup error_coding_blk + * + * \details + * + * Encodes frames received as async messages or as a PDU over a + * message port. This encoder works off a full message as one + * frame or block to encode. The message length is used as the + * frame length. To support this, the encoder variable used will + * have had its frame_size set. This block treats that initial + * frame_size value as the maximum transmission unit (MTU) and + * will not process frames larger than that. + * + * This deployment works off messages and expects them to either + * be messages full of unpacked bits or PDU messages, which means + * full bytes of a frame from the higher layers, including things + * like headers, tails, CRC check bytes, etc. For handling PDUs, + * set the \p packed option of this deployment block to True. The + * block will then use the FEC API to properly unpack the bits + * from the PDU, pass it through the encoder, and repack them to + * output the PDUs for the next stage of processing. + * + * The packed PDU form of this deployment is designed to work well + * with other PDU-based blocks to operate within the processing + * flow of data packets or frames. + * + * Due to differences in how data is packed and processed, this + * block also offers the ability to change the direction of how + * bits are unpacked and packed, where reading or writing from the + * LSB or MSB. By default, the \p rev_unpack and \p rev_pack modes + * are set to True. Using this setup allows the async block to + * behave with PDUs in the same operation and format as the tagged + * stream encoders. That is, putting the same data into both the + * tagged stream encoder deployment and this with these default + * settings should produce the same data. + */ + class FEC_API async_encoder : virtual public block + { + public: + typedef boost::shared_ptr<async_encoder> sptr; + + /*! + * Build the PDU-based FEC encoder block from an FECAPI encoder object. + * + * \param my_encoder An FECAPI encoder object child of the generic_encoder class. + * \param packed True if working on packed bytes (like PDUs). + * \param rev_unpack Reverse the unpacking order from input bytes to bits. + * \param rev_pack Reverse the packing order from bits to output bytes. + */ + static sptr make(generic_encoder::sptr my_encoder, + bool packed=false, + bool rev_unpack=true, bool rev_pack=true); + + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ASYNC_ENCODER_H */ diff --git a/gr-qtgui/lib/NumberDisplayPlot.cc b/gr-fec/include/gnuradio/fec/ber_bf.h index b1fbca9ded..cc42bcebe6 100644 --- a/gr-qtgui/lib/NumberDisplayPlot.cc +++ b/gr-fec/include/gnuradio/fec/ber_bf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2014 Free Software Foundation, Inc. + * Copyright 2013-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,44 +20,33 @@ * Boston, MA 02110-1301, USA. */ -#ifndef NUMBER_DISPLAY_PLOT_C -#define NUMBER_DISPLAY_PLOT_C +#ifndef INCLUDED_FEC_BER_BF_H +#define INCLUDED_FEC_BER_BF_H -#include <gnuradio/qtgui/NumberDisplayPlot.h> +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> -#include <qwt_scale_draw.h> -#include <QColor> -#include <cmath> -#include <iostream> -#include <volk/volk.h> +namespace gr { + namespace fec { -NumberDisplayPlot::NumberDisplayPlot(int nplots, QWidget* parent) - : DisplayPlot(nplots, parent) -{ - resize(0, 0); + /*! + * \brief BER block in FECAPI + * \ingroup error_coding_blk + * + * \details + * + * What does this block do? + */ + class FEC_API ber_bf : virtual public block + { + public: + // gr::fec::ber_bf::sptr + typedef boost::shared_ptr<ber_bf> sptr; - // Setup dataPoints and plot vectors - // Automatically deleted when parent is deleted - for(int i = 0; i < d_nplots; i++) { + static sptr make(bool test_mode = false, int berminerrors=100, float ber_limit=-7.0); + }; - } -} + } /* namespace fec */ +} /* namespace gr */ -NumberDisplayPlot::~NumberDisplayPlot() -{ -} - -void -NumberDisplayPlot::replot() -{ - QwtPlot::replot(); -} - -void -NumberDisplayPlot::plotNewData(const std::vector<double> samples) -{ - if(!d_stop) { - } -} - -#endif /* NUMBER_DISPLAY_PLOT_C */ +#endif /* INCLUDED_FEC_BER_BF_H */ diff --git a/gr-qtgui/include/gnuradio/qtgui/NumberDisplayPlot.h b/gr-fec/include/gnuradio/fec/cc_common.h index 307d806b87..8abf565d4a 100644 --- a/gr-qtgui/include/gnuradio/qtgui/NumberDisplayPlot.h +++ b/gr-fec/include/gnuradio/fec/cc_common.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2014 Free Software Foundation, Inc. + * Copyright 2013-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,35 +20,32 @@ * Boston, MA 02110-1301, USA. */ -#ifndef NUMBER_DISPLAY_PLOT_H -#define NUMBER_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include <gnuradio/qtgui/DisplayPlot.h> -#include <gnuradio/tags.h> -#include <qwt_plot.h> - -/*! - * \brief QWidget for displaying number plots. - * \ingroup qtgui_blk - */ -class NumberDisplayPlot: public DisplayPlot -{ - Q_OBJECT - -public: - NumberDisplayPlot(int nplots, QWidget*); - virtual ~NumberDisplayPlot(); - - void plotNewData(const std::vector<double> samples); - - void replot(); - -public slots: - -private: +#ifndef INCLUDED_FEC_CC_COMMON_H +#define INCLUDED_FEC_CC_COMMON_H + +typedef enum _cc_mode_t { + CC_STREAMING = 0, + CC_TERMINATED, + CC_TRUNCATED, + CC_TAILBITING +} cc_mode_t; + +typedef union { + //decision_t is a BIT vector + unsigned char* t; + unsigned int* w; + unsigned short* s; + unsigned char* c; +} decision_t; + +typedef union { + unsigned char* t; +} metric_t; + +struct v { + unsigned char *metrics; + metric_t old_metrics,new_metrics,metrics1,metrics2; /* Pointers to path metrics, swapped on every bit */ + unsigned char *decisions; }; -#endif /* NUMBER_DISPLAY_PLOT_H */ +#endif /*INCLUDED_FEC_CC_COMMON_H*/ diff --git a/gr-fec/include/gnuradio/fec/cc_decoder.h b/gr-fec/include/gnuradio/fec/cc_decoder.h new file mode 100644 index 0000000000..8f29af98ca --- /dev/null +++ b/gr-fec/include/gnuradio/fec/cc_decoder.h @@ -0,0 +1,144 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_CC_DECODER_H +#define INCLUDED_FEC_CC_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <gnuradio/fec/cc_common.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + typedef void(*conv_kernel)(unsigned char *Y, unsigned char *X, + unsigned char *syms, unsigned char *dec, + unsigned int framebits, unsigned int excess, + unsigned char *Branchtab); + + /*! + * \brief Convolutional Code Decoding class. + * \ingroup error_coding_blk + * + * \details + * This class performs convolutional decoding via the Viterbi + * algorithm. While it is set up to take variable values for K, + * rate, and the polynomials, currently, the block is only + * capable of handling the following settings: + * + * \li K = 7 + * \li rate = 1/2 (given as 2 to the constructor) + * \li polynomials = [109, 79] + * + * This is the well-known convolutional part of the Voyager code + * implemented in the CCSDS encoder. + * + * The intent of having this FECAPI code classes fully + * parameterizable is to eventually allow it to take on generic + * settings, much like the cc_encoder class where the CCSDS + * settings would be a highly-optimized version of this. + * + * The decoder is set up with a number of bits per frame in the + * constructor. When not being used in a tagged stream mode, + * this encoder will only process frames of the length provided + * here. If used in a tagged stream block, this setting becomes + * the maximum allowable frame size that the block may process. + * + * The \p mode is a cc_mode_t that specifies how the convolutional + * encoder will behave and under what conditions. + * + * \li 'CC_STREAMING': mode expects an uninterrupted flow of + * samples into the encoder, and the output stream is + * continually encoded. This mode is the only mode for this + * decoder that has a history requirement because it requires + * rate*(K-1) bits more to finish the decoding properly. This + * mode does not work with any deployments that do not allow + * history. + * + * \li 'CC_TERMINATED': is a mode designed for packet-based + * systems. This mode adds rate*(k-1) bits to the output as a + * way to help flush the decoder. + * + * \li 'CC_TAILBITING': is another packet-based method. Instead of + * adding bits onto the end of the packet, this mode will + * continue the code between the payloads of packets by + * pre-initializing the state of the new packet based on the + * state of the last packet for (k-1) bits. + * + * \li 'CC_TRUNCATED': a truncated code always resets the registers + * to the \p start_state between frames. + * + * A common convolutional encoder uses K=7, Rate=1/2, + * Polynomials=[109, 79]. This is the Voyager code from NASA: + * \li 109: b(1101101) --> 1 + x + x^3 + x^4 + x^6 + * \li 79: b(1001111) --> 1 + x^3 + x^4 + x^5 + x^6 + */ + class FEC_API cc_decoder : virtual public generic_decoder + { + public: + + /*! + * Build a convolutional code decoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + * \param k Constraint length (K) of the encoder. + * \param rate Inverse of the coder's rate + * (rate=2 means 2 output bits per 1 input). + * \param polys Vector of polynomials as integers. + * \param start_state Initialization state of the shift register. + * \param end_state Ending state of the shift register. + * \param mode cc_mode_t mode of the encoding. + * \param padded true if the encoded frame is padded + * to the nearest byte. + */ + static generic_decoder::sptr make + (int frame_size, int k, + int rate, std::vector<int> polys, + int start_state=0, int end_state=-1, + cc_mode_t mode=CC_STREAMING, + bool padded=false); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder. + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CC_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/cc_encoder.h b/gr-fec/include/gnuradio/fec/cc_encoder.h new file mode 100644 index 0000000000..04ce6299d6 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/cc_encoder.h @@ -0,0 +1,140 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_CC_ENCODER_H +#define INCLUDED_FEC_CC_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/encoder.h> +#include <gnuradio/fec/cc_common.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief Convolutional Code Encoding class. + * \ingroup error_coding_blk + * + * \details + * This class performs convolutional encoding for unpacked bits + * for frames of a constant length. This class is general in its + * application of the convolutional encoding and allows us to + * specify the constraint length, the coding rate, and the + * polynomials used in the coding process. + * + * The parameter \p k sets the constraint length directly. We + * set the coding rate by setting \p rate to R given a desired + * rate of 1/R. That is, for a rate 1/2 coder, we would set \p + * rate to 2. And the polynomial is specified as a vector of + * integers, where each integer represents the coding polynomial + * for a different arm of the code. The number of polynomials + * given must be the same as the value \p rate. + * + * The encoding object holds a shift register that takes in each + * bit from the input stream and then ANDs the shift register + * with each polynomial, and places the parity of the result + * into the output stream. The output stream is therefore also + * unpacked bits. + * + * The encoder is set up with a number of bits per frame in the + * constructor. When not being used in a tagged stream mode, + * this encoder will only process frames of the length provided + * here. If used in a tagged stream block, this setting becomes + * the maximum allowable frame size that the block may process. + * + * The \p mode is a cc_mode_t that specifies how the convolutional + * encoder will behave and under what conditions. + * + * \li 'CC_STREAMING': mode expects an uninterrupted flow of + * samples into the encoder, and the output stream is + * continually encoded. + * + * \li 'CC_TERMINATED': is a mode designed for packet-based + * systems. This mode adds rate*(k-1) bits to the output as a + * way to help flush the decoder. + * + * \li 'CC_TAILBITING': is another packet-based method. Instead of + * adding bits onto the end of the packet, this mode will + * continue the code between the payloads of packets by + * pre-initializing the state of the new packet based on the + * state of the last packet for (k-1) bits. + * + * \li 'CC_TRUNCATED': a truncated code always resets the registers + * to the \p start_state between frames. + * + * A common convolutional encoder uses K=7, Rate=1/2, + * Polynomials=[109, 79]. This is the Voyager code from NASA: + * \li 109: b(1101101) --> 1 + x + x^3 + x^4 + x^6 + * \li 79: b(1001111) --> 1 + x^3 + x^4 + x^5 + x^6 + * + * Another encoder class is provided with gr-fec called the + * gr::fec::code::ccsds_encoder, which implements the above code + * that is more highly optimized for just those specific + * settings. + */ + class FEC_API cc_encoder : virtual public generic_encoder + { + public: + + /*! + * Build a convolutional code encoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + * \param k Constraint length (K) of the encoder. + * \param rate Inverse of the coder's rate + * (rate=2 means 2 output bits per 1 input). + * \param polys Vector of polynomials as integers. + * \param start_state Initialization state of the shift register. + * \param mode cc_mode_t mode of the encoding. + * \param padded true if the encoded frame should be padded + * to the nearest byte. + */ + static generic_encoder::sptr make + (int frame_size, int k, int rate, + std::vector<int> polys, int start_state = 0, + cc_mode_t mode=CC_STREAMING, bool padded=false); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder. + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CC_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/ccsds_encoder.h b/gr-fec/include/gnuradio/fec/ccsds_encoder.h new file mode 100644 index 0000000000..9fa364a42e --- /dev/null +++ b/gr-fec/include/gnuradio/fec/ccsds_encoder.h @@ -0,0 +1,117 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_CCSDS_ENCODER_H +#define INCLUDED_FEC_CCSDS_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/encoder.h> +#include <gnuradio/fec/cc_common.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief CCSDS Encoding class for convolutional encoding with + * rate 1/2, K=7, and polynomials [109, 79]. + * \ingroup error_coding_blk + * + * \details + * + * Uses Phil Karn's (KA9Q) implementation of the CCSDS encoder + * for rate 1/2, K=7, and CC polynomial [109, 79]. These are + * non-adjustable in this encoder. For an adjustable CC encoder + * where we can set the rate, constraint length, and polynomial, + * see gr::fec::code::cc_encoder. + * + * The encoder is set up wtih a number of bits per frame in the + * constructor. When not being used in a tagged stream mode, + * this encoder will only process frames of the length provided + * here. If used in a tagged stream block, this setting becomes + * the maximum allowable frame size that the block may process. + * + * The \p mode is a cc_mode_t that specifies how the convolutional + * encoder will behave and under what conditions. + * + * \li 'CC_STREAMING': mode expects an uninterrupted flow of + * samples into the encoder, and the output stream is + * continually encoded. + * + * \li 'CC_TERMINATED': is a mode designed for packet-based + * systems. This mode adds rate*(k-1) bits to the output as a + * way to help flush the decoder. + * + * \li 'CC_TAILBITING': is another packet-based method. Instead of + * adding bits onto the end of the packet, this mode will + * continue the code between the payloads of packets by + * pre-initializing the state of the new packet based on the + * state of the last packet for (k-1) bits. + * + * \li 'CC_TRUNCATED': a truncated code always resets the registers + * to the \p start_state between frames. + * + * A common convolutional encoder uses K=7, Rate=1/2, + * Polynomials=[109, 79]. This is the Voyager code from NASA: + * \li 109: b(1101101) --> 1 + x + x^3 + x^4 + x^6 + * \li 79: b(1001111) --> 1 + x^3 + x^4 + x^5 + x^6 + */ + class FEC_API ccsds_encoder : virtual public generic_encoder + { + public: + + /*! + * Build the CCSDS (rate=1/2, K=7, polys=[109,79] + * convolutional code FECAPI object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + * \param start_state Initialization state of the shift register. + * \param mode cc_mode_t mode of the encoding. + */ + static generic_encoder::sptr make + (int frame_size, int start_state = 0, + cc_mode_t mode=CC_STREAMING); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder. + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CCSDS_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/conv_bit_corr_bb.h b/gr-fec/include/gnuradio/fec/conv_bit_corr_bb.h new file mode 100644 index 0000000000..87ab768fcc --- /dev/null +++ b/gr-fec/include/gnuradio/fec/conv_bit_corr_bb.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_CONV_BIT_CORR_BB_H +#define INCLUDED_FEC_CONV_BIT_CORR_BB_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> +#include <vector> + +namespace gr { + namespace fec { + + /*! + * \brief Correlate block in FECAPI + * \ingroup error_coding_blk + * + * \details + * + * What does this block do? + */ + class FEC_API conv_bit_corr_bb : virtual public block + { + public: + // gr::fec::conv_bit_corr_bb::sptr + typedef boost::shared_ptr<conv_bit_corr_bb> sptr; + + static sptr make(std::vector<unsigned long long> correlator, + int corr_sym, int corr_len, int cut, + int flush, float thresh); + + /*! + * This subroutine will find the encoded data garble rate + * corresponding to a syndrome density of `target', that is created + * with an annihilating polynomial with 'taps' number of taps. + */ + virtual float data_garble_rate(int taps, float syn_density) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CONV_BIT_CORR_BB_H */ diff --git a/gr-fec/include/gnuradio/fec/decoder.h b/gr-fec/include/gnuradio/fec/decoder.h new file mode 100644 index 0000000000..79eeef2197 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/decoder.h @@ -0,0 +1,97 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_DECODER_H +#define INCLUDED_FEC_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <gnuradio/block.h> +#include <boost/shared_ptr.hpp> +#include <boost/shared_array.hpp> +#include <boost/format.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief General FEC decoding block that takes in a decoder + * variable object (derived from gr::fec::general_decoder) for use + * in a flowgraph. + * + * \ingroup error_coding_blk + * + * \details + * This block uses a decoder variable object (derived from + * gr::fec::generic_decoder) to decode data within a + * flowgraph. This block interacts with the general FECAPI + * architecture to handle all passing all input and output data in + * a flowgraph. The decoder variable takes care of understanding + * the requirements, data types and sizes, and boundary conditions + * of the specific FEC decoding algorithm. + * + * Generally, this block is used within the fec.extended_decoder + * Python block to handle some input/output formatting issues. In + * the FECAPI, the decoder variable sets properties like the input + * and output types and sizes and whether the output is packed or + * unpacked bytes. The fec.extended_decoder uses this information + * to set up an gr::hier_block2 structure to make sure the I/O to + * the variable is handled consistently, such as to make sure all + * inputs are floats with one soft symbol per item and the outputs + * are unpacked bytes with the bit in the LSB. + * + * See gr::fec::generic_decoder for detail on what information an + * FECAPI variable object can set if using this block directly and + * not as part of the fec.extended_decoder. + */ + class FEC_API decoder : virtual public block + { + public: + typedef boost::shared_ptr<decoder> sptr; + typedef boost::shared_array<unsigned char> buf_sptr; + + /*! + * Create the FEC decoder block by taking in the FECAPI decoder + * object as well as input and output sizes. + * + * \param my_decoder An FECAPI decoder object (See gr::fec::generic_decoder). + * \param input_item_size The size of the input items (often the my_decoder object can tell us this). + * \param output_item_size The size of the output items (often the my_decoder object can tell us this). + */ + static sptr make(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size); + + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + virtual int fixed_rate_ninput_to_noutput(int ninput) = 0; + virtual int fixed_rate_noutput_to_ninput(int noutput) = 0; + virtual void forecast(int noutput_items, + gr_vector_int& ninput_items_required) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/depuncture_bb.h b/gr-fec/include/gnuradio/fec/depuncture_bb.h new file mode 100644 index 0000000000..de11defd2a --- /dev/null +++ b/gr-fec/include/gnuradio/fec/depuncture_bb.h @@ -0,0 +1,111 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_DEPUNCTURE_BB_H +#define INCLUDED_FEC_DEPUNCTURE_BB_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> + +namespace gr { + namespace fec { + + /*! + * \brief Depuncture a stream of samples. + * \ingroup error_coding_blk + * + * \details + + * Depuncture a given block of input samples of \p puncsize. The + * items produced is based on the pattern \p puncpat. Basically, + * if: + * + * \code + * k = 0 + * if _puncpat[i] == 1: + * out[i] = input[k++] + * else: + * out[i] = symbol # default sym=127 + * \endcode + * + * This block is designed for unpacked bits - that is, every + * input sample is a bit, either a 1 or 0. It's possible to use + * packed bits as symbols, but the depuncturing will be done on + * the symbol level, not the bit level. + * + * \p puncpat is specified as a 32-bit integer that we can + * convert into the vector _puncpat used in the algorithm above: + * + * \code + * _puncpat = [0,...] + * for i in puncsize: + * _puncpat[i] = puncpat >> (puncsize-1-i) + * \endcode + * + * Example: + * \code + * puncsize = 8 + * puncpat = 0xEF --> [1,1,1,0,1,1,1,1] + * input = [a, b, c, d, e, f, g, h] + * output = [a, b, c, 127, e, f, g, h] + * \endcode + * + * The gr.fec Python module provides a read_bitlist function + * that can turn a string of a puncture pattern into the correct + * integer form. The pattern of 0xEF could be specified as + * fec.readbitlist("11101111"). Also, this allows us to use + * puncsize=len("11101111") to make sure that our sizes are set + * up correctly for the pattern we want. + * + * The fec.extended_decoder takes in the puncture pattern + * directly as a string and uses the readbitlist inside to do + * the conversion. + * + * The \p delay parameter delays the application of the puncture + * pattern. This is equivalent to circularly rotating the \p + * puncpat by \p delay. Note that because of the circular shift, + * the delay should be between 0 and \p puncsize, but this is + * not enforced; the effective delay will simply be \p delay mod + * \p puncsize. A negative value here is ignored. + */ + class FEC_API depuncture_bb : virtual public block + { + public: + // gr::fec::depuncture_bb::sptr + typedef boost::shared_ptr<depuncture_bb> sptr; + + /*! + * \brief Constructs a depuncture block. + * + * \param puncsize Size of block of bits to puncture + * \param puncpat The puncturing pattern + * \param delay Delayed the puncturing pattern by shifting it + * \param symbol The symbol to reinsert into the stream (def=127) + */ + static sptr make(int puncsize, int puncpat, + int delay=0, char symbol=127); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DEPUNCTURE_BB_H */ diff --git a/gr-fec/include/gnuradio/fec/dummy_decoder.h b/gr-fec/include/gnuradio/fec/dummy_decoder.h new file mode 100644 index 0000000000..071b57151e --- /dev/null +++ b/gr-fec/include/gnuradio/fec/dummy_decoder.h @@ -0,0 +1,76 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_DUMMY_DECODER_H +#define INCLUDED_FEC_DUMMY_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief Dummy Decoding class. + * \ingroup error_coding_blk + * + * \details + * A dummy decoder class that simply passes the input to the + * output. It is meant to allow us to easily use the FEC API + * encoder and decoder blocks in an application with no coding. + */ + class FEC_API dummy_decoder : virtual public generic_decoder + { + public: + + /*! + * Build a dummy decoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + */ + static generic_decoder::sptr make(int frame_size); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder (it will always be 1). + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DUMMY_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/dummy_encoder.h b/gr-fec/include/gnuradio/fec/dummy_encoder.h new file mode 100644 index 0000000000..2270d1f684 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/dummy_encoder.h @@ -0,0 +1,76 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_DUMMY_ENCODER_H +#define INCLUDED_FEC_DUMMY_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/encoder.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief Dummy Encoding class. + * \ingroup error_coding_blk + * + * \details + * A dummy encoder class that simply passes the input to the + * output. It is meant to allow us to easily use the FEC API + * encoder and decoder blocks in an application with no coding. + */ + class FEC_API dummy_encoder : virtual public generic_encoder + { + public: + + /*! + * Build a dummy encoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + */ + static generic_encoder::sptr make(int frame_size); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder (it will always be 1). + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DUMMY_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/encoder.h b/gr-fec/include/gnuradio/fec/encoder.h new file mode 100644 index 0000000000..fae4bdfdda --- /dev/null +++ b/gr-fec/include/gnuradio/fec/encoder.h @@ -0,0 +1,76 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_ENCODER_H +#define INCLUDED_FEC_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_encoder.h> +#include <gnuradio/block.h> +#include <boost/shared_ptr.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief Creates the encoder block for use in GNU Radio + * flowgraphs from a given FECAPI object derived from the + * generic_encoder class. + * \ingroup error_coding_blk + * + * \details + * + * Generally, we would use the fec.extended_encoder Python + * implementation to instantiate this. The extended_encoder wraps + * up a few more details, like taking care of puncturing as well + * as the encoder itself. + */ + class FEC_API encoder : virtual public block + { + public: + typedef boost::shared_ptr<encoder> sptr; + + /*! + * Build the FEC encoder block from an FECAPI encoder object. + * + * \param my_encoder An FECAPI encoder object child of the generic_encoder class. + * \param input_item_size size of a block of data for the encoder. + * \param output_item_size size of a block of data the encoder will produce. + */ + static sptr make(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size); + + virtual int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + virtual int fixed_rate_ninput_to_noutput(int ninput) = 0; + virtual int fixed_rate_noutput_to_ninput(int noutput) = 0; + virtual void forecast(int noutput_items, + gr_vector_int& ninput_items_required) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/generic_decoder.h b/gr-fec/include/gnuradio/fec/generic_decoder.h new file mode 100644 index 0000000000..0e14d49e76 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/generic_decoder.h @@ -0,0 +1,242 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_GENERIC_DECODER_H +#define INCLUDED_FEC_GENERIC_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/logger.h> +#include <boost/shared_ptr.hpp> +#include <boost/format.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief Parent class for FECAPI objects. + * + * \ingroup error_coding_blk + * + * \details + * + * Parent of a decoder variable class for FECAPI that will fit + * into the gr::fec::decoder block to handle FEC decoding. This + * class provides the basic information required to fit into the + * FECAPI structure. It provides information about input and + * output data types, potential data conversions, and a few other + * parameters useful to establish the decoder's behavior. + * + * We create objects from FECAPI-derived classes to go into the + * actual GNU Radio decoder block. Each object contains its own + * state and so there should be a one-to-one mapping of an FECAPI + * object and a GR decoder block. Sharing these objects is not + * guaranteed to be thread-safe. + * + * This is a pure virtual class and must be derived from by a + * child class. + * + * \sa gr::fec::code::cc_decoder + * \sa gr::fec::code::ccsds_decoder + */ + class FEC_API generic_decoder + { + protected: + gr::logger_ptr d_logger; + + public: + friend class decoder; + virtual void generic_work(void *inbuffer, void *outbuffer) = 0; + static int base_unique_id; + int my_id; + int unique_id(); + std::string d_name; + std::string alias(){ return (boost::format("%s%d")%d_name%unique_id()).str(); } + + public: + typedef boost::shared_ptr<generic_decoder> sptr; + + generic_decoder(void) {}; + generic_decoder(std::string name); + virtual ~generic_decoder(); + + /*! + * Returns the rate of the code. For every r input bits, there + * is 1 output bit, so the rate is 1/r. Used for setting things + * like the encoder block's relative rate. + * + * This function MUST be reimplemented by the child class. + */ + virtual double rate() = 0; + + /*! + * Returns the input size in items that the decoder object uses + * to decode a full frame. Often, this number is the number of + * bits per frame if the input format is unpacked. If the block + * expects packed bytes, then this value should be the number of + * bytes (number of bits / 8) per input frame. + * + * The child class MUST implement this function. + */ + virtual int get_input_size() = 0; + + /*! + * Returns the output size in items that the decoder object + * produces after decoding a full frame. Often, this number is + * the number of bits in the outputted frame if the input format + * is unpacked. If the block produces packed bytes, then this + * value should be the number of bytes (number of bits / 8) per + * frame produced. This value is generally something like + * get_input_size()/R for a 1/R rate code. + * + * The child class MUST implement this function. + */ + virtual int get_output_size() = 0; + + /*! + * Sets up history for the decoder when the decoder is required + * to look ahead in the data stream in order to finish + * its processing. + * + * The child class MAY implement this function. If not + * reimplemented, it returns 0. + */ + virtual int get_history(); + + /*! + * Some decoders require the input items to float around a + * particular soft value. We can set that floating value by + * setting this value to return some non-zero number. + * + * The fec.extended_decoder block will use this to create an + * add_const_ff block before the decoder block to adjust all + * input samples appropriately. + * + * The child class MAY implement this function. If not + * reimplemented, it returns 0. + */ + virtual float get_shift(); + + /*! + * Sets the size of an input item, as in the size of a char or + * float item. + * + * The child class SHOULD implement this function. If not + * reimplemented, it returns sizeof(float) as the decoders + * typically expect floating point input types. + */ + virtual int get_input_item_size(); + + /*! + * Sets the size of an output item, as in the size of a char or + * float item. + * + * The child class SHOULD implement this function. If not + * reimplemented, it returns sizeof(char) as the decoders + * typically expect to produce bits or bytes. + */ + virtual int get_output_item_size(); + + /*! + * Set up a conversion type required to setup the data properly + * for this decoder. The decoder itself will not implement the + * conversion and expects an external wrapper (e.g., + * fec.extended_decoder) to read this value and "do the right + * thing" to format the data. + * + * The default behavior is 'none', which means no conversion is + * required. Whatever the get_input_item_size() value returns, + * the input is expected to conform directly to this. + * + * This may also return 'uchar', which indicates that the + * wrapper should convert the standard float samples to unsigned + * characters, either hard sliced or 8-bit soft symbols. See + * gr::fec::code::cc_decoder as an example decoder that uses + * this conversion format. + * + * If 'packed_bits', the block expects the inputs to be packed + * hard bits. Each input item is a unsigned char where each of + * the 8-bits is a hard bit value. + * + * The child class SHOULD implement this function. If not + * reimplemented, it returns "none". + */ + virtual const char* get_input_conversion(); + + /*! + * Set up a conversion type required to understand the output + * style of this decoder. Generally, follow-on processing + * expects unpacked bits, so we specify the conversion type here + * to indicate what the wrapper (e.g., fec.extended_decoder) + * should do to convert the output samples from the decoder into + * unpacked bits. + * + * The default behavior is 'none', which means no conversion is + * required. This should mean that the output data is produced + * from this decoder as unpacked bit. + * + * If 'unpack', the block produces packed bytes that should be + * unpacked by the wrapper. See gr::fec::code::ccsds_decoder as + * an example of a decoder that produces packed bytes. + * + * The child class SHOULD implement this function. If not + * reimplemented, it returns "none". + */ + virtual const char* get_output_conversion(); + + /*! + * Updates the size of a decoded frame. + * + * The child class MUST implement this function and interpret + * how the \p frame_size information affects the block's + * behavior. It should also provide bounds checks. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + }; + + /*! see generic_decoder::get_output_size() */ + FEC_API int get_decoder_output_size(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_input_size() */ + FEC_API int get_decoder_input_size(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_shift() */ + FEC_API float get_shift(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_history() */ + FEC_API int get_history(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_input_item_size() */ + FEC_API int get_decoder_input_item_size(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_output_item_size() */ + FEC_API int get_decoder_output_item_size(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_input_conversion() */ + FEC_API const char* get_decoder_input_conversion(generic_decoder::sptr my_decoder); + + /*! see generic_decoder::get_output_conversion() */ + FEC_API const char* get_decoder_output_conversion(generic_decoder::sptr my_decoder); + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_GENRIC_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/generic_encoder.h b/gr-fec/include/gnuradio/fec/generic_encoder.h new file mode 100644 index 0000000000..7c5e08e5d0 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/generic_encoder.h @@ -0,0 +1,152 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_GENERIC_ENCODER_H +#define INCLUDED_FEC_GENERIC_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> +#include <gnuradio/logger.h> +#include <boost/shared_ptr.hpp> + +namespace gr { + namespace fec { + + class FEC_API generic_encoder + { + protected: + gr::logger_ptr d_logger; + + public: + friend class encoder; + virtual void generic_work(void *in_buffer, void *out_buffer) = 0; + static int base_unique_id; + int my_id; + int unique_id(); + std::string d_name; + std::string alias(){ return (boost::format("%s%d")%d_name%unique_id()).str(); } + + public: + typedef boost::shared_ptr<generic_encoder> sptr; + + /*! + * Returns the rate of the code. For every 1 input bit, there + * are r output bits, so the rate is 1/r. Used for setting + * things like the encoder block's relative rate. + * + * This function MUST be reimplemented by the child class. + */ + virtual double rate() = 0; + + /*! + * Returns the input size in items that the encoder object uses + * to encode a full frame. Often, this number is the number of + * bits per frame if the input format is unpacked. If the block + * expects packed bytes, then this value should be the number of + * bytes (number of bits / 8) per input frame. + * + * The child class MUST implement this function. + */ + virtual int get_input_size() = 0; + + /*! + * Returns the output size in items that the encoder object + * produces after encoding a full frame. Often, this number is + * the number of bits in the outputted frame if the input format + * is unpacked. If the block produces packed bytes, then this + * value should be the number of bytes (number of bits / 8) per + * frame produced. This value is generally something like + * R*get_input_size() for a 1/R rate code. + * + * The child class MUST implement this function. + */ + virtual int get_output_size() = 0; + + /*! + * Set up a conversion type required to setup the data properly + * for this encoder. The encoder itself will not implement the + * conversion and expects an external wrapper (e.g., + * fec.extended_encoder) to read this value and "do the right + * thing" to format the data. + * + * The default behavior is 'none', which means no conversion is + * required. Whatever the get_input_item_size() value returns, + * the input is expected to conform directly to this. Generally, + * this means unpacked bytes. + * + * If 'pack', the block expects the inputs to be packed + * bytes. The wrapper should implement a + * gr::blocks::pack_k_bits_bb(8) block for this. + * + * The child class MAY implement this function. If not + * reimplemented, it returns "none". + */ + virtual const char* get_input_conversion(); + + /*! + * Set up a conversion type required to understand the output + * style of this encoder. Generally an encoder will produce + * unpacked bytes with a bit set in the LSB. + * + * The default behavior is 'none', which means no conversion is + * required and the encoder produces unpacked bytes. + * + * If 'packed_bits', the block produces packed bits and the + * wrapper should unpack these (using, for instance, + * gr::block::unpack_k_bits_bb(8)). + * + * The child class MAY implement this function. If not + * reimplemented, it returns "none". + */ + virtual const char* get_output_conversion(); + + /*! + * Updates the size of the frame to encode. + * + * The child class MUST implement this function and interpret + * how the \p frame_size information affects the block's + * behavior. It should also provide bounds checks. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + generic_encoder(void) {}; + generic_encoder(std::string name); + virtual ~generic_encoder(); + }; + + /*! see generic_encoder::get_output_size() */ + FEC_API int get_encoder_output_size(generic_encoder::sptr my_encoder); + + /*! see generic_encoder::get_input_size() */ + FEC_API int get_encoder_input_size(generic_encoder::sptr my_encoder); + + /*! see generic_encoder::get_input_conversion() */ + FEC_API const char* get_encoder_input_conversion(generic_encoder::sptr my_encoder); + + /*! see generic_encoder::get_output_conversion() */ + FEC_API const char* get_encoder_output_conversion(generic_encoder::sptr my_encoder); + + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_GENERIC_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/puncture_bb.h b/gr-fec/include/gnuradio/fec/puncture_bb.h new file mode 100644 index 0000000000..3fc8d7ee9b --- /dev/null +++ b/gr-fec/include/gnuradio/fec/puncture_bb.h @@ -0,0 +1,105 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_PUNCTURE_BB_H +#define INCLUDED_FEC_PUNCTURE_BB_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> + +namespace gr { + namespace fec { + + /*! + * \brief Puncture a stream of unpacked bits. + * \ingroup error_coding_blk + * + * \details + * Puncture a given block of input samples of \p puncsize. The + * items produced is based on pattern \p puncpat. Basically, if: + * + * \code + * k = 0 + * if _puncpat[i] == 1: + * out[k++] = input[i] + * \endcode + * + * This block is designed for unpacked bits - that is, every + * input sample is a bit, either a 1 or 0. It's possible to use + * packed bits as symbols, but the puncturing will be done on + * the symbol level, not the bit level. + * + * \p puncpat is specified as a 32-bit integer that we can + * convert into the vector _puncpat used in the algorithm above: + * + * \code + * _puncpat = [0,...] + * for i in puncsize: + * _puncpat[i] = puncpat >> (puncsize-1-i) + * \endcode + * + * Example: + * \code + * puncsize = 8 + * puncpat = 0xEF --> [1,1,1,0,1,1,1,1] + * input = [a, b, c, d, e, f, g, h] + * output = [a, b, c, e, f, g, h] + * \endcode + * + * The gr.fec Python module provides a read_bitlist function + * that can turn a string of a puncture pattern into the correct + * integer form. The pattern of 0xEF could be specified as + * fec.readbitlist("11101111"). Also, this allows us to use + * puncsize=len("11101111") to make sure that our sizes are set + * up correctly for the pattern we want. + * + * The fec.extended_encoder takes in the puncture pattern + * directly as a string and uses the readbitlist inside to do + * the conversion. + * + * The \p delay parameter delays the application of the puncture + * pattern. This is equivalent to circularly rotating the \p + * puncpat by \p delay. Note that because of the circular shift, + * the delay should be between 0 and \p puncsize, but this is + * not enforced; the effective delay will simply be \p delay mod + * \p puncsize. A negative value here is ignored. + */ + class FEC_API puncture_bb : virtual public block + { + public: + // gr::fec::puncture_bb::sptr + typedef boost::shared_ptr<puncture_bb> sptr; + + /*! + * \brief Constructs a puncture block for unpacked bits. + * + * \param puncsize Size of block of bits to puncture + * \param puncpat The puncturing pattern + * \param delay Delayed the puncturing pattern by shifting it + */ + static sptr make(int puncsize, int puncpat, int delay=0); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_PUNCTURE_BB_H */ diff --git a/gr-fec/include/gnuradio/fec/puncture_ff.h b/gr-fec/include/gnuradio/fec/puncture_ff.h new file mode 100644 index 0000000000..8625ab4ffb --- /dev/null +++ b/gr-fec/include/gnuradio/fec/puncture_ff.h @@ -0,0 +1,104 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_PUNCTURE_FF_H +#define INCLUDED_FEC_PUNCTURE_FF_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/block.h> + +namespace gr { + namespace fec { + + /*! + * \brief Puncture a stream of floats. + * \ingroup error_coding_blk + * + * \details + * For a given block of input samples of \p puncsize, the items + * produced is based on \p puncpat. Basically, if: + * + * \code + * k = 0 + * if _puncpat[i] == 1: + * out[k++] = input[i] + * \endcode + * + * This block is designed for floats, generally 1's and -1's. It's + * possible to use other float values as symbols, but this is not + * the expected operation. + * + * \p puncpat is specified as a 32-bit integer that we can + * convert into the vector _puncpat used in the algorithm above: + * + * \code + * _puncpat = [0,...] + * for i in puncsize: + * _puncpat[i] = puncpat >> (puncsize-1-i) + * \endcode + * + * Example: + * \code + * puncsize = 8 + * puncpat = 0xEF --> [1,1,1,0,1,1,1,1] + * input = [a, b, c, d, e, f, g, h] + * output = [a, b, c, e, f, g, h] + * \endcode + * + * The gr.fec Python module provides a read_bitlist function + * that can turn a string of a puncture pattern into the correct + * integer form. The pattern of 0xEF could be specified as + * fec.readbitlist("11101111"). Also, this allows us to use + * puncsize=len("11101111") to make sure that our sizes are set + * up correctly for the pattern we want. + * + * The fec.extended_encoder takes in the puncture pattern + * directly as a string and uses the readbitlist inside to do + * the conversion. + * + * The \p delay parameter delays the application of the puncture + * pattern. This is equivalent to circularly rotating the \p + * puncpat by \p delay. Note that because of the circular shift, + * the delay should be between 0 and \p puncsize, but this is + * not enforced; the effective delay will simply be \p delay mod + * \p puncsize. A negative value here is ignored. + */ + class FEC_API puncture_ff : virtual public block + { + public: + // gr::fec::puncture_ff::sptr + typedef boost::shared_ptr<puncture_ff> sptr; + + /*! + * \brief Constructs a puncture block for floats. + * + * \param puncsize Size of block of bits to puncture + * \param puncpat The puncturing pattern + * \param delay Delayed the puncturing pattern by shifting it + */ + static sptr make(int puncsize, int puncpat, int delay); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_PUNCTURE_FF_H */ diff --git a/gr-fec/include/gnuradio/fec/repetition_decoder.h b/gr-fec/include/gnuradio/fec/repetition_decoder.h new file mode 100644 index 0000000000..e17f612b83 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/repetition_decoder.h @@ -0,0 +1,82 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_REPETITION_DECODER_H +#define INCLUDED_FEC_REPETITION_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief Repetition Decoding class. + * \ingroup error_coding_blk + * + * \details + * A repetition decoder class. This takes a majority vote, + * biased by the \p ap_prob rate, and decides if the number of 1 + * bits > ap_prob, it is a 1; else, it is a 0. + */ + class FEC_API repetition_decoder : virtual public generic_decoder + { + public: + + /*! + * Build a repetition decoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + * \param rep Repetition rate; encoder rate is rep bits out + * for each input bit. + * \param ap_prob The a priori probability that a bit is a 1 + * (generally, unless otherwise known, assume to be + * 0.5). + */ + static generic_decoder::sptr make(int frame_size, int rep, + float ap_prob=0.5); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder (it will always be 1). + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_REPETITION_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/repetition_encoder.h b/gr-fec/include/gnuradio/fec/repetition_encoder.h new file mode 100644 index 0000000000..313dc6415f --- /dev/null +++ b/gr-fec/include/gnuradio/fec/repetition_encoder.h @@ -0,0 +1,78 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_REPETITION_ENCODER_H +#define INCLUDED_FEC_REPETITION_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/encoder.h> +#include <map> +#include <string> + +namespace gr { + namespace fec { + namespace code { + + /*! + * \brief Repetition Encoding class. + * \ingroup error_coding_blk + * + * \details + * A repetition encoder class that repeats each input bit \p rep + * times. To decode, take a majority vote over the number of + * repetitions. + */ + class FEC_API repetition_encoder : virtual public generic_encoder + { + public: + + /*! + * Build a repetition encoding FEC API object. + * + * \param frame_size Number of bits per frame. If using in the + * tagged stream style, this is the maximum allowable + * number of bits per frame. + * \param rep Repetition rate; encoder rate is rep bits out + * for each input bit. + */ + static generic_encoder::sptr make(int frame_size, int rep); + + /*! + * Sets the uncoded frame size to \p frame_size. If \p + * frame_size is greater than the value given to the + * constructor, the frame size will be capped by that initial + * value and this function will return false. Otherwise, it + * returns true. + */ + virtual bool set_frame_size(unsigned int frame_size) = 0; + + /*! + * Returns the coding rate of this encoder. + */ + virtual double rate() = 0; + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_REPETITION_ENCODER_H */ diff --git a/gr-fec/include/gnuradio/fec/tagged_decoder.h b/gr-fec/include/gnuradio/fec/tagged_decoder.h new file mode 100644 index 0000000000..4eba17a7a2 --- /dev/null +++ b/gr-fec/include/gnuradio/fec/tagged_decoder.h @@ -0,0 +1,95 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_TAGGED_DECODER_H +#define INCLUDED_FEC_TAGGED_DECODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_decoder.h> +#include <gnuradio/tagged_stream_block.h> +#include <boost/shared_ptr.hpp> +#include <boost/shared_array.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief General FEC decoding block that takes in a decoder + * variable object (derived from gr::fec::general_decoder) for use + * in a flowgraph. + * + * \ingroup error_coding_blk + * + * \details + * This block uses a decoder variable object (derived from + * gr::fec::generic_decoder) to decode data within a + * flowgraph. This block interacts with the general FECAPI + * architecture to handle all passing all input and output data in + * a flowgraph. The decoder variable takes care of understanding + * the requirements, data types and sizes, and boundary conditions + * of the specific FEC decoding algorithm. + * + * Generally, this block is used within the fec.extended_decoder + * Python block to handle some input/output formatting issues. In + * the FECAPI, the decoder variable sets properties like the input + * and output types and sizes and whether the output is packed or + * unpacked bytes. The fec.extended_decoder uses this information + * to set up an gr::hier_block2 structure to make sure the I/O to + * the variable is handled consistently, such as to make sure all + * inputs are floats with one soft symbol per item and the outputs + * are unpacked bytes with the bit in the LSB. + * + * See gr::fec::generic_decoder for detail on what information an + * FECAPI variable object can set if using this block directly and + * not as part of the fec.extended_decoder. + */ + class FEC_API tagged_decoder : virtual public tagged_stream_block + { + public: + typedef boost::shared_ptr<tagged_decoder> sptr; + typedef boost::shared_array<unsigned char> buf_sptr; + + /*! + * Create the FEC decoder block by taking in the FECAPI decoder + * object as well as input and output sizes. + * + * \param my_decoder An FECAPI decoder object (See gr::fec::generic_decoder). + * \param input_item_size The size of the input items (often the my_decoder object can tell us this). + * \param output_item_size The size of the output items (often the my_decoder object can tell us this). + * \param lengthtagname Key name of the tagged stream frame size. + */ + static sptr make(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size, + const std::string &lengthtagname="packet_len"); + + virtual int work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + virtual int calculate_output_stream_length(const gr_vector_int &ninput_items) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_TAGGED_DECODER_H */ diff --git a/gr-fec/include/gnuradio/fec/tagged_encoder.h b/gr-fec/include/gnuradio/fec/tagged_encoder.h new file mode 100644 index 0000000000..86c2603edc --- /dev/null +++ b/gr-fec/include/gnuradio/fec/tagged_encoder.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_TAGGED_ENCODER_H +#define INCLUDED_FEC_TAGGED_ENCODER_H + +#include <gnuradio/fec/api.h> +#include <gnuradio/fec/generic_encoder.h> +#include <gnuradio/tagged_stream_block.h> +#include <boost/shared_ptr.hpp> + +namespace gr { + namespace fec { + + /*! + * \brief Creates the encoder block for use in GNU Radio + * flowgraphs from a given FECAPI object derived from the + * generic_encoder class. + * \ingroup error_coding_blk + * + * \details + * + * Generally, we would use the fec.extended_encoder Python + * implementation to instantiate this. The extended_encoder wraps + * up a few more details, like taking care of puncturing as well + * as the encoder itself. + */ + class FEC_API tagged_encoder : virtual public tagged_stream_block + { + public: + typedef boost::shared_ptr<tagged_encoder> sptr; + + /*! + * Build the FEC encoder block from an FECAPI encoder object. + * + * \param my_encoder An FECAPI encoder object child of the generic_encoder class. + * \param input_item_size size of a block of data for the encoder. + * \param output_item_size size of a block of data the encoder will produce. + * \param lengthtagname Key name of the tagged stream frame size. + */ + static sptr make(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size, + const std::string& lengthtagname="packet_len"); + + virtual int work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) = 0; + virtual int calculate_output_stream_length(const gr_vector_int &ninput_items) = 0; + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_TAGGED_ENCODER_H */ diff --git a/gr-fec/lib/CMakeLists.txt b/gr-fec/lib/CMakeLists.txt index 34c0746798..8af27db334 100644 --- a/gr-fec/lib/CMakeLists.txt +++ b/gr-fec/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2012-2013 Free Software Foundation, Inc. +# Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,7 +29,10 @@ 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} ${Boost_INCLUDE_DIRS} ) @@ -38,14 +41,38 @@ if(ENABLE_GR_CTRLPORT) include_directories(${ICE_INCLUDE_DIR}) endif(ENABLE_GR_CTRLPORT) -link_directories(${Boost_LIBRARY_DIRS}) +link_directories( + ${Boost_LIBRARY_DIRS} + ${LOG4CPP_LIBRARY_DIRS} +) ######################################################################## # Setup library ######################################################################## list(APPEND gnuradio_fec_sources - decode_ccsds_27_fb_impl.cc - encode_ccsds_27_bb_impl.cc + generic_decoder.cc + generic_encoder.cc + decoder_impl.cc + encoder_impl.cc + tagged_decoder_impl.cc + tagged_encoder_impl.cc + async_decoder_impl.cc + async_encoder_impl.cc + cc_decoder_impl.cc + cc_encoder_impl.cc + ccsds_encoder_impl.cc + dummy_decoder_impl.cc + dummy_encoder_impl.cc + repetition_decoder_impl.cc + repetition_encoder_impl.cc + decode_ccsds_27_fb_impl.cc + encode_ccsds_27_bb_impl.cc + ber_tools.cc + ber_bf_impl.cc + conv_bit_corr_bb_impl.cc + puncture_bb_impl.cc + puncture_ff_impl.cc + depuncture_bb_impl.cc ) #Add Windows DLL resource file if using MSVC @@ -63,11 +90,26 @@ if(MSVC) endif(MSVC) list(APPEND gnuradio_fec_libs + gnuradio-blocks gnuradio-runtime + volk ${Boost_LIBRARIES} + ${LOG4CPP_LIBRARIES} ) add_library(gnuradio-fec SHARED ${gnuradio_fec_sources}) target_link_libraries(gnuradio-fec ${gnuradio_fec_libs}) GR_LIBRARY_FOO(gnuradio-fec RUNTIME_COMPONENT "fec_runtime" DEVEL_COMPONENT "fec_devel") +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-fec_static STATIC ${gnuradio_fec_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-fec_static + PROPERTIES OUTPUT_NAME gnuradio-fec) + endif(NOT WIN32) + + install(TARGETS gnuradio-fec_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "fec_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-fec/lib/async_decoder_impl.cc b/gr-fec/lib/async_decoder_impl.cc new file mode 100644 index 0000000000..f5924ec1f9 --- /dev/null +++ b/gr-fec/lib/async_decoder_impl.cc @@ -0,0 +1,223 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "async_decoder_impl.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + async_decoder::sptr + async_decoder::make(generic_decoder::sptr my_decoder, + bool packed, bool rev_pack) + { + return gnuradio::get_initial_sptr + (new async_decoder_impl(my_decoder, packed, rev_pack)); + } + + async_decoder_impl::async_decoder_impl(generic_decoder::sptr my_decoder, + bool packed, bool rev_pack) + : block("async_decoder", + io_signature::make(0,0,0), + io_signature::make(0,0,0)), + d_input_item_size(sizeof(float)), d_output_item_size(sizeof(char)) + { + d_in_port = pmt::mp("in"); + d_out_port = pmt::mp("out"); + + d_decoder = my_decoder; + + if(d_decoder->get_history() > 0) { + throw std::runtime_error("async_decoder deploment does not support decoders with history requirements."); + } + + d_packed = packed; + d_rev_pack = rev_pack; + + message_port_register_in(d_in_port); + message_port_register_out(d_out_port); + + if(d_packed) { + d_pack = new blocks::kernel::pack_k_bits(8); + set_msg_handler(d_in_port, boost::bind(&async_decoder_impl::decode_packed, this ,_1)); + } + else { + set_msg_handler(d_in_port, boost::bind(&async_decoder_impl::decode_unpacked, this ,_1)); + } + + // The maximum frame size is set by the initial frame size of the decoder. + d_max_bits_in = d_decoder->get_input_size(); + d_tmp_f32 = (float*)volk_malloc(d_max_bits_in*sizeof(float), + volk_get_alignment()); + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + d_tmp_u8 = (int8_t*)volk_malloc(d_max_bits_in*sizeof(uint8_t), + volk_get_alignment()); + } + + if(d_packed) { + int max_bits_out = d_decoder->get_output_size(); + d_bits_out = (uint8_t*)volk_malloc(max_bits_out*sizeof(uint8_t), + volk_get_alignment()); + } + } + + async_decoder_impl::~async_decoder_impl() + { + if(d_packed) { + delete d_pack; + volk_free(d_bits_out); + } + + volk_free(d_tmp_f32); + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + volk_free(d_tmp_u8); + } + } + + void + async_decoder_impl::decode_unpacked(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bits(pmt::cdr(msg)); + + // Watch out for this diff. It might be over-specializing to the + // CC decoder in terminated mode that has an extra rate(K-1) + // bits added on to the transmitted frame. + int diff = d_decoder->rate()*d_decoder->get_input_size() - d_decoder->get_output_size(); + + int nbits_in = pmt::length(bits); + int nbits_out = nbits_in*d_decoder->rate() - diff; + + // Check here if the frame size is larger than what we've + // allocated for in the constructor. + if(nbits_in > d_max_bits_in) { + throw std::runtime_error("async_decoder: Received frame larger than max frame size."); + } + + d_decoder->set_frame_size(nbits_out); + + size_t o0(0); + const float* f32in = pmt::f32vector_elements(bits, o0); + pmt::pmt_t outvec(pmt::make_u8vector(nbits_out, 0x00)); + uint8_t* u8out = pmt::u8vector_writable_elements(outvec, o0); + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + volk_32f_s32f_multiply_32f(d_tmp_f32, f32in, 48.0f, nbits_in); + } + else { + memcpy(d_tmp_f32, f32in, nbits_in*sizeof(float)); + } + + if(d_decoder->get_shift() != 0) { + for(int n = 0; n < nbits_in; n++) + d_tmp_f32[n] += d_decoder->get_shift(); + } + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + //volk_32f_s32f_convert_8i(d_tmp_u8, d_tmp_f32, 1, nbits_in); + for(int n = 0; n < nbits_in; n++) + d_tmp_u8[n] = static_cast<uint8_t>(d_tmp_f32[n]); + + d_decoder->generic_work((void*)d_tmp_u8, (void*)u8out); + } + else { + d_decoder->generic_work((void*)d_tmp_f32, (void*)u8out); + } + + message_port_pub(d_out_port, pmt::cons(meta, outvec)); + } + + void + async_decoder_impl::decode_packed(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bits(pmt::cdr(msg)); + + size_t o0 = 0; + int nbits_in = pmt::length(bits); + int nbits_out = nbits_in*d_decoder->rate(); + int nbytes_out = nbits_out/8; + + // Check here if the frame size is larger than what we've + // allocated for in the constructor. + if(nbits_in > d_max_bits_in) { + throw std::runtime_error("async_decoder: Received frame larger than max frame size."); + } + + d_decoder->set_frame_size(nbits_out); + + pmt::pmt_t outvec(pmt::make_u8vector(nbytes_out, 0x00)); + uint8_t* bytes_out = pmt::u8vector_writable_elements(outvec, o0); + const float* f32in = pmt::f32vector_elements(bits, o0); + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + volk_32f_s32f_multiply_32f(d_tmp_f32, f32in, 48.0f, nbits_in); + } + else { + memcpy(d_tmp_f32, f32in, nbits_in*sizeof(float)); + } + + if(d_decoder->get_shift() != 0) { + for(int n = 0; n < nbits_in; n++) + d_tmp_f32[n] += d_decoder->get_shift(); + } + + if(strncmp(d_decoder->get_input_conversion(), "uchar", 5) == 0) { + //volk_32f_s32f_convert_8i(d_tmp_u8, d_tmp_f32, 1.0, nbits_in); + for(int n = 0; n < nbits_in; n++) + d_tmp_u8[n] = static_cast<uint8_t>(d_tmp_f32[n]); + + d_decoder->generic_work((void*)d_tmp_u8, (void*)d_bits_out); + } + else { + d_decoder->generic_work((void*)d_tmp_f32, (void*)d_bits_out); + } + + if(d_rev_pack) + d_pack->pack_rev(bytes_out, d_bits_out, nbytes_out); + else + d_pack->pack(bytes_out, d_bits_out, nbytes_out); + + message_port_pub(d_out_port, pmt::cons(meta, outvec)); + } + + int + async_decoder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + return noutput_items; + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/async_decoder_impl.h b/gr-fec/lib/async_decoder_impl.h new file mode 100644 index 0000000000..c3c7a7c3ff --- /dev/null +++ b/gr-fec/lib/async_decoder_impl.h @@ -0,0 +1,69 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_ASYNC_DECODER_IMPL_H +#define INCLUDED_FEC_ASYNC_DECODER_IMPL_H + +#include <gnuradio/fec/async_decoder.h> +#include <gnuradio/blocks/pack_k_bits.h> + +namespace gr { + namespace fec { + + class FEC_API async_decoder_impl : public async_decoder + { + private: + generic_decoder::sptr d_decoder; + size_t d_input_item_size; + size_t d_output_item_size; + + pmt::pmt_t d_in_port; + pmt::pmt_t d_out_port; + + blocks::kernel::pack_k_bits *d_pack; + + bool d_packed; + bool d_rev_pack; + + int d_max_bits_in; + float *d_tmp_f32; + int8_t *d_tmp_u8; + uint8_t *d_bits_out; + + void decode_packed(pmt::pmt_t msg); + void decode_unpacked(pmt::pmt_t msg); + + public: + async_decoder_impl(generic_decoder::sptr my_decoder, + bool packed=false, bool rev_pack=true); + ~async_decoder_impl(); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ASYNC_DECODER_IMPL_H */ diff --git a/gr-fec/lib/async_encoder_impl.cc b/gr-fec/lib/async_encoder_impl.cc new file mode 100644 index 0000000000..d6ce67d491 --- /dev/null +++ b/gr-fec/lib/async_encoder_impl.cc @@ -0,0 +1,194 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "async_encoder_impl.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + async_encoder::sptr + async_encoder::make(generic_encoder::sptr my_encoder, + bool packed, bool rev_unpack, bool rev_pack) + { + return gnuradio::get_initial_sptr + (new async_encoder_impl(my_encoder, packed, rev_unpack, rev_pack)); + } + + async_encoder_impl::async_encoder_impl(generic_encoder::sptr my_encoder, + bool packed, bool rev_unpack, bool rev_pack) + : block("async_encoder", + io_signature::make(0,0,0), + io_signature::make(0,0,0)), + d_input_item_size(sizeof(char)), d_output_item_size(sizeof(char)) + { + d_in_port = pmt::mp("in"); + d_out_port = pmt::mp("out"); + + d_encoder = my_encoder; + + d_packed = packed; + d_rev_unpack = rev_unpack; + d_rev_pack = rev_pack; + + message_port_register_in(d_in_port); + message_port_register_out(d_out_port); + + if(d_packed) { + set_msg_handler(d_in_port, boost::bind(&async_encoder_impl::encode_packed, this ,_1) ); + + d_unpack = new blocks::kernel::unpack_k_bits(8); + + int max_bits_out = d_encoder->get_output_size(); + d_bits_out = (uint8_t*)volk_malloc(max_bits_out*sizeof(uint8_t), + volk_get_alignment()); + + } + else { + set_msg_handler(d_in_port, boost::bind(&async_encoder_impl::encode_unpacked, this ,_1) ); + } + + if(d_packed || (strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0)) { + // encode_unpacked: if input conversion is 'pack', pack the input bits + // encode_packed: used to repack the output + d_pack = new blocks::kernel::pack_k_bits(8); + + // encode_unpacked: Holds packed bits in when input conversion is packed + // encode_packed: holds the output bits of the encoder to be packed + int max_bits_in = d_encoder->get_input_size(); + d_bits_in = (uint8_t*)volk_malloc(max_bits_in*sizeof(uint8_t), + volk_get_alignment()); + } + } + + async_encoder_impl::~async_encoder_impl() + { + if(d_packed) { + delete d_unpack; + volk_free(d_bits_out); + } + + if(d_packed || (strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0)) { + delete d_pack; + volk_free(d_bits_in); + } + } + + void + async_encoder_impl::encode_unpacked(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bits(pmt::cdr(msg)); + + size_t o0 = 0; + int nbits_in = pmt::length(bits); + const uint8_t* bits_in = pmt::u8vector_elements(bits, o0); + + d_encoder->set_frame_size(nbits_in); + + int nbits_out = d_encoder->get_output_size(); + + // buffers for output bits to go to + pmt::pmt_t outvec = pmt::make_u8vector(nbits_out, 0x00); + uint8_t* bits_out = pmt::u8vector_writable_elements(outvec, o0); + + if(strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0) { + d_pack->pack(d_bits_in, bits_in, nbits_in/8); + d_encoder->generic_work((void*)d_bits_in, (void*)bits_out); + } + else { + d_encoder->generic_work((void*)bits_in, (void*)bits_out); + } + + pmt::pmt_t msg_pair = pmt::cons(meta, outvec); + message_port_pub(d_out_port, msg_pair); + } + + void + async_encoder_impl::encode_packed(pmt::pmt_t msg) + { + // extract input pdu + pmt::pmt_t meta(pmt::car(msg)); + pmt::pmt_t bytes(pmt::cdr(msg)); + + size_t o0 = 0; + int nbytes_in = pmt::length(bytes); + int nbits_in = 8*nbytes_in; + const uint8_t* bytes_in = pmt::u8vector_elements(bytes, o0); + + d_encoder->set_frame_size(nbits_in); + + int nbits_out = d_encoder->get_output_size(); + int nbytes_out = nbits_out/8; + + if(strncmp(d_encoder->get_input_conversion(), "pack", 4) == 0) { + // If the input takes packed, anyways, don't go through the + // unpacker. Note that if we need the unpacking to reverse, + // we won't get that here and might have to correct for it in + // the decoder. + // d_bits_in > bytes_in, so we're abusing the existence of + // this allocated memory here + memcpy(d_bits_in, bytes_in, nbytes_in*sizeof(uint8_t)); + } + else { + // Encoder takes a stream of bits, but PDU's are received as + // bytes, so we unpack them here. + if(d_rev_unpack) + d_unpack->unpack_rev(d_bits_in, bytes_in, nbytes_in); + else + d_unpack->unpack(d_bits_in, bytes_in, nbytes_in); + } + + // buffers for output bytes to go to + pmt::pmt_t outvec = pmt::make_u8vector(nbytes_out, 0x00); + uint8_t* bytes_out = pmt::u8vector_writable_elements(outvec, o0); + + // ENCODE! + d_encoder->generic_work((void*)d_bits_in, (void*)d_bits_out); + + if(d_rev_pack) + d_pack->pack_rev(bytes_out, d_bits_out, nbytes_out); + else + d_pack->pack(bytes_out, d_bits_out, nbytes_out); + + pmt::pmt_t msg_pair = pmt::cons(meta, outvec); + message_port_pub(d_out_port, msg_pair); + } + + int + async_encoder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + return noutput_items; + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/async_encoder_impl.h b/gr-fec/lib/async_encoder_impl.h new file mode 100644 index 0000000000..fe48177b95 --- /dev/null +++ b/gr-fec/lib/async_encoder_impl.h @@ -0,0 +1,71 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_ASYNC_ENCODER_IMPL_H +#define INCLUDED_FEC_ASYNC_ENCODER_IMPL_H + +#include <gnuradio/fec/async_encoder.h> +#include <gnuradio/blocks/unpack_k_bits.h> +#include <gnuradio/blocks/pack_k_bits.h> + +namespace gr { + namespace fec { + + class FEC_API async_encoder_impl : public async_encoder + { + private: + generic_encoder::sptr d_encoder; + size_t d_input_item_size; + size_t d_output_item_size; + + pmt::pmt_t d_in_port; + pmt::pmt_t d_out_port; + + blocks::kernel::unpack_k_bits *d_unpack; + blocks::kernel::pack_k_bits *d_pack; + + bool d_packed; + bool d_rev_unpack; + bool d_rev_pack; + + uint8_t* d_bits_in; + uint8_t* d_bits_out; + + void encode_packed(pmt::pmt_t msg); + void encode_unpacked(pmt::pmt_t msg); + + public: + async_encoder_impl(generic_encoder::sptr my_encoder, + bool packed=false, + bool rev_unpack=true, bool rev_pack=true); + ~async_encoder_impl(); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ASYNC_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/ber_bf_impl.cc b/gr-fec/lib/ber_bf_impl.cc new file mode 100644 index 0000000000..d7282ea699 --- /dev/null +++ b/gr-fec/lib/ber_bf_impl.cc @@ -0,0 +1,143 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ber_bf_impl.h" +#include "ber_tools.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <math.h> + +namespace gr { + namespace fec { + + ber_bf::sptr + ber_bf::make(bool test_mode, int berminerrors, float ber_limit) + { + return gnuradio::get_initial_sptr + (new ber_bf_impl(test_mode, berminerrors, ber_limit)); + } + + ber_bf_impl::ber_bf_impl(bool test_mode, int berminerrors, float ber_limit) + : block("fec_ber_bf", + io_signature::make(2, 2, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(float))), + d_total_errors(0), d_total(0), d_test_mode(test_mode), + d_berminerrors(berminerrors), d_ber_limit(ber_limit) + { + } + + ber_bf_impl::~ber_bf_impl() + { + } + + void + ber_bf_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = 1<<10 * noutput_items; + ninput_items_required[1] = 1<<10 * noutput_items; + } + + int + ber_bf_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + if(d_test_mode) { + if(d_total_errors >= d_berminerrors) { + return -1; + } + else { + unsigned char *inbuffer0 = (unsigned char *)input_items[0]; + unsigned char *inbuffer1 = (unsigned char *)input_items[1]; + float *outbuffer = (float *)output_items[0]; + + int items = ninput_items[0] <= ninput_items[1] ? ninput_items[0] : ninput_items[1]; + + if(items > 0) { + /* + for(int i = 0; i < items; ++i) { + if(inbuffer0[i] != inbuffer1[i]) { + GR_LOG_INFO(d_logger, boost::format("%1%/%2%: %3% versus %4%") \ + % i % items % inbuffer0[i] % inbuffer1[i]); + } + } + GR_LOG_INFO(d_logger, boost::format("%1% errors") \ + % (compber(inbuffer0, inbuffer1, items))); + */ + + d_total_errors += compber(inbuffer0, inbuffer1, items); + d_total += items; + } + consume_each(items); + + if(d_total_errors >= d_berminerrors) { + outbuffer[0] = log10(((double)d_total_errors)/(d_total * 8.0)); + GR_LOG_INFO(d_logger, boost::format(" %1% over %2% --> %3%") \ + % d_total_errors % (d_total * 8) % outbuffer[0]); + return 1; + } + else if(log10(((double)d_berminerrors)/(d_total * 8.0)) < d_ber_limit) { + GR_LOG_INFO(d_logger, " Min. BER limit reached"); + outbuffer[0] = d_ber_limit; + d_total_errors = d_berminerrors + 1; + return 1; + } + else { + return 0; + } + } + } + else { // streaming mode + unsigned char *inbuffer0 = (unsigned char *)input_items[0]; + unsigned char *inbuffer1 = (unsigned char *)input_items[1]; + float *outbuffer = (float *)output_items[0]; + + int items = ninput_items[0] <= ninput_items[1] ? ninput_items[0] : ninput_items[1]; + + if(items > 0) { + uint32_t ret; + for(int i = 0; i < items; i++) { + volk_32u_popcnt(&ret, static_cast<uint32_t>(inbuffer0[i]^inbuffer1[i])); + d_total_errors += ret; + } + + d_total += items; + outbuffer[0] = log10(((double)d_total_errors)/(d_total * 8.0)); + + consume_each(items); + return 1; + } + else { + consume_each(0); + return 0; + } + } + } + + } /* namespace fec */ +}/* namespace gr */ diff --git a/gr-fec/lib/ber_bf_impl.h b/gr-fec/lib/ber_bf_impl.h new file mode 100644 index 0000000000..c7faf123ab --- /dev/null +++ b/gr-fec/lib/ber_bf_impl.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_BER_BF_IMPL_H +#define INCLUDED_FEC_BER_BF_IMPL_H + +#include <gnuradio/fec/ber_bf.h> + +namespace gr { + namespace fec { + + class FEC_API ber_bf_impl : public ber_bf + { + private: + int d_total_errors; + int d_total; + bool d_test_mode; + int d_berminerrors; + float d_ber_limit; + + public: + ber_bf_impl(bool d_test_mode = false, int berminerrors=100, float ber_limit=-7.0); + ~ber_bf_impl(); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_BER_BF_IMPL_H */ diff --git a/gr-fec/lib/ber_tools.cc b/gr-fec/lib/ber_tools.cc new file mode 100644 index 0000000000..675932a690 --- /dev/null +++ b/gr-fec/lib/ber_tools.cc @@ -0,0 +1,106 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#include "ber_tools.h" + +inline int +putbit(int word, int loc, int bit) +{ + return (((word)&(~((1)<<(loc))))^((bit)<<(loc))); +} + +void +gaussnoise(float *inbuffer, int buffsize, float sigma) +{ + int i; + float udrn1=0.0, udrn2=0.0, noise=0.0; + + for(i = 0; i < buffsize;i++) { + while((udrn1 = (float)drand48()) < 0.0000001); + udrn2 = (float)drand48(); + noise = sigma*sqrt(-2*log(udrn1))*cos(2*M_PI*udrn2); + inbuffer[i] += noise; + } +} + + +int +compber(unsigned char *inbuffer1, unsigned char *inbuffer2, int buffsize) +{ + int i, totaldiff=0; + int popcnt[256] = + { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 + }; + + for(i = 0; i < buffsize; i++) { + totaldiff += popcnt[inbuffer1[i]^inbuffer2[i]]; + } + + return totaldiff; +} + +void randbuffer(unsigned char *databuffer,int buffsize, int charout) +{ + int i; + unsigned char randbit; + + for(i = 0; i < buffsize; i++) { + // generate random element + randbit = (unsigned char)((0x000010000&rand())>>16); + // place in the data buffer + if(charout == 0) + databuffer[i>>3] = putbit(databuffer[i>>3],7-(i&0x7),randbit); + else + databuffer[i] = randbit; + } +} + +void +char2bin(unsigned char *inbuffer,int buffSize) +{ + int i; + unsigned char fbit=0; + + for(i = 0; i < buffSize; i++) { + if(inbuffer[i] == 0) + fbit = 0; + else + fbit = 1; + inbuffer[i>>3] = putbit(inbuffer[i>>3],7-(i&0x7),fbit); + } +} diff --git a/gr-fec/lib/ber_tools.h b/gr-fec/lib/ber_tools.h new file mode 100644 index 0000000000..038b362974 --- /dev/null +++ b/gr-fec/lib/ber_tools.h @@ -0,0 +1,73 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_GNURADIO_FEC_BER_TOOLS_H +#define INCLUDED_GNURADIO_FEC_BER_TOOLS_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <math.h> + +#define BERMINFRAMES (10000) +#define BERMINERRORS (100) +#define BERMAXBITS (1000000000) + +/*! + * Add BPSK gaussian noise with standard deviation equal to sigma to a + * floating point input buffer. + * + * \param inbuffer (float*) buffer containing data to receive additive + * gaussian noise + * \param buffsize (int) size of \p inbuffer + * \param sigma (float) noise power of the guassian random variables + */ +void gaussnoise(float *inbuffer, int buffsize, float sigma); + +/*! + * Compute the number of bit differences between input buffers + * + * \param inbuffer1 input stream 1 to compare against \p inbuffer2 + * \param inbuffer2 input stream 2 to be compared against + * \param buffsize number of elements in each buffer + */ +int compber(unsigned char *inbuffer1, unsigned char *inbuffer2, int buffsize); + +/*! + * Generate a random buffer of data + * + * \param databuffer pointer to buffer containing random data + * \param buffsize number of elements in each buffer + */ +void randbuffer(unsigned char *databuffer, int buffsize, int charout); + +/*! + * Pack the character buffer + * + * \param databuffer pointer to buffer containing unpacked chars + * \param buffsize number of elements in each buffer + */ +void char2bin(unsigned char *inbuffer, int buffsize); + +#endif /* INCLUDED_GNURADIO_FEC_BER_TOOLS_H */ + + diff --git a/gr-fec/lib/cc_decoder_impl.cc b/gr-fec/lib/cc_decoder_impl.cc new file mode 100644 index 0000000000..20587a21ae --- /dev/null +++ b/gr-fec/lib/cc_decoder_impl.cc @@ -0,0 +1,503 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cc_decoder_impl.h" +#include <math.h> +#include <boost/assign/list_of.hpp> +#include <volk/volk.h> +#include <sstream> +#include <stdio.h> +#include <vector> + +namespace gr { + namespace fec { + namespace code { + + generic_decoder::sptr + cc_decoder::make(int frame_size, int k, + int rate, std::vector<int> polys, + int start_state, int end_state, + cc_mode_t mode, bool padded) + { + return generic_decoder::sptr + (new cc_decoder_impl(frame_size, k, rate, polys, + start_state, end_state, mode, padded)); + } + + cc_decoder_impl::cc_decoder_impl(int frame_size, int k, + int rate, std::vector<int> polys, + int start_state, int end_state, + cc_mode_t mode, bool padded) + : generic_decoder("cc_decoder"), + d_k(k), + d_rate(rate), + d_partial_rate(rate), + d_polys(polys), + d_mode(mode), + d_padding(0), + d_start_state_chaining(start_state), + d_start_state_nonchaining(start_state), + d_end_state_nonchaining(end_state) + { + // Set max frame size here; all buffers and settings will be + // based on this value. + d_max_frame_size = frame_size; + d_frame_size = frame_size; + + // set up a padding factor. If padding, the encoded frame was exteded + // by this many bits to fit into a full byte. + if(padded && (mode == CC_TERMINATED)) { + d_padding = static_cast<int>(8.0f*ceilf(d_rate*(d_k-1)/8.0f) - (d_rate*(d_k-1))); + } + + d_vp = new struct v; + + d_numstates = 1 << (d_k - 1); + + d_decision_t_size = d_numstates/8; //packed bit array + + d_managed_in_size = 0; + switch(d_mode) { + case(CC_TAILBITING): + d_end_state = &d_end_state_chaining; + d_veclen = d_frame_size + (6 * (d_k - 1)); + d_managed_in = (unsigned char*)volk_malloc(d_veclen*d_rate*sizeof(unsigned char), + volk_get_alignment()); + d_managed_in_size = d_veclen * d_rate; + if(d_managed_in == NULL) { + throw std::runtime_error("cc_decoder: bad alloc for d_managed_in\n"); + } + break; + + case(CC_TRUNCATED): + d_veclen = d_frame_size; + d_end_state = &d_end_state_chaining; + break; + + case(CC_TERMINATED): + d_veclen = d_frame_size + d_k - 1; + d_end_state = (end_state == -1) ? &d_end_state_chaining : &d_end_state_nonchaining; + break; + + case(CC_STREAMING): + d_veclen = d_frame_size + d_k - 1; + d_end_state = &d_end_state_chaining; + break; + + default: + throw std::runtime_error("cc_decoder: mode not recognized"); + } + + d_vp->metrics = (unsigned char*)volk_malloc(2*sizeof(unsigned char)*d_numstates, + volk_get_alignment()); + if(d_vp->metrics == NULL) { + throw std::runtime_error("bad alloc for d_vp->metrics!\n"); + } + + d_vp->metrics1.t = d_vp->metrics; + d_vp->metrics2.t = d_vp->metrics + d_numstates; + + d_vp->decisions = (unsigned char*)volk_malloc(sizeof(unsigned char)*d_veclen*d_decision_t_size, + volk_get_alignment()); + if(d_vp->decisions == NULL) { + throw std::runtime_error("bad alloc for d_vp->decisions!\n"); + } + + Branchtab = (unsigned char*)volk_malloc(sizeof(unsigned char)*d_numstates/2*rate, + volk_get_alignment()); + if(Branchtab == NULL) { + throw std::runtime_error("bad alloc for d_vp->decisions!\n"); + } + + create_viterbi(); + + if(d_k-1<8) { + d_ADDSHIFT = (8-(d_k-1)); + d_SUBSHIFT = 0; + } + else if(d_k-1>8) { + d_ADDSHIFT = 0; + d_SUBSHIFT = ((d_k-1)-8); + } + else { + d_ADDSHIFT = 0; + d_SUBSHIFT = 0; + } + + yp_kernel = boost::assign::map_list_of("k=7r=2", volk_8u_x4_conv_k7_r2_8u); + + std::string k_ = "k="; + std::string r_ = "r="; + + std::ostringstream kerneltype; + kerneltype << k_ << d_k << r_ << d_rate; + + d_kernel = yp_kernel[kerneltype.str()]; + } + + cc_decoder_impl::~cc_decoder_impl() + { + volk_free(d_vp->decisions); + volk_free(Branchtab); + volk_free(d_vp->metrics); + + delete d_vp; + + if(d_mode == CC_TAILBITING) { + volk_free(d_managed_in); + } + } + + int + cc_decoder_impl::get_output_size() + { + //unpacked bits + return d_frame_size; + } + + int + cc_decoder_impl::get_input_size() + { + if(d_mode == CC_TERMINATED) { + return d_rate * (d_frame_size + d_k - 1) + d_padding; + } + else { + return d_rate * d_frame_size; + } + } + + int + cc_decoder_impl::get_input_item_size() + { + return 1; + } + + int + cc_decoder_impl::get_history() + { + if(d_mode == CC_STREAMING) { + return d_rate * (d_k - 1); + } + else { + return 0; + } + } + + float + cc_decoder_impl::get_shift() + { + return 128.0; + } + + const char* + cc_decoder_impl::get_input_conversion() + { + return "uchar"; + } + + void + cc_decoder_impl::create_viterbi() + { + int state; + unsigned int i; + partab_init(); + for(state = 0; state < d_numstates/2; state++) { + for(i = 0; i < d_rate; i++) { + Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^ parity((2*state) & abs(d_polys[i])) ? 255 : 0; + } + } + + switch(d_mode) { + case(CC_STREAMING): + d_start_state = &d_start_state_chaining; + init_viterbi_unbiased(d_vp); + break; + + case(CC_TAILBITING): + d_start_state = &d_start_state_nonchaining; + init_viterbi_unbiased(d_vp); + break; + + case(CC_TRUNCATED): + case(CC_TERMINATED): + d_start_state = &d_start_state_nonchaining; + init_viterbi(d_vp, *d_start_state); + break; + + default: + throw std::runtime_error("cc_decoder: mode not recognized"); + } + + return; + } + + int + cc_decoder_impl::parity(int x) + { + x ^= (x >> 16); + x ^= (x >> 8); + return parityb(x); + } + + int + cc_decoder_impl::parityb(unsigned char x) + { + return Partab[x]; + } + + void + cc_decoder_impl::partab_init(void) + { + int i,cnt,ti; + + /* Initialize parity lookup table */ + for(i=0;i<256;i++){ + cnt = 0; + ti = i; + while(ti){ + if(ti & 1) + cnt++; + ti >>= 1; + } + Partab[i] = cnt & 1; + } + } + + int + cc_decoder_impl::init_viterbi(struct v* vp, int starting_state) + { + int i; + + if(vp == NULL) + return -1; + for(i = 0; i < d_numstates; i++) { + vp->metrics1.t[i] = 63; + } + + vp->old_metrics = vp->metrics1; + vp->new_metrics = vp->metrics2; + vp->old_metrics.t[starting_state & (d_numstates-1)] = 0; /* Bias known start state */ + return 0; + } + + int + cc_decoder_impl::init_viterbi_unbiased(struct v* vp) + { + int i; + + if(vp == NULL) + return -1; + for(i=0;i<d_numstates;i++) + vp->metrics1.t[i] = 31; + + vp->old_metrics = vp->metrics1; + vp->new_metrics = vp->metrics2; + //no bias step + return 0; + } + + int + cc_decoder_impl::find_endstate() + { + unsigned char* met = ((d_k + d_veclen)%2 == 0)? d_vp->new_metrics.t : d_vp->old_metrics.t; + + unsigned char min = met[0]; + int state = 0; + for(int i = 1; i < d_numstates; ++i) { + if(met[i] < min) { + min = met[i]; + state = i; + } + + + } + //printf("min %d\n", state); + return state; + } + + int + cc_decoder_impl::update_viterbi_blk(unsigned char* syms, int nbits) + { + unsigned char *d; + + d = d_vp->decisions; + + memset(d,0,d_decision_t_size * nbits); + + d_kernel(d_vp->new_metrics.t, d_vp->old_metrics.t, syms, + d, nbits - (d_k - 1), d_k - 1, Branchtab); + + return 0; + } + + int + cc_decoder_impl::chainback_viterbi(unsigned char* data, + unsigned int nbits, + unsigned int endstate, + unsigned int tailsize) + { + unsigned char *d; + + /* ADDSHIFT and SUBSHIFT make sure that the thing returned is a byte. */ + d = d_vp->decisions; + /* Make room beyond the end of the encoder register so we can + * accumulate a full byte of decoded data + */ + + endstate = (endstate%d_numstates) << d_ADDSHIFT; + + /* The store into data[] only needs to be done every 8 bits. + * But this avoids a conditional branch, and the writes will + * combine in the cache anyway + */ + + d += tailsize * d_decision_t_size ; /* Look past tail */ + int retval; + int dif = tailsize - (d_k - 1); + decision_t dec; + while(nbits-- > d_frame_size - (d_k - 1)) { + int k; + dec.t = &d[nbits * d_decision_t_size]; + k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1; + + endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT)); + data[((nbits+dif)%d_frame_size)] = k; + + retval = endstate; + } + nbits += 1; + + while(nbits-- != 0) { + int k; + + dec.t = &d[nbits * d_decision_t_size]; + + k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1; + + endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT)); + data[((nbits+dif)%d_frame_size)] = k; + } + + return retval >> d_ADDSHIFT; + } + + bool + cc_decoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("cc_decoder: tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + switch(d_mode) { + case(CC_TAILBITING): + d_veclen = d_frame_size + (6 * (d_k - 1)); + if(d_veclen * d_rate > d_managed_in_size) { + throw std::runtime_error("cc_decoder: attempt to resize beyond d_managed_in buffer size!\n"); + } + break; + + case(CC_TRUNCATED): + d_veclen = d_frame_size; + break; + + case(CC_STREAMING): + d_veclen = d_frame_size + d_k - 1; + break; + + case(CC_TERMINATED): + // If the input is being padded out to a byte, we know the + // real frame size is without the padding. + d_frame_size -= d_padding * d_rate; + d_veclen = d_frame_size + d_k - 1; + break; + + default: + throw std::runtime_error("cc_decoder: mode not recognized"); + } + + return ret; + } + + double + cc_decoder_impl::rate() + { + return 1.0/static_cast<double>(d_rate); + } + + void + cc_decoder_impl::generic_work(void *inbuffer, void *outbuffer) + { + const unsigned char *in = (const unsigned char *) inbuffer; + unsigned char *out = (unsigned char *) outbuffer; + + switch(d_mode) { + + case(CC_TAILBITING): + memcpy(d_managed_in, in, d_frame_size * d_rate * sizeof(unsigned char)); + memcpy(d_managed_in + d_frame_size * d_rate * sizeof(unsigned char), in, + (d_veclen - d_frame_size) * d_rate * sizeof(unsigned char)); + update_viterbi_blk(d_managed_in, d_veclen); + d_end_state_chaining = find_endstate(); + chainback_viterbi(&out[0], d_frame_size, *d_end_state, d_veclen - d_frame_size); + init_viterbi_unbiased(d_vp); + break; + + + case(CC_TRUNCATED): + update_viterbi_blk((unsigned char*)(&in[0]), d_veclen); + d_end_state_chaining = find_endstate(); + for(unsigned int i = 0; i < d_k-1; ++i) { + out[d_veclen - 1 - i] = ((*d_end_state) >> i) & 1; + } + d_start_state_chaining = chainback_viterbi(&out[0], d_frame_size - (d_k - 1), + *d_end_state, d_k - 1); + init_viterbi(d_vp, *d_start_state); + break; + + case(CC_STREAMING): + case(CC_TERMINATED): + update_viterbi_blk((unsigned char*)(&in[0]), d_veclen); + d_end_state_chaining = find_endstate(); + d_start_state_chaining = chainback_viterbi(&out[0], d_frame_size, *d_end_state, + d_veclen - d_frame_size); + + init_viterbi(d_vp, *d_start_state); + break; + + default: + throw std::runtime_error("cc_decoder: mode not recognized"); + } + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/cc_decoder_impl.h b/gr-fec/lib/cc_decoder_impl.h new file mode 100644 index 0000000000..33ced0250c --- /dev/null +++ b/gr-fec/lib/cc_decoder_impl.h @@ -0,0 +1,106 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_CC_DECODER_IMPL_H +#define INCLUDED_FEC_CC_DECODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/cc_decoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API cc_decoder_impl : public cc_decoder + { + private: + //plug into the generic fec api + int get_output_size(); + int get_input_size(); + int get_history(); + float get_shift(); + int get_input_item_size(); + const char* get_input_conversion(); + //const char* get_output_conversion(); + + //everything else... + void create_viterbi(); + int init_viterbi(struct v* vp, int starting_state); + int init_viterbi_unbiased(struct v* vp); + int update_viterbi_blk(unsigned char* syms, int nbits); + int chainback_viterbi(unsigned char* data, unsigned int nbits, + unsigned int endstate, unsigned int tailsize); + int find_endstate(); + int tester[12]; + + unsigned char *Branchtab; + unsigned char Partab[256]; + + + int d_ADDSHIFT; + int d_SUBSHIFT; + conv_kernel d_kernel; + unsigned int d_max_frame_size; + unsigned int d_frame_size; + unsigned int d_k; + unsigned int d_rate; + unsigned int d_partial_rate; + std::vector<int> d_polys; + cc_mode_t d_mode; + int d_padding; + + struct v* d_vp; + unsigned char* d_managed_in; + unsigned int d_managed_in_size; + int d_numstates; + int d_decision_t_size; + int *d_start_state; + int d_start_state_chaining; + int d_start_state_nonchaining; + int *d_end_state; + int d_end_state_chaining; + int d_end_state_nonchaining; + unsigned int d_veclen; + + int parity(int x); + int parityb(unsigned char x); + void partab_init(void); + std::map<std::string, conv_kernel> yp_kernel; + + public: + cc_decoder_impl(int frame_size, int k, + int rate, std::vector<int> polys, + int start_state = 0, int end_state = -1, + cc_mode_t mode=CC_STREAMING, bool padded=false); + ~cc_decoder_impl(); + + void generic_work(void *inbuffer, void *outbuffer); + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CC_DECODER_IMPL_H */ diff --git a/gr-fec/lib/cc_encoder_impl.cc b/gr-fec/lib/cc_encoder_impl.cc new file mode 100644 index 0000000000..75d7dcd66b --- /dev/null +++ b/gr-fec/lib/cc_encoder_impl.cc @@ -0,0 +1,204 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cc_encoder_impl.h" +#include <math.h> +#include <boost/assign/list_of.hpp> +#include <volk/volk_typedefs.h> +#include <volk/volk.h> +#include <sstream> +#include <stdio.h> +#include <vector> +#include <gnuradio/fec/generic_encoder.h> +#include <gnuradio/fec/cc_common.h> + +namespace gr { + namespace fec { + namespace code { + + generic_encoder::sptr + cc_encoder::make(int frame_size, int k, int rate, + std::vector<int> polys, int start_state, + cc_mode_t mode, bool padded) + { + return generic_encoder::sptr + (new cc_encoder_impl(frame_size, k, rate, + polys, start_state, + mode, padded)); + } + + cc_encoder_impl::cc_encoder_impl(int frame_size, int k, int rate, + std::vector<int> polys, int start_state, + cc_mode_t mode, bool padded) + : generic_encoder("cc_encoder"), + d_rate(rate), d_k(k), d_polys(polys), + d_start_state(start_state), + d_mode(mode), d_padding(0) + { + if(static_cast<size_t>(d_rate) != d_polys.size()) { + throw std::runtime_error("cc_encoder: Number of polynomials must be the same as the value of rate"); + } + + partab_init(); + + // set up a padding factor. If padding, extends the encoding + // by this many bits to fit into a full byte. + if(padded && (mode == CC_TERMINATED)) { + d_padding = static_cast<int>(8.0f*ceilf(d_rate*(d_k-1)/8.0f) - (d_rate*(d_k-1))); + } + + d_max_frame_size = frame_size; + set_frame_size(frame_size); + } + + cc_encoder_impl::~cc_encoder_impl() + { + } + + int + cc_encoder_impl::get_output_size() + { + return d_output_size; + } + + int + cc_encoder_impl::get_input_size() + { + return d_frame_size; + } + + bool + cc_encoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + if(d_mode == CC_TERMINATED) { + d_output_size = d_rate * (d_frame_size + d_k - 1) + d_padding; + } + /* + else if(d_trunc_intrinsic) { + int cnt = 0; + for(int i = 0; i < d_rate; ++i) { + if (d_polys[i] != 1) { + cnt++; + } + } + d_output_size = (d_rate * (d_frame_size)) + (cnt * (d_k - 1)); + } + */ + else { + d_output_size = d_rate * d_frame_size; + } + + return ret; + } + + double + cc_encoder_impl::rate() + { + return static_cast<double>(d_rate); + } + + int + cc_encoder_impl::parity(int x) + { + x ^= (x >> 16); + x ^= (x >> 8); + return parityb(x); + } + + int + cc_encoder_impl::parityb(unsigned char x) + { + return Partab[x]; + } + + void + cc_encoder_impl::partab_init(void) + { + int i,cnt,ti; + + /* Initialize parity lookup table */ + for(i=0;i<256;i++){ + cnt = 0; + ti = i; + while(ti){ + if(ti & 1) + cnt++; + ti >>= 1; + } + Partab[i] = cnt & 1; + } + } + + void + cc_encoder_impl::generic_work(void *in_buffer, void *out_buffer) + { + const unsigned char *in = (const unsigned char *) in_buffer; + unsigned char *out = (unsigned char *) out_buffer; + + unsigned char my_state = d_start_state; + + if(d_mode == CC_TAILBITING) { + for(unsigned int i = 0; i < d_k - 1; ++i) { + my_state = (my_state << 1) | (in[d_frame_size - (d_k - 1) + i] & 1); + } + } + + for(unsigned int i = 0; i < d_frame_size; ++i) { + my_state = (my_state << 1) | (in[i] & 1); + for(unsigned int j = 0; j < d_rate; ++j) { + out[i * d_rate + j] = parity(my_state & d_polys[j]) == 0 ? 0 : 1; + } + } + + if(d_mode == CC_TERMINATED) { + for(unsigned int i = 0; i < d_k - 1; ++i) { + my_state = (my_state << 1) | ((d_start_state >> (d_k - 2 - i)) & 1); + for(unsigned int j = 0; j < d_rate; ++j) { + out[(i + d_frame_size) * d_rate + j] = parity(my_state & d_polys[j]) == 0 ? 0 : 1; + } + } + } + + if(d_mode == CC_TRUNCATED) { + my_state = d_start_state; + } + + d_start_state = my_state; + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/cc_encoder_impl.h b/gr-fec/lib/cc_encoder_impl.h new file mode 100644 index 0000000000..77d5f42462 --- /dev/null +++ b/gr-fec/lib/cc_encoder_impl.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + * +p * 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. + */ + +#ifndef INCLUDED_FEC_CC_ENCODER_IMPL_H +#define INCLUDED_FEC_CC_ENCODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/cc_encoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API cc_encoder_impl : public cc_encoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + + //everything else... + unsigned char Partab[256]; + unsigned int d_frame_size; + unsigned int d_max_frame_size; + unsigned int d_rate; + unsigned int d_k; + std::vector<int> d_polys; + struct v* d_vp; + int d_numstates; + int d_decision_t_size; + int d_start_state; + cc_mode_t d_mode; + int d_padding; + int d_output_size; + + int parity(int x); + int parityb(unsigned char x); + void partab_init(void); + + public: + cc_encoder_impl(int frame_size, int k, int rate, + std::vector<int> polys, int start_state = 0, + cc_mode_t mode=CC_STREAMING, bool padded=false); + ~cc_encoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CC_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/ccsds_encoder_impl.cc b/gr-fec/lib/ccsds_encoder_impl.cc new file mode 100644 index 0000000000..2a2228a8ed --- /dev/null +++ b/gr-fec/lib/ccsds_encoder_impl.cc @@ -0,0 +1,152 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "ccsds_encoder_impl.h" +#include <gnuradio/fec/generic_encoder.h> +#include <cstdio> + +extern "C" { +#include <gnuradio/fec/viterbi.h> +} + +namespace gr { + namespace fec { + namespace code { + + generic_encoder::sptr + ccsds_encoder::make(int frame_size, int start_state, + cc_mode_t mode) + { + return generic_encoder::sptr + (new ccsds_encoder_impl(frame_size, start_state, mode)); + } + + ccsds_encoder_impl::ccsds_encoder_impl(int frame_size, int start_state, + cc_mode_t mode) + : generic_encoder("ccsds_encoder"), + d_start_state(static_cast<unsigned char>(start_state)), + d_mode(mode) + { + d_max_frame_size = frame_size; + set_frame_size(frame_size); + } + + ccsds_encoder_impl::~ccsds_encoder_impl() + { + } + + int + ccsds_encoder_impl::get_output_size() + { + return d_output_size; + } + + int + ccsds_encoder_impl::get_input_size() + { + return d_frame_size/8; // packed byte input + } + + const char* + ccsds_encoder_impl::get_input_conversion() + { + // Expects packed data input; tell wrapper to pack it. + return "pack"; + } + + bool + ccsds_encoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + if(d_mode == CC_TERMINATED) { + d_output_size = 2*(d_frame_size + 7 - 1); + } + else { + d_output_size = 2*d_frame_size; + } + + return ret; + } + + double + ccsds_encoder_impl::rate() + { + return 0.5; + } + + void + ccsds_encoder_impl::generic_work(void *in_buffer, void *out_buffer) + { + unsigned char *in = (unsigned char*) in_buffer; + unsigned char *out = (unsigned char*) out_buffer; + + unsigned char my_state = d_start_state; + + if(d_mode == CC_TAILBITING) { + // Grab K-1 (6) bits of data from the last input byte to add + // onto the from of the encoding stream for tailbiting mode. + unsigned char sym = in[d_frame_size/8 - 1]; + for(unsigned int i = 0; i < 7 - 1; ++i) { + my_state = (my_state << 1) | ((sym >> (5 - i)) & 1); + } + } + + my_state = encode(out, in, d_frame_size/8, my_state); + + if(d_mode == CC_TERMINATED) { + // encode works on bytes, but we are only adding some number + // of bits to the end of the frame, so we abuse the encode + // function by reshifting the start state within the + // for-loop and only taking the last two bits out of the + // encoded 2-bytes. + unsigned char end_bits[16]; + for(unsigned int i = 0; i < (7 - 1); ++i) { + my_state = (my_state << 1) | ((d_start_state >> (7 - 2 - i)) & 1); + encode(&end_bits[0], &my_state, 1, my_state); + out[(i + d_frame_size) * 2 + 0] = end_bits[14]; + out[(i + d_frame_size) * 2 + 1] = end_bits[15]; + } + } + + if(d_mode == CC_TRUNCATED) { + my_state = d_start_state; + } + + d_start_state = my_state; + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/ccsds_encoder_impl.h b/gr-fec/lib/ccsds_encoder_impl.h new file mode 100644 index 0000000000..e67890b0f8 --- /dev/null +++ b/gr-fec/lib/ccsds_encoder_impl.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_CCSDS_ENCODER_IMPL_H +#define INCLUDED_FEC_CCSDS_ENCODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/ccsds_encoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API ccsds_encoder_impl : public ccsds_encoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + const char* get_input_conversion(); + + unsigned int d_max_frame_size; + unsigned int d_frame_size; + + unsigned char d_start_state; + cc_mode_t d_mode; + + int d_output_size; + + public: + ccsds_encoder_impl(int frame_size, int start_state = 0, + cc_mode_t mode=CC_STREAMING); + ~ccsds_encoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CCSDS_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/conv_bit_corr_bb_impl.cc b/gr-fec/lib/conv_bit_corr_bb_impl.cc new file mode 100644 index 0000000000..48de06157b --- /dev/null +++ b/gr-fec/lib/conv_bit_corr_bb_impl.cc @@ -0,0 +1,258 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "conv_bit_corr_bb_impl.h" +#include <gnuradio/io_signature.h> +#include <gnuradio/messages/msg_passing.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + conv_bit_corr_bb::sptr + conv_bit_corr_bb::make(std::vector<unsigned long long> correlator, + int corr_sym, int corr_len, int cut, + int flush, float thresh) + { + return gnuradio::get_initial_sptr + (new conv_bit_corr_bb_impl(correlator, corr_sym, corr_len, + cut, flush, thresh)); + } + + conv_bit_corr_bb_impl::conv_bit_corr_bb_impl(std::vector<unsigned long long> correlator, + int corr_sym, int corr_len, int cut, + int flush, float thresh) + : block("conv_bit_corr_bb", + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char))), + d_acquire(-1), + d_produce(0), + d_message(0), + d_thresh(cut * thresh), + d_corr_len(corr_len), + d_corr_sym(corr_sym), + d_lane(0), + d_op(0), + d_flush(flush), + d_flush_count(0), + d_cut(cut), + d_counter(cut), + d_data_garble_rate(0.0), + d_havelock(false) + //d_acquire_track(-1) + +// d_msgrecv_rpc(alias(), "messages_recieved", &d_msgrecv, +// pmt::mp(0), pmt::mp(65536), pmt::mp(0), +// "messages", "Asynch Messages Recieved", +// RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP), +// d_msgsent_rpc(alias(), "messages_sent", &d_msgsent, +// pmt::mp(0), pmt::mp(65536), pmt::mp(0), +// "messages", "Asynch Messages Sent", +// RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP), +// d_flush_rpc(alias(), "flush_constant", (int*)&d_flush, +// pmt::mp(0), pmt::mp(1), pmt::mp(0), +// "int", "Flush Distance", +// RPC_PRIVLVL_MIN, DISPTIME | DISPOPTSTRIP), +// d_cut_rpc(alias(), "integration_period", &d_cut, +// pmt::from_uint64(0), pmt::from_uint64(65536), pmt::from_uint64(d_cut), +// "uint64_t", "Integration Time"), +// d_data_garble_rate_rpc(alias(), "norm_garble_rate", &d_data_garble_rate, +// pmt::mp(0.0f), pmt::mp(0.0f), pmt::mp(1.0f), +// "normalized_garble_rate", "Normalized Data Garble Rate", +// RPC_PRIVLVL_MIN), +// d_havelock_rpc(alias(), "locked", &d_havelock, +// pmt::mp(0), pmt::mp(1), pmt::mp(0), +// "bool","Sync Locked", +// RPC_PRIVLVL_MIN, DISPTIME) + { + //big correlator mode (ugh) + std::vector<unsigned char> temp; + for(unsigned int k = 0; k < d_corr_sym; ++k) { + d_acc.push_back(0); + } + for(unsigned int i = 0; i < d_corr_len; ++i) { + if((correlator[i/64] >> (64 - (i%64) - 1)) & 1) { + temp.push_back(i); + } + } + d_correlator.push_back(temp); + + for(unsigned int j = 0; j < d_correlator.size(); ++j) { + std::vector<int> temp(d_corr_sym); + d_score_keeper.push_back(temp); + } + + set_history(d_corr_len + d_corr_sym); + d_flush_count = d_corr_len + d_corr_sym - 1; + set_output_multiple(d_corr_sym); + } + + conv_bit_corr_bb_impl::~conv_bit_corr_bb_impl() + { + } + + void + conv_bit_corr_bb_impl::catch_msg(pmt::pmt_t msg) + { + //stub code + d_msgrecv++; + } + + int + conv_bit_corr_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + if(d_flush_count > 0) { + int items = (ninput_items[0] > static_cast<int>(d_flush_count)) ? d_flush_count : ninput_items[0]; + consume_each(items); + d_flush_count -= items; + return 0; + } + + const uint8_t *in = (const uint8_t *) input_items[0]; + uint8_t *score_in = (uint8_t *) input_items[0]; + + //counting on 1:1 forecast + history to provide enough ninput_items... may need to insert check + //printf("%d, %d, %d\n", ninput_items[0], noutput_items, d_counter); + int correlation_cycles = (noutput_items/output_multiple() <= static_cast<int>(d_counter)) ? \ + noutput_items/output_multiple() : d_counter; + + + for(int p = 0; p < correlation_cycles; ++p) { + //reset scores + for(unsigned int j = 0; j < d_correlator.size(); ++j) { + for(unsigned int i = 0; i < d_corr_sym; ++i) { + d_score_keeper[j][i] = 0; + } + } + + //correlate against each correlation constant + for(unsigned int j = 0; j < d_correlator.size(); ++j) { + for(unsigned int k = 0; k < d_corr_sym; ++k) { + for(unsigned int i = 0; i < d_correlator[j].size(); ++i) { + d_score_keeper[j][k] += (score_in[d_correlator[j][i] + k] >= 128) ? 1 : 0; + } + } + + for(unsigned int k = 0; k < d_corr_sym; ++k) { + d_acc[j * (d_corr_sym) + k] += d_score_keeper[j][k] % 2; + } + } + score_in += d_corr_sym; + } + + //decrement the cut counter + + d_counter -= correlation_cycles; + + //d_counter == 0: check the accumulator and update states + if(d_counter == 0) { + d_message = 1; + d_produce = 0; + float my_min = 1.0; + for(unsigned int i = 0; (i < d_correlator.size()) && (!d_produce); ++i) { + for(unsigned int k = 0; k < d_corr_sym; ++k) { + + my_min = (d_acc[i * (d_corr_sym) + k]/(float)d_cut < my_min) ? \ + d_acc[i * (d_corr_sym) + k]/(float)d_cut:my_min; + + if(d_acc[i * (d_corr_sym) + k] < d_thresh) { + d_produce = 1; + d_message = 0; + d_acquire = k; + d_lane = i + 1; + d_op = 1; + //printf("winner: lane %u, punc_cycle %u, pos/neg corr %d\n", i, k, d_op); + break; + } + else if(d_acc[i * (d_corr_sym) + k] > (d_cut - d_thresh)) { + d_acquire = k; + d_lane = i + 1; + d_op = -1; + //printf("winner: lane %u, punc_cycle %u, pos/neg corr %d\n", i, k, d_op); + break; + } + } + d_data_garble_rate = 100.0 * data_garble_rate(d_correlator[i].size(), my_min); + d_havelock = d_data_garble_rate < 3; + } + + //clear the accumulator, reset the counter + d_counter = d_cut; + for(unsigned int i = 0; i < d_correlator.size(); ++i) { + for(unsigned int k = 0; k < d_corr_sym; ++k) { + d_acc[i * (d_corr_sym) + k] = 0; + } + } + + //examine the new states and react to environment, make a final production decision + if(d_message) { + d_msgsent++; + //stub code + d_message = 0; + } + } + //states are set + + if(d_produce) { + //printf("producing\n"); + unsigned char *out = (unsigned char *) output_items[0]; + memcpy(out, &(in[d_acquire]), correlation_cycles*d_corr_sym*sizeof(unsigned char)); + + consume_each(d_corr_sym * correlation_cycles); + return d_corr_sym * correlation_cycles; + } + + else { + consume_each(d_corr_sym * correlation_cycles); + return 0; + } + } + + float + conv_bit_corr_bb_impl::data_garble_rate(int taps, float target) + { + double base,expo,answer; + + if(target > 0.5) + target=1-target; + + base=1.0-2.0*target; + expo=(double) 1/taps; + answer=0.5*(1-pow(base,expo)); + + if((errno==EDOM) || (errno==ERANGE)) { + fprintf(stderr,"Out of range errors while computing garble rate.\n"); + exit(-1); + } + return answer; + } + + } /* namespace fec */ +} /* namespace gr */ + diff --git a/gr-fec/lib/conv_bit_corr_bb_impl.h b/gr-fec/lib/conv_bit_corr_bb_impl.h new file mode 100644 index 0000000000..509ad6f23e --- /dev/null +++ b/gr-fec/lib/conv_bit_corr_bb_impl.h @@ -0,0 +1,97 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_CONV_BIT_CORR_BB_IMPL_H +#define INCLUDED_FEC_CONV_BIT_CORR_BB_IMPL_H + +#include <gnuradio/fec/conv_bit_corr_bb.h> + +namespace gr { + namespace fec { + + class FEC_API conv_bit_corr_bb_impl : public conv_bit_corr_bb + { + private: + std::vector< std::vector<int> > d_score_keeper; + + int d_angry_fop; + int d_acquire; + //int d_acquire_track; + unsigned int d_produce; + unsigned int d_message; + unsigned int d_thresh; + unsigned int d_corr_len; + unsigned int d_corr_sym; + unsigned int d_lane; + unsigned int d_op; + unsigned int d_flush; + unsigned int d_flush_count; + std::vector< std::vector<unsigned char> > d_correlator; + std::vector<unsigned int> d_acc; + uint64_t d_cut; + uint64_t d_counter; + float d_data_garble_rate; + + void alert_fops(); + +// //rpcbasic_register_get<conv_bit_corr_bb, std::vector< int> > d_correlator_rpc; +// rpcbasic_register_variable_rw<uint64_t> d_cut_rpc; // integration period +// rpcbasic_register_variable_rw<int> d_flush_rpc; // time to flush +// rpcbasic_register_variable<uint64_t> d_msgsent_rpc; +// rpcbasic_register_variable<uint64_t> d_msgrecv_rpc; +// rpcbasic_register_variable<float> d_data_garble_rate_rpc; + + uint64_t d_msgsent,d_msgrecv; + std::vector<int> get_corr() + { + std::vector<int> bits; + if(d_correlator.size() < 1) { + return bits; + } + for(size_t i = 0; i < d_correlator[0].size(); i++) { + bits.push_back(d_correlator[0][i]); + } + return bits; + } + + bool d_havelock; + //rpcbasic_register_variable<bool> d_havelock_rpc; + + public: + conv_bit_corr_bb_impl(std::vector<unsigned long long> correlator, + int corr_sym, int corr_len, int cut, + int flush, float thresh); + ~conv_bit_corr_bb_impl(); + + void catch_msg(pmt::pmt_t msg); + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + + float data_garble_rate(int taps, float target); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_CONV_BIT_CORR_BB_IMPL_H */ diff --git a/gr-fec/lib/decode_ccsds_27_fb_impl.cc b/gr-fec/lib/decode_ccsds_27_fb_impl.cc index 1058e67296..9b782b7098 100644 --- a/gr-fec/lib/decode_ccsds_27_fb_impl.cc +++ b/gr-fec/lib/decode_ccsds_27_fb_impl.cc @@ -37,9 +37,9 @@ namespace gr { decode_ccsds_27_fb_impl::decode_ccsds_27_fb_impl() : sync_decimator("decode_ccsds_27_fb", - io_signature::make (1, 1, sizeof(float)), - io_signature::make (1, 1, sizeof(char)), - 2*8), d_count(0) // Rate 1/2 code, unpacked to packed conversion + io_signature::make (1, 1, sizeof(float)), + io_signature::make (1, 1, sizeof(char)), + 2*8), d_count(0) // Rate 1/2 code, unpacked to packed conversion { float RATE = 0.5; float ebn0 = 12.0; @@ -55,20 +55,20 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - const float *in = (const float *)input_items[0]; - unsigned char *out = (unsigned char *)output_items[0]; + const float *in = (const float*)input_items[0]; + unsigned char *out = (unsigned char*)output_items[0]; for (int i = 0; i < noutput_items*16; i++) { // Translate and clip [-1.0..1.0] to [28..228] float sample = in[i]*100.0+128.0; - if (sample > 255.0) + if(sample > 255.0) sample = 255.0; - else if (sample < 0.0) + else if(sample < 0.0) sample = 0.0; unsigned char sym = (unsigned char)(floor(sample)); d_viterbi_in[d_count % 4] = sym; - if ((d_count % 4) == 3) { + if((d_count % 4) == 3) { // Every fourth symbol, perform butterfly operation viterbi_butterfly2(d_viterbi_in, d_mettab, d_state0, d_state1); diff --git a/gr-fec/lib/decoder_impl.cc b/gr-fec/lib/decoder_impl.cc new file mode 100644 index 0000000000..ba8a7d000e --- /dev/null +++ b/gr-fec/lib/decoder_impl.cc @@ -0,0 +1,120 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "decoder_impl.h" +#include <gnuradio/io_signature.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + decoder::sptr + decoder::make(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size) + { + return gnuradio::get_initial_sptr + ( new decoder_impl(my_decoder, input_item_size, output_item_size)); + } + + decoder_impl::decoder_impl(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size) + : block("fec_decoder", + io_signature::make(1, 1, input_item_size), + io_signature::make(1, 1, output_item_size)), + d_input_item_size(input_item_size), d_output_item_size(output_item_size) + { + set_fixed_rate(true); + set_relative_rate((double)(my_decoder->get_output_size())/my_decoder->get_input_size()); + + //want to guarantee you have enough to run at least one time... + //remember! this is not a sync block... set_output_multiple does not + //actually guarantee the output multiple... it DOES guarantee how many + //outputs (hence inputs) are made available... this is WEIRD to do in + //GNU Radio, and the algorithm is sensitive to this value + set_output_multiple(my_decoder->get_output_size() + (my_decoder->get_history())); + d_decoder = my_decoder; + } + + int + decoder_impl::fixed_rate_ninput_to_noutput(int ninput) + { + return (int)(0.5 + ninput*relative_rate()); + } + + int + decoder_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int)(0.5 + noutput/relative_rate()); + } + + void + decoder_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = 0.5 + fixed_rate_noutput_to_ninput(noutput_items); + } + + int + decoder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const unsigned char *in = (unsigned char*)input_items[0]; + unsigned char *out = (unsigned char *)output_items[0]; + + int outnum = (int)(((1.0/relative_rate()) * noutput_items) + 0.5); + int innum = (int)(relative_rate() * (ninput_items[0] - d_decoder->get_history()) + 0.5)/(output_multiple() - d_decoder->get_history()); + + int items = (outnum <= ninput_items[0] - d_decoder->get_history()) ? + noutput_items/(output_multiple() - d_decoder->get_history()) : + innum; + + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%, %2%, %3%") \ + % outnum % ninput_items[0] % items); + + for(int i = 0; i < items; ++i) { + d_decoder->generic_work((void*)(in+(i*d_decoder->get_input_size()*d_input_item_size)), + (void*)(out+(i*d_decoder->get_output_size()*d_output_item_size))); + + add_item_tag(0, nitems_written(0) + ((i+1)*d_decoder->get_output_size()*d_output_item_size), + pmt::intern(d_decoder->alias()), pmt::PMT_T, pmt::intern(alias())); + } + + int consumed = static_cast<int>(items/relative_rate()*(output_multiple() - d_decoder->get_history()) + 0.5); + int returned = items*(output_multiple() - d_decoder->get_history()); + + GR_LOG_DEBUG(d_debug_logger, boost::format("consumed %1%") % consumed); + GR_LOG_DEBUG(d_debug_logger, boost::format("returned %1%") % returned); + + consume_each(consumed); + return returned; + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/decoder_impl.h b/gr-fec/lib/decoder_impl.h new file mode 100644 index 0000000000..78b1b926b5 --- /dev/null +++ b/gr-fec/lib/decoder_impl.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_DECODER_IMPL_H +#define INCLUDED_FEC_DECODER_IMPL_H + +#include <gnuradio/fec/decoder.h> + +namespace gr { + namespace fec { + + class FEC_API decoder_impl : public decoder + { + private: + generic_decoder::sptr d_decoder; + size_t d_input_item_size; + size_t d_output_item_size; + + public: + decoder_impl(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int fixed_rate_ninput_to_noutput(int ninput); + int fixed_rate_noutput_to_ninput(int noutput); + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DECODER_IMPL_H */ diff --git a/gr-fec/lib/depuncture_bb_impl.cc b/gr-fec/lib/depuncture_bb_impl.cc new file mode 100644 index 0000000000..e388120bbf --- /dev/null +++ b/gr-fec/lib/depuncture_bb_impl.cc @@ -0,0 +1,153 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "depuncture_bb_impl.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <boost/bind.hpp> +#include <pmt/pmt.h> +#include <string> +#include <stdio.h> + +namespace gr { + namespace fec { + + depuncture_bb::sptr + depuncture_bb::make(int puncsize, int puncpat, + int delay, char symbol) + { + return gnuradio::get_initial_sptr + (new depuncture_bb_impl(puncsize, puncpat, + delay, symbol)); + } + + depuncture_bb_impl::depuncture_bb_impl(int puncsize, int puncpat, + int delay, char symbol) + : block("depuncture_bb", + io_signature::make(1, 1, sizeof(unsigned char)), + io_signature::make(1, 1, sizeof(unsigned char))), + d_puncsize(puncsize), d_delay(delay), d_sym(symbol) + { + // Create a mask of all 1's of puncsize length + int mask = 0; + for(int i = 0; i < d_puncsize; i++) + mask |= 1 << i; + + // Rotate the pattern for the delay value; then mask it if there + // are any excess 1's in the pattern. + for(int i = 0; i < d_delay; ++i) { + puncpat = ((puncpat & 1) << (d_puncsize - 1)) + (puncpat >> 1); + } + d_puncpat = puncpat & mask; + + // Calculate the number of holes in the pattern. The mask is all + // 1's given puncsize and puncpat is a pattern with >= puncsize + // 0's (masked to ensure this). The difference between the + // number of 1's in the mask and the puncpat is the number of + // holes. + uint32_t count_mask=0, count_pat=0; + volk_32u_popcnt(&count_mask, static_cast<uint32_t>(mask)); + volk_32u_popcnt(&count_pat, static_cast<uint32_t>(d_puncpat)); + d_puncholes = count_mask - count_pat; + + set_fixed_rate(true); + set_relative_rate((double)d_puncsize/(d_puncsize - d_puncholes)); + set_output_multiple(d_puncsize); + //set_msg_handler(boost::bind(&depuncture_bb_impl::catch_msg, this, _1)); + } + + depuncture_bb_impl::~depuncture_bb_impl() + { + } + + int + depuncture_bb_impl::fixed_rate_ninput_to_noutput(int ninput) + { + return (int)(((d_puncsize/(double)(d_puncsize - d_puncholes)) * ninput) + .5); + } + + int + depuncture_bb_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int)((((d_puncsize - d_puncholes)/(double)(d_puncsize)) * noutput) + .5); + } + + void + depuncture_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = (int)((((d_puncsize - d_puncholes)/(double)(d_puncsize)) * noutput_items) + .5); + } + + /* + void depuncture_bb_impl::catch_msg(pmt::pmt_t msg) + { + long mlong = pmt::pmt_to_long(msg); + for(int i = 0; i < mlong; ++i) { + d_puncholes = (d_puncholes >> 1) | ((d_puncholes & 1) << (d_puncsize - 1)); + } + } + */ + + int + depuncture_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const uint8_t *in = (const uint8_t*)input_items[0]; + uint8_t *out = (uint8_t*)output_items[0]; + + for(int i=0, k=0; i < noutput_items/output_multiple(); ++i) { + for(int j = 0; j < output_multiple(); ++j) { + out[i*output_multiple() + j] = ((d_puncpat >> (d_puncsize - 1 - j)) & 1) ? in[k++] : d_sym; + } + } + + /* + GR_LOG_DEBUG(d_debug_logger, ">>>>>> start"); + for(int i = 0, k=0; i < noutput_items; ++i) { + if((d_puncpat >> (d_puncsize - 1 - (i % d_puncsize))) & 1) { + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%...%2%") \ + % out[i] % in[k++]); + } + else { + GR_LOG_DEBUG(d_debug_logger, boost::format("snit %1%") % out[i]); + } + } + + GR_LOG_DEBUG(d_debug_logger, boost::format("comp: %1%, %2%\n") \ + % noutput_items % ninput_items[0]); + GR_LOG_DEBUG(d_debug_logger, boost::format("consuming %1%") \ + % ((int)(((1.0/relative_rate()) * noutput_items) + .5))); + */ + + consume_each((int)(((1.0/relative_rate()) * noutput_items) + .5)); + return noutput_items; + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/depuncture_bb_impl.h b/gr-fec/lib/depuncture_bb_impl.h new file mode 100644 index 0000000000..013276d7ee --- /dev/null +++ b/gr-fec/lib/depuncture_bb_impl.h @@ -0,0 +1,58 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_REINFLATE_BB_IMPL_H +#define INCLUDED_FEC_REINFLATE_BB_IMPL_H + +#include <gnuradio/fec/depuncture_bb.h> + +namespace gr { + namespace fec { + + class FEC_API depuncture_bb_impl : public depuncture_bb + { + private: + int d_puncsize; + int d_delay; + int d_puncholes; + int d_puncpat; + char d_sym; + + public: + depuncture_bb_impl(int puncsize, int puncpat, + int delay=0, char symbol=127); + ~depuncture_bb_impl(); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int fixed_rate_ninput_to_noutput(int ninput); + int fixed_rate_noutput_to_ninput(int noutput); + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DEPUNCTURE_BB_IMPL_H */ diff --git a/gr-fec/lib/dummy_decoder_impl.cc b/gr-fec/lib/dummy_decoder_impl.cc new file mode 100644 index 0000000000..5ab91d0799 --- /dev/null +++ b/gr-fec/lib/dummy_decoder_impl.cc @@ -0,0 +1,124 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dummy_decoder_impl.h" +#include <math.h> +#include <boost/assign/list_of.hpp> +#include <volk/volk.h> +#include <sstream> +#include <stdio.h> +#include <vector> + +namespace gr { + namespace fec { + namespace code { + + generic_decoder::sptr + dummy_decoder::make(int frame_size) + { + return generic_decoder::sptr + (new dummy_decoder_impl(frame_size)); + } + + dummy_decoder_impl::dummy_decoder_impl(int frame_size) + : generic_decoder("dummy_decoder") + { + // Set max frame size here; all buffers and settings will be + // based on this value. + d_max_frame_size = frame_size; + set_frame_size(frame_size); + } + + dummy_decoder_impl::~dummy_decoder_impl() + { + } + + int + dummy_decoder_impl::get_output_size() + { + //unpacked bits + return d_frame_size; + } + + int + dummy_decoder_impl::get_input_size() + { + return d_frame_size; + } + + int + dummy_decoder_impl::get_input_item_size() + { + return sizeof(float); + } + + const char* + dummy_decoder_impl::get_input_conversion() + { + return "none"; + } + + float + dummy_decoder_impl::get_shift() + { + return 1; + } + + bool + dummy_decoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + return ret; + } + + double + dummy_decoder_impl::rate() + { + return 1.0; + } + + void + dummy_decoder_impl::generic_work(void *inbuffer, void *outbuffer) + { + const float *in = (const float*)inbuffer; + int8_t *out = (int8_t*)outbuffer; + + //memcpy(out, in, d_frame_size*sizeof(char)); + volk_32f_s32f_convert_8i(out, in, 1.0/2.0, d_frame_size); + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/dummy_decoder_impl.h b/gr-fec/lib/dummy_decoder_impl.h new file mode 100644 index 0000000000..4685a86f14 --- /dev/null +++ b/gr-fec/lib/dummy_decoder_impl.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_DUMMY_DECODER_IMPL_H +#define INCLUDED_FEC_DUMMY_DECODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/dummy_decoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API dummy_decoder_impl : public dummy_decoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + int get_input_item_size(); + float get_shift(); + const char* get_input_conversion(); + //const char* get_output_conversion(); + + unsigned int d_max_frame_size; + unsigned int d_frame_size; + + public: + dummy_decoder_impl(int frame_size); + ~dummy_decoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DUMMY_DECODER_IMPL_H */ diff --git a/gr-fec/lib/dummy_encoder_impl.cc b/gr-fec/lib/dummy_encoder_impl.cc new file mode 100644 index 0000000000..188b07cef6 --- /dev/null +++ b/gr-fec/lib/dummy_encoder_impl.cc @@ -0,0 +1,99 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dummy_encoder_impl.h" +#include <gnuradio/fec/generic_encoder.h> +#include <volk/volk.h> +#include <sstream> + +namespace gr { + namespace fec { + namespace code { + + generic_encoder::sptr + dummy_encoder::make(int frame_size) + { + return generic_encoder::sptr + (new dummy_encoder_impl(frame_size)); + } + + dummy_encoder_impl::dummy_encoder_impl(int frame_size) + : generic_encoder("dummy_encoder") + { + d_max_frame_size = frame_size; + set_frame_size(frame_size); + } + + dummy_encoder_impl::~dummy_encoder_impl() + { + } + + int + dummy_encoder_impl::get_output_size() + { + return d_frame_size; + } + + int + dummy_encoder_impl::get_input_size() + { + return d_frame_size; + } + + bool + dummy_encoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + return ret; + } + + double + dummy_encoder_impl::rate() + { + return 1.0; + } + + void + dummy_encoder_impl::generic_work(void *inbuffer, void *outbuffer) + { + const unsigned char *in = (const unsigned char*)inbuffer; + unsigned char *out = (unsigned char*)outbuffer; + + memcpy(out, in, d_frame_size*sizeof(char)); + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/dummy_encoder_impl.h b/gr-fec/lib/dummy_encoder_impl.h new file mode 100644 index 0000000000..7bfb1cd666 --- /dev/null +++ b/gr-fec/lib/dummy_encoder_impl.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +/* + * 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. + * +p * 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. + */ + +#ifndef INCLUDED_FEC_DUMMY_ENCODER_IMPL_H +#define INCLUDED_FEC_DUMMY_ENCODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/dummy_encoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API dummy_encoder_impl : public dummy_encoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + + unsigned int d_max_frame_size; + unsigned int d_frame_size; + + public: + dummy_encoder_impl(int frame_size); + ~dummy_encoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_DUMMY_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/encoder_impl.cc b/gr-fec/lib/encoder_impl.cc new file mode 100644 index 0000000000..399bcc41cf --- /dev/null +++ b/gr-fec/lib/encoder_impl.cc @@ -0,0 +1,113 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "encoder_impl.h" +#include <gnuradio/io_signature.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + encoder::sptr + encoder::make(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size) + { + return gnuradio::get_initial_sptr + (new encoder_impl(my_encoder, input_item_size, + output_item_size)); + } + + encoder_impl::encoder_impl(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size) + : block("fec_encoder", + io_signature::make(1, 1, input_item_size), + io_signature::make(1, 1, output_item_size)), + d_input_item_size(input_item_size), + d_output_item_size(output_item_size) + { + set_fixed_rate(true); + set_relative_rate((double)my_encoder->get_output_size()/(double)my_encoder->get_input_size()); + set_output_multiple(my_encoder->get_output_size()); + d_encoder = my_encoder; + + d_input_size = d_encoder->get_input_size()*d_input_item_size; + d_output_size = d_encoder->get_output_size()*d_output_item_size; + } + + encoder_impl::~encoder_impl() + { + } + + int + encoder_impl::fixed_rate_ninput_to_noutput(int ninput) + { + return (int)(0.5 + ninput*relative_rate()); + } + + int + encoder_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int)(0.5 + noutput/relative_rate()); + } + + void + encoder_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = fixed_rate_noutput_to_ninput(noutput_items); + } + + int + encoder_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + char *inbuffer = (char*)input_items[0]; + char *outbuffer = (char*)output_items[0]; + + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%, %2%, %3%") \ + % noutput_items % ninput_items[0] % (noutput_items/output_multiple())); + + + for(int i = 0; i < noutput_items/output_multiple(); i++) { + d_encoder->generic_work((void*)(inbuffer+(i*d_input_size)), + (void*)(outbuffer+(i*d_output_size))); + } + + GR_LOG_DEBUG(d_debug_logger, boost::format("consuming: %1%") \ + % (fixed_rate_noutput_to_ninput(noutput_items))); + GR_LOG_DEBUG(d_debug_logger, boost::format("returning: %1%") \ + % (noutput_items)); + + consume_each(fixed_rate_noutput_to_ninput(noutput_items)); + return noutput_items; + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/encoder_impl.h b/gr-fec/lib/encoder_impl.h new file mode 100644 index 0000000000..3f325219b8 --- /dev/null +++ b/gr-fec/lib/encoder_impl.h @@ -0,0 +1,59 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_ENCODER_IMPL_H +#define INCLUDED_FEC_ENCODER_IMPL_H + +#include <gnuradio/fec/encoder.h> + +namespace gr { + namespace fec { + + class FEC_API encoder_impl : public encoder + { + private: + generic_encoder::sptr d_encoder; + size_t d_input_item_size; + size_t d_output_item_size; + size_t d_input_size; + size_t d_output_size; + + public: + encoder_impl(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size); + ~encoder_impl(); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int fixed_rate_ninput_to_noutput(int ninput); + int fixed_rate_noutput_to_ninput(int noutput); + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/generic_decoder.cc b/gr-fec/lib/generic_decoder.cc new file mode 100644 index 0000000000..aa11aa8d5e --- /dev/null +++ b/gr-fec/lib/generic_decoder.cc @@ -0,0 +1,168 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/fec/generic_decoder.h> +#include <gnuradio/prefs.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + generic_decoder::generic_decoder(std::string name) + { + d_name = name; + my_id = base_unique_id++; + +#ifdef ENABLE_GR_LOG +#ifdef HAVE_LOG4CPP + prefs *p = prefs::singleton(); + std::string config_file = p->get_string("LOG", "log_config", ""); + std::string log_level = p->get_string("LOG", "log_level", "off"); + std::string log_file = p->get_string("LOG", "log_file", ""); + + GR_CONFIG_LOGGER(config_file); + + GR_LOG_GETLOGGER(LOG, "gr_log." + alias()); + GR_LOG_SET_LEVEL(LOG, log_level); + if(log_file.size() > 0) { + if(log_file == "stdout") { + GR_LOG_SET_CONSOLE_APPENDER(LOG, "cout","gr::log :%p: %c{1} - %m%n"); + } + else if(log_file == "stderr") { + GR_LOG_SET_CONSOLE_APPENDER(LOG, "cerr","gr::log :%p: %c{1} - %m%n"); + } + else { + GR_LOG_SET_FILE_APPENDER(LOG, log_file , true,"%r :%p: %c{1} - %m%n"); + } + } + d_logger = LOG; + +#endif /* HAVE_LOG4CPP */ +#else /* ENABLE_GR_LOG */ + d_logger = NULL; +#endif /* ENABLE_GR_LOG */ + } + + generic_decoder::~generic_decoder() + { + } + + int + generic_decoder::get_history() + { + return 0; + } + + float + generic_decoder::get_shift() + { + return 0.0; + } + + int + generic_decoder::get_input_item_size() + { + return sizeof(float); + } + + int + generic_decoder::get_output_item_size() + { + return sizeof(char); + } + + const char* + generic_decoder::get_input_conversion() + { + return "none"; + } + + const char* + generic_decoder::get_output_conversion() + { + return "none"; + } + + int generic_decoder::base_unique_id = 1; + int + generic_decoder::unique_id() + { + return my_id; + } + + /******************************************************* + * Static functions + ******************************************************/ + int + get_decoder_output_size(generic_decoder::sptr my_decoder) + { + return my_decoder->get_output_size(); + } + + int + get_history(generic_decoder::sptr my_decoder) + { + return my_decoder->get_history(); + } + + int + get_decoder_input_size(generic_decoder::sptr my_decoder) + { + return my_decoder->get_input_size(); + } + + int + get_decoder_output_item_size(generic_decoder::sptr my_decoder) + { + return my_decoder->get_output_item_size(); + } + + int + get_decoder_input_item_size(generic_decoder::sptr my_decoder) + { + return my_decoder->get_input_item_size(); + } + + float + get_shift(generic_decoder::sptr my_decoder) + { + return my_decoder->get_shift(); + } + + const char* + get_decoder_input_conversion(generic_decoder::sptr my_decoder) + { + return my_decoder->get_input_conversion(); + } + + const char* + get_decoder_output_conversion(generic_decoder::sptr my_decoder) + { + return my_decoder->get_output_conversion(); + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/generic_encoder.cc b/gr-fec/lib/generic_encoder.cc new file mode 100644 index 0000000000..c5c7f04f55 --- /dev/null +++ b/gr-fec/lib/generic_encoder.cc @@ -0,0 +1,120 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/fec/generic_encoder.h> +#include <gnuradio/prefs.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + generic_encoder::generic_encoder(std::string name) + { + d_name = name; + my_id = base_unique_id++; + +#ifdef ENABLE_GR_LOG +#ifdef HAVE_LOG4CPP + prefs *p = prefs::singleton(); + std::string config_file = p->get_string("LOG", "log_config", ""); + std::string log_level = p->get_string("LOG", "log_level", "off"); + std::string log_file = p->get_string("LOG", "log_file", ""); + + GR_CONFIG_LOGGER(config_file); + + GR_LOG_GETLOGGER(LOG, "gr_log." + alias()); + GR_LOG_SET_LEVEL(LOG, log_level); + if(log_file.size() > 0) { + if(log_file == "stdout") { + GR_LOG_SET_CONSOLE_APPENDER(LOG, "cout","gr::log :%p: %c{1} - %m%n"); + } + else if(log_file == "stderr") { + GR_LOG_SET_CONSOLE_APPENDER(LOG, "cerr","gr::log :%p: %c{1} - %m%n"); + } + else { + GR_LOG_SET_FILE_APPENDER(LOG, log_file , true,"%r :%p: %c{1} - %m%n"); + } + } + d_logger = LOG; + +#endif /* HAVE_LOG4CPP */ +#else /* ENABLE_GR_LOG */ + d_logger = NULL; +#endif /* ENABLE_GR_LOG */ + } + + generic_encoder::~generic_encoder() + { + } + + const char* + generic_encoder::get_input_conversion() + { + return "none"; + } + + const char* + generic_encoder::get_output_conversion() + { + return "none"; + } + + int generic_encoder::base_unique_id = 1; + int + generic_encoder::unique_id() + { + return my_id; + } + + /******************************************************* + * Static functions + ******************************************************/ + int + get_encoder_output_size(generic_encoder::sptr my_encoder) + { + return my_encoder->get_output_size(); + } + + int + get_encoder_input_size(generic_encoder::sptr my_encoder) + { + return my_encoder->get_input_size(); + } + + const char* + get_encoder_input_conversion(generic_encoder::sptr my_encoder) + { + return my_encoder->get_input_conversion(); + } + + const char* + get_encoder_output_conversion(generic_encoder::sptr my_encoder) + { + return my_encoder->get_output_conversion(); + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/puncture_bb_impl.cc b/gr-fec/lib/puncture_bb_impl.cc new file mode 100644 index 0000000000..63633b2748 --- /dev/null +++ b/gr-fec/lib/puncture_bb_impl.cc @@ -0,0 +1,153 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "puncture_bb_impl.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <boost/bind.hpp> +#include <pmt/pmt.h> +#include <string> +#include <stdio.h> + +namespace gr { + namespace fec { + + puncture_bb::sptr + puncture_bb::make(int puncsize, int puncpat, int delay) + { + return gnuradio::get_initial_sptr + (new puncture_bb_impl(puncsize, puncpat, delay)); + } + + puncture_bb_impl::puncture_bb_impl(int puncsize, int puncpat, int delay) + : block("puncture_bb", + io_signature::make(1, 1, sizeof(char)), + io_signature::make(1, 1, sizeof(char))), + d_puncsize(puncsize), d_delay(delay) + { + // Create a mask of all 1's of puncsize length + int mask = 0; + for(int i = 0; i < d_puncsize; i++) + mask |= 1 << i; + + // Rotate the pattern for the delay value; then mask it if there + // are any excess 1's in the pattern. + for(int i = 0; i < d_delay; ++i) { + puncpat = ((puncpat & 1) << (d_puncsize - 1)) + (puncpat >> 1); + } + d_puncpat = puncpat & mask; + + // Calculate the number of holes in the pattern. The mask is all + // 1's given puncsize and puncpat is a pattern with >= puncsize + // 0's (masked to ensure this). The difference between the + // number of 1's in the mask and the puncpat is the number of + // holes. + uint32_t count_mask=0, count_pat=0; + volk_32u_popcnt(&count_mask, static_cast<uint32_t>(mask)); + volk_32u_popcnt(&count_pat, static_cast<uint32_t>(d_puncpat)); + d_puncholes = count_mask - count_pat; + + set_fixed_rate(true); + set_relative_rate((double)(d_puncsize - d_puncholes)/d_puncsize); + set_output_multiple(d_puncsize - d_puncholes); + //set_msg_handler(boost::bind(&puncture_bb_impl::catch_msg, this, _1)); + } + + puncture_bb_impl::~puncture_bb_impl() + { + } + + int + puncture_bb_impl::fixed_rate_ninput_to_noutput(int ninput) + { + return (int)((((d_puncsize - d_puncholes)/(double)(d_puncsize)) * ninput) + .5); + } + + int + puncture_bb_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int)(((d_puncsize/(double)(d_puncsize-d_puncholes)) * noutput) + .5); + } + + void + puncture_bb_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = (int)(((d_puncsize/(double)(d_puncsize-d_puncholes)) * noutput_items) + .5); + } + + /* + void + puncture_bb_impl::catch_msg(pmt::pmt_t msg) + { + long mlong = pmt::pmt_to_long(msg); + for(int i = 0; i < mlong; ++i) { + d_puncholes = (d_puncholes >> 1) | ((d_puncholes & 1) << (d_puncsize - 1)); + } + } + */ + + int + puncture_bb_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const char *in = (const char *)input_items[0]; + char *out = (char *)output_items[0]; + + for(int i=0, k=0; i < noutput_items/output_multiple(); ++i) { + for(int j = 0; j < d_puncsize; ++j) { + if((d_puncpat >> (d_puncsize - 1 - j)) & 1) { + out[k++] = in[i*d_puncsize + j]; + } + } + } + + /* + GR_LOG_DEBUG(d_debug_logger, ">>>>>> start"); + for(int i = 0, k=0; i < noutput_items; ++i) { + if((d_puncpat >> (d_puncsize - 1 - (i % d_puncsize))) & 1) { + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%...%2%") \ + % out[k++] % in[i]); + } + else { + GR_LOG_DEBUG(d_debug_logger, boost::format("snit %1%") % in[i]); + } + } + + GR_LOG_DEBUG(d_debug_logger, boost::format("comp: %1%, %2%\n") \ + % noutput_items % ninput_items[0]); + GR_LOG_DEBUG(d_debug_logger, boost::format("consuming %1%") \ + % ((int)(((1.0/relative_rate()) * noutput_items) + .5))); + */ + + consume_each((int)(((1.0/relative_rate()) * noutput_items) + .5)); + return noutput_items; + } + + } /* namespace fec */ +}/* namespace gr */ diff --git a/gr-fec/lib/puncture_bb_impl.h b/gr-fec/lib/puncture_bb_impl.h new file mode 100644 index 0000000000..abf9c09dc1 --- /dev/null +++ b/gr-fec/lib/puncture_bb_impl.h @@ -0,0 +1,58 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_PUNCTURE_BB_IMPL_H +#define INCLUDED_FEC_PUNCTURE_BB_IMPL_H + +#include <gnuradio/fec/puncture_bb.h> + +namespace gr { + namespace fec { + + class FEC_API puncture_bb_impl : public puncture_bb + { + private: + int d_puncsize; + int d_delay; + int d_puncholes; + int d_puncpat; + + public: + puncture_bb_impl(int puncsize, int puncpat, int delay=0); + ~puncture_bb_impl(); + + //void catch_msg(pmt::pmt_t msg); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int fixed_rate_ninput_to_noutput(int ninput); + int fixed_rate_noutput_to_ninput(int noutput); + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_PUNCTURE_BB_IMPL_H */ diff --git a/gr-fec/lib/puncture_ff_impl.cc b/gr-fec/lib/puncture_ff_impl.cc new file mode 100644 index 0000000000..9a7c8f6dc2 --- /dev/null +++ b/gr-fec/lib/puncture_ff_impl.cc @@ -0,0 +1,153 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "puncture_ff_impl.h" +#include <gnuradio/io_signature.h> +#include <volk/volk.h> +#include <boost/bind.hpp> +#include <pmt/pmt.h> +#include <string> +#include <stdio.h> + +namespace gr { + namespace fec { + + puncture_ff::sptr + puncture_ff::make(int puncsize, int puncpat, int delay) + { + return gnuradio::get_initial_sptr + (new puncture_ff_impl(puncsize, puncpat, delay)); + } + + puncture_ff_impl::puncture_ff_impl(int puncsize, int puncpat, int delay) + : block("puncture_ff", + io_signature::make(1, 1, sizeof(float)), + io_signature::make(1, 1, sizeof(float))), + d_puncsize(puncsize), d_delay(delay) + { + // Create a mask of all 1's of puncsize length + int mask = 0; + for(int i = 0; i < d_puncsize; i++) + mask |= 1 << i; + + // Rotate the pattern for the delay value; then mask it if there + // are any excess 1's in the pattern. + for(int i = 0; i < d_delay; ++i) { + puncpat = ((puncpat & 1) << (d_puncsize - 1)) + (puncpat >> 1); + } + d_puncpat = puncpat & mask; + + // Calculate the number of holes in the pattern. The mask is all + // 1's given puncsize and puncpat is a pattern with >= puncsize + // 0's (masked to ensure this). The difference between the + // number of 1's in the mask and the puncpat is the number of + // holes. + uint32_t count_mask=0, count_pat=0; + volk_32u_popcnt(&count_mask, static_cast<uint32_t>(mask)); + volk_32u_popcnt(&count_pat, static_cast<uint32_t>(d_puncpat)); + d_puncholes = count_mask - count_pat; + + set_fixed_rate(true); + set_relative_rate((double)(d_puncsize - d_puncholes)/d_puncsize); + set_output_multiple(d_puncsize - d_puncholes); + //set_msg_handler(boost::bind(&puncture_ff_impl::catch_msg, this, _1)); + } + + puncture_ff_impl::~puncture_ff_impl() + { + } + + int + puncture_ff_impl::fixed_rate_ninput_to_noutput(int ninput) + { + return (int)((((d_puncsize - d_puncholes)/(double)(d_puncsize)) * ninput) + .5); + } + + int + puncture_ff_impl::fixed_rate_noutput_to_ninput(int noutput) + { + return (int)(((d_puncsize/(double)(d_puncsize-d_puncholes)) * noutput) + .5); + } + + void + puncture_ff_impl::forecast(int noutput_items, + gr_vector_int& ninput_items_required) + { + ninput_items_required[0] = (int)(((d_puncsize/(double)(d_puncsize-d_puncholes)) * noutput_items) + .5); + } + + /* + void + puncture_ff_impl::catch_msg(pmt::pmt_t msg) + { + long mlong = pmt::pmt_to_long(msg); + for(int i = 0; i < mlong; ++i) { + d_puncholes = (d_puncholes >> 1) | ((d_puncholes & 1) << (d_puncsize - 1)); + } + } + */ + + int + puncture_ff_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const float *in = (const float *)input_items[0]; + float *out = (float *)output_items[0]; + + for(int i=0, k=0; i < noutput_items/output_multiple(); ++i) { + for(int j = 0; j < d_puncsize; ++j) { + if((d_puncpat >> (d_puncsize - 1 - j)) & 1) { + out[k++] = in[i*d_puncsize + j]; + } + } + } + + /* + GR_LOG_DEBUG(d_debug_logger, ">>>>>> start"); + for(int i = 0, k=0; i < noutput_items; ++i) { + if((d_puncpat >> (d_puncsize - 1 - (i % d_puncsize))) & 1) { + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%...%2%") \ + % out[k++] % in[i]); + } + else { + GR_LOG_DEBUG(d_debug_logger, boost::format("snit %1%") % in[i]); + } + } + + GR_LOG_DEBUG(d_debug_logger, boost::format("comp: %1%, %2%\n") \ + % noutput_items % ninput_items[0]); + GR_LOG_DEBUG(d_debug_logger, boost::format("consuming %1%") \ + % ((int)(((1.0/relative_rate()) * noutput_items) + .5))); + */ + + consume_each((int)(((1.0/relative_rate()) * noutput_items) + .5)); + return noutput_items; + } + + } /* namespace fec */ +}/* namespace gr */ diff --git a/gr-fec/lib/puncture_ff_impl.h b/gr-fec/lib/puncture_ff_impl.h new file mode 100644 index 0000000000..e86d0d25c5 --- /dev/null +++ b/gr-fec/lib/puncture_ff_impl.h @@ -0,0 +1,58 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_FEC_PUNCTURE_FF_IMPL_H +#define INCLUDED_FEC_PUNCTURE_FF_IMPL_H + +#include <gnuradio/fec/puncture_ff.h> + +namespace gr { + namespace fec { + + class FEC_API puncture_ff_impl : public puncture_ff + { + private: + int d_puncsize; + int d_delay; + int d_puncholes; + int d_puncpat; + + public: + puncture_ff_impl(int puncsize, int puncpat, int delay); + ~puncture_ff_impl(); + + //void catch_msg(pmt::pmt_t msg); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int fixed_rate_ninput_to_noutput(int ninput); + int fixed_rate_noutput_to_ninput(int noutput); + void forecast(int noutput_items, + gr_vector_int& ninput_items_required); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_PUNCTURE_FF_IMPL_H */ diff --git a/gr-fec/lib/repetition_decoder_impl.cc b/gr-fec/lib/repetition_decoder_impl.cc new file mode 100644 index 0000000000..bce41de5ca --- /dev/null +++ b/gr-fec/lib/repetition_decoder_impl.cc @@ -0,0 +1,144 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "repetition_decoder_impl.h" +#include <math.h> +#include <boost/assign/list_of.hpp> +#include <volk/volk.h> +#include <sstream> +#include <stdio.h> +#include <vector> + +namespace gr { + namespace fec { + namespace code { + + generic_decoder::sptr + repetition_decoder::make(int frame_size, int rep, + float ap_prob) + { + return generic_decoder::sptr + (new repetition_decoder_impl(frame_size, rep, + ap_prob)); + } + + repetition_decoder_impl::repetition_decoder_impl(int frame_size, int rep, + float ap_prob) + : generic_decoder("repetition_decoder") + { + // Set max frame size here; all buffers and settings will be + // based on this value. + d_max_frame_size = frame_size; + set_frame_size(frame_size); + + if(rep < 0) + throw std::runtime_error("repetition_encoder: repetition rate must be >= 0"); + if((ap_prob < 0) || (ap_prob > 1.0)) + throw std::runtime_error("repetition_encoder: a priori probability rate must be in [0, 1]"); + + d_rep = rep; + d_ap_prob = ap_prob; + d_trials.resize(d_rep); + } + + repetition_decoder_impl::~repetition_decoder_impl() + { + } + + int + repetition_decoder_impl::get_output_size() + { + //unpacked bits + return d_frame_size; + } + + int + repetition_decoder_impl::get_input_size() + { + return d_frame_size*d_rep; + } + + int + repetition_decoder_impl::get_input_item_size() + { + return sizeof(float); + } + + const char* + repetition_decoder_impl::get_input_conversion() + { + return "none"; + } + + float + repetition_decoder_impl::get_shift() + { + return 0; + } + + bool + repetition_decoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + return ret; + } + + double + repetition_decoder_impl::rate() + { + return 1.0/static_cast<double>(d_rep); + } + + void + repetition_decoder_impl::generic_work(void *inbuffer, void *outbuffer) + { + const float *in = (const float*)inbuffer; + unsigned char *out = (unsigned char *) outbuffer; + + for(unsigned int i = 0; i < d_frame_size; i++) { + for(unsigned int r = 0; r < d_rep; r++) { + d_trials[r] = (in[d_rep*i + r] > 0) ? 1.0f : 0.0f; + } + float res = std::count(d_trials.begin(), d_trials.end(), 1.0f); + if((res / static_cast<float>(d_rep)) > d_ap_prob) + out[i] = 1; + else + out[i] = 0; + } + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/repetition_decoder_impl.h b/gr-fec/lib/repetition_decoder_impl.h new file mode 100644 index 0000000000..33fb174456 --- /dev/null +++ b/gr-fec/lib/repetition_decoder_impl.h @@ -0,0 +1,67 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_REPETITION_DECODER_IMPL_H +#define INCLUDED_FEC_REPETITION_DECODER_IMPL_H + +#include <vector> +#include <algorithm> +#include <string> +#include <gnuradio/fec/repetition_decoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API repetition_decoder_impl : public repetition_decoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + int get_input_item_size(); + float get_shift(); + const char* get_input_conversion(); + //const char* get_output_conversion(); + + unsigned int d_max_frame_size; + unsigned int d_frame_size; + unsigned int d_rep; + float d_ap_prob; + + std::vector<float> d_trials; + + public: + repetition_decoder_impl(int frame_size, int rep, + float ap_prob=0.5); + ~repetition_decoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_REPETITION_DECODER_IMPL_H */ diff --git a/gr-fec/lib/repetition_encoder_impl.cc b/gr-fec/lib/repetition_encoder_impl.cc new file mode 100644 index 0000000000..dd6bc01615 --- /dev/null +++ b/gr-fec/lib/repetition_encoder_impl.cc @@ -0,0 +1,108 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "repetition_encoder_impl.h" +#include <gnuradio/fec/generic_encoder.h> +#include <volk/volk.h> +#include <sstream> + +namespace gr { + namespace fec { + namespace code { + + generic_encoder::sptr + repetition_encoder::make(int frame_size, int rep) + { + return generic_encoder::sptr + (new repetition_encoder_impl(frame_size, rep)); + } + + repetition_encoder_impl::repetition_encoder_impl(int frame_size, int rep) + : generic_encoder("repetition_encoder") + { + d_max_frame_size = frame_size; + set_frame_size(frame_size); + + if(rep < 0) + throw std::runtime_error("repetition_encoder: repetition rate must be >= 0"); + + d_rep = rep; + } + + repetition_encoder_impl::~repetition_encoder_impl() + { + } + + int + repetition_encoder_impl::get_output_size() + { + return d_frame_size*d_rep; + } + + int + repetition_encoder_impl::get_input_size() + { + return d_frame_size; + } + + bool + repetition_encoder_impl::set_frame_size(unsigned int frame_size) + { + bool ret = true; + if(frame_size > d_max_frame_size) { + GR_LOG_INFO(d_logger, boost::format("tried to set frame to %1%; max possible is %2%") \ + % frame_size % d_max_frame_size); + frame_size = d_max_frame_size; + ret = false; + } + + d_frame_size = frame_size; + + return ret; + } + + double + repetition_encoder_impl::rate() + { + return static_cast<double>(d_rep); + } + + void + repetition_encoder_impl::generic_work(void *inbuffer, void *outbuffer) + { + const unsigned char *in = (const unsigned char*)inbuffer; + unsigned char *out = (unsigned char*)outbuffer; + + for(unsigned int i = 0; i < d_frame_size; i++) { + for(unsigned int r = 0; r < d_rep; r++) { + out[d_rep*i + r] = in[i]; + } + } + } + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/repetition_encoder_impl.h b/gr-fec/lib/repetition_encoder_impl.h new file mode 100644 index 0000000000..4730110817 --- /dev/null +++ b/gr-fec/lib/repetition_encoder_impl.h @@ -0,0 +1,58 @@ +/* -*- c++ -*- */ +/* + * 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. + * +p * 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. + */ + +#ifndef INCLUDED_FEC_REPETITION_ENCODER_IMPL_H +#define INCLUDED_FEC_REPETITION_ENCODER_IMPL_H + +#include <map> +#include <string> +#include <gnuradio/fec/repetition_encoder.h> + +namespace gr { + namespace fec { + namespace code { + + class FEC_API repetition_encoder_impl : public repetition_encoder + { + private: + //plug into the generic fec api + void generic_work(void *inbuffer, void *outbuffer); + int get_output_size(); + int get_input_size(); + + unsigned int d_max_frame_size; + unsigned int d_frame_size; + unsigned int d_rep; + + public: + repetition_encoder_impl(int frame_size, int rep); + ~repetition_encoder_impl(); + + bool set_frame_size(unsigned int frame_size); + double rate(); + }; + + } /* namespace code */ + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_REPETITION_ENCODER_IMPL_H */ diff --git a/gr-fec/lib/tagged_decoder_impl.cc b/gr-fec/lib/tagged_decoder_impl.cc new file mode 100644 index 0000000000..2841b5f57f --- /dev/null +++ b/gr-fec/lib/tagged_decoder_impl.cc @@ -0,0 +1,92 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tagged_decoder_impl.h" +#include <gnuradio/io_signature.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + tagged_decoder::sptr + tagged_decoder::make(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size, + const std::string &lengthtagname) + { + return gnuradio::get_initial_sptr + ( new tagged_decoder_impl(my_decoder, input_item_size, + output_item_size, lengthtagname)); + } + + tagged_decoder_impl::tagged_decoder_impl(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size, + const std::string &lengthtagname) + : tagged_stream_block("fec_tagged_decoder", + io_signature::make(1, 1, input_item_size), + io_signature::make(1, 1, output_item_size), + lengthtagname), + d_input_item_size(input_item_size), d_output_item_size(output_item_size) + { + d_decoder = my_decoder; + + set_relative_rate(d_decoder->rate()); + } + + int + tagged_decoder_impl::calculate_output_stream_length(const gr_vector_int &ninput_items) + { + return d_decoder->get_output_size(); + } + + tagged_decoder_impl::~tagged_decoder_impl() + { + } + + int + tagged_decoder_impl::work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + const unsigned char *in = (unsigned char*)input_items[0]; + unsigned char *out = (unsigned char *)output_items[0]; + + d_decoder->set_frame_size(ninput_items[0]*d_decoder->rate()); + if(noutput_items < d_decoder->get_output_size()) + return 0; + + GR_LOG_DEBUG(d_debug_logger, boost::format("%1%, %2%, %3%") \ + % noutput_items % ninput_items[0] % d_decoder->get_output_size()); + + d_decoder->generic_work((void*)in, (void*)out); + + return d_decoder->get_output_size(); + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/tagged_decoder_impl.h b/gr-fec/lib/tagged_decoder_impl.h new file mode 100644 index 0000000000..ec81a4fa76 --- /dev/null +++ b/gr-fec/lib/tagged_decoder_impl.h @@ -0,0 +1,55 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_TAGGED_DECODER_IMPL_H +#define INCLUDED_FEC_TAGGED_DECODER_IMPL_H + +#include <gnuradio/fec/tagged_decoder.h> + +namespace gr { + namespace fec { + + class FEC_API tagged_decoder_impl : public tagged_decoder + { + private: + generic_decoder::sptr d_decoder; + size_t d_input_item_size; + size_t d_output_item_size; + + public: + tagged_decoder_impl(generic_decoder::sptr my_decoder, + size_t input_item_size, + size_t output_item_size, + const std::string &lengthtagname="packet_len"); + ~tagged_decoder_impl(); + + int work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int calculate_output_stream_length(const gr_vector_int &ninput_items); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_TAGGED_DECODER_IMPL_H */ diff --git a/gr-fec/lib/tagged_encoder_impl.cc b/gr-fec/lib/tagged_encoder_impl.cc new file mode 100644 index 0000000000..8461a56ef7 --- /dev/null +++ b/gr-fec/lib/tagged_encoder_impl.cc @@ -0,0 +1,93 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tagged_encoder_impl.h" +#include <gnuradio/io_signature.h> +#include <stdio.h> + +namespace gr { + namespace fec { + + tagged_encoder::sptr + tagged_encoder::make(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size, + const std::string& lengthtagname) + { + return gnuradio::get_initial_sptr + (new tagged_encoder_impl(my_encoder, input_item_size, + output_item_size, + lengthtagname)); + } + + tagged_encoder_impl::tagged_encoder_impl(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size, + const std::string& lengthtagname) + : tagged_stream_block("fec_tagged_encoder", + io_signature::make(1, 1, input_item_size), + io_signature::make(1, 1, output_item_size), + lengthtagname), + d_input_item_size(input_item_size), d_output_item_size(output_item_size) + { + d_encoder = my_encoder; + + set_relative_rate(d_encoder->rate()); + } + + tagged_encoder_impl::~tagged_encoder_impl() + { + } + + int + tagged_encoder_impl::calculate_output_stream_length(const gr_vector_int &ninput_items) + { + return d_encoder->get_output_size(); + } + + int + tagged_encoder_impl::work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + char *inbuffer = (char*)input_items[0]; + char *outbuffer = (char*)output_items[0]; + + d_encoder->set_frame_size(ninput_items[0]); + if(noutput_items < d_encoder->get_output_size()) + return 0; + + GR_LOG_DEBUG(d_debug_logger, boost::format("nout: %1% nin: %2% ret: %3%") \ + % noutput_items % ninput_items[0] % d_encoder->get_output_size()); + + d_encoder->generic_work((void*)(inbuffer), (void*)(outbuffer)); + + return d_encoder->get_output_size(); + } + + } /* namespace fec */ +} /* namespace gr */ diff --git a/gr-fec/lib/tagged_encoder_impl.h b/gr-fec/lib/tagged_encoder_impl.h new file mode 100644 index 0000000000..55b355342c --- /dev/null +++ b/gr-fec/lib/tagged_encoder_impl.h @@ -0,0 +1,55 @@ +/* -*- c++ -*- */ +/* + * 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. + */ + +#ifndef INCLUDED_FEC_TAGGED_ENCODER_IMPL_H +#define INCLUDED_FEC_TAGGED_ENCODER_IMPL_H + +#include <gnuradio/fec/tagged_encoder.h> + +namespace gr { + namespace fec { + + class FEC_API tagged_encoder_impl : public tagged_encoder + { + private: + generic_encoder::sptr d_encoder; + size_t d_input_item_size; + size_t d_output_item_size; + + public: + tagged_encoder_impl(generic_encoder::sptr my_encoder, + size_t input_item_size, + size_t output_item_size, + const std::string &lengthtagname="packet_len"); + ~tagged_encoder_impl(); + + int work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + int calculate_output_stream_length(const gr_vector_int &ninput_items); + }; + + } /* namespace fec */ +} /* namespace gr */ + +#endif /* INCLUDED_FEC_TAGGED_ENCODER_IMPL_H */ diff --git a/gr-fec/python/fec/CMakeLists.txt b/gr-fec/python/fec/CMakeLists.txt index a7eefaa0c1..032816866d 100644 --- a/gr-fec/python/fec/CMakeLists.txt +++ b/gr-fec/python/fec/CMakeLists.txt @@ -23,6 +23,18 @@ include(GrPython) GR_PYTHON_INSTALL( FILES __init__.py + bitflip.py + extended_encoder.py + extended_decoder.py + capillary_threaded_decoder.py + capillary_threaded_encoder.py + threaded_decoder.py + threaded_encoder.py + extended_async_encoder.py + extended_tagged_encoder.py + extended_tagged_decoder.py + fec_test.py + bercurve_generator.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/fec COMPONENT "fec_python" ) diff --git a/gr-fec/python/fec/__init__.py b/gr-fec/python/fec/__init__.py index bfec694739..6c82232d4f 100644 --- a/gr-fec/python/fec/__init__.py +++ b/gr-fec/python/fec/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright 2012,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -30,3 +30,18 @@ except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) from fec_swig import * + +from bitflip import * +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder +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 extended_tagged_encoder import extended_tagged_encoder +from extended_tagged_decoder import extended_tagged_decoder + + +from fec_test import fec_test +from bercurve_generator import bercurve_generator diff --git a/gr-fec/python/fec/_qa_helper.py b/gr-fec/python/fec/_qa_helper.py new file mode 100755 index 0000000000..8722453441 --- /dev/null +++ b/gr-fec/python/fec/_qa_helper.py @@ -0,0 +1,90 @@ +#!/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 blocks +from gnuradio import gr +import sys, numpy + +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder + +class map_bb(gr.sync_block): + def __init__(self, bitmap): + gr.sync_block.__init__( + self, + name = "map_bb", + in_sig = [numpy.int8], + out_sig = [numpy.int8]) + self.bitmap = bitmap + + def work(self, input_items, output_items): + output_items[0][:] = map(lambda x: self.bitmap[x], input_items[0]) + return len(output_items[0]) + + +class _qa_helper(gr.top_block): + + def __init__(self, data_size, enc, dec, threading): + gr.top_block.__init__(self, "_qa_helper") + + self.puncpat = puncpat = '11' + + self.enc = enc + self.dec = dec + self.data_size = data_size + self.threading = threading + + self.ext_encoder = extended_encoder(enc, threading=self.threading, puncpat=self.puncpat) + self.ext_decoder= extended_decoder(dec, threading=self.threading, ann=None, + puncpat=self.puncpat, integration_period=10000) + + self.src = blocks.vector_source_b(data_size*[0, 1, 2, 3, 5, 7, 9, 13, 15, 25, 31, 45, 63, 95, 127], False) + self.unpack = blocks.unpack_k_bits_bb(8) + self.map = map_bb([-1, 1]) + self.to_float = blocks.char_to_float(1) + self.snk_input = blocks.vector_sink_b() + self.snk_output = blocks.vector_sink_b() + + self.connect(self.src, self.unpack, self.ext_encoder) + self.connect(self.ext_encoder, self.map, self.to_float) + self.connect(self.to_float, self.ext_decoder) + self.connect(self.unpack, self.snk_input) + self.connect(self.ext_decoder, self.snk_output) + +if __name__ == '__main__': + frame_size = 30 + enc = fec.dummy_encoder_make(frame_size*8) + #enc = fec.repetition_encoder_make(frame_size*8, 3) + dec = fec.dummy_decoder.make(frame_size*8) + + tb = _qa_helper(10*frame_size, enc, dec, None) + tb.run() + + errs = 0 + for i,o in zip(tb.snk_input.data(), tb.snk_output.data()): + if i-o != 0: + errs += 1 + + if errs == 0: + print "Decoded properly" + else: + print "Problem Decoding" diff --git a/gr-fec/python/fec/bercurve_generator.py b/gr-fec/python/fec/bercurve_generator.py new file mode 100644 index 0000000000..e67d1e17c2 --- /dev/null +++ b/gr-fec/python/fec/bercurve_generator.py @@ -0,0 +1,95 @@ +#!/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, blocks +import numpy + +from fec_test import fec_test + +class bercurve_generator(gr.hier_block2): + + def __init__(self, encoder_list, decoder_list, esno=numpy.arange(0.0, 3.0, .25), + samp_rate=3200000, threading='capillary', puncpat='11', seed=0): + gr.hier_block2.__init__( + self, "ber_curve_generator", + gr.io_signature(0, 0, 0), + gr.io_signature(len(esno) * 2, len(esno) * 2, gr.sizeof_char*1)) + + self.esno = esno + self.samp_rate = samp_rate + self.encoder_list = encoder_list + self.decoder_list = decoder_list + self.puncpat = puncpat + + self.random_gen_b_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 256, 100000)), True) + self.deinterleave = blocks.deinterleave(gr.sizeof_char*1) + self.connect(self.random_gen_b_0, self.deinterleave) + self.ber_generators = [] + for i in range(0, len(esno)): + ber_generator_temp = fec_test( + generic_encoder=encoder_list[i], + generic_decoder=decoder_list[i], + esno=esno[i], + samp_rate=samp_rate, + threading=threading, + puncpat=puncpat, + seed=seed) + self.ber_generators.append(ber_generator_temp); + + for i in range(0, len(esno)): + self.connect((self.deinterleave, i), (self.ber_generators[i])) + self.connect((self.ber_generators[i], 0), (self, i*2)); + self.connect((self.ber_generators[i], 1), (self, i*2 + 1)); + + def get_esno(self): + return self.esno + + def set_esno(self, esno): + self.esno = esno + self.ber_generator_0.set_esno(self.esno) + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.ber_generator_0.set_samp_rate(self.samp_rate) + + def get_encoder_list(self): + return self.encoder_list + + def set_encoder_list(self, encoder_list): + self.encoder_list = encoder_list + self.ber_generator_0.set_generic_encoder(self.encoder_list) + + def get_decoder_list(self): + return self.decoder_list + + def set_decoder_list(self, decoder_list): + self.decoder_list = decoder_list + self.ber_generator_0.set_generic_decoder(self.decoder_list) + + def get_puncpat(self): + return self.puncpat + + def set_puncpat(self, puncpat): + self.puncpat = puncpat diff --git a/gr-fec/python/fec/bitflip.py b/gr-fec/python/fec/bitflip.py new file mode 100644 index 0000000000..235dc19a05 --- /dev/null +++ b/gr-fec/python/fec/bitflip.py @@ -0,0 +1,80 @@ +#!/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. +# + +def bitreverse(mint): + res = 0; + while mint != 0: + res = res << 1; + res += mint & 1; + mint = mint >> 1; + return res; + +const_lut = [2]; +specinvert_lut = [[0, 2, 1, 3]]; + +def bitflip(mint, bitflip_lut, index, csize): + res = 0; + cnt = 0; + mask = (1 << const_lut[index]) - 1; + while (cnt < csize): + res += (bitflip_lut[(mint >> cnt) & (mask)]) << cnt; + cnt += const_lut[index]; + return res; + + +def read_bitlist(bitlist): + res = 0; + for i in range(len(bitlist)): + if int(bitlist[i]) == 1: + res += 1 << (len(bitlist) - i - 1); + return res; + + +def read_big_bitlist(bitlist): + ret = [] + for j in range(0, len(bitlist)/64): + res = 0; + for i in range(0, 64): + if int(bitlist[j*64+i]) == 1: + res += 1 << (64 - i - 1); + ret.append(res); + res = 0; + j = 0; + for i in range(len(bitlist)%64): + if int(bitlist[len(ret)*64+i]) == 1: + res += 1 << (64 - j - 1); + j += 1; + ret.append(res); + return ret; + +def generate_symmetries(symlist): + retlist = [] + if len(symlist) == 1: + for i in range(len(symlist[0])): + retlist.append(symlist[0][i:] + symlist[0][0:i]); + invlist = symlist[0]; + for i in range(1, len(symlist[0])/2): + invlist[i] = symlist[0][i + len(symlist[0])/2]; + invlist[i + len(symlist[0])/2] = symlist[0][i]; + for i in range(len(symlist[0])): + retlist.append(symlist[0][i:] + symlist[0][0:i]); + return retlist; diff --git a/gr-fec/python/fec/capillary_threaded_decoder.py b/gr-fec/python/fec/capillary_threaded_decoder.py new file mode 100644 index 0000000000..9a00cde192 --- /dev/null +++ b/gr-fec/python/fec/capillary_threaded_decoder.py @@ -0,0 +1,100 @@ +#!/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, blocks +import fec_swig as fec +import math + +class capillary_threaded_decoder(gr.hier_block2): + def __init__(self, decoder_list_0, input_size, output_size): + gr.hier_block2.__init__( + self, "Capillary Threaded Decoder", + gr.io_signature(1, 1, input_size*1), + gr.io_signature(1, 1, output_size*1)) + + self.decoder_list_0 = decoder_list_0 + + check = math.log10(len(self.decoder_list_0)) / math.log10(2.0) + if(abs(check - int(check)) > 0): + gr.log.info("fec.capillary_threaded_decoder: number of decoders must be a power of 2.") + raise AttributeError + + self.deinterleaves_0 = [] + for i in range(int(math.log(len(decoder_list_0), 2))): + for j in range(int(math.pow(2, i))): + self.deinterleaves_0.append(blocks.deinterleave(input_size, + fec.get_decoder_input_size(decoder_list_0[0]))) + + self.generic_decoders_0 = [] + for i in range(len(decoder_list_0)): + self.generic_decoders_0.append(fec.decoder(decoder_list_0[i], input_size, output_size)) + + self.interleaves_0 = [] + for i in range(int(math.log(len(decoder_list_0), 2))): + for j in range(int(math.pow(2, i))): + self.interleaves_0.append(blocks.interleave(output_size, + fec.get_decoder_output_size(decoder_list_0[0]))) + + rootcount = 0 + branchcount = 1 + for i in range(int(math.log(len(decoder_list_0), 2)) - 1): + for j in range(int(math.pow(2, i))): + self.connect((self.deinterleaves_0[rootcount], 0), (self.deinterleaves_0[branchcount], 0)) + self.connect((self.deinterleaves_0[rootcount], 1), (self.deinterleaves_0[branchcount + 1], 0)) + rootcount += 1 + branchcount += 2 + + codercount = 0 + for i in range(len(decoder_list_0)/2): + self.connect((self.deinterleaves_0[rootcount], 0), (self.generic_decoders_0[codercount], 0)) + self.connect((self.deinterleaves_0[rootcount], 1), (self.generic_decoders_0[codercount + 1], 0)) + rootcount += 1 + codercount += 2 + + rootcount = 0 + branchcount = 1 + for i in range(int(math.log(len(decoder_list_0), 2)) - 1): + for j in range(int(math.pow(2, i))): + self.connect((self.interleaves_0[branchcount], 0), (self.interleaves_0[rootcount], 0)) + self.connect((self.interleaves_0[branchcount + 1], 0), (self.interleaves_0[rootcount], 1)) + rootcount += 1 + branchcount += 2 + + codercount = 0 + for i in range(len(decoder_list_0)/2): + self.connect((self.generic_decoders_0[codercount], 0), (self.interleaves_0[rootcount], 0)) + self.connect((self.generic_decoders_0[codercount + 1], 0), (self.interleaves_0[rootcount], 1)) + rootcount += 1 + codercount += 2 + + if ((len(self.decoder_list_0)) > 1): + self.connect((self, 0), (self.deinterleaves_0[0], 0)) + self.connect((self.interleaves_0[0], 0), (self, 0)) + else: + self.connect((self, 0), (self.generic_decoders_0[0], 0)) + self.connect((self.generic_decoders_0[0], 0), (self, 0)) + + def get_decoder_list_0(self): + return self.decoder_list_0 + + def set_decoder_list_0(self, decoder_list_0): + self.decoder_list_0 = decoder_list_0 diff --git a/gr-fec/python/fec/capillary_threaded_encoder.py b/gr-fec/python/fec/capillary_threaded_encoder.py new file mode 100644 index 0000000000..21d4af62ca --- /dev/null +++ b/gr-fec/python/fec/capillary_threaded_encoder.py @@ -0,0 +1,102 @@ +#!/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, blocks +import fec_swig as fec +import math + +class capillary_threaded_encoder(gr.hier_block2): + def __init__(self, encoder_list_0, input_size=gr.sizeof_char, output_size=gr.sizeof_char): + gr.hier_block2.__init__(self, "Capillary Threaded Encoder", + gr.io_signature(1, 1, input_size), + gr.io_signature(1, 1, output_size)) + + self.encoder_list_0 = encoder_list_0 + + check = math.log10(len(self.encoder_list_0)) / math.log10(2.0) + if(abs(check - int(check)) > 0.0): + gr.log.info("fec.capillary_threaded_encoder: number of encoders must be a power of 2.") + raise AttributeError + + self.deinterleaves_0 = []; + for i in range(int(math.log(len(encoder_list_0), 2))): + for j in range(int(math.pow(2, i))): + self.deinterleaves_0.append(blocks.deinterleave(input_size, + fec.get_encoder_input_size(encoder_list_0[0]))) + + self.generic_encoders_0 = []; + for i in range(len(encoder_list_0)): + self.generic_encoders_0.append(fec.encoder(encoder_list_0[i], + input_size, output_size)) + + self.interleaves_0 = []; + for i in range(int(math.log(len(encoder_list_0), 2))): + for j in range(int(math.pow(2, i))): + self.interleaves_0.append(blocks.interleave(output_size, + fec.get_encoder_output_size(encoder_list_0[0]))) + + rootcount = 0; + branchcount = 1; + for i in range(int(math.log(len(encoder_list_0), 2)) - 1): + for j in range(int(math.pow(2, i))): + self.connect((self.deinterleaves_0[rootcount], 0), (self.deinterleaves_0[branchcount], 0)) + self.connect((self.deinterleaves_0[rootcount], 1), (self.deinterleaves_0[branchcount + 1], 0)) + rootcount += 1; + branchcount += 2; + + codercount = 0; + for i in range(len(encoder_list_0)/2): + self.connect((self.deinterleaves_0[rootcount], 0), (self.generic_encoders_0[codercount], 0)) + self.connect((self.deinterleaves_0[rootcount], 1), (self.generic_encoders_0[codercount + 1], 0)) + rootcount += 1; + codercount += 2; + + + rootcount = 0; + branchcount = 1; + for i in range(int(math.log(len(encoder_list_0), 2)) - 1): + for j in range(int(math.pow(2, i))): + self.connect((self.interleaves_0[branchcount], 0), (self.interleaves_0[rootcount], 0)) + self.connect((self.interleaves_0[branchcount + 1], 0), (self.interleaves_0[rootcount], 1)) + rootcount += 1; + branchcount += 2; + + + codercount = 0; + for i in range(len(encoder_list_0)/2): + self.connect((self.generic_encoders_0[codercount], 0), (self.interleaves_0[rootcount], 0)) + self.connect((self.generic_encoders_0[codercount + 1], 0), (self.interleaves_0[rootcount], 1)) + rootcount += 1; + codercount += 2; + + if((len(self.encoder_list_0)) > 1): + self.connect((self, 0), (self.deinterleaves_0[0], 0)) + self.connect((self.interleaves_0[0], 0), (self, 0)) + else: + self.connect((self, 0), (self.generic_encoders_0[0], 0)) + self.connect((self.generic_encoders_0[0], 0), (self, 0)) + + def get_encoder_list_0(self): + return self.encoder_list_0 + + def set_encoder_list_0(self, encoder_list_0): + self.encoder_list_0 = encoder_list_0 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") diff --git a/gr-fec/python/fec/extended_decoder.py b/gr-fec/python/fec/extended_decoder.py new file mode 100644 index 0000000000..7e6cf452f9 --- /dev/null +++ b/gr-fec/python/fec/extended_decoder.py @@ -0,0 +1,176 @@ +#!/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, blocks +import fec_swig as fec +from bitflip import * +import sys + +if sys.modules.has_key("gnuradio.digital"): + digital = sys.modules["gnuradio.digital"] +else: + from gnuradio import digital + +from threaded_decoder import threaded_decoder +from capillary_threaded_decoder import capillary_threaded_decoder + +class extended_decoder(gr.hier_block2): + +#solution to log_(1-2*t)(1-2*.0335) = 1/taps where t is thresh (syndrome density) +#for i in numpy.arange(.1, .499, .01): + #print str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i); + garbletable = { + 0.310786835319:0.1, + 0.279118162802:0.11, + 0.252699589071:0.12, + 0.230318516016:0.13, + 0.211108735347:0.14, + 0.194434959095:0.15, + 0.179820650401:0.16, + 0.166901324951:0.17, + 0.15539341766:0.18, + 0.145072979886:0.19, + 0.135760766313:0.2, + 0.127311581396:0.21, + 0.119606529806:0.22, + 0.112547286766:0.23, + 0.106051798775:0.24, + 0.10005101381:0.25, + 0.0944863633098:0.26, + 0.0893078003966:0.27, + 0.084472254501:0.28, + 0.0799424008658:0.29, + 0.0756856701944:0.3, + 0.0716734425668:0.31, + 0.0678803831565:0.32, + 0.0642838867856:0.33, + 0.0608636049994:0.34, + 0.0576010337489:0.35, + 0.0544791422522:0.36, + 0.0514820241933:0.37, + 0.0485945507251:0.38, + 0.0458019998183:0.39, + 0.0430896262596:0.4, + 0.0404421166935:0.41, + 0.0378428350972:0.42, + 0.0352726843274:0.43, + 0.0327082350617:0.44, + 0.0301183562535:0.45, + 0.0274574540266:0.46, + 0.0246498236897:0.47, + 0.0215448131298:0.48, + 0.0177274208353:0.49, + } + + def __init__(self, decoder_obj_list, threading, ann=None, puncpat='11', + integration_period=10000, flush=None, rotator=None): + gr.hier_block2.__init__(self, "extended_decoder", + gr.io_signature(1, 1, gr.sizeof_float), + gr.io_signature(1, 1, gr.sizeof_char)) + self.blocks=[] + self.ann=ann + self.puncpat=puncpat + self.flush=flush + + if(type(decoder_obj_list) == list): + if(type(decoder_obj_list[0]) == list): + gr.log.info("fec.extended_decoder: Parallelism must be 1.") + raise AttributeError + else: + # If it has parallelism of 0, force it into a list of 1 + decoder_obj_list = [decoder_obj_list,] + + message_collector_connected=False + + ##anything going through the annihilator needs shifted, uchar vals + if fec.get_decoder_input_conversion(decoder_obj_list[0]) == "uchar" or \ + fec.get_decoder_input_conversion(decoder_obj_list[0]) == "packed_bits": + self.blocks.append(blocks.multiply_const_ff(48.0)) + + if fec.get_shift(decoder_obj_list[0]) != 0.0: + self.blocks.append(blocks.add_const_ff(fec.get_shift(decoder_obj_list[0]))) + elif fec.get_decoder_input_conversion(decoder_obj_list[0]) == "packed_bits": + self.blocks.append(blocks.add_const_ff(128.0)) + + if fec.get_decoder_input_conversion(decoder_obj_list[0]) == "uchar" or \ + fec.get_decoder_input_conversion(decoder_obj_list[0]) == "packed_bits": + self.blocks.append(blocks.float_to_uchar()); + + const_index = 0; #index that corresponds to mod order for specinvert purposes + + if not self.flush: + flush = 10000; + else: + flush = self.flush; + if self.ann: #ann and puncpat are strings of 0s and 1s + cat = fec.ULLVector(); + for i in fec.read_big_bitlist(ann): + cat.append(i); + + synd_garble = .49 + idx_list = self.garbletable.keys() + idx_list.sort() + for i in idx_list: + if 1.0/self.ann.count('1') >= i: + synd_garble = self.garbletable[i] + print 'using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb' + print 'ceiling: .0335 data garble rate' + self.blocks.append(fec.conv_bit_corr_bb(cat, len(puncpat) - puncpat.count('0'), + len(ann), integration_period, flush, synd_garble)) + + if self.puncpat != '11': + self.blocks.append(fec.depuncture_bb(len(puncpat), read_bitlist(puncpat), 0)) + + if fec.get_decoder_input_conversion(decoder_obj_list[0]) == "packed_bits": + self.blocks.append(blocks.uchar_to_float()) + self.blocks.append(blocks.add_const_ff(-128.0)) + self.blocks.append(digital.binary_slicer_fb()) + self.blocks.append(blocks.unpacked_to_packed_bb(1,0)) + + if(len(decoder_obj_list) > 1): + if(fec.get_history(decoder_obj_list[0]) != 0): + gr.log.info("fec.extended_decoder: Cannot use multi-threaded parallelism on a decoder with history.") + raise AttributeError + + if threading == 'capillary': + self.blocks.append(capillary_threaded_decoder(decoder_obj_list, + fec.get_decoder_input_item_size(decoder_obj_list[0]), + fec.get_decoder_output_item_size(decoder_obj_list[0]))) + + elif threading == 'ordinary': + self.blocks.append(threaded_decoder(decoder_obj_list, + fec.get_decoder_input_item_size(decoder_obj_list[0]), + fec.get_decoder_output_item_size(decoder_obj_list[0]))) + + else: + self.blocks.append(fec.decoder(decoder_obj_list[0], + fec.get_decoder_input_item_size(decoder_obj_list[0]), + fec.get_decoder_output_item_size(decoder_obj_list[0]))) + + if fec.get_decoder_output_conversion(decoder_obj_list[0]) == "unpack": + self.blocks.append(blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)); + + self.connect((self, 0), (self.blocks[0], 0)); + self.connect((self.blocks[-1], 0), (self, 0)); + + for i in range(len(self.blocks) - 1): + self.connect((self.blocks[i], 0), (self.blocks[i+1], 0)); diff --git a/gr-fec/python/fec/extended_encoder.py b/gr-fec/python/fec/extended_encoder.py new file mode 100644 index 0000000000..50a8891ea5 --- /dev/null +++ b/gr-fec/python/fec/extended_encoder.py @@ -0,0 +1,74 @@ +#!/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, blocks + +import fec_swig as fec +from threaded_encoder import threaded_encoder +from capillary_threaded_encoder import capillary_threaded_encoder +from bitflip import read_bitlist + +class extended_encoder(gr.hier_block2): + def __init__(self, encoder_obj_list, threading, puncpat=None): + gr.hier_block2.__init__(self, "extended_encoder", + gr.io_signature(1, 1, gr.sizeof_char), + gr.io_signature(1, 1, gr.sizeof_char)) + + self.blocks=[] + self.puncpat=puncpat + + if(type(encoder_obj_list) == list): + if(type(encoder_obj_list[0]) == list): + gr.log.info("fec.extended_encoder: Parallelism must be 1.") + raise AttributeError + else: + # If it has parallelism of 0, force it into a list of 1 + encoder_obj_list = [encoder_obj_list,] + + if fec.get_encoder_input_conversion(encoder_obj_list[0]) == "pack": + self.blocks.append(blocks.pack_k_bits_bb(8)) + + if threading == 'capillary': + self.blocks.append(capillary_threaded_encoder(encoder_obj_list, + gr.sizeof_char, + gr.sizeof_char)) + elif threading == 'ordinary': + self.blocks.append(threaded_encoder(encoder_obj_list, + gr.sizeof_char, + gr.sizeof_char)) + else: + self.blocks.append(fec.encoder(encoder_obj_list[0], + gr.sizeof_char, + gr.sizeof_char)) + + if self.puncpat != '11': + self.blocks.append(fec.puncture_bb(len(puncpat), read_bitlist(puncpat), 0)) + + # Connect the input to the encoder and the output to the + # puncture if used or the encoder if not. + self.connect((self, 0), (self.blocks[0], 0)); + self.connect((self.blocks[-1], 0), (self, 0)); + + # If using the puncture block, add it into the flowgraph after + # the encoder. + for i in range(len(self.blocks) - 1): + self.connect((self.blocks[i], 0), (self.blocks[i+1], 0)); diff --git a/gr-fec/python/fec/extended_tagged_decoder.py b/gr-fec/python/fec/extended_tagged_decoder.py new file mode 100644 index 0000000000..1865cbfbe4 --- /dev/null +++ b/gr-fec/python/fec/extended_tagged_decoder.py @@ -0,0 +1,175 @@ +#!/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, blocks +import fec_swig as fec +from bitflip import * +import sys + +if sys.modules.has_key("gnuradio.digital"): + digital = sys.modules["gnuradio.digital"] +else: + from gnuradio import digital + +class extended_tagged_decoder(gr.hier_block2): + +#solution to log_(1-2*t)(1-2*.0335) = 1/taps where t is thresh (syndrome density) +#for i in numpy.arange(.1, .499, .01): + #print str(log((1-(2 * .035)), (1-(2 * i)))) + ':' + str(i); + garbletable = { + 0.310786835319:0.1, + 0.279118162802:0.11, + 0.252699589071:0.12, + 0.230318516016:0.13, + 0.211108735347:0.14, + 0.194434959095:0.15, + 0.179820650401:0.16, + 0.166901324951:0.17, + 0.15539341766:0.18, + 0.145072979886:0.19, + 0.135760766313:0.2, + 0.127311581396:0.21, + 0.119606529806:0.22, + 0.112547286766:0.23, + 0.106051798775:0.24, + 0.10005101381:0.25, + 0.0944863633098:0.26, + 0.0893078003966:0.27, + 0.084472254501:0.28, + 0.0799424008658:0.29, + 0.0756856701944:0.3, + 0.0716734425668:0.31, + 0.0678803831565:0.32, + 0.0642838867856:0.33, + 0.0608636049994:0.34, + 0.0576010337489:0.35, + 0.0544791422522:0.36, + 0.0514820241933:0.37, + 0.0485945507251:0.38, + 0.0458019998183:0.39, + 0.0430896262596:0.4, + 0.0404421166935:0.41, + 0.0378428350972:0.42, + 0.0352726843274:0.43, + 0.0327082350617:0.44, + 0.0301183562535:0.45, + 0.0274574540266:0.46, + 0.0246498236897:0.47, + 0.0215448131298:0.48, + 0.0177274208353:0.49, + } + + def __init__(self, decoder_obj_list, ann=None, puncpat='11', + integration_period=10000, flush=None, rotator=None, lentagname=None): + gr.hier_block2.__init__(self, "extended_decoder", + gr.io_signature(1, 1, gr.sizeof_float), + gr.io_signature(1, 1, gr.sizeof_char)) + self.blocks=[] + self.ann=ann + self.puncpat=puncpat + self.flush=flush + + if(type(decoder_obj_list) == list): + # This block doesn't handle parallelism of > 1 + # We could just grab encoder [0][0], but we don't want to encourage this. + if(type(decoder_obj_list[0]) == list): + gr.log.info("fec.extended_tagged_decoder: Parallelism must be 1.") + raise AttributeError + + decoder_obj = decoder_obj_list[0] + + # Otherwise, just take it as is + else: + decoder_obj = decoder_obj_list + + # If lentagname is None, fall back to using the non tagged + # stream version + if type(lentagname) == str: + if(lentagname.lower() == 'none'): + lentagname = None + + message_collector_connected=False + + ##anything going through the annihilator needs shifted, uchar vals + if fec.get_decoder_input_conversion(decoder_obj) == "uchar" or \ + fec.get_decoder_input_conversion(decoder_obj) == "packed_bits": + self.blocks.append(blocks.multiply_const_ff(48.0)) + + if fec.get_shift(decoder_obj) != 0.0: + self.blocks.append(blocks.add_const_ff(fec.get_shift(decoder_obj))) + elif fec.get_decoder_input_conversion(decoder_obj) == "packed_bits": + self.blocks.append(blocks.add_const_ff(128.0)) + + if fec.get_decoder_input_conversion(decoder_obj) == "uchar" or \ + fec.get_decoder_input_conversion(decoder_obj) == "packed_bits": + self.blocks.append(blocks.float_to_uchar()); + + const_index = 0; #index that corresponds to mod order for specinvert purposes + + if not self.flush: + flush = 10000; + else: + flush = self.flush; + if self.ann: #ann and puncpat are strings of 0s and 1s + cat = fec.ULLVector(); + for i in fec.read_big_bitlist(ann): + cat.append(i); + + synd_garble = .49 + idx_list = self.garbletable.keys() + idx_list.sort() + for i in idx_list: + if 1.0/self.ann.count('1') >= i: + synd_garble = self.garbletable[i] + print 'using syndrom garble threshold ' + str(synd_garble) + 'for conv_bit_corr_bb' + print 'ceiling: .0335 data garble rate' + self.blocks.append(fec.conv_bit_corr_bb(cat, len(puncpat) - puncpat.count('0'), + len(ann), integration_period, flush, synd_garble)) + + if self.puncpat != '11': + self.blocks.append(fec.depuncture_bb(len(puncpat), read_bitlist(puncpat), 0)) + + if fec.get_decoder_input_conversion(decoder_obj) == "packed_bits": + self.blocks.append(blocks.uchar_to_float()) + self.blocks.append(blocks.add_const_ff(-128.0)) + self.blocks.append(digital.binary_slicer_fb()) + self.blocks.append(blocks.unpacked_to_packed_bb(1,0)) + + else: + if(not lentagname): + self.blocks.append(fec.decoder(decoder_obj, + fec.get_decoder_input_item_size(decoder_obj), + fec.get_decoder_output_item_size(decoder_obj))) + else: + self.blocks.append(fec.tagged_decoder(decoder_obj, + fec.get_decoder_input_item_size(decoder_obj), + fec.get_decoder_output_item_size(decoder_obj), + lentagname)) + + if fec.get_decoder_output_conversion(decoder_obj) == "unpack": + self.blocks.append(blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)); + + self.connect((self, 0), (self.blocks[0], 0)); + self.connect((self.blocks[-1], 0), (self, 0)); + + for i in range(len(self.blocks) - 1): + self.connect((self.blocks[i], 0), (self.blocks[i+1], 0)); diff --git a/gr-fec/python/fec/extended_tagged_encoder.py b/gr-fec/python/fec/extended_tagged_encoder.py new file mode 100644 index 0000000000..2f78b8e5c9 --- /dev/null +++ b/gr-fec/python/fec/extended_tagged_encoder.py @@ -0,0 +1,82 @@ +#!/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, blocks + +import fec_swig as fec +from bitflip import read_bitlist + +class extended_tagged_encoder(gr.hier_block2): + def __init__(self, encoder_obj_list, puncpat=None, lentagname=None): + gr.hier_block2.__init__(self, "extended_tagged_encoder", + gr.io_signature(1, 1, gr.sizeof_char), + gr.io_signature(1, 1, gr.sizeof_char)) + + self.blocks=[] + 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 + # We could just grab encoder [0][0], but we don't want to encourage this. + if(type(encoder_obj_list[0]) == list): + gr.log.info("fec.extended_tagged_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 + + # If lentagname is None, fall back to using the non tagged + # stream version + if type(lentagname) == str: + if(lentagname.lower() == 'none'): + lentagname = None + + if fec.get_encoder_input_conversion(encoder_obj) == "pack": + self.blocks.append(blocks.pack_k_bits_bb(8)) + + if(not lentagname): + self.blocks.append(fec.encoder(encoder_obj, + gr.sizeof_char, + gr.sizeof_char)) + else: + self.blocks.append(fec.tagged_encoder(encoder_obj, + gr.sizeof_char, + gr.sizeof_char, + lentagname)) + + if self.puncpat != '11': + self.blocks.append(fec.puncture_bb(len(puncpat), read_bitlist(puncpat), 0)) + + # Connect the input to the encoder and the output to the + # puncture if used or the encoder if not. + self.connect((self, 0), (self.blocks[0], 0)); + self.connect((self.blocks[-1], 0), (self, 0)); + + # If using the puncture block, add it into the flowgraph after + # the encoder. + for i in range(len(self.blocks) - 1): + self.connect((self.blocks[i], 0), (self.blocks[i+1], 0)); diff --git a/gr-fec/python/fec/fec_test.py b/gr-fec/python/fec/fec_test.py new file mode 100644 index 0000000000..6466a0bcb4 --- /dev/null +++ b/gr-fec/python/fec/fec_test.py @@ -0,0 +1,123 @@ +#!/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.fec.bitflip import read_bitlist +from gnuradio import gr, blocks, analog +import math +import sys + +if sys.modules.has_key("gnuradio.digital"): + digital = sys.modules["gnuradio.digital"] +else: + from gnuradio import digital + +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder + +class fec_test(gr.hier_block2): + + def __init__(self, generic_encoder=0, generic_decoder=0, esno=0, + samp_rate=3200000, threading="capillary", puncpat='11', + seed=0): + gr.hier_block2.__init__(self, "fec_test", + gr.io_signature(1, 1, gr.sizeof_char*1), + gr.io_signature(2, 2, gr.sizeof_char*1)) + + self.generic_encoder = generic_encoder + self.generic_decoder = generic_decoder + self.esno = esno + self.samp_rate = samp_rate + self.threading = threading + self.puncpat = puncpat + + self.map_bb = digital.map_bb(([-1, 1])) + self.b2f = blocks.char_to_float(1, 1) + + self.unpack8 = blocks.unpack_k_bits_bb(8) + self.pack8 = blocks.pack_k_bits_bb(8) + + self.encoder = extended_encoder(encoder_obj_list=generic_encoder, + threading=threading, + puncpat=puncpat) + + self.decoder = extended_decoder(decoder_obj_list=generic_decoder, + threading=threading, + ann=None, puncpat=puncpat, + integration_period=10000, rotator=None) + + noise = math.sqrt((10.0**(-esno/10.0))/2.0) + #self.fastnoise = analog.fastnoise_source_f(analog.GR_GAUSSIAN, noise, seed, 8192) + self.fastnoise = analog.noise_source_f(analog.GR_GAUSSIAN, noise, seed) + self.addnoise = blocks.add_ff(1) + + # Send packed input directly to the second output + self.copy_packed = blocks.copy(gr.sizeof_char) + self.connect(self, self.copy_packed) + self.connect(self.copy_packed, (self, 1)) + + # Unpack inputl encode, convert to +/-1, add noise, decode, repack + self.connect(self, self.unpack8) + self.connect(self.unpack8, self.encoder) + self.connect(self.encoder, self.map_bb) + self.connect(self.map_bb, self.b2f) + self.connect(self.b2f, (self.addnoise, 0)) + self.connect(self.fastnoise, (self.addnoise,1)) + self.connect(self.addnoise, self.decoder) + self.connect(self.decoder, self.pack8) + self.connect(self.pack8, (self, 0)) + + + def get_generic_encoder(self): + return self.generic_encoder + + def set_generic_encoder(self, generic_encoder): + self.generic_encoder = generic_encoder + + def get_generic_decoder(self): + return self.generic_decoder + + def set_generic_decoder(self, generic_decoder): + self.generic_decoder = generic_decoder + + def get_esno(self): + return self.esno + + def set_esno(self, esno): + self.esno = esno + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + + def get_threading(self): + return self.threading + + def set_threading(self, threading): + self.threading = threading + + def get_puncpat(self): + return self.puncpat + + def set_puncpat(self, puncpat): + self.puncpat = puncpat diff --git a/gr-fec/python/fec/qa_depuncture.py b/gr-fec/python/fec/qa_depuncture.py new file mode 100644 index 0000000000..5566e83a25 --- /dev/null +++ b/gr-fec/python/fec/qa_depuncture.py @@ -0,0 +1,192 @@ +#!/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, gr_unittest +import fec_swig as fec +import blocks_swig as blocks +from collections import deque + +class test_depuncture (gr_unittest.TestCase): + + def depuncture_setup(self): + p = [] + for i in range(self.puncsize): + p.append(self.puncpat >> (self.puncsize - 1 - i) & 1) + d = deque(p) + d.rotate(self.delay) + _puncpat = list(d) + + k = 0 + self.expected = [] + for n in range(len(self.src_data)/(self.puncsize - self.puncholes)): + for i in range(self.puncsize): + if _puncpat[i] == 1: + self.expected.append(self.src_data[k]); + k+=1 + else: + self.expected.append(self.sym) + + def setUp(self): + self.src_data = 2000*range(64) + self.tb = gr.top_block () + + def tearDown(self): + self.tb = None + + def test_000(self): + # Test normal operation of the depuncture block + + self.puncsize = 8 + self.puncpat = 0xEF + self.delay = 0 + self.sym = 0 + self.puncholes = 1 + + self.depuncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.depuncture_bb(self.puncsize, self.puncpat, + self.delay, self.sym) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + def test_001(self): + # Test normal operation of the depuncture block with a delay + + self.puncsize = 8 + self.puncpat = 0xEF + self.delay = 1 + self.sym = 0 + self.puncholes = 1 + + self.depuncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.depuncture_bb(self.puncsize, self.puncpat, + self.delay, self.sym) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + def test_002(self): + # Test scenario where we have defined a puncture pattern with + # more bits than the puncsize. + + self.puncsize = 4 + self.puncpat = 0x5555 + self.delay = 0 + self.sym = 0 + self.puncholes = 2 + + self.depuncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.depuncture_bb(self.puncsize, self.puncpat, + self.delay, self.sym) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + def test_003(self): + # Test scenario where we have defined a puncture pattern with + # more bits than the puncsize with a delay. The python code + # doesn't account for this when creating self.expected, but + # this should be equivalent to a puncpat of the correct size. + + self.puncsize = 4 + self.puncpat0 = 0x5555 # too many bits set + self.puncpat1 = 0x55 # num bits = puncsize + self.delay = 1 + self.sym = 0 + + src = blocks.vector_source_b(self.src_data) + op0 = fec.depuncture_bb(self.puncsize, self.puncpat0, + self.delay, self.sym) + op1 = fec.depuncture_bb(self.puncsize, self.puncpat1, + self.delay, self.sym) + dst0 = blocks.vector_sink_b() + dst1 = blocks.vector_sink_b() + + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() + + dst_data0 = list(dst0.data()) + for i in xrange(len(dst_data0)): + dst_data0[i] = int(dst_data0[i]) + + dst_data1 = list(dst1.data()) + for i in xrange(len(dst_data1)): + dst_data1[i] = int(dst_data1[i]) + + self.assertEqual(dst_data1, dst_data0) + + def test_004(self): + # Test normal operation of the depuncture block without + # specifying the fill symbol (defaults to 127). + + self.puncsize = 8 + self.puncpat = 0xEF + self.delay = 0 + self.sym = 127 + self.puncholes = 1 + + self.depuncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.depuncture_bb(self.puncsize, self.puncpat, + self.delay) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + +if __name__ == '__main__': + gr_unittest.run(test_depuncture, "test_depuncture.xml") diff --git a/gr-fec/python/fec/qa_fecapi_cc.py b/gr-fec/python/fec/qa_fecapi_cc.py new file mode 100644 index 0000000000..bbd500161e --- /dev/null +++ b/gr-fec/python/fec/qa_fecapi_cc.py @@ -0,0 +1,195 @@ +#!/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, gr_unittest +import fec_swig as fec +from _qa_helper import _qa_helper + +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder + +class test_fecapi_cc(gr_unittest.TestCase): + + def setUp(self): + self.tb = gr.top_block() + + def tearDown(self): + self.tb = None + + def test_parallelism0_00(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = fec.cc_encoder_make(frame_size*8, k, rate, polys) + dec = fec.cc_decoder.make(frame_size*8, k, rate, polys) + threading = None + self.test = _qa_helper(4*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism0_01(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = fec.cc_encoder_make(frame_size*8, k, rate, polys) + dec = fec.cc_decoder.make(frame_size*8, k, rate, polys) + threading = 'ordinary' + self.test = _qa_helper(5*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism0_02(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = fec.cc_encoder_make(frame_size*8, k, rate, polys) + dec = fec.cc_decoder.make(frame_size*8, k, rate, polys) + threading = 'capillary' + self.test = _qa_helper(5*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_00(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + threading = None + self.test = _qa_helper(5*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_01(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + threading = 'ordinary' + self.test = _qa_helper(5*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_02(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys)), range(0,1)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys)), range(0,1)) + threading = 'capillary' + self.test = _qa_helper(5*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_03(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + mode = fec.CC_TERMINATED + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + threading = 'capillary' + self.test = _qa_helper(4*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_04(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + mode = fec.CC_TRUNCATED + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + threading = 'capillary' + self.test = _qa_helper(4*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + + def test_parallelism1_05(self): + frame_size = 30 + k = 7 + rate = 2 + polys = [109,79] + mode = fec.CC_TAILBITING + enc = map((lambda a: fec.cc_encoder_make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + dec = map((lambda a: fec.cc_decoder.make(frame_size*8, k, rate, polys, mode=mode)), range(0,4)) + threading = 'capillary' + self.test = _qa_helper(4*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_out = self.test.snk_output.data() + data_in = self.test.snk_input.data()[0:len(data_out)] + + self.assertEqual(data_in, data_out) + +if __name__ == '__main__': + gr_unittest.run(test_fecapi_cc, "test_fecapi_cc.xml") diff --git a/gr-fec/python/fec/qa_fecapi_dummy.py b/gr-fec/python/fec/qa_fecapi_dummy.py new file mode 100644 index 0000000000..a07890fb84 --- /dev/null +++ b/gr-fec/python/fec/qa_fecapi_dummy.py @@ -0,0 +1,190 @@ +#!/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, gr_unittest +import fec_swig as fec +from _qa_helper import _qa_helper + +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder + +class test_fecapi_dummy(gr_unittest.TestCase): + + def setUp(self): + self.tb = gr.top_block() + + def tearDown(self): + self.tb = None + + def test_parallelism0_00(self): + frame_size = 30 + enc = fec.dummy_encoder_make(frame_size*8) + dec = fec.dummy_decoder.make(frame_size*8) + threading = None + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism0_01(self): + frame_size = 30 + enc = fec.dummy_encoder_make(frame_size*8) + dec = fec.dummy_decoder.make(frame_size*8) + threading = 'ordinary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism0_02(self): + frame_size = 30 + enc = fec.dummy_encoder_make(frame_size*8) + dec = fec.dummy_decoder.make(frame_size*8) + threading = 'capillary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_00(self): + frame_size = 30 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + threading = None + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_01(self): + frame_size = 30 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + threading = 'ordinary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_02(self): + frame_size = 300 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,1)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,1)) + threading = 'capillary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_03(self): + frame_size = 30 + dims = 10 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + threading = 'ordinary' + self.test = _qa_helper(dims*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_04(self): + frame_size = 30 + dims = 16 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + threading = 'capillary' + self.test = _qa_helper(dims*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_05(self): + frame_size = 30 + dims = 5 + enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) + #dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + threading = 'capillary' + + self.assertRaises(AttributeError, lambda: extended_encoder(enc, threading=threading, puncpat="11")) + + def test_parallelism1_06(self): + frame_size = 30 + dims = 5 + #enc = map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims)) + dec = map((lambda a: fec.dummy_decoder.make(frame_size*8)), range(0,dims)) + threading = 'capillary' + + self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) + + def test_parallelism2_00(self): + frame_size = 30 + dims1 = 16 + dims2 = 16 + enc = map((lambda b: map((lambda a: fec.dummy_encoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) + #dec = map((lambda b: map((lambda a: fec.dummy_decoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) + threading = 'capillary' + + self.assertRaises(AttributeError, lambda: extended_encoder(enc, threading=threading, puncpat="11")) + + def test_parallelism2_01(self): + frame_size = 30 + dims1 = 16 + dims2 = 16 + dec = map((lambda b: map((lambda a: fec.dummy_decoder_make(frame_size*8)), range(0,dims1))), range(0,dims2)) + threading = 'capillary' + + self.assertRaises(AttributeError, lambda: extended_decoder(dec, threading=threading, puncpat="11")) + +if __name__ == '__main__': + gr_unittest.run(test_fecapi_dummy, "test_fecapi_dummy.xml") diff --git a/gr-fec/python/fec/qa_fecapi_repetition.py b/gr-fec/python/fec/qa_fecapi_repetition.py new file mode 100644 index 0000000000..7998d61bd1 --- /dev/null +++ b/gr-fec/python/fec/qa_fecapi_repetition.py @@ -0,0 +1,161 @@ +#!/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, gr_unittest +import fec_swig as fec +from _qa_helper import _qa_helper + +from extended_encoder import extended_encoder +from extended_decoder import extended_decoder + +class test_fecapi_repetition(gr_unittest.TestCase): + + def setUp(self): + self.tb = gr.top_block() + + def tearDown(self): + self.tb = None + + def test_parallelism0_00(self): + frame_size = 30 + rep = 3 + enc = fec.repetition_encoder_make(frame_size*8, rep) + dec = fec.repetition_decoder.make(frame_size*8, rep) + threading = None + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism0_01(self): + frame_size = 30 + rep = 3 + enc = fec.repetition_encoder_make(frame_size*8, rep) + dec = fec.repetition_decoder.make(frame_size*8, rep) + threading = 'ordinary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism0_02(self): + frame_size = 30 + rep = 3 + enc = fec.repetition_encoder_make(frame_size*8, rep) + dec = fec.repetition_decoder.make(frame_size*8, rep) + threading = 'capillary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_00(self): + frame_size = 30 + rep = 3 + enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) + dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + threading = None + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_01(self): + frame_size = 30 + rep = 3 + enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) + dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + threading = 'ordinary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_02(self): + frame_size = 300 + rep = 3 + enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,1)) + dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,1)) + threading = 'capillary' + self.test = _qa_helper(10*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_03(self): + frame_size = 30 + rep = 3 + dims = 10 + enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,dims)) + dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,dims)) + threading = 'ordinary' + self.test = _qa_helper(dims*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + + def test_parallelism1_04(self): + frame_size = 30 + rep = 3 + dims = 16 + enc = map((lambda a: fec.repetition_encoder_make(frame_size*8, rep)), range(0,dims)) + dec = map((lambda a: fec.repetition_decoder.make(frame_size*8, rep)), range(0,dims)) + threading = 'capillary' + self.test = _qa_helper(dims*frame_size, enc, dec, threading) + self.tb.connect(self.test) + self.tb.run() + + data_in = self.test.snk_input.data() + data_out =self.test.snk_output.data() + + self.assertEqual(data_in, data_out) + +if __name__ == '__main__': + gr_unittest.run(test_fecapi_repetition, "test_fecapi_repetition.xml") diff --git a/gr-fec/python/fec/qa_puncture.py b/gr-fec/python/fec/qa_puncture.py new file mode 100644 index 0000000000..fdd15c9a08 --- /dev/null +++ b/gr-fec/python/fec/qa_puncture.py @@ -0,0 +1,244 @@ +#!/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, gr_unittest +import fec_swig as fec +import blocks_swig as blocks +from collections import deque + +class test_puncture (gr_unittest.TestCase): + + def puncture_setup(self): + p = [] + for i in range(self.puncsize): + p.append(self.puncpat >> (self.puncsize - 1 - i) & 1) + d = deque(p) + d.rotate(self.delay) + _puncpat = list(d) + + self.expected = [] + for n in range(len(self.src_data)/self.puncsize): + for i in range(self.puncsize): + if _puncpat[i] == 1: + self.expected.append(self.src_data[n*self.puncsize+i]); + + def setUp(self): + self.src_data = 10000*range(64) + self.tb = gr.top_block() + + def tearDown(self): + self.tb = None + + def test_000(self): + # Test normal operation of the puncture block + + self.puncsize = 8 + self.puncpat = 0xEF + self.delay = 0 + + self.puncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + + def test_001(self): + # Test normal operation of the puncture block with a delay + + self.puncsize = 8 + self.puncpat = 0xEE + self.delay = 1 + + self.src_data = range(16) + + self.puncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + + def test_002(self): + # Test scenario where we have defined a puncture pattern with + # more bits than the puncsize. + + self.puncsize = 4 + self.puncpat = 0x5555 + self.delay = 0 + + self.puncture_setup() + + src = blocks.vector_source_b(self.src_data) + op = fec.puncture_bb(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_b() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + for i in xrange(len(dst_data)): + dst_data[i] = int(dst_data[i]) + + self.assertEqual(self.expected, dst_data) + + def test_003(self): + # Test scenario where we have defined a puncture pattern with + # more bits than the puncsize with a delay. The python code + # doesn't account for this when creating self.expected, but + # this should be equivalent to a puncpat of the correct size. + + self.puncsize = 4 + self.puncpat0 = 0x5555 # too many bits set + self.puncpat1 = 0x55 # num bits = puncsize + self.delay = 1 + + src = blocks.vector_source_b(self.src_data) + op0 = fec.puncture_bb(self.puncsize, self.puncpat0, self.delay) + op1 = fec.puncture_bb(self.puncsize, self.puncpat1, self.delay) + dst0 = blocks.vector_sink_b() + dst1 = blocks.vector_sink_b() + + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() + + dst_data0 = list(dst0.data()) + for i in xrange(len(dst_data0)): + dst_data0[i] = int(dst_data0[i]) + + dst_data1 = list(dst1.data()) + for i in xrange(len(dst_data1)): + dst_data1[i] = int(dst_data1[i]) + + self.assertEqual(dst_data1, dst_data0) + + + + def test_f_000(self): + # Test normal operation of the float puncture block + + self.puncsize = 8 + self.puncpat = 0xEF + self.delay = 0 + + self.puncture_setup() + + src = blocks.vector_source_f(self.src_data) + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + self.assertEqual(self.expected, dst_data) + + + def test_f_001(self): + # Test normal operation of the puncture block with a delay + + self.puncsize = 8 + self.puncpat = 0xEE + self.delay = 1 + + self.src_data = range(16) + + self.puncture_setup() + + src = blocks.vector_source_f(self.src_data) + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + self.assertEqual(self.expected, dst_data) + + + def test_f_002(self): + # Test scenariou where we have defined a puncture pattern with + # more bits than the puncsize. + + self.puncsize = 4 + self.puncpat = 0x5555 + self.delay = 0 + + self.puncture_setup() + + src = blocks.vector_source_f(self.src_data) + op = fec.puncture_ff(self.puncsize, self.puncpat, self.delay) + dst = blocks.vector_sink_f() + + self.tb.connect(src, op, dst) + self.tb.run() + + dst_data = list(dst.data()) + self.assertEqual(self.expected, dst_data) + + def test_f_003(self): + # Test scenariou where we have defined a puncture pattern with + # more bits than the puncsize with a delay. The python code + # doesn't account for this when creating self.expected, but + # this should be equivalent to a puncpat of the correct size. + + self.puncsize = 4 + self.puncpat0 = 0x5555 # too many bits set + self.puncpat1 = 0x55 # num bits = puncsize + self.delay = 1 + + src = blocks.vector_source_f(self.src_data) + op0 = fec.puncture_ff(self.puncsize, self.puncpat0, self.delay) + op1 = fec.puncture_ff(self.puncsize, self.puncpat1, self.delay) + dst0 = blocks.vector_sink_f() + dst1 = blocks.vector_sink_f() + + self.tb.connect(src, op0, dst0) + self.tb.connect(src, op1, dst1) + self.tb.run() + + dst_data0 = list(dst0.data()) + dst_data1 = list(dst1.data()) + + self.assertEqual(dst_data1, dst_data0) + +if __name__ == '__main__': + gr_unittest.run(test_puncture, "test_puncture.xml") diff --git a/gr-fec/python/fec/threaded_decoder.py b/gr-fec/python/fec/threaded_decoder.py new file mode 100644 index 0000000000..115ad7b5d3 --- /dev/null +++ b/gr-fec/python/fec/threaded_decoder.py @@ -0,0 +1,60 @@ +#!/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, blocks +import fec_swig as fec + +class threaded_decoder(gr.hier_block2): + def __init__(self, decoder_list_0, input_size, output_size): + gr.hier_block2.__init__( + self, "Threaded Decoder", + gr.io_signature(1, 1, input_size*1), + gr.io_signature(1, 1, output_size*1)) + + self.decoder_list_0 = decoder_list_0 + + self.deinterleave_0 = blocks.deinterleave(input_size, + fec.get_decoder_input_size(decoder_list_0[0])) + + self.generic_decoders_0 = [] + for i in range(len(decoder_list_0)): + self.generic_decoders_0.append(fec.decoder(decoder_list_0[i], + input_size, output_size)) + + self.interleave_0 = blocks.interleave(output_size, + fec.get_decoder_output_size(decoder_list_0[0])) + + for i in range(len(decoder_list_0)): + self.connect((self.deinterleave_0, i), (self.generic_decoders_0[i], 0)) + + for i in range(len(decoder_list_0)): + self.connect((self.generic_decoders_0[i], 0), (self.interleave_0, i)) + + + self.connect((self, 0), (self.deinterleave_0, 0)) + self.connect((self.interleave_0, 0), (self, 0)) + + def get_decoder_list_0(self): + return self.decoder_list_0 + + def set_decoder_list_0(self, decoder_list_0): + self.decoder_list_0 = decoder_list_0 diff --git a/gr-fec/python/fec/threaded_encoder.py b/gr-fec/python/fec/threaded_encoder.py new file mode 100644 index 0000000000..391baa5442 --- /dev/null +++ b/gr-fec/python/fec/threaded_encoder.py @@ -0,0 +1,59 @@ +#!/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, blocks +import fec_swig as fec + +class threaded_encoder(gr.hier_block2): + def __init__(self, encoder_list_0, input_size, output_size): + gr.hier_block2.__init__( + self, "Threaded Encoder", + gr.io_signature(1, 1, input_size*1), + gr.io_signature(1, 1, output_size*1)) + + self.encoder_list_0 = encoder_list_0 + + self.fec_deinterleave_0 = blocks.deinterleave(input_size, + fec.get_encoder_input_size(encoder_list_0[0])) + + self.generic_encoders_0 = []; + for i in range(len(encoder_list_0)): + self.generic_encoders_0.append(fec.encoder(encoder_list_0[i], + input_size, output_size)) + + self.fec_interleave_0 = blocks.interleave(output_size, + fec.get_encoder_output_size(encoder_list_0[0])) + + for i in range(len(encoder_list_0)): + self.connect((self.fec_deinterleave_0, i), (self.generic_encoders_0[i], 0)) + + for i in range(len(encoder_list_0)): + self.connect((self.generic_encoders_0[i], 0), (self.fec_interleave_0, i)) + + self.connect((self, 0), (self.fec_deinterleave_0, 0)) + self.connect((self.fec_interleave_0, 0), (self, 0)) + + def get_encoder_list_0(self): + return self.encoder_list_0 + + def set_encoder_list_0(self, encoder_list_0): + self.encoder_list_0 = encoder_list_0 diff --git a/gr-fec/swig/fec_swig.i b/gr-fec/swig/fec_swig.i index 62bb767f22..8ad845fd1c 100644 --- a/gr-fec/swig/fec_swig.i +++ b/gr-fec/swig/fec_swig.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,13 +27,72 @@ //load generated python docstrings %include "fec_swig_doc.i" +%include "gnuradio/fec/cc_common.h" + +%nodefaultctor gr::fec::generic_encoder; +%template(generic_encoder_sptr) boost::shared_ptr<gr::fec::generic_encoder>; + +%nodefaultctor gr::fec::generic_decoder; +%template(generic_decoder_sptr) boost::shared_ptr<gr::fec::generic_decoder>; + %{ +#include "gnuradio/fec/generic_decoder.h" +#include "gnuradio/fec/generic_encoder.h" +#include "gnuradio/fec/decoder.h" +#include "gnuradio/fec/encoder.h" +#include "gnuradio/fec/tagged_decoder.h" +#include "gnuradio/fec/tagged_encoder.h" +#include "gnuradio/fec/async_decoder.h" +#include "gnuradio/fec/async_encoder.h" +#include "gnuradio/fec/cc_decoder.h" +#include "gnuradio/fec/cc_encoder.h" +#include "gnuradio/fec/ccsds_encoder.h" +#include "gnuradio/fec/dummy_decoder.h" +#include "gnuradio/fec/dummy_encoder.h" +#include "gnuradio/fec/repetition_decoder.h" +#include "gnuradio/fec/repetition_encoder.h" #include "gnuradio/fec/decode_ccsds_27_fb.h" #include "gnuradio/fec/encode_ccsds_27_bb.h" +#include "gnuradio/fec/ber_bf.h" +#include "gnuradio/fec/conv_bit_corr_bb.h" +#include "gnuradio/fec/puncture_bb.h" +#include "gnuradio/fec/puncture_ff.h" +#include "gnuradio/fec/depuncture_bb.h" %} +%include "gnuradio/fec/generic_decoder.h" +%include "gnuradio/fec/generic_encoder.h" +%include "gnuradio/fec/decoder.h" +%include "gnuradio/fec/encoder.h" +%include "gnuradio/fec/tagged_decoder.h" +%include "gnuradio/fec/tagged_encoder.h" +%include "gnuradio/fec/async_decoder.h" +%include "gnuradio/fec/async_encoder.h" +%include "gnuradio/fec/cc_decoder.h" +%include "gnuradio/fec/cc_encoder.h" +%include "gnuradio/fec/ccsds_encoder.h" +%include "gnuradio/fec/dummy_decoder.h" +%include "gnuradio/fec/dummy_encoder.h" +%include "gnuradio/fec/repetition_decoder.h" +%include "gnuradio/fec/repetition_encoder.h" %include "gnuradio/fec/decode_ccsds_27_fb.h" %include "gnuradio/fec/encode_ccsds_27_bb.h" +%include "gnuradio/fec/ber_bf.h" +%include "gnuradio/fec/conv_bit_corr_bb.h" +%include "gnuradio/fec/puncture_bb.h" +%include "gnuradio/fec/puncture_ff.h" +%include "gnuradio/fec/depuncture_bb.h" +GR_SWIG_BLOCK_MAGIC2(fec, decoder); +GR_SWIG_BLOCK_MAGIC2(fec, encoder); +GR_SWIG_BLOCK_MAGIC2(fec, tagged_decoder); +GR_SWIG_BLOCK_MAGIC2(fec, tagged_encoder); +GR_SWIG_BLOCK_MAGIC2(fec, async_decoder); +GR_SWIG_BLOCK_MAGIC2(fec, async_encoder); GR_SWIG_BLOCK_MAGIC2(fec, decode_ccsds_27_fb); GR_SWIG_BLOCK_MAGIC2(fec, encode_ccsds_27_bb); +GR_SWIG_BLOCK_MAGIC2(fec, ber_bf); +GR_SWIG_BLOCK_MAGIC2(fec, conv_bit_corr_bb); +GR_SWIG_BLOCK_MAGIC2(fec, puncture_bb); +GR_SWIG_BLOCK_MAGIC2(fec, puncture_ff); +GR_SWIG_BLOCK_MAGIC2(fec, depuncture_bb); diff --git a/gr-fft/lib/CMakeLists.txt b/gr-fft/lib/CMakeLists.txt index 045df5b4f8..51fecbe677 100644 --- a/gr-fft/lib/CMakeLists.txt +++ b/gr-fft/lib/CMakeLists.txt @@ -83,3 +83,16 @@ endif() add_library(gnuradio-fft SHARED ${fft_sources}) target_link_libraries(gnuradio-fft ${fft_libs}) GR_LIBRARY_FOO(gnuradio-fft RUNTIME_COMPONENT "fft_runtime" DEVEL_COMPONENT "fft_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-fft_static STATIC ${fft_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-fft_static + PROPERTIES OUTPUT_NAME gnuradio-fft) + endif(NOT WIN32) + + install(TARGETS gnuradio-fft_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "fft_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-filter/examples/channelizer_demo.grc b/gr-filter/examples/channelizer_demo.grc index b7b4c1cb79..1891f33b2a 100644 --- a/gr-filter/examples/channelizer_demo.grc +++ b/gr-filter/examples/channelizer_demo.grc @@ -209,7 +209,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -530,7 +530,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -745,7 +745,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> @@ -1015,7 +1015,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>fftsize</key> diff --git a/gr-filter/grc/filter_freq_xlating_fir_filter_xxx.xml b/gr-filter/grc/filter_freq_xlating_fir_filter_xxx.xml index 178a42f487..8c8e100e60 100644 --- a/gr-filter/grc/filter_freq_xlating_fir_filter_xxx.xml +++ b/gr-filter/grc/filter_freq_xlating_fir_filter_xxx.xml @@ -86,6 +86,13 @@ <name>in</name> <type>$type.input</type> </sink> + + <sink> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </sink> + <source> <name>out</name> <type>$type.output</type> diff --git a/gr-filter/include/gnuradio/filter/freq_xlating_fir_filter_XXX.h.t b/gr-filter/include/gnuradio/filter/freq_xlating_fir_filter_XXX.h.t index e6563c9461..d8cb8f962c 100644 --- a/gr-filter/include/gnuradio/filter/freq_xlating_fir_filter_XXX.h.t +++ b/gr-filter/include/gnuradio/filter/freq_xlating_fir_filter_XXX.h.t @@ -49,6 +49,15 @@ namespace gr { * * Uses a single input array to produce a single output array. * Additional inputs and/or outputs are ignored. + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * The block then sets its frequency translation value to + * the new frequency provided by the message. A tag is then + * produced when the new frequency is applied to let + * downstream blocks know when this has taken affect. + * Use the filter's group delay to determine when the + * transients after the change have settled down. */ class FILTER_API @BASE_NAME@ : virtual public sync_decimator { diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt index 3d6aea5b52..17867f8879 100644 --- a/gr-filter/lib/CMakeLists.txt +++ b/gr-filter/lib/CMakeLists.txt @@ -185,6 +185,24 @@ add_dependencies(gnuradio-filter filter_generated_includes filter_generated_swigs gnuradio-runtime gnuradio-fft) +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-filter_static STATIC ${filter_sources}) + + add_dependencies(gnuradio-filter_static + filter_generated_includes + gnuradio-runtime_static gnuradio-fft_static) + + if(NOT WIN32) + set_target_properties(gnuradio-filter_static + PROPERTIES OUTPUT_NAME gnuradio-filter) + endif(NOT WIN32) + + install(TARGETS gnuradio-filter_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "filter_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + + ######################################################################## # QA C++ Code for gr-filter ######################################################################## diff --git a/gr-filter/lib/filterbank_vcvcf_impl.cc b/gr-filter/lib/filterbank_vcvcf_impl.cc index e290108b7e..96fe13c250 100644 --- a/gr-filter/lib/filterbank_vcvcf_impl.cc +++ b/gr-filter/lib/filterbank_vcvcf_impl.cc @@ -90,8 +90,6 @@ namespace gr { return 0; // history requirements may have changed. } - size_t noutputs = output_items.size(); - gr_complex *working; working = new gr_complex [noutput_items + d_ntaps]; diff --git a/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.cc.t b/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.cc.t index 93951df4e5..57fa47f935 100644 --- a/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.cc.t +++ b/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.cc.t @@ -65,6 +65,11 @@ namespace gr { set_history(d_proto_taps.size()); build_composite_fir(); + + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&@IMPL_NAME@::handle_set_center_freq, + this, _1)); } @IMPL_NAME@::~@IMPL_NAME@() @@ -120,6 +125,18 @@ namespace gr { return d_proto_taps; } + void + @IMPL_NAME@::handle_set_center_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + double freq = pmt::to_double(x); + set_center_freq(freq*d_sampling_freq); + } + } + } + int @IMPL_NAME@::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -133,6 +150,11 @@ namespace gr { set_history(d_proto_taps.size()); build_composite_fir(); d_updated = false; + + // Tell downstream items where the frequency change was applied + add_item_tag(0, nitems_written(0), + pmt::intern("freq"), pmt::from_double(d_center_freq), + alias_pmt()); return 0; // history requirements may have changed. } @@ -147,4 +169,3 @@ namespace gr { } /* namespace filter */ } /* namespace gr */ - diff --git a/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.h.t b/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.h.t index 35649676e6..bd7aced6f8 100644 --- a/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.h.t +++ b/gr-filter/lib/freq_xlating_fir_filter_XXX_impl.h.t @@ -61,6 +61,8 @@ namespace gr { void set_taps(const std::vector<@TAP_TYPE@> &taps); std::vector<@TAP_TYPE@> taps() const; + void handle_set_center_freq(pmt::pmt_t msg); + int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt index 2c69c65675..49310ecb50 100644 --- a/gr-noaa/lib/CMakeLists.txt +++ b/gr-noaa/lib/CMakeLists.txt @@ -67,3 +67,16 @@ list(APPEND noaa_libs add_library(gnuradio-noaa SHARED ${noaa_sources}) target_link_libraries(gnuradio-noaa ${noaa_libs}) GR_LIBRARY_FOO(gnuradio-noaa RUNTIME_COMPONENT "noaa_runtime" DEVEL_COMPONENT "noaa_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-noaa_static STATIC ${noaa_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-noaa_static + PROPERTIES OUTPUT_NAME gnuradio-noaa) + endif(NOT WIN32) + + install(TARGETS gnuradio-noaa_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "noaa_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-pager/lib/CMakeLists.txt b/gr-pager/lib/CMakeLists.txt index 1fcdfe301c..7fae2c9892 100644 --- a/gr-pager/lib/CMakeLists.txt +++ b/gr-pager/lib/CMakeLists.txt @@ -75,3 +75,16 @@ list(APPEND pager_libs add_library(gnuradio-pager SHARED ${pager_sources}) target_link_libraries(gnuradio-pager ${pager_libs}) GR_LIBRARY_FOO(gnuradio-pager RUNTIME_COMPONENT "pager_runtime" DEVEL_COMPONENT "pager_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-pager_static STATIC ${pager_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-pager_static + PROPERTIES OUTPUT_NAME gnuradio-pager) + endif(NOT WIN32) + + install(TARGETS gnuradio-pager_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "pager_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-pager/lib/flex_modes.cc b/gr-pager/lib/flex_modes.cc index 5daaae7948..bb54733fcd 100644 --- a/gr-pager/lib/flex_modes.cc +++ b/gr-pager/lib/flex_modes.cc @@ -30,7 +30,7 @@ namespace gr { { { 0x870C78F3, 1600, 2 }, { 0xB0684F97, 1600, 4 }, - // { 0xUNKNOWN, 3200, 2 }, + { 0x7B1884E7, 3200, 2 }, { 0xDEA0215F, 3200, 4 }, { 0x4C7CB383, 3200, 4 } }; diff --git a/gr-qtgui/examples/CMakeLists.txt b/gr-qtgui/examples/CMakeLists.txt index 8d3b29957b..cd6de245d6 100644 --- a/gr-qtgui/examples/CMakeLists.txt +++ b/gr-qtgui/examples/CMakeLists.txt @@ -39,6 +39,7 @@ GR_PYTHON_INSTALL(PROGRAMS install( FILES dark.qss + alt.qss qtgui_tags_viewing.grc DESTINATION ${GR_PKG_QTGUI_EXAMPLES_DIR} COMPONENT "qtgui_python" diff --git a/gr-qtgui/examples/alt.qss b/gr-qtgui/examples/alt.qss new file mode 100644 index 0000000000..c310b80a65 --- /dev/null +++ b/gr-qtgui/examples/alt.qss @@ -0,0 +1,126 @@ +QWidget +{ + color: white; + background-color: black; +} + +QwtPlot +{ + padding: 10px; + font-size: 18px; +} + +DisplayPlot { + qproperty-zoomer_color: green; + qproperty-line_color1: #00FF00; + qproperty-line_color2: magenta; + qproperty-line_color3: #FF6905; + qproperty-line_style1: SolidLine; + qproperty-line_style2: DashLine; + qproperty-line_style3: DotLine; + qproperty-line_width1: 2; + qproperty-line_width2: 2; + qproperty-line_width3: 2; + qproperty-axes_label_font_size: 18; +} + +WaterfallDisplayPlot { + qproperty-intensity_color_map_type1: 5; + qproperty-low_intensity_color: black; + qproperty-high_intensity_color: green; +} + +TimeRasterDisplayPlot { + qproperty-intensity_color_map_type1: 6; +} + +FrequencyDisplayPlot { + qproperty-line_color1: cyan; + qproperty-line_color2: magenta; + qproperty-line_color3: purple; + qproperty-line_style1: SolidLine; + qproperty-line_style2: DashLine; + qproperty-line_style3: DotLine; + qproperty-max_fft_color: palegreen; + qproperty-min_fft_color: darkblue; + qproperty-marker_lower_intensity_color: white; + qproperty-marker_upper_intensity_color: red; + qproperty-marker_lower_intensity_visible: false; + qproperty-marker_upper_intensity_visible: false; + qproperty-marker_noise_floor_amplitude_color: red; + qproperty-marker_noise_floor_amplitude_visible: false; +} + +QwtPlotCanvas +{ + border: 1px solid White; + border-radius: 10px; +} + +QwtScaleWidget +{ + font-size: 14px; +} + +QwtLegend +{ + padding: 3px; + margin: 3px; + font-size: 14px; +} + +QwtLegendItem +{ + padding: 2px; + margin: 2px; +} + +QLineEdit, +QPlainTextEdit, +QComboBox, +QMenu { + selection-color: black; + selection-background-color: lightgrey; + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 black, stop: 1 rgb(128, 128, 128)); + border: 1px solid gray; + padding: 2px; + border-radius: 3px; +} + +QPushButton, +QToolButton { + selection-color: black; + selection-background-color: white; + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 black, stop: 1 rgb(128, 128, 128)); + border: 1px solid gray; + padding: 2px; + border-radius: 3px; +} + +QTabWidget::pane { + border: 1px solid white; +} + +QTabBar { + margin: 20px; + padding: 20px; +} + +QTabBar::tab { + background-color: rgb(100, 100, 100); + border: 1px solid white; + padding: 5px; +} + +QTabBar::tab:first { + border-top-left-radius: 4px; +} + +QTabBar::tab:last { + border-top-right-radius: 4px; +} + +QTabBar::tab:selected { + background-color: rgb(200, 200, 200); + color: black; +} diff --git a/gr-qtgui/examples/qtgui_tags_viewing.grc b/gr-qtgui/examples/qtgui_tags_viewing.grc index 296641d5cb..4c6454537a 100644 --- a/gr-qtgui/examples/qtgui_tags_viewing.grc +++ b/gr-qtgui/examples/qtgui_tags_viewing.grc @@ -520,7 +520,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -654,7 +654,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -784,7 +784,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> @@ -871,7 +871,7 @@ </param> <param> <key>name</key> - <value>QT GUI Plot</value> + <value></value> </param> <param> <key>size</key> diff --git a/gr-qtgui/grc/qtgui_ber_sink_b.xml b/gr-qtgui/grc/qtgui_ber_sink_b.xml new file mode 100644 index 0000000000..da3fc6ebf8 --- /dev/null +++ b/gr-qtgui/grc/qtgui_ber_sink_b.xml @@ -0,0 +1,684 @@ +<?xml version="1.0"?> +<!-- +################################################### +##QT GUI Sink +################################################### + --> +<block> + <name>QT GUI Bercurve Sink</name> + <key>qtgui_bercurve_sink</key> + <import>from PyQt4 import Qt</import> + <import>from gnuradio import qtgui</import> + <import>import sip</import> + <import>import numpy</import> + <make>#set $win = 'self._%s_win'%$id + qtgui.ber_sink_b( + $esno, \#range of esnos + $num_curves, \#number of curves + $berminerrors, \#ensure at least + $berlimit, \#cutoff + $curvenames, \#indiv. curve names + ) +self.$(id).set_update_time($update_time) +self.$(id).set_y_axis($ymin, $ymax) +self.$(id).set_x_axis($(esno)[0], $(esno)[-1]) + +labels = [$label1, $label2, $label3, $label4, $label5, + $label6, $label7, $label8, $label9, $label10] +widths = [$width1, $width2, $width3, $width4, $width5, + $width6, $width7, $width8, $width9, $width10] +colors = [$color1, $color2, $color3, $color4, $color5, + $color6, $color7, $color8, $color9, $color10] +styles = [$style1, $style2, $style3, $style4, $style5, + $style6, $style7, $style8, $style9, $style10] +markers = [$marker1, $marker2, $marker3, $marker4, $marker5, + $marker6, $marker7, $marker8, $marker9, $marker10] +alphas = [$alpha1, $alpha2, $alpha3, $alpha4, $alpha5, + $alpha6, $alpha7, $alpha8, $alpha9, $alpha10] +for i in xrange($num_curves): + if len(labels[i]) == 0: + self.$(id).set_line_label(i, "Data {0}".format(i)) + else: + self.$(id).set_line_label(i, labels[i]) + self.$(id).set_line_width(i, widths[i]) + self.$(id).set_line_color(i, colors[i]) + self.$(id).set_line_style(i, styles[i]) + self.$(id).set_line_marker(i, markers[i]) + self.$(id).set_line_alpha(i, alphas[i]) + +self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) +$(gui_hint()($win))</make> + + <param> + <name>esno</name> + <key>esno</key> + <value>numpy.arange(0.0, 4.0, .5)</value> + <type>raw</type> + </param> + + <param> + <name>Min. BER Errs.</name> + <key>berminerrors</key> + <value>100</value> + <type>int</type> + </param> + + <param> + <name>BER Limit</name> + <key>berlimit</key> + <value>-7.0</value> + <type>real</type> + </param> + + <param> + <name>Num Curves</name> + <key>num_curves</key> + <value>1</value> + <type>int</type> + </param> + + <param> + <name>Curve Names</name> + <key>curvenames</key> + <value>[]</value> + <type>raw</type> + <hide>part</hide> + </param> + + <param> + <name>Y min</name> + <key>ymin</key> + <value>-10</value> + <type>real</type> + <hide>part</hide> + </param> + + <param> + <name>Y max</name> + <key>ymax</key> + <value>0</value> + <type>real</type> + <hide>part</hide> + </param> + + <param> + <name>Update Period</name> + <key>update_time</key> + <value>0.10</value> + <type>real</type> + <hide>part</hide> + </param> + + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + + <param> + <name>Line 1 Label</name> + <key>label1</key> + <type>string</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <tab>Config</tab> + </param> + + <param> + <name>Line 1 Width</name> + <key>width1</key> + <value>1</value> + <type>int</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <tab>Config</tab> + </param> + + <param> + <name>Line 1 Color</name> + <key>color1</key> + <type>enum</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <option> + <name>Blue</name> + <key>"blue"</key> + </option> + <option> + <name>Red</name> + <key>"red"</key> + </option> + <option> + <name>Green</name> + <key>"green"</key> + </option> + <option> + <name>Black</name> + <key>"black"</key> + </option> + <option> + <name>Cyan</name> + <key>"cyan"</key> + </option> + <option> + <name>Magenta</name> + <key>"magenta"</key> + </option> + <option> + <name>Yellow</name> + <key>"yellow"</key> + </option> + <option> + <name>Dark Red</name> + <key>"dark red"</key> + </option> + <option> + <name>Dark Green</name> + <key>"dark green"</key> + </option> + <option> + <name>Dark Blue</name> + <key>"Dark Blue"</key> + </option> + <tab>Config</tab> + </param> + + <param> + <name>Line 1 Style</name> + <key>style1</key> + <type>enum</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <option> + <name>Solid</name> + <key>1</key> + </option> + <option> + <name>Dash</name> + <key>2</key> + </option> + <option> + <name>Dots</name> + <key>3</key> + </option> + <option> + <name>Dash-Dot</name> + <key>4</key> + </option> + <option> + <name>Dash-Dot-Dot</name> + <key>5</key> + </option> + <option> + <name>None</name> + <key>0</key> + </option> + <tab>Config</tab> + </param> + + <param> + <name>Line 1 Marker</name> + <key>marker1</key> + <type>enum</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <option> + <name>Circle</name> + <key>0</key> + </option> + <option> + <name>Rectangle</name> + <key>1</key> + </option> + <option> + <name>Diamond</name> + <key>2</key> + </option> + <option> + <name>Triangle</name> + <key>3</key> + </option> + <option> + <name>Down Triangle</name> + <key>4</key> + </option> + <option> + <name>Left Triangle</name> + <key>6</key> + </option> + <option> + <name>Right Triangle</name> + <key>7</key> + </option> + <option> + <name>Cross</name> + <key>8</key> + </option> + <option> + <name>X-Cross</name> + <key>9</key> + </option> + <option> + <name>None</name> + <key>-1</key> + </option> + <tab>Config</tab> + </param> + + <param> + <name>Line 1 Alpha</name> + <key>alpha1</key> + <value>1.0</value> + <type>float</type> + <hide>#if int($num_curves()) >= 1 then 'part' else 'all'#</hide> + <tab>Config</tab> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 2 Label</name> + <key>label2</key> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 2 Width</name> + <key>width2</key> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 2 Color</name> + <key>color2</key> + <value>"red"</value> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 2 Style</name> + <key>style2</key> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 2 Marker</name> + <key>marker2</key> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 2 Alpha</name> + <key>alpha2</key> + <hide>#if int($num_curves()) >= 2 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 3 Label</name> + <key>label3</key> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 3 Width</name> + <key>width3</key> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 3 Color</name> + <key>color3</key> + <value>"green"</value> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 3 Style</name> + <key>style3</key> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 3 Marker</name> + <key>marker3</key> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 3 Alpha</name> + <key>alpha3</key> + <hide>#if int($num_curves()) >= 3 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 4 Label</name> + <key>label4</key> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 4 Width</name> + <key>width4</key> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 4 Color</name> + <key>color4</key> + <value>"black"</value> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 4 Style</name> + <key>style4</key> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 4 Marker</name> + <key>marker4</key> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 4 Alpha</name> + <key>alpha4</key> + <hide>#if int($num_curves()) >= 4 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 5 Label</name> + <key>label5</key> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 5 Width</name> + <key>width5</key> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 5 Color</name> + <key>color5</key> + <value>"cyan"</value> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 5 Style</name> + <key>style5</key> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 5 Marker</name> + <key>marker5</key> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 5 Alpha</name> + <key>alpha5</key> + <hide>#if int($num_curves()) >= 5 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 6 Label</name> + <key>label6</key> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 6 Width</name> + <key>width6</key> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 6 Color</name> + <key>color6</key> + <value>"magenta"</value> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 6 Style</name> + <key>style6</key> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 6 Marker</name> + <key>marker6</key> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 6 Alpha</name> + <key>alpha6</key> + <hide>#if int($num_curves()) >= 6 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 7 Label</name> + <key>label7</key> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 7 Width</name> + <key>width7</key> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 7 Color</name> + <key>color7</key> + <value>"yellow"</value> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 7 Style</name> + <key>style7</key> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 7 Marker</name> + <key>marker7</key> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 7 Alpha</name> + <key>alpha7</key> + <hide>#if int($num_curves()) >= 7 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 8 Label</name> + <key>label8</key> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 8 Width</name> + <key>width8</key> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 8 Color</name> + <key>color8</key> + <value>"dark red"</value> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 8 Style</name> + <key>style8</key> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 8 Marker</name> + <key>marker8</key> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 8 Alpha</name> + <key>alpha8</key> + <hide>#if int($num_curves()) >= 8 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 9 Label</name> + <key>label9</key> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 9 Width</name> + <key>width9</key> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 9 Color</name> + <key>color9</key> + <value>"dark green"</value> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 9 Style</name> + <key>style9</key> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 9 Marker</name> + <key>marker9</key> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 9 Alpha</name> + <key>alpha9</key> + <hide>#if int($num_curves()) >= 9 then 'part' else 'all'#</hide> + </param> + + + <param> + <base_key>label1</base_key> + <name>Line 10 Label</name> + <key>label10</key> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>width1</base_key> + <name>Line 10 Width</name> + <key>width10</key> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>color1</base_key> + <name>Line 10 Color</name> + <key>color10</key> + <value>"dark blue"</value> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>style1</base_key> + <name>Line 10 Style</name> + <key>style10</key> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>marker1</base_key> + <name>Line 10 Marker</name> + <key>marker10</key> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + <param> + <base_key>alpha1</base_key> + <name>Line 10 Alpha</name> + <key>alpha10</key> + <hide>#if int($num_curves()) >= 10 then 'part' else 'all'#</hide> + </param> + + + <sink> + <name>out</name> + <type>byte</type> + <nports>len($esno)*2*$num_curves</nports> + </sink> + + <bus_structure_sink>map(lambda b: map(lambda a: b * len($esno) * 2 + a, range(len($esno)*2)), range($num_curves))</bus_structure_sink> + + <doc> + The GUI hint can be used to position the widget within the application. \ + The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ + Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_block_tree.xml b/gr-qtgui/grc/qtgui_block_tree.xml index 2fc1b0343e..4461f82d5d 100644 --- a/gr-qtgui/grc/qtgui_block_tree.xml +++ b/gr-qtgui/grc/qtgui_block_tree.xml @@ -37,6 +37,7 @@ <block>qtgui_const_sink_x</block> <block>qtgui_waterfall_sink_x</block> <block>qtgui_time_raster_sink_x</block> + <block>qtgui_bercurve_sink</block> <block>qtgui_histogram_sink_x</block> <block>qtgui_number_sink</block> <block>qtgui_sink_x</block> diff --git a/gr-qtgui/grc/qtgui_const_sink_x.xml b/gr-qtgui/grc/qtgui_const_sink_x.xml index 3b549e2d31..0062bcaba8 100644 --- a/gr-qtgui/grc/qtgui_const_sink_x.xml +++ b/gr-qtgui/grc/qtgui_const_sink_x.xml @@ -66,12 +66,15 @@ $(gui_hint()($win))</make> <option><name>Complex</name><key>complex</key><opt>fcn:const_sink_c</opt></option> <!--<option><name>Float</name><key>float</key><opt>fcn:const_sink_f</opt></option> --> </param> + <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> + <param> <name>Number of Points</name> <key>size</key> diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.xml b/gr-qtgui/grc/qtgui_freq_sink_x.xml index 761943eefc..beed7fa921 100644 --- a/gr-qtgui/grc/qtgui_freq_sink_x.xml +++ b/gr-qtgui/grc/qtgui_freq_sink_x.xml @@ -48,6 +48,7 @@ $(gui_hint()($win))</make> <callback>set_update_time($update_time)</callback> <callback>set_title($which, $title)</callback> <callback>set_color($which, $color)</callback> + <callback>set_y_axis($ymin, $ymax)</callback> <param_tab_order> <tab>General</tab> @@ -62,11 +63,13 @@ $(gui_hint()($win))</make> <option><name>Complex</name><key>complex</key><opt>fcn:freq_sink_c</opt></option> <option><name>Float</name><key>float</key><opt>fcn:freq_sink_f</opt></option> </param> + <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> <param> @@ -550,6 +553,19 @@ $(gui_hint()($win))</make> <type>$type</type> <nports>$nconnections</nports> </sink> + + <sink> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </sink> + + <source> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </source> + <doc> The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.xml b/gr-qtgui/grc/qtgui_histogram_sink_x.xml index 254089181b..a7137ac6a1 100644 --- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml +++ b/gr-qtgui/grc/qtgui_histogram_sink_x.xml @@ -64,9 +64,11 @@ $(gui_hint()($win))</make> <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> + <param> <name>Number of Points</name> <key>size</key> diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml index 756b325ebe..618973ed59 100644 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -27,6 +27,8 @@ self.$(id).set_update_time(1.0/$rate) self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) $(gui_hint()($win)) +self.$(id).enable_rf_freq($showrf) + #if $freqchangevar() is not None def $(id)_callback(p, num): if num == 1 or num == 2: self.set_$(freqchangevar)(p.x()) @@ -47,8 +49,9 @@ Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, int)") <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> <param> <name>FFT Size</name> @@ -105,6 +108,23 @@ Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, int)") <value>10</value> <type>real</type> </param> + + <param> + <name>Show RF Freq</name> + <key>showrf</key> + <value>False</value> + <type>enum</type> + <hide>part</hide> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <param> <name>Plot Frequency</name> <key>plotfreq</key> @@ -155,14 +175,28 @@ Qt.QObject.connect(self._$(id)_win, Qt.SIGNAL("plotPointSelected(QPointF, int)") <type>raw</type> <hide>part</hide> </param> + <sink> <name>in</name> <type>$type</type> <nports>$num_inputs</nports> </sink> - <doc> + + <sink> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </sink> + + <source> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </source> + + <doc> The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ Both the tab specification and the grid position are optional. - </doc> + </doc> </block> diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml b/gr-qtgui/grc/qtgui_time_raster_x.xml index db13ce5f6a..d303e7f42a 100644 --- a/gr-qtgui/grc/qtgui_time_raster_x.xml +++ b/gr-qtgui/grc/qtgui_time_raster_x.xml @@ -60,12 +60,15 @@ $(gui_hint()($win))</make> <option><name>Byte</name><key>byte</key><opt>fcn:time_raster_sink_b</opt></option> <option><name>Float</name><key>float</key><opt>fcn:time_raster_sink_f</opt></option> </param> + <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> + <param> <name>Sample Rate</name> <key>samp_rate</key> @@ -148,6 +151,14 @@ $(gui_hint()($win))</make> <name>Incandescent</name> <key>3</key> </option> + <option> + <name>Sunset</name> + <key>5</key> + </option> + <option> + <name>Cool</name> + <key>6</key> + </option> <tab>Config</tab> </param> diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml b/gr-qtgui/grc/qtgui_time_sink_x.xml index 172da7a02d..f40487e61f 100644 --- a/gr-qtgui/grc/qtgui_time_sink_x.xml +++ b/gr-qtgui/grc/qtgui_time_sink_x.xml @@ -87,12 +87,15 @@ $(gui_hint()($win))</make> <option><name>Complex</name><key>complex</key><opt>fcn:time_sink_c</opt></option> <option><name>Float</name><key>float</key><opt>fcn:time_sink_f</opt></option> </param> + <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> + <param> <name>Number of Points</name> <key>size</key> diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml index 943aa9d962..36df704a3e 100644 --- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml +++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml @@ -36,12 +36,15 @@ for i in xrange($nconnections): self.$(id).set_color_map(i, colors[i]) self.$(id).set_line_alpha(i, alphas[i]) +self.$(id).set_intensity_range($int_min, $int_max) + self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) $(gui_hint()($win))</make> <callback>set_frequency_range($fc, $bw)</callback> <callback>set_update_time($update_time)</callback> <callback>set_title($which, $title)</callback> <callback>set_color($which, $color)</callback> + <callback>set_intensity_range($int_min, $int_max)</callback> <param_tab_order> <tab>General</tab> @@ -56,12 +59,15 @@ $(gui_hint()($win))</make> <option><name>Complex</name><key>complex</key><opt>fcn:waterfall_sink_c</opt></option> <option><name>Float</name><key>float</key><opt>fcn:waterfall_sink_f</opt></option> </param> + <param> <name>Name</name> <key>name</key> - <value>QT GUI Plot</value> + <value>""</value> <type>string</type> + <hide>#if len($name()) > 0 then 'none' else 'part'#</hide> </param> + <param> <name>FFT Size</name> <key>fftsize</key> @@ -115,6 +121,23 @@ $(gui_hint()($win))</make> <value>samp_rate</value> <type>real</type> </param> + + <param> + <name>Intensity Min</name> + <key>int_min</key> + <value>-140</value> + <type>float</type> + <hide>part</hide> + </param> + + <param> + <name>Intensity Max</name> + <key>int_max</key> + <value>10</value> + <type>float</type> + <hide>part</hide> + </param> + <param> <name>Number of Inputs</name> <key>nconnections</key> @@ -168,6 +191,14 @@ $(gui_hint()($win))</make> <name>Incandescent</name> <key>3</key> </option> + <option> + <name>Sunset</name> + <key>5</key> + </option> + <option> + <name>Cool</name> + <key>6</key> + </option> <tab>Config</tab> </param> @@ -384,6 +415,19 @@ $(gui_hint()($win))</make> <type>$type</type> <nports>$nconnections</nports> </sink> + + <sink> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </sink> + + <source> + <name>freq</name> + <type>message</type> + <optional>1</optional> + </source> + <doc> The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ diff --git a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt index bb0d3cf953..e7a4701c49 100644 --- a/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt +++ b/gr-qtgui/include/gnuradio/qtgui/CMakeLists.txt @@ -22,6 +22,7 @@ ######################################################################## install(FILES api.h + ber_sink_b.h CMakeLists.txt constellationdisplayform.h ConstellationDisplayPlot.h @@ -38,7 +39,6 @@ install(FILES HistogramDisplayPlot.h number_sink.h numberdisplayform.h - NumberDisplayPlot.h plot_raster.h plot_waterfall.h qtgui_types.h diff --git a/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h b/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h index f95ab6477a..2fb70448d6 100644 --- a/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h +++ b/gr-qtgui/include/gnuradio/qtgui/SpectrumGUIClass.h @@ -103,6 +103,11 @@ public: void setUpdateTime(double t); + void enableRFFreq(bool en); + + bool checkClicked(); + float getClickedFreq(); + protected: private: diff --git a/gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h b/gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h index 2a49cbddbe..7ef1ad2d75 100644 --- a/gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h +++ b/gr-qtgui/include/gnuradio/qtgui/TimeRasterDisplayPlot.h @@ -46,6 +46,8 @@ class TimeRasterDisplayPlot: public DisplayPlot { Q_OBJECT + Q_PROPERTY(int intensity_color_map_type1 READ getIntensityColorMapType1 WRITE setIntensityColorMapType1) + public: TimeRasterDisplayPlot(int nplots, double samp_rate, @@ -80,7 +82,9 @@ public: void replot(void); int getIntensityColorMapType(int) const; + int getIntensityColorMapType1() const; void setIntensityColorMapType(const int, const int, const QColor, const QColor); + void setIntensityColorMapType1(int); const QColor getUserDefinedLowIntensityColor() const; const QColor getUserDefinedHighIntensityColor() const; diff --git a/gr-qtgui/include/gnuradio/qtgui/ber_sink_b.h b/gr-qtgui/include/gnuradio/qtgui/ber_sink_b.h new file mode 100644 index 0000000000..1f10976441 --- /dev/null +++ b/gr-qtgui/include/gnuradio/qtgui/ber_sink_b.h @@ -0,0 +1,91 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_QTGUI_BER_SINK_B_H +#define INCLUDED_QTGUI_BER_SINK_B_H + +#ifdef ENABLE_PYTHON +#include <Python.h> +#endif + +#include <gnuradio/qtgui/api.h> +#include <gnuradio/block.h> +#include <qapplication.h> + + + +namespace gr { + namespace qtgui { + + class QTGUI_API ber_sink_b : virtual public block + { + public: + // gr::fec::ber_sink_b::sptr + typedef boost::shared_ptr<ber_sink_b> sptr; + + static sptr make(std::vector<float> esnos, int curves = 1, + int berminerrors = 100, float berLimit = -7.0, + std::vector<std::string> curvenames = std::vector<std::string>(), + QWidget *parent=NULL); + + virtual void exec_() = 0; + +#ifdef ENABLE_PYTHON + virtual PyObject* pyqwidget() = 0; +#else + virtual void* pyqwidget() = 0; +#endif + + virtual void set_y_axis(double min, double max) = 0; + virtual void set_x_axis(double min, double max) = 0; + + virtual void set_update_time(double t) = 0; + virtual void set_title(const std::string &title) = 0; + virtual void set_line_label(int which, const std::string &label) = 0; + virtual void set_line_color(int which, const std::string &color) = 0; + virtual void set_line_width(int which, int width) = 0; + virtual void set_line_style(int which, int style) = 0; + virtual void set_line_marker(int which, int marker) = 0; + + virtual void set_line_alpha(int which, double alpha) = 0; + + virtual std::string title() = 0; + virtual std::string line_label(int which) = 0; + virtual std::string line_color(int which) = 0; + virtual int line_width(int which) = 0; + virtual int line_style(int which) = 0; + virtual int line_marker(int which) = 0; + virtual double line_alpha(int which) = 0; + + virtual void set_size(int width, int height) = 0; + + virtual void enable_menu(bool en=true) = 0; + virtual void enable_autoscale(bool en) = 0; + virtual int nsamps() const = 0; + + QApplication *d_qApplication; + }; + + } /* namespace qtgui */ +} /* namespace gr */ + +#endif /* INCLUDED_QTGUI_BER_SINK_B_H */ diff --git a/gr-qtgui/include/gnuradio/qtgui/displayform.h b/gr-qtgui/include/gnuradio/qtgui/displayform.h index c4a9cf789d..42c8e40e3d 100644 --- a/gr-qtgui/include/gnuradio/qtgui/displayform.h +++ b/gr-qtgui/include/gnuradio/qtgui/displayform.h @@ -91,7 +91,7 @@ private slots: virtual void autoScale(bool) = 0; void updateGuiTimer(); - void onPlotPointSelected(const QPointF p); + virtual void onPlotPointSelected(const QPointF p); signals: void plotPointSelected(const QPointF p, int type); diff --git a/gr-qtgui/include/gnuradio/qtgui/form_menus.h b/gr-qtgui/include/gnuradio/qtgui/form_menus.h index 1b26d289e6..d22577ef67 100644 --- a/gr-qtgui/include/gnuradio/qtgui/form_menus.h +++ b/gr-qtgui/include/gnuradio/qtgui/form_menus.h @@ -41,6 +41,8 @@ public: LineColorMenu(int which, QWidget *parent) : QMenu("Line Color", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("Blue", this)); d_act.push_back(new QAction("Red", this)); d_act.push_back(new QAction("Green", this)); @@ -70,6 +72,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -108,6 +112,7 @@ public slots: void getDarkGray() { emit whichTrigger(d_which, "darkgray"); } private: + QActionGroup *d_grp; QList<QAction *> d_act; int d_which; }; @@ -124,6 +129,8 @@ public: LineWidthMenu(int which, QWidget *parent) : QMenu("Line Width", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("1", this)); d_act.push_back(new QAction("2", this)); d_act.push_back(new QAction("3", this)); @@ -149,6 +156,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -185,6 +194,7 @@ public slots: void getTen() { emit whichTrigger(d_which, 10); } private: + QActionGroup *d_grp; QList<QAction *> d_act; int d_which; }; @@ -201,6 +211,8 @@ public: LineStyleMenu(int which, QWidget *parent) : QMenu("Line Style", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("None", this)); d_act.push_back(new QAction("Solid", this)); d_act.push_back(new QAction("Dash", this)); @@ -218,6 +230,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -250,6 +264,7 @@ public slots: void getDashDotDot() { emit whichTrigger(d_which, Qt::DashDotDotLine); } private: + QActionGroup *d_grp; QList<QAction *> d_act; int d_which; }; @@ -266,6 +281,8 @@ public: LineMarkerMenu(int which, QWidget *parent) : QMenu("Line Marker", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("None", this)); d_act.push_back(new QAction("Circle", this)); d_act.push_back(new QAction("Rectangle", this)); @@ -301,6 +318,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -342,6 +361,7 @@ public slots: void getHexagon() { emit whichTrigger(d_which, QwtSymbol::Hexagon); } private: + QActionGroup *d_grp; QList<QAction *> d_act; int d_which; }; @@ -358,6 +378,8 @@ public: MarkerAlphaMenu(int which, QWidget *parent) : QMenu("Line Transparency", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("None", this)); d_act.push_back(new QAction("Low", this)); d_act.push_back(new QAction("Medium", this)); @@ -373,6 +395,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -404,6 +428,7 @@ public slots: void getOff() { emit whichTrigger(d_which, 0); } private: + QActionGroup *d_grp; QList<QAction *> d_act; int d_which; }; @@ -607,6 +632,8 @@ public: FFTSizeMenu(QWidget *parent) : QMenu("FFT Size", parent) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("32", this)); d_act.push_back(new QAction("64", this)); d_act.push_back(new QAction("128", this)); @@ -646,6 +673,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -723,6 +752,8 @@ public: FFTAverageMenu(QWidget *parent) : QMenu("FFT Average", parent) { + d_grp = new QActionGroup(this); + d_off = 1.0; d_high = 0.05; d_medium = 0.1; @@ -754,6 +785,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } } @@ -995,10 +1028,14 @@ public: ColorMapMenu(int which, QWidget *parent) : QMenu("Color Map", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("Multi-Color", this)); d_act.push_back(new QAction("White Hot", this)); d_act.push_back(new QAction("Black Hot", this)); d_act.push_back(new QAction("Incandescent", this)); + d_act.push_back(new QAction("Sunset", this)); + d_act.push_back(new QAction("Cool", this)); d_act.push_back(new QAction("Other", this)); //d_act.push_back(new OtherDualAction("Min Intensity: ", "Max Intensity: ", this)); @@ -1006,11 +1043,15 @@ public: connect(d_act[1], SIGNAL(triggered()), this, SLOT(getWhiteHot())); connect(d_act[2], SIGNAL(triggered()), this, SLOT(getBlackHot())); connect(d_act[3], SIGNAL(triggered()), this, SLOT(getIncandescent())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getOther())); + connect(d_act[4], SIGNAL(triggered()), this, SLOT(getSunset())); + connect(d_act[5], SIGNAL(triggered()), this, SLOT(getCool())); + connect(d_act[6], SIGNAL(triggered()), this, SLOT(getOther())); QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } @@ -1044,6 +1085,8 @@ public: void getWhiteHot() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_WHITE_HOT); } void getBlackHot() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_BLACK_HOT); } void getIncandescent() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_INCANDESCENT); } + void getSunset() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_SUNSET); } + void getCool() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_COOL); } //void getOther(d_which, const QString &min_str, const QString &max_str) void getOther() { @@ -1058,6 +1101,7 @@ public: } private: + QActionGroup *d_grp; QList<QAction *> d_act; OtherDualAction *d_other; QColor d_max_value, d_min_value; @@ -1360,6 +1404,8 @@ public: NumberColorMapMenu(int which, QWidget *parent) : QMenu("Color Map", parent), d_which(which) { + d_grp = new QActionGroup(this); + d_act.push_back(new QAction("Black", this)); d_act.push_back(new QAction("Blue-Red", this)); d_act.push_back(new QAction("White Hot", this)); @@ -1377,6 +1423,8 @@ public: QListIterator<QAction*> i(d_act); while(i.hasNext()) { QAction *a = i.next(); + a->setCheckable(true); + a->setActionGroup(d_grp); addAction(a); } @@ -1423,6 +1471,7 @@ public: } private: + QActionGroup *d_grp; QList<QAction *> d_act; QColor d_max_value, d_min_value; int d_which; diff --git a/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h b/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h index fcbfd72ec3..d02505c6f6 100644 --- a/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h +++ b/gr-qtgui/include/gnuradio/qtgui/freq_sink_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,6 +46,25 @@ namespace gr { * different color, and the \a set_title and \a set_color * functions can be used to change the lable and color for a given * input number. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ class QTGUI_API freq_sink_c : virtual public sync_block { @@ -112,6 +131,8 @@ namespace gr { virtual void enable_menu(bool en=true) = 0; virtual void enable_grid(bool en=true) = 0; virtual void enable_autoscale(bool en=true) = 0; + virtual void clear_max_hold() = 0; + virtual void clear_min_hold() = 0; virtual void reset() = 0; QApplication *d_qApplication; diff --git a/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h b/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h index a6507da3af..81f9c0c8c5 100644 --- a/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h +++ b/gr-qtgui/include/gnuradio/qtgui/freq_sink_f.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,6 +46,25 @@ namespace gr { * different color, and the \a set_title and \a set_color * functions can be used to change the lable and color for a given * input number. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ class QTGUI_API freq_sink_f : virtual public sync_block { @@ -111,6 +130,8 @@ namespace gr { virtual void enable_menu(bool en=true) = 0; virtual void enable_grid(bool en=true) = 0; virtual void enable_autoscale(bool en=true) = 0; + virtual void clear_max_hold() = 0; + virtual void clear_min_hold() = 0; virtual void reset() = 0; QApplication *d_qApplication; diff --git a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h index 95e6337f04..c0cd36ef23 100644 --- a/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h +++ b/gr-qtgui/include/gnuradio/qtgui/freqdisplayform.h @@ -49,6 +49,12 @@ class FreqDisplayForm : public DisplayForm float getFFTAverage() const; gr::filter::firdes::win_type getFFTWindowType() const; + // returns the frequency that was last double-clicked on by the user + float getClickedFreq() const; + + // checks if there was a double-click event; reset if there was + bool checkClicked(); + public slots: void customEvent(QEvent *e); @@ -61,9 +67,12 @@ public slots: const double bandwidth); void setYaxis(double min, double max); void autoScale(bool en); + void clearMaxHold(); + void clearMinHold(); private slots: void newData(const QEvent *updateEvent); + void onPlotPointSelected(const QPointF p); private: uint64_t d_num_real_data_points; @@ -73,11 +82,15 @@ private: int d_fftsize; float d_fftavg; gr::filter::firdes::win_type d_fftwintype; + double d_units; + + bool d_clicked; + double d_clicked_freq; FFTSizeMenu *d_sizemenu; FFTAverageMenu *d_avgmenu; FFTWindowMenu *d_winmenu; - + QAction *d_clearmin_act, *d_clearmax_act; }; #endif /* FREQ_DISPLAY_FORM_H */ diff --git a/gr-qtgui/include/gnuradio/qtgui/qtgui_types.h b/gr-qtgui/include/gnuradio/qtgui/qtgui_types.h index cde52547a9..e55746c48c 100644 --- a/gr-qtgui/include/gnuradio/qtgui/qtgui_types.h +++ b/gr-qtgui/include/gnuradio/qtgui/qtgui_types.h @@ -154,7 +154,9 @@ enum{ INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1, INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2, INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3, - INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4 + INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4, + INTENSITY_COLOR_MAP_TYPE_SUNSET = 5, + INTENSITY_COLOR_MAP_TYPE_COOL = 6, }; class ColorMap_MultiColor: public QwtLinearColorMap @@ -197,6 +199,36 @@ public: } }; +class ColorMap_Sunset: public QwtLinearColorMap +{ +public: + ColorMap_Sunset(): + QwtLinearColorMap(QColor(0, 0, 0, 0), + QColor(255, 255, 193, 255)) + { + addColorStop(0.167, QColor( 86, 0, 153, 45)); + addColorStop(0.333, QColor(147, 51, 119, 91)); + addColorStop(0.500, QColor(226, 51, 71, 140)); + addColorStop(0.667, QColor(255, 109, 0, 183)); + addColorStop(0.833, QColor(255, 183, 0, 221)); + } +}; + +class ColorMap_Cool: public QwtLinearColorMap +{ +public: + ColorMap_Cool(): + QwtLinearColorMap(QColor(0, 0, 0, 0), + QColor(255, 255, 255, 255)) + { + addColorStop(0.167, QColor( 0, 0, 127, 25)); + addColorStop(0.333, QColor( 0, 63, 153, 86)); + addColorStop(0.500, QColor(76, 114, 178, 127)); + addColorStop(0.667, QColor(153, 165, 204, 178)); + addColorStop(0.833, QColor(204, 216, 229, 211)); + } +}; + class ColorMap_UserDefined: public QwtLinearColorMap { public: diff --git a/gr-qtgui/include/gnuradio/qtgui/sink_c.h b/gr-qtgui/include/gnuradio/qtgui/sink_c.h index e0c770039f..c1c8777255 100644 --- a/gr-qtgui/include/gnuradio/qtgui/sink_c.h +++ b/gr-qtgui/include/gnuradio/qtgui/sink_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2011,2012 Free Software Foundation, Inc. + * Copyright 2008,2009,2011,2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -47,8 +47,26 @@ namespace gr { * spectrogram (waterfall), time domain I&Q, and constellation (I * vs. Q) plots. The plots may be turned off by setting the * appropriate boolean value in the constructor to False. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ - class QTGUI_API sink_c : virtual public block { public: @@ -91,6 +109,7 @@ namespace gr { virtual void set_frequency_range(const double centerfreq, const double bandwidth) = 0; virtual void set_fft_power_db(double min, double max) = 0; + virtual void enable_rf_freq(bool en) = 0; //void set_time_domain_axis(double min, double max); //void set_constellation_axis(double xmin, double xmax, diff --git a/gr-qtgui/include/gnuradio/qtgui/sink_f.h b/gr-qtgui/include/gnuradio/qtgui/sink_f.h index 0e8004b1ed..32854ec8ae 100644 --- a/gr-qtgui/include/gnuradio/qtgui/sink_f.h +++ b/gr-qtgui/include/gnuradio/qtgui/sink_f.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2011,2012 Free Software Foundation, Inc. + * Copyright 2008,2009,2011,2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -47,8 +47,26 @@ namespace gr { * spectrogram (waterfall), and time domain plots. The plots may be * turned off by setting the appropriate boolean value in the * constructor to False. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ - class QTGUI_API sink_f : virtual public block { public: @@ -91,6 +109,7 @@ namespace gr { virtual void set_frequency_range(const double centerfreq, const double bandwidth) = 0; virtual void set_fft_power_db(double min, double max) = 0; + virtual void enable_rf_freq(bool en) = 0; //void set_time_domain_axis(double min, double max); //void set_constellation_axis(double xmin, double xmax, diff --git a/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h b/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h index d26f41e26d..7ab2d23f63 100644 --- a/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h +++ b/gr-qtgui/include/gnuradio/qtgui/spectrumUpdateEvents.h @@ -176,6 +176,20 @@ private: }; +class SetFreqEvent:public QEvent +{ +public: + SetFreqEvent(const double, const double); + ~SetFreqEvent(); + double getCenterFrequency() const; + double getBandwidth() const; + +private: + double _centerFrequency; + double _bandwidth; +}; + + /********************************************************************/ diff --git a/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h b/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h index 6b43661cb4..7c71254b8b 100644 --- a/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h +++ b/gr-qtgui/include/gnuradio/qtgui/spectrumdisplayform.h @@ -55,6 +55,12 @@ class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm void resizeBuffers(const uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints); + // returns the frequency that was last double-clicked on by the user + float getClickedFreq() const; + + // checks if there was a double-click event; reset if there was + bool checkClicked(); + public slots: void resizeEvent(QResizeEvent * e); void customEvent(QEvent * e); @@ -71,6 +77,7 @@ public slots: void closeEvent(QCloseEvent * e); void windowTypeChanged(int newItem); void useRFFrequenciesCB(bool useRFFlag); + void toggleRFFrequencies(bool en); void waterfallMaximumIntensityChangedCB(double); void waterfallMinimumIntensityChangedCB(double); void waterfallIntensityColorTypeChanged(int); @@ -124,6 +131,10 @@ private: double _peakAmplitude; double _stopFrequency; + double d_units; + bool d_clicked; + double d_clicked_freq; + //SpectrumUpdateEvent _lastSpectrumEvent; // whether or not to use a particular display diff --git a/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_c.h b/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_c.h index 4a3e9f0e81..bf73db3f1a 100644 --- a/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_c.h +++ b/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -52,6 +52,25 @@ namespace gr { * would love to see them. Otherwise, to display multiple signals * here, it's probably best to sum the signals together and * connect that here. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ class QTGUI_API waterfall_sink_c : virtual public sync_block { diff --git a/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_f.h b/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_f.h index 3877158e7c..bbfcc33164 100644 --- a/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_f.h +++ b/gr-qtgui/include/gnuradio/qtgui/waterfall_sink_f.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -52,6 +52,25 @@ namespace gr { * would love to see them. Otherwise, to display multiple signals * here, it's probably best to sum the signals together and * connect that here. + * + * Message Ports: + * + * - freq (input): + * Receives a PMT pair: (intern("freq"), double(frequency). + * This is used to retune the center frequency of the + * display's x-axis. + * + * - freq (output): + * Produces a PMT pair with (intern("freq"), double(frequency). + * When a user double-clicks on the display, the block + * produces and emits a message containing the frequency of + * where on the x-axis the user clicked. This value can be + * used by other blocks to update their frequency setting. + * + * To perform click-to-tune behavior, this output 'freq' + * port can be redirected to this block's input 'freq' port + * to catch the message and update the center frequency of + * the display. */ class QTGUI_API waterfall_sink_f : virtual public sync_block { diff --git a/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h b/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h index 1ac1cf428f..5af2680b8a 100644 --- a/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h +++ b/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h @@ -56,6 +56,12 @@ class WaterfallDisplayForm : public DisplayForm void clearData(); + // returns the frequency that was last double-clicked on by the user + float getClickedFreq() const; + + // checks if there was a double-click event; reset if there was + bool checkClicked(); + public slots: void customEvent(QEvent *e); @@ -81,6 +87,7 @@ public slots: private slots: void newData(const QEvent *updateEvent); + void onPlotPointSelected(const QPointF p); private: QIntValidator* d_int_validator; @@ -89,6 +96,10 @@ private: int d_fftsize; float d_fftavg; gr::filter::firdes::win_type d_fftwintype; + double d_units; + + bool d_clicked; + double d_clicked_freq; double d_min_val; double d_max_val; diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index f46fe838a3..2dc73a9abb 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -39,9 +39,8 @@ set(qtgui_moc_hdrs ${qtgui_mod_includedir}/WaterfallDisplayPlot.h ${qtgui_mod_includedir}/ConstellationDisplayPlot.h ${qtgui_mod_includedir}/HistogramDisplayPlot.h - ${qtgui_mod_includedir}/NumberDisplayPlot.h ) -QT4_WRAP_CPP(qtgui_moc_srcs ${qtgui_moc_hdrs}) +QT4_WRAP_CPP(qtgui_moc_sources ${qtgui_moc_hdrs}) QT4_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) #FIXME the sources expect <foo>.ui.h, but the macros generate ui_foo.h @@ -51,8 +50,8 @@ if(NOT EXISTS ${spectrum_ui_hdr}) file(WRITE ${spectrum_ui_hdr} "#include <ui_spectrumdisplayform.h>\n") endif(NOT EXISTS ${spectrum_ui_hdr}) -set(qtgui_srcs - ${qtgui_moc_srcs} +set(qtgui_sources + ${qtgui_moc_sources} ${qtgui_ui_hdrs} DisplayPlot.cc FrequencyDisplayPlot.cc @@ -70,7 +69,6 @@ set(qtgui_srcs freqdisplayform.cc constellationdisplayform.cc histogramdisplayform.cc - NumberDisplayPlot.cc numberdisplayform.cc waterfalldisplayform.cc SpectrumGUIClass.cc @@ -91,6 +89,7 @@ set(qtgui_srcs histogram_sink_f_impl.cc number_sink_impl.cc qtgui_util.cc + ber_sink_b_impl.cc ) #Add Windows DLL resource file if using MSVC @@ -102,7 +101,7 @@ if(MSVC) ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-qtgui.rc @ONLY) - list(APPEND qtgui_srcs + list(APPEND qtgui_sources ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-qtgui.rc ) endif(MSVC) @@ -161,6 +160,19 @@ if(ENABLE_PYTHON) endif(ENABLE_PYTHON) add_definitions(-DQWT_DLL) #setup QWT library linkage -add_library(gnuradio-qtgui SHARED ${qtgui_srcs}) +add_library(gnuradio-qtgui SHARED ${qtgui_sources}) target_link_libraries(gnuradio-qtgui ${qtgui_libs}) GR_LIBRARY_FOO(gnuradio-qtgui RUNTIME_COMPONENT "qtgui_runtime" DEVEL_COMPONENT "qtgui_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-qtgui_static STATIC ${qtgui_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-qtgui_static + PROPERTIES OUTPUT_NAME gnuradio-qtgui) + endif(NOT WIN32) + + install(TARGETS gnuradio-qtgui_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "qtgui_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc index e93ced2d14..19ebac1a82 100644 --- a/gr-qtgui/lib/FrequencyDisplayPlot.cc +++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc @@ -110,6 +110,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) << QColor(Qt::yellow) << QColor(Qt::gray) << QColor(Qt::darkRed) << QColor(Qt::darkGreen) << QColor(Qt::darkBlue) << QColor(Qt::darkGray); + // Create a curve for each input // Automatically deleted when parent is deleted for(int i = 0; i < d_nplots; i++) { d_ydata.push_back(new double[d_numPoints]); @@ -131,7 +132,8 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) setLineColor(i, default_colors[i]); } - d_min_fft_plot_curve = new QwtPlotCurve("Minimum Power"); + // Create min/max plotter curves + d_min_fft_plot_curve = new QwtPlotCurve("Min Hold"); d_min_fft_plot_curve->attach(this); const QColor default_min_fft_color = Qt::magenta; setMinFFTColor(default_min_fft_color); @@ -141,8 +143,9 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) d_min_fft_plot_curve->setRawSamples(d_xdata, d_min_fft_data, d_numPoints); #endif d_min_fft_plot_curve->setVisible(false); + d_min_fft_plot_curve->setZ(0); - d_max_fft_plot_curve = new QwtPlotCurve("Maximum Power"); + d_max_fft_plot_curve = new QwtPlotCurve("Max Hold"); d_max_fft_plot_curve->attach(this); QColor default_max_fft_color = Qt::darkYellow; setMaxFFTColor(default_max_fft_color); @@ -152,6 +155,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) d_max_fft_plot_curve->setRawSamples(d_xdata, d_max_fft_data, d_numPoints); #endif d_max_fft_plot_curve->setVisible(false); + d_max_fft_plot_curve->setZ(0); d_lower_intensity_marker= new QwtPlotMarker(); d_lower_intensity_marker->setLineStyle(QwtPlotMarker::HLine); diff --git a/gr-qtgui/lib/SpectrumGUIClass.cc b/gr-qtgui/lib/SpectrumGUIClass.cc index 8708ff0207..5272d8ab30 100644 --- a/gr-qtgui/lib/SpectrumGUIClass.cc +++ b/gr-qtgui/lib/SpectrumGUIClass.cc @@ -192,9 +192,10 @@ SpectrumGUIClass::setFrequencyRange(const double centerFreq, _startFrequency = startFreq; _stopFrequency = stopFreq; - _spectrumDisplayForm->setFrequencyRange(_centerFrequency, - _startFrequency, - _stopFrequency); + qApp->postEvent(_spectrumDisplayForm, + new SpectrumFrequencyRangeEvent(_centerFrequency, + _startFrequency, + _stopFrequency)); } double @@ -470,5 +471,25 @@ SpectrumGUIClass::setUpdateTime(double t) _spectrumDisplayForm->setUpdateTime(_updateTime); } +void +SpectrumGUIClass::enableRFFreq(bool en) +{ + gr::thread::scoped_lock lock(d_mutex); + _spectrumDisplayForm->toggleRFFrequencies(en); +} + +bool +SpectrumGUIClass::checkClicked() +{ + gr::thread::scoped_lock lock(d_mutex); + return _spectrumDisplayForm->checkClicked(); +} + +float +SpectrumGUIClass::getClickedFreq() +{ + gr::thread::scoped_lock lock(d_mutex); + return _spectrumDisplayForm->getClickedFreq(); +} #endif /* SPECTRUM_GUI_CLASS_CPP */ diff --git a/gr-qtgui/lib/TimeRasterDisplayPlot.cc b/gr-qtgui/lib/TimeRasterDisplayPlot.cc index ffacd80bad..5cf736d389 100644 --- a/gr-qtgui/lib/TimeRasterDisplayPlot.cc +++ b/gr-qtgui/lib/TimeRasterDisplayPlot.cc @@ -468,6 +468,12 @@ TimeRasterDisplayPlot::getIntensityColorMapType(int which) const return d_color_map_type[which]; } +int +TimeRasterDisplayPlot::getIntensityColorMapType1() const +{ + return getIntensityColorMapType(0); +} + void TimeRasterDisplayPlot::setIntensityColorMapType(const int which, const int newType, @@ -504,6 +510,16 @@ TimeRasterDisplayPlot::setIntensityColorMapType(const int which, d_raster[which]->setColorMap(new ColorMap_Incandescent()); break; } + case INTENSITY_COLOR_MAP_TYPE_SUNSET: { + d_color_map_type[which] = newType; + d_raster[which]->setColorMap(new ColorMap_Sunset()); + break; + } + case INTENSITY_COLOR_MAP_TYPE_COOL: { + d_color_map_type[which] = newType; + d_raster[which]->setColorMap(new ColorMap_Cool()); + break; + } case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED: { d_low_intensity = lowColor; d_high_intensity = highColor; @@ -518,6 +534,12 @@ TimeRasterDisplayPlot::setIntensityColorMapType(const int which, } } +void +TimeRasterDisplayPlot::setIntensityColorMapType1(int newType) +{ + setIntensityColorMapType(0, newType, d_low_intensity, d_high_intensity); +} + const QColor TimeRasterDisplayPlot::getUserDefinedLowIntensityColor() const { @@ -555,6 +577,10 @@ TimeRasterDisplayPlot::_updateIntensityRangeDisplay() rightAxis->setColorMap(intv, new ColorMap_BlackHot()); break; case INTENSITY_COLOR_MAP_TYPE_INCANDESCENT: rightAxis->setColorMap(intv, new ColorMap_Incandescent()); break; + case INTENSITY_COLOR_MAP_TYPE_SUNSET: + rightAxis->setColorMap(intv, new ColorMap_Sunset()); break; + case INTENSITY_COLOR_MAP_TYPE_COOL: + rightAxis->setColorMap(intv, new ColorMap_Cool()); break; case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED: rightAxis->setColorMap(intv, new ColorMap_UserDefined(d_low_intensity, d_high_intensity)); diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.cc b/gr-qtgui/lib/WaterfallDisplayPlot.cc index 2d783d01a0..eb33cba921 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.cc +++ b/gr-qtgui/lib/WaterfallDisplayPlot.cc @@ -456,6 +456,26 @@ WaterfallDisplayPlot::setIntensityColorMapType(const int which, #endif break; } + case INTENSITY_COLOR_MAP_TYPE_SUNSET: { + d_intensity_color_map_type[which] = newType; +#if QWT_VERSION < 0x060000 + ColorMap_Sunset colorMap; + d_spectrogram[which]->setColorMap(colorMap); +#else + d_spectrogram[which]->setColorMap(new ColorMap_Sunset()); +#endif + break; + } + case INTENSITY_COLOR_MAP_TYPE_COOL: { + d_intensity_color_map_type[which] = newType; +#if QWT_VERSION < 0x060000 + ColorMap_Cool colorMap; + d_spectrogram[which]->setColorMap(colorMap); +#else + d_spectrogram[which]->setColorMap(new ColorMap_Cool()); +#endif + break; + } case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED:{ d_user_defined_low_intensity_color = lowColor; d_user_defined_high_intensity_color = highColor; @@ -549,6 +569,10 @@ WaterfallDisplayPlot::_updateIntensityRangeDisplay() rightAxis->setColorMap(intv, new ColorMap_BlackHot()); break; case INTENSITY_COLOR_MAP_TYPE_INCANDESCENT: rightAxis->setColorMap(intv, new ColorMap_Incandescent()); break; + case INTENSITY_COLOR_MAP_TYPE_SUNSET: + rightAxis->setColorMap(intv, new ColorMap_Sunset()); break; + case INTENSITY_COLOR_MAP_TYPE_COOL: + rightAxis->setColorMap(intv, new ColorMap_Cool()); break; case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED: rightAxis->setColorMap(intv, new ColorMap_UserDefined(d_user_defined_low_intensity_color, d_user_defined_high_intensity_color)); diff --git a/gr-qtgui/lib/ber_sink_b_impl.cc b/gr-qtgui/lib/ber_sink_b_impl.cc new file mode 100644 index 0000000000..bcbe146e80 --- /dev/null +++ b/gr-qtgui/lib/ber_sink_b_impl.cc @@ -0,0 +1,401 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#include "ber_sink_b_impl.h" +#include <gnuradio/io_signature.h> +#include <gnuradio/math.h> +#include <gnuradio/fft/fft.h> +#include <volk/volk.h> +//#include <math.h> + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +namespace gr { + namespace qtgui { + + ber_sink_b::sptr + ber_sink_b::make(std::vector<float> esnos, int curves, + int ber_min_errors, float ber_limit, + std::vector<std::string> curvenames, + QWidget *parent) + { + return gnuradio::get_initial_sptr + (new ber_sink_b_impl(esnos, curves, + ber_min_errors, ber_limit, + curvenames, parent)); + } + + ber_sink_b_impl::ber_sink_b_impl(std::vector<float> esnos, int curves, + int ber_min_errors, float ber_limit, + std::vector<std::string> curvenames, + QWidget *parent) + : block("ber_sink_b", + io_signature::make(curves*esnos.size()*2, curves*esnos.size()*2, sizeof(unsigned char)), + io_signature::make(0, 0, 0)), + d_ber_min_errors(ber_min_errors), + d_ber_limit(ber_limit), + d_parent(parent), + d_nconnections(esnos.size()), + d_last_time(0) + { + d_main_gui = NULL; + + // Enough curves for the input streams plus the BPSK AWGN curve. + d_curves = curves; + d_esno_buffers.reserve(curves + 1); + d_ber_buffers.reserve(curves + 1); + d_total.reserve(curves * esnos.size()); + d_total_errors.reserve(curves * esnos.size()); + + for(int j = 0; j < curves; j++) { + d_esno_buffers.push_back((double*)volk_malloc(esnos.size()*sizeof(double), + volk_get_alignment())); + d_ber_buffers.push_back((double*)volk_malloc(esnos.size()*sizeof(double), + volk_get_alignment())); + + for(int i = 0; i < d_nconnections; i++) { + d_esno_buffers[j][i] = esnos[i]; + d_ber_buffers[j][i] = 0.0; + d_total.push_back(0); + d_total_errors.push_back(1); + } + } + + // Now add the known curves + d_esno_buffers.push_back((double*)volk_malloc(esnos.size()*sizeof(double), + volk_get_alignment())); + d_ber_buffers.push_back((double*)volk_malloc(esnos.size()*sizeof(double), + volk_get_alignment())); + for(size_t i = 0; i < esnos.size(); i++) { + double e = pow(10.0, esnos[i]/10.0); + d_esno_buffers[curves][i] = esnos[i]; + d_ber_buffers[curves][i] = log10(erfc(sqrt(e))); + } + + + // Initialize and set up some of the curve visual properties + initialize(); + for(int j= 0; j < curves; j++) { + set_line_width(j, 1); + //35 unique styles supported + set_line_style(j, (j%5) + 1); + set_line_marker(j, (j%7)); + } + + if(curvenames.size() == (unsigned int)curves) { + for(int j = 0; j < curves; j++) { + if(curvenames[j] != "") { + set_line_label(j, curvenames[j]); + } + } + } + + set_line_label(d_curves, "BPSK AWGN"); + set_line_style(d_curves, 5); // non-solid line + set_line_marker(d_curves, -1); // no marker + set_line_alpha(d_curves, 0.25); // high transparency + } + + ber_sink_b_impl::~ber_sink_b_impl() + { + if(!d_main_gui->isClosed()) { + d_main_gui->close(); + } + + for(unsigned int i = 0; i < d_esno_buffers.size(); i++) { + volk_free(d_esno_buffers[i]); + volk_free(d_ber_buffers[i]); + } + } + + bool + ber_sink_b_impl::check_topology(int ninputs, int noutputs) + { + return ninputs == (int)(d_curves * d_nconnections * 2); + } + + void + ber_sink_b_impl::initialize() + { + if(qApp != NULL) { + d_qApplication = qApp; + } + else { + int argc=0; + char **argv = NULL; + d_qApplication = new QApplication(argc, argv); + } + + d_main_gui = new ConstellationDisplayForm(d_esno_buffers.size(), d_parent); + + d_main_gui->setNPoints(d_nconnections); + d_main_gui->getPlot()->setAxisTitle(QwtPlot::yLeft, "LogScale BER"); + d_main_gui->getPlot()->setAxisTitle(QwtPlot::xBottom, "ESNO"); + // initialize update time to 10 times a second + set_update_time(0.1); + } + + void + ber_sink_b_impl::exec_() + { + d_qApplication->exec(); + } + + QWidget* + ber_sink_b_impl::qwidget() + { + return d_main_gui; + } + +#ifdef ENABLE_PYTHON + PyObject* + ber_sink_b_impl::pyqwidget() + { + PyObject *w = PyLong_FromVoidPtr((void*)d_main_gui); + PyObject *retarg = Py_BuildValue("N", w); + return retarg; + } +#else + void * + ber_sink_b_impl::pyqwidget() + { + return NULL; + } +#endif + + void + ber_sink_b_impl::set_y_axis(double min, double max) + { + d_main_gui->setYaxis(min, max); + } + + void + ber_sink_b_impl::set_x_axis(double min, double max) + { + d_main_gui->setXaxis(min, max); + } + + void + ber_sink_b_impl::set_update_time(double t) + { + //convert update time to ticks + gr::high_res_timer_type tps = gr::high_res_timer_tps(); + d_update_time = t * tps; + d_main_gui->setUpdateTime(t); + d_last_time = 0; + } + + void + ber_sink_b_impl::set_title(const std::string &title) + { + d_main_gui->setTitle(title.c_str()); + } + + void + ber_sink_b_impl::set_line_label(int which, const std::string &label) + { + d_main_gui->setLineLabel(which, label.c_str()); + } + + void + ber_sink_b_impl::set_line_color(int which, const std::string &color) + { + d_main_gui->setLineColor(which, color.c_str()); + } + + void + ber_sink_b_impl::set_line_width(int which, int width) + { + d_main_gui->setLineWidth(which, width); + } + + void + ber_sink_b_impl::set_line_style(int which, int style) + { + d_main_gui->setLineStyle(which, (Qt::PenStyle)style); + } + + void + ber_sink_b_impl::set_line_marker(int which, int marker) + { + d_main_gui->setLineMarker(which, (QwtSymbol::Style)marker); + } + + void + ber_sink_b_impl::set_line_alpha(int which, double alpha) + { + d_main_gui->setMarkerAlpha(which, (int)(255.0*alpha)); + } + + void + ber_sink_b_impl::set_size(int width, int height) + { + d_main_gui->resize(QSize(width, height)); + } + + std::string + ber_sink_b_impl::title() + { + return d_main_gui->title().toStdString(); + } + + std::string + ber_sink_b_impl::line_label(int which) + { + return d_main_gui->lineLabel(which).toStdString(); + } + + std::string + ber_sink_b_impl::line_color(int which) + { + return d_main_gui->lineColor(which).toStdString(); + } + + int + ber_sink_b_impl::line_width(int which) + { + return d_main_gui->lineWidth(which); + } + + int + ber_sink_b_impl::line_style(int which) + { + return d_main_gui->lineStyle(which); + } + + int + ber_sink_b_impl::line_marker(int which) + { + return d_main_gui->lineMarker(which); + } + + double + ber_sink_b_impl::line_alpha(int which) + { + return (double)(d_main_gui->markerAlpha(which))/255.0; + } + + int + ber_sink_b_impl::nsamps() const + { + return d_nconnections; + } + + void + ber_sink_b_impl::enable_menu(bool en) + { + d_main_gui->enableMenu(en); + } + + void + ber_sink_b_impl::enable_autoscale(bool en) + { + d_main_gui->autoScale(en); + } + + int + ber_sink_b_impl::general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); + d_qApplication->postEvent(d_main_gui, + new ConstUpdateEvent(d_esno_buffers, + d_ber_buffers, + d_nconnections)); + } + + //check stopping condition + int done=0, maxed=0; + for(int j = 0; j < d_curves; ++j) { + for(int i = 0; i < d_nconnections; ++i) { + + if(d_total_errors[j * d_nconnections + i] >= d_ber_min_errors) { + done++; + } + else if(log10(((double)d_ber_min_errors)/(d_total[j * d_nconnections + i] * 8.0)) < d_ber_limit) { + maxed++; + } + } + } + + if(done+maxed == (int)(d_nconnections * d_curves)) { + d_qApplication->postEvent(d_main_gui, + new ConstUpdateEvent(d_esno_buffers, + d_ber_buffers, + d_nconnections)); + return -1; + } + + float ber; + for(unsigned int i = 0; i < ninput_items.size(); i += 2) { + + if((d_total_errors[i >> 1] < d_ber_min_errors) && \ + (log10(((double)d_ber_min_errors)/(d_total[i >> 1] * 8.0)) >= d_ber_limit)) { + + int items = ninput_items[i] <= ninput_items[i+1] ? ninput_items[i] : ninput_items[i+1]; + + unsigned char *inbuffer0 = (unsigned char *)input_items[i]; + unsigned char *inbuffer1 = (unsigned char *)input_items[i+1]; + + if(items > 0) { + uint32_t ret; + for(int j = 0; j < items; j++) { + volk_32u_popcnt(&ret, static_cast<uint32_t>(inbuffer0[j]^inbuffer1[j])); + d_total_errors[i >> 1] += ret; + } + + d_total[i >> 1] += items; + + ber = log10(((double)d_total_errors[i >> 1])/(d_total[i >> 1] * 8.0)); + d_ber_buffers[i/(d_nconnections * 2)][(i%(d_nconnections * 2)) >> 1] = ber; + + } + consume(i, items); + consume(i + 1, items); + + if(d_total_errors[i >> 1] >= d_ber_min_errors) { + GR_LOG_INFO(d_logger, boost::format(" %1% over %2% --> %3%") \ + % d_total_errors[i >> 1] % (d_total[i >> 1] * 8) % ber); + } + else if(log10(((double)d_ber_min_errors)/(d_total[i >> 1] * 8.0)) < d_ber_limit) { + GR_LOG_INFO(d_logger, "BER Limit Reached"); + d_ber_buffers[i/(d_nconnections * 2)][(i%(d_nconnections * 2)) >> 1] = d_ber_limit; + d_total_errors[i >> 1] = d_ber_min_errors + 1; + } + } + else { + consume(i, ninput_items[i]); + consume(i+1, ninput_items[i+1]); + } + } + + return 0; + } + + + } /* namespace qtgui */ +} /* namespace gr */ diff --git a/gr-qtgui/lib/ber_sink_b_impl.h b/gr-qtgui/lib/ber_sink_b_impl.h new file mode 100644 index 0000000000..9ab61e6652 --- /dev/null +++ b/gr-qtgui/lib/ber_sink_b_impl.h @@ -0,0 +1,111 @@ +/* -*- c++ -*- */ +/* + * Copyright 2013-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. + */ + +#ifndef INCLUDED_QTGUI_BER_SINK_B_IMPL_H +#define INCLUDED_QTGUI_BER_SINK_B_IMPL_H + +#include <gnuradio/qtgui/ber_sink_b.h> +#include <gnuradio/high_res_timer.h> +#include <gnuradio/thread/thread.h> +#include <gnuradio/qtgui/constellationdisplayform.h> + +namespace gr { + namespace qtgui { + + class QTGUI_API ber_sink_b_impl : public ber_sink_b + { + private: + void initialize(); + + gr::thread::mutex d_mutex; + + std::vector<double*> d_esno_buffers; + std::vector<double*> d_ber_buffers; + + ConstellationDisplayForm *d_main_gui; + gr::high_res_timer_type d_update_time; + std::vector<int> d_total_errors; + int d_ber_min_errors; + float d_ber_limit; + QWidget *d_parent; + int d_nconnections; + int d_curves; + gr::high_res_timer_type d_last_time; + std::vector<int> d_total; + + //int compBER(unsigned char *inBuffer1, unsigned char *inBuffer2,int buffSize); + + public: + ber_sink_b_impl(std::vector<float> esnos, int curves = 1, + int ber_min_errors = 100, float ber_limit = -7.0, + std::vector<std::string> curvenames = std::vector<std::string>(), + QWidget *parent=NULL); + ~ber_sink_b_impl(); + + bool check_topology(int ninputs, int noutputs); + + void exec_(); + QWidget* qwidget(); + +#ifdef ENABLE_PYTHON + PyObject* pyqwidget(); +#else + void* pyqwidget(); +#endif + + void set_y_axis(double min, double max); + void set_x_axis(double min, double max); + + void set_update_time(double t); + void set_title(const std::string &title); + void set_line_label(int which, const std::string &label); + void set_line_color(int which, const std::string &color); + void set_line_width(int which, int width); + void set_line_style(int which, int style); + void set_line_marker(int which, int marker); + + void set_line_alpha(int which, double alpha); + + std::string title(); + std::string line_label(int which); + std::string line_color(int which); + int line_width(int which); + int line_style(int which); + int line_marker(int which); + double line_alpha(int which); + + void set_size(int width, int height); + + int nsamps() const; + void enable_menu(bool en); + void enable_autoscale(bool en); + + int general_work(int noutput_items, + gr_vector_int& ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; + + } /* namespace qtgui */ +} /* namespace gr */ + +#endif /*INCLUDED_QTGUI_BER_SINK_B_IMPL_H*/ diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc index a703336a61..93986d84c7 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -129,6 +129,10 @@ namespace gr { d_main_gui = new ConstellationDisplayForm(d_nconnections, d_parent); d_main_gui->setNPoints(d_size); + + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index ff40ff3f43..4b43967f32 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -69,6 +69,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&freq_sink_c_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -150,6 +157,9 @@ namespace gr { set_fft_size(d_fftsize); set_frequency_range(d_center_freq, d_bandwidth); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } @@ -352,6 +362,18 @@ namespace gr { } void + freq_sink_c_impl::clear_max_hold() + { + d_main_gui->clearMaxHold(); + } + + void + freq_sink_c_impl::clear_min_hold() + { + d_main_gui->clearMinHold(); + } + + void freq_sink_c_impl::reset() { d_index = 0; @@ -444,6 +466,30 @@ namespace gr { } } + void + freq_sink_c_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + freq_sink_c_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + d_qApplication->postEvent(d_main_gui, + new SetFreqEvent(d_center_freq, d_bandwidth)); + } + } + } + int freq_sink_c_impl::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -455,6 +501,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/freq_sink_c_impl.h b/gr-qtgui/lib/freq_sink_c_impl.h index 15b513715c..e435cc6614 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.h +++ b/gr-qtgui/lib/freq_sink_c_impl.h @@ -70,8 +70,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const gr_complex *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: freq_sink_c_impl(int size, int wintype, double fc, double bw, @@ -124,6 +129,8 @@ namespace gr { void enable_menu(bool en); void enable_grid(bool en); void enable_autoscale(bool en); + void clear_max_hold(); + void clear_min_hold(); void reset(); int work(int noutput_items, diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index b661f7b07b..ab6167d10a 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -69,6 +69,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&freq_sink_f_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -150,6 +157,9 @@ namespace gr { set_fft_size(d_fftsize); set_frequency_range(d_center_freq, d_bandwidth); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } @@ -352,6 +362,18 @@ namespace gr { } void + freq_sink_f_impl::clear_max_hold() + { + d_main_gui->clearMaxHold(); + } + + void + freq_sink_f_impl::clear_min_hold() + { + d_main_gui->clearMinHold(); + } + + void freq_sink_f_impl::reset() { d_index = 0; @@ -447,6 +469,30 @@ namespace gr { } } + void + freq_sink_f_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + freq_sink_f_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + d_qApplication->postEvent(d_main_gui, + new SetFreqEvent(d_center_freq, d_bandwidth)); + } + } + } + int freq_sink_f_impl::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -458,6 +504,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/freq_sink_f_impl.h b/gr-qtgui/lib/freq_sink_f_impl.h index 68cb8c66b4..8a821f86c3 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.h +++ b/gr-qtgui/lib/freq_sink_f_impl.h @@ -70,8 +70,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const float *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: freq_sink_f_impl(int size, int wintype, double fc, double bw, @@ -123,6 +128,8 @@ namespace gr { void enable_menu(bool en); void enable_grid(bool en); void enable_autoscale(bool en); + void clear_max_hold(); + void clear_min_hold(); void reset(); int work(int noutput_items, diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc index 16576b387b..e9968df0b2 100644 --- a/gr-qtgui/lib/freqdisplayform.cc +++ b/gr-qtgui/lib/freqdisplayform.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,6 +39,8 @@ FreqDisplayForm::FreqDisplayForm(int nplots, QWidget* parent) d_num_real_data_points = 1024; d_fftsize = 1024; d_fftavg = 1.0; + d_clicked = false; + d_clicked_freq = 0; d_sizemenu = new FFTSizeMenu(this); d_avgmenu = new FFTAverageMenu(this); @@ -53,6 +55,15 @@ FreqDisplayForm::FreqDisplayForm(int nplots, QWidget* parent) connect(d_winmenu, SIGNAL(whichTrigger(gr::filter::firdes::win_type)), this, SLOT(setFFTWindowType(const gr::filter::firdes::win_type))); + d_clearmax_act = new QAction("Clear Max", this); + d_menu->addAction(d_clearmax_act); + connect(d_clearmax_act, SIGNAL(triggered()), + this, SLOT(clearMaxHold())); + d_clearmin_act = new QAction("Clear Min", this); + d_menu->addAction(d_clearmin_act); + connect(d_clearmin_act, SIGNAL(triggered()), + this, SLOT(clearMinHold())); + Reset(); connect(d_display_plot, SIGNAL(plotPointSelected(const QPointF)), @@ -90,6 +101,10 @@ FreqDisplayForm::customEvent( QEvent * e) if(e->type() == FreqUpdateEvent::Type()) { newData(e); } + else if(e->type() == SpectrumFrequencyRangeEventType) { + SetFreqEvent *fevent = (SetFreqEvent*)e; + setFrequencyRange(fevent->getCenterFrequency(), fevent->getBandwidth()); + } } int @@ -147,14 +162,14 @@ FreqDisplayForm::setFrequencyRange(const double centerfreq, std::string strunits[4] = {"Hz", "kHz", "MHz", "GHz"}; double units10 = floor(log10(bandwidth)); double units3 = std::max(floor(units10 / 3.0), 0.0); - double units = pow(10, (units10-fmod(units10, 3.0))); + d_units = pow(10, (units10-fmod(units10, 3.0))); int iunit = static_cast<int>(units3); d_center_freq = centerfreq; d_samp_rate = bandwidth; getPlot()->setFrequencyRange(centerfreq, bandwidth, - units, strunits[iunit]); + d_units, strunits[iunit]); } void @@ -177,3 +192,40 @@ FreqDisplayForm::autoScale(bool en) getPlot()->setAutoScale(d_autoscale_state); getPlot()->replot(); } + +void +FreqDisplayForm::clearMaxHold() +{ + getPlot()->clearMaxData(); +} + +void +FreqDisplayForm::clearMinHold() +{ + getPlot()->clearMinData(); +} + +void +FreqDisplayForm::onPlotPointSelected(const QPointF p) +{ + d_clicked = true; + d_clicked_freq = d_units*p.x(); +} + +bool +FreqDisplayForm::checkClicked() +{ + if(d_clicked) { + d_clicked = false; + return true; + } + else { + return false; + } +} + +float +FreqDisplayForm::getClickedFreq() const +{ + return d_clicked_freq; +} diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index dc3e63cb01..bd43f8645c 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -126,6 +126,9 @@ namespace gr { d_main_gui->setNPoints(d_size); d_main_gui->setXaxis(d_xmin, d_xmax); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index 992512a999..bcd2c4468c 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008-2012 Free Software Foundation, Inc. + * Copyright 2008-2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -73,6 +73,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&sink_c_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -218,6 +225,12 @@ namespace gr { d_main_gui->setFrequencyAxis(min, max); } + void + sink_c_impl::enable_rf_freq(bool en) + { + d_main_gui->enableRFFreq(en); + } + /* void sink_c_impl::set_time_domain_axis(double min, double max) @@ -312,6 +325,29 @@ namespace gr { } } + void + sink_c_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + sink_c_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + set_frequency_range(d_center_freq, d_bandwidth); + } + } + } + int sink_c_impl::general_work(int noutput_items, gr_vector_int &ninput_items, @@ -324,6 +360,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/sink_c_impl.h b/gr-qtgui/lib/sink_c_impl.h index 18508d30aa..87ce7ad39e 100644 --- a/gr-qtgui/lib/sink_c_impl.h +++ b/gr-qtgui/lib/sink_c_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2011,2012 Free Software Foundation, Inc. + * Copyright 2008,2009,2011,2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -67,8 +67,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const gr_complex *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: sink_c_impl(int fftsize, int wintype, double fc, double bw, @@ -95,6 +100,7 @@ namespace gr { void set_frequency_range(const double centerfreq, const double bandwidth); void set_fft_power_db(double min, double max); + void enable_rf_freq(bool en); //void set_time_domain_axis(double min, double max); //void set_constellation_axis(double xmin, double xmax, diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index 0a0e119181..67896b71df 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008-2012 Free Software Foundation, Inc. + * Copyright 2008-2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -73,6 +73,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&sink_f_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -210,6 +217,12 @@ namespace gr { d_main_gui->setFrequencyAxis(min, max); } + void + sink_f_impl::enable_rf_freq(bool en) + { + d_main_gui->enableRFFreq(en); + } + /* void sink_f_impl::set_time_domain_axis(double min, double max) @@ -307,6 +320,29 @@ namespace gr { } } + void + sink_f_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + sink_f_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + set_frequency_range(d_center_freq, d_bandwidth); + } + } + } + int sink_f_impl::general_work(int noutput_items, gr_vector_int &ninput_items, @@ -319,6 +355,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/sink_f_impl.h b/gr-qtgui/lib/sink_f_impl.h index 68331cc4e6..53494b9ccf 100644 --- a/gr-qtgui/lib/sink_f_impl.h +++ b/gr-qtgui/lib/sink_f_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2011,2012 Free Software Foundation, Inc. + * Copyright 2008,2009,2011,2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -65,8 +65,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const float *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: sink_f_impl(int fftsize, int wintype, double fc, double bw, @@ -93,6 +98,7 @@ namespace gr { void set_frequency_range(const double centerfreq, const double bandwidth); void set_fft_power_db(double min, double max); + void enable_rf_freq(bool en); //void set_time_domain_axis(double min, double max); //void set_constellation_axis(double xmin, double xmax, diff --git a/gr-qtgui/lib/spectrumUpdateEvents.cc b/gr-qtgui/lib/spectrumUpdateEvents.cc index f48e079861..1294587409 100644 --- a/gr-qtgui/lib/spectrumUpdateEvents.cc +++ b/gr-qtgui/lib/spectrumUpdateEvents.cc @@ -296,6 +296,32 @@ FreqUpdateEvent::getNumDataPoints() const } + +SetFreqEvent::SetFreqEvent(const double centerFreq, + const double bandwidth) + : QEvent(QEvent::Type(SpectrumFrequencyRangeEventType)) +{ + _centerFrequency = centerFreq; + _bandwidth = bandwidth; +} + +SetFreqEvent::~SetFreqEvent() +{ +} + +double +SetFreqEvent::getCenterFrequency() const +{ + return _centerFrequency; +} + +double +SetFreqEvent::getBandwidth() const +{ + return _bandwidth; +} + + /***************************************************************************/ diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 0b5f6300d3..8c67b7a2bf 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008-2011 Free Software Foundation, Inc. + * Copyright 2008-2011,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,6 +31,9 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) { setupUi(this); + d_clicked = false; + d_clicked_freq = 0; + _systemSpecifiedFlag = false; _intValidator = new QIntValidator(this); _intValidator->setBottom(0); @@ -426,7 +429,7 @@ SpectrumDisplayForm::setFrequencyRange(const double newCenterFrequency, std::string strtime[4] = {"sec", "ms", "us", "ns"}; double units10 = floor(log10(fdiff)); double units3 = std::max(floor(units10 / 3.0), 0.0); - double units = pow(10, (units10-fmod(units10, 3.0))); + d_units = pow(10, (units10-fmod(units10, 3.0))); int iunit = static_cast<int>(units3); _startFrequency = newStartFrequency; @@ -434,11 +437,11 @@ SpectrumDisplayForm::setFrequencyRange(const double newCenterFrequency, _centerFrequency = newCenterFrequency; _frequencyDisplayPlot->setFrequencyRange(fcenter, fdiff, - units, strunits[iunit]); + d_units, strunits[iunit]); _waterfallDisplayPlot->setFrequencyRange(fcenter, fdiff, - units, strunits[iunit]); + d_units, strunits[iunit]); _timeDomainDisplayPlot->setSampleRate((_stopFrequency - _startFrequency)/2.0, - units, strtime[iunit]); + d_units, strtime[iunit]); } } @@ -572,6 +575,12 @@ SpectrumDisplayForm::useRFFrequenciesCB(bool useRFFlag) setFrequencyRange(_centerFrequency, _startFrequency, _stopFrequency); } +void +SpectrumDisplayForm::toggleRFFrequencies(bool en) +{ + UseRFFrequenciesCheckBox->setChecked(en); +} + void SpectrumDisplayForm::waterfallMaximumIntensityChangedCB(double newValue) @@ -762,23 +771,47 @@ SpectrumDisplayForm::setUpdateTime(double t) void SpectrumDisplayForm::onFFTPlotPointSelected(const QPointF p) { - emit plotPointSelected(p, 1); + d_clicked = true; + d_clicked_freq = d_units*p.x(); + + setFrequencyRange(d_clicked_freq, _startFrequency, _stopFrequency); } void SpectrumDisplayForm::onWFallPlotPointSelected(const QPointF p) { - emit plotPointSelected(p, 2); + d_clicked = true; + d_clicked_freq = d_units*p.x(); + + setFrequencyRange(d_clicked_freq, _startFrequency, _stopFrequency); } void SpectrumDisplayForm::onTimePlotPointSelected(const QPointF p) { - emit plotPointSelected(p, 3); + //emit plotPointSelected(p, 3); } void SpectrumDisplayForm::onConstPlotPointSelected(const QPointF p) { - emit plotPointSelected(p, 4); + //emit plotPointSelected(p, 4); +} + +bool +SpectrumDisplayForm::checkClicked() +{ + if(d_clicked) { + d_clicked = false; + return true; + } + else { + return false; + } +} + +float +SpectrumDisplayForm::getClickedFreq() const +{ + return d_clicked_freq; } diff --git a/gr-qtgui/lib/spectrumdisplayform.ui b/gr-qtgui/lib/spectrumdisplayform.ui index ceab55b049..1176aec4de 100644 --- a/gr-qtgui/lib/spectrumdisplayform.ui +++ b/gr-qtgui/lib/spectrumdisplayform.ui @@ -448,6 +448,16 @@ </item> <item> <property name="text"> + <string>Sunset</string> + </property> + </item> + <item> + <property name="text"> + <string>Cool</string> + </property> + </item> + <item> + <property name="text"> <string>User Defined</string> </property> </item> diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index a1189f4413..ecd8ac319a 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -145,6 +145,9 @@ namespace gr { d_rows, d_cols, 1, d_parent); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index c8b865d55d..3a18985b2d 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -143,6 +143,9 @@ namespace gr { d_rows, d_cols, 1, d_parent); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index 499529c57d..e053806fd2 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -129,6 +129,9 @@ namespace gr { d_main_gui->setNPoints(d_size); d_main_gui->setSampleRate(d_samp_rate); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index e571654615..8424702bc1 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -131,6 +131,9 @@ namespace gr { d_main_gui->setNPoints(d_size); d_main_gui->setSampleRate(d_samp_rate); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index 2c436db789..8cb3f1a7bf 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -69,6 +69,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&waterfall_sink_c_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -149,6 +156,9 @@ namespace gr { set_fft_size(d_fftsize); set_frequency_range(d_center_freq, d_bandwidth); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } @@ -418,6 +428,30 @@ namespace gr { } } + void + waterfall_sink_c_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + waterfall_sink_c_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + d_qApplication->postEvent(d_main_gui, + new SetFreqEvent(d_center_freq, d_bandwidth)); + } + } + } + int waterfall_sink_c_impl::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -429,6 +463,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.h b/gr-qtgui/lib/waterfall_sink_c_impl.h index aad4a4debb..ecff5a9676 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.h +++ b/gr-qtgui/lib/waterfall_sink_c_impl.h @@ -68,8 +68,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const gr_complex *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: waterfall_sink_c_impl(int size, int wintype, double fc, double bw, diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index fc6d9fab67..1c1453c1d1 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -68,6 +68,13 @@ namespace gr { d_argv = new char; d_argv[0] = '\0'; + // setup output message port to post frequency when display is + // double-clicked + message_port_register_out(pmt::mp("freq")); + message_port_register_in(pmt::mp("freq")); + set_msg_handler(pmt::mp("freq"), + boost::bind(&waterfall_sink_f_impl::handle_set_freq, this, _1)); + d_main_gui = NULL; // Perform fftshift operation; @@ -148,6 +155,9 @@ namespace gr { set_fft_size(d_fftsize); set_frequency_range(d_center_freq, d_bandwidth); + if(d_name.size() > 0) + set_title(d_name); + // initialize update time to 10 times a second set_update_time(0.1); } @@ -419,6 +429,30 @@ namespace gr { } } + void + waterfall_sink_f_impl::check_clicked() + { + if(d_main_gui->checkClicked()) { + double freq = d_main_gui->getClickedFreq(); + message_port_pub(pmt::mp("freq"), + pmt::cons(pmt::mp("freq"), + pmt::from_double(freq))); + } + } + + void + waterfall_sink_f_impl::handle_set_freq(pmt::pmt_t msg) + { + if(pmt::is_pair(msg)) { + pmt::pmt_t x = pmt::cdr(msg); + if(pmt::is_real(x)) { + d_center_freq = pmt::to_double(x); + d_qApplication->postEvent(d_main_gui, + new SetFreqEvent(d_center_freq, d_bandwidth)); + } + } + } + int waterfall_sink_f_impl::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -430,6 +464,7 @@ namespace gr { // Update the FFT size from the application fftresize(); windowreset(); + check_clicked(); for(int i=0; i < noutput_items; i+=d_fftsize) { unsigned int datasize = noutput_items - i; diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.h b/gr-qtgui/lib/waterfall_sink_f_impl.h index 172f873a7f..86cf0dc5d2 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.h +++ b/gr-qtgui/lib/waterfall_sink_f_impl.h @@ -68,8 +68,13 @@ namespace gr { void windowreset(); void buildwindow(); void fftresize(); + void check_clicked(); void fft(float *data_out, const float *data_in, int size); + // Handles message input port for setting new center frequency. + // The message is a PMT pair (intern('freq'), double(frequency)). + void handle_set_freq(pmt::pmt_t msg); + public: waterfall_sink_f_impl(int size, int wintype, double fc, double bw, diff --git a/gr-qtgui/lib/waterfalldisplayform.cc b/gr-qtgui/lib/waterfalldisplayform.cc index f4dd2fd338..51f518f375 100644 --- a/gr-qtgui/lib/waterfalldisplayform.cc +++ b/gr-qtgui/lib/waterfalldisplayform.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2012 Free Software Foundation, Inc. + * Copyright 2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -46,6 +46,9 @@ WaterfallDisplayForm::WaterfallDisplayForm(int nplots, QWidget* parent) d_min_val = 1000; d_max_val = -1000; + d_clicked = false; + d_clicked_freq = 0; + // We don't use the normal menus that are part of the displayform. // Clear them out to get rid of their resources. for(int i = 0; i < nplots; i++) { @@ -136,6 +139,10 @@ WaterfallDisplayForm::customEvent( QEvent * e) if(e->type() == WaterfallUpdateEvent::Type()) { newData(e); } + else if(e->type() == SpectrumFrequencyRangeEventType) { + SetFreqEvent *fevent = (SetFreqEvent*)e; + setFrequencyRange(fevent->getCenterFrequency(), fevent->getBandwidth()); + } } int @@ -217,14 +224,14 @@ WaterfallDisplayForm::setFrequencyRange(const double centerfreq, std::string strunits[4] = {"Hz", "kHz", "MHz", "GHz"}; double units10 = floor(log10(bandwidth)); double units3 = std::max(floor(units10 / 3.0), 0.0); - double units = pow(10, (units10-fmod(units10, 3.0))); + d_units = pow(10, (units10-fmod(units10, 3.0))); int iunit = static_cast<int>(units3); d_center_freq = centerfreq; d_samp_rate = bandwidth; getPlot()->setFrequencyRange(centerfreq, bandwidth, - units, strunits[iunit]); + d_units, strunits[iunit]); getPlot()->replot(); } @@ -269,3 +276,28 @@ WaterfallDisplayForm::clearData() { getPlot()->clearData(); } + +void +WaterfallDisplayForm::onPlotPointSelected(const QPointF p) +{ + d_clicked = true; + d_clicked_freq = d_units*p.x(); +} + +bool +WaterfallDisplayForm::checkClicked() +{ + if(d_clicked) { + d_clicked = false; + return true; + } + else { + return false; + } +} + +float +WaterfallDisplayForm::getClickedFreq() const +{ + return d_clicked_freq; +} diff --git a/gr-qtgui/swig/qtgui_swig.i b/gr-qtgui/swig/qtgui_swig.i index b753a666e8..4859df1750 100644 --- a/gr-qtgui/swig/qtgui_swig.i +++ b/gr-qtgui/swig/qtgui_swig.i @@ -46,7 +46,9 @@ enum{ INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1, INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2, INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3, - INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4 + INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4, + INTENSITY_COLOR_MAP_TYPE_SUNSET = 5, + INTENSITY_COLOR_MAP_TYPE_COOL = 6, }; %include "gnuradio/qtgui/trigger_mode.h" @@ -71,6 +73,7 @@ enum{ #include "gnuradio/qtgui/waterfall_sink_f.h" #include "gnuradio/qtgui/histogram_sink_f.h" #include "gnuradio/qtgui/number_sink.h" +#include "gnuradio/qtgui/ber_sink_b.h" %} %include "gnuradio/qtgui/sink_c.h" @@ -86,6 +89,7 @@ enum{ %include "gnuradio/qtgui/waterfall_sink_f.h" %include "gnuradio/qtgui/histogram_sink_f.h" %include "gnuradio/qtgui/number_sink.h" +%include "gnuradio/qtgui/ber_sink_b.h" GR_SWIG_BLOCK_MAGIC2(qtgui, sink_c); GR_SWIG_BLOCK_MAGIC2(qtgui, sink_f); @@ -100,3 +104,4 @@ GR_SWIG_BLOCK_MAGIC2(qtgui, waterfall_sink_c); GR_SWIG_BLOCK_MAGIC2(qtgui, waterfall_sink_f); GR_SWIG_BLOCK_MAGIC2(qtgui, histogram_sink_f); GR_SWIG_BLOCK_MAGIC2(qtgui, number_sink); +GR_SWIG_BLOCK_MAGIC2(qtgui, ber_sink_b); diff --git a/gr-trellis/lib/CMakeLists.txt b/gr-trellis/lib/CMakeLists.txt index babca4036e..67a339d029 100644 --- a/gr-trellis/lib/CMakeLists.txt +++ b/gr-trellis/lib/CMakeLists.txt @@ -154,3 +154,21 @@ GR_LIBRARY_FOO(gnuradio-trellis RUNTIME_COMPONENT "trellis_runtime" DEVEL_COMPON add_dependencies(gnuradio-trellis trellis_generated_includes trellis_generated_swigs gnuradio-runtime gnuradio-digital) + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-trellis_static STATIC ${trellis_sources}) + + add_dependencies(gnuradio-trellis_static + trellis_generated_includes trellis_generated_swigs + gnuradio-runtime_static gnuradio-digital_static + ) + + if(NOT WIN32) + set_target_properties(gnuradio-trellis_static + PROPERTIES OUTPUT_NAME gnuradio-trellis) + endif(NOT WIN32) + + install(TARGETS gnuradio-trellis_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "trellis_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index 5981bb4c89..6490723589 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -1,5 +1,5 @@ """ -Copyright 2010-2011 Free Software Foundation, Inc. +Copyright 2010-2011,2014 Free Software Foundation, Inc. This file is part of GNU Radio @@ -27,7 +27,7 @@ MAIN_TMPL = """\ <import>from gnuradio import uhd</import> <import>import time</import> <make>uhd.usrp_$(sourk)( - \$dev_addr, + ",".join((\$dev_addr, \$dev_args)), uhd.stream_args( cpu_format="\$type", \#if \$otw() @@ -163,7 +163,7 @@ self.\$(id).set_bandwidth(\$bw$(n), $n) </hide> </param> <param> - <name>Device Addr</name> + <name>Device Address</name> <key>dev_addr</key> <value>""</value> <type>string</type> @@ -176,6 +176,19 @@ self.\$(id).set_bandwidth(\$bw$(n), $n) </hide> </param> <param> + <name>Device Arguments</name> + <key>dev_args</key> + <value>""</value> + <type>string</type> + <hide> + \#if \$dev_args() + none + \#else + part + \#end if + </hide> + </param> + <param> <name>Sync</name> <key>sync</key> <value></value> diff --git a/gr-video-sdl/lib/CMakeLists.txt b/gr-video-sdl/lib/CMakeLists.txt index 2388fdae34..8c992f98ef 100644 --- a/gr-video-sdl/lib/CMakeLists.txt +++ b/gr-video-sdl/lib/CMakeLists.txt @@ -67,5 +67,19 @@ ENDIF(MSVC) add_library(gnuradio-video-sdl SHARED ${video_sdl_sources}) target_link_libraries(gnuradio-video-sdl ${video_sdl_libs}) GR_LIBRARY_FOO(gnuradio-video-sdl RUNTIME_COMPONENT "video_sdl_runtime" DEVEL_COMPONENT "video_sdl_devel") -add_dependencies(gnuradio-video-sdl - gnuradio-runtime) +add_dependencies(gnuradio-video-sdl gnuradio-runtime) + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-video-sdl_static STATIC ${video_sdl_sources}) + + add_dependencies(gnuradio-video-sdl_static gnuradio-runtime_static) + + if(NOT WIN32) + set_target_properties(gnuradio-video-sdl_static + PROPERTIES OUTPUT_NAME gnuradio-video-sdl) + endif(NOT WIN32) + + install(TARGETS gnuradio-video-sdl_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "video_sdl_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt index e11b143c51..61c973b699 100644 --- a/gr-vocoder/lib/CMakeLists.txt +++ b/gr-vocoder/lib/CMakeLists.txt @@ -161,3 +161,16 @@ endif(GR_USE_SYSTEM_LIBGSM) add_library(gnuradio-vocoder SHARED ${gr_vocoder_sources}) target_link_libraries(gnuradio-vocoder ${vocoder_libs}) GR_LIBRARY_FOO(gnuradio-vocoder RUNTIME_COMPONENT "vocoder_runtime" DEVEL_COMPONENT "vocoder_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-vocoder_static STATIC ${gr_vocoder_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-vocoder_static + PROPERTIES OUTPUT_NAME gnuradio-vocoder) + endif(NOT WIN32) + + install(TARGETS gnuradio-vocoder_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "vocoder_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-vocoder/lib/codec2/c2dec.c b/gr-vocoder/lib/codec2/c2dec.c index df4e82f77a..ec44f0a9fd 100644 --- a/gr-vocoder/lib/codec2/c2dec.c +++ b/gr-vocoder/lib/codec2/c2dec.c @@ -26,18 +26,22 @@ */ #include "codec2.h" +#include "dump.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> +#include <getopt.h> #define NONE 0 /* no bit errors */ #define UNIFORM 1 /* random bit errors */ #define TWO_STATE 2 /* Two state error model */ #define UNIFORM_RANGE 3 /* random bit errors over a certain range */ +void print_help(const struct option *long_options, int num_opts, char* argv[]); + int main(int argc, char *argv[]) { int mode; @@ -52,18 +56,25 @@ int main(int argc, char *argv[]) int state, next_state; float ber, r, burst_length, burst_period, burst_timer, ber_est; unsigned char mask; - - if ((argc != 4) && (argc != 5) && (argc != 6) && (argc != 7)) { - printf("basic usage.................: c2dec 3200|2400|1600|1400|1300|1200 InputBitFile OutputRawSpeechFile\n"); - printf("uniform errors usage........: c2dec 3200|2400|1600|1400|1300|1200 InputBitFile OutputRawSpeechFile uniformBER startBit endBit\n"); - printf("uniform error on range usage: c2dec 3200|2400|1600|1400|1300|1200 InputBitFile OutputRawSpeechFile uniformBER\n"); - printf("demod BER estimate..........: c2dec 3200|2400|1600|1400|1300|1200 InputBitFile OutputRawSpeechFile BERfile\n"); - printf("two state fading usage......: c2dec 3200|2400|1600|1400|1300|1200 InputBitFile OutputRawSpeechFile burstLength burstPeriod\n"); - printf("e.g c2dec 1400 hts1a.c2 hts1a_1400.raw\n"); - printf("e.g c2dec 1400 hts1a.c2 hts1a_1400.raw 0.9\n"); - printf("e.g c2dec 1400 hts1a.c2 hts1a_1400.raw 0.99 0.9\n"); - exit(1); - } + int natural, dump; + + char* opt_string = "h:"; + struct option long_options[] = { + { "ber", required_argument, NULL, 0 }, + { "startbit", required_argument, NULL, 0 }, + { "endbit", required_argument, NULL, 0 }, + { "berfile", required_argument, NULL, 0 }, + { "natural", no_argument, &natural, 1 }, + #ifdef DUMP + { "dump", required_argument, &dump, 1 }, + #endif + { "help", no_argument, NULL, 'h' }, + { NULL, no_argument, NULL, 0 } + }; + int num_opts=sizeof(long_options)/sizeof(struct option); + + if (argc < 4) + print_help(long_options, num_opts, argv); if (strcmp(argv[1],"3200") == 0) mode = CODEC2_MODE_3200; @@ -101,6 +112,7 @@ int main(int argc, char *argv[]) ber = 0.0; burst_length = burst_period = 0.0; burst_timer = 0.0; + dump = natural = 0; codec2 = codec2_create(mode); nsam = codec2_samples_per_frame(codec2); @@ -113,34 +125,50 @@ int main(int argc, char *argv[]) nstart_bit = 0; nend_bit = nbit-1; - if (argc == 5) { - /* see if 4th argument is a valid file name */ - if ( (fber = fopen(argv[4],"rb")) == NULL ) { - /* otherwise it must be BER value for uniform errors */ - ber = atof(argv[4]); - error_mode = UNIFORM; - } - } + while(1) { + int option_index = 0; + int opt = getopt_long(argc, argv, opt_string, + long_options, &option_index); + if (opt == -1) + break; + + switch (opt) { + case 0: + if(strcmp(long_options[option_index].name, "ber") == 0) { + ber = atof(optarg); + error_mode = UNIFORM; + } else if(strcmp(long_options[option_index].name, "startbit") == 0) { + nstart_bit = atoi(optarg); + } else if(strcmp(long_options[option_index].name, "endbit") == 0) { + nend_bit = atoi(optarg); + } else if(strcmp(long_options[option_index].name, "berfile") == 0) { + if ((fber = fopen(optarg,"wt")) == NULL) { + fprintf(stderr, "Error opening BER file: %s %s.\n", + optarg, strerror(errno)); + exit(1); + } - if (argc == 6) { - error_mode = TWO_STATE; - burst_length = atof(argv[4]); - burst_period = atof(argv[5]); - nstart_bit = 0; - nend_bit = 2; - state = 0; - } + } + #ifdef DUMP + else if(strcmp(long_options[option_index].name, "dump") == 0) { + if (dump) + dump_on(optarg); + } + #endif + break; - if (argc == 7) { - error_mode = UNIFORM_RANGE; - ber = atof(argv[4]); - nstart_bit = atoi(argv[5]); - nend_bit = atoi(argv[6]); - fprintf(stderr, "ber: %f nstart_bit: %d nend_bit: %d\n", ber, nstart_bit, nend_bit); - state = 0; - } + case 'h': + print_help(long_options, num_opts, argv); + break; + default: + /* This will never be reached */ + break; + } + } assert(nend_bit <= nbit); + codec2_set_natural_or_gray(codec2, !natural); + //printf("%d %d\n", nstart_bit, nend_bit); while(fread(bits, sizeof(char), nbyte, fin) == (size_t)nbyte) { frames++; @@ -211,13 +239,7 @@ int main(int argc, char *argv[]) else ber_est = 0.0; - /* frame repeat logic */ - if (ber_est > 0.15) { - //memcpy(bits, prev_bits, nbyte); - // fprintf(stderr, "repeat\n"); - } - - codec2_decode(codec2, buf, bits, ber_est); + codec2_decode_ber(codec2, buf, bits, ber_est); fwrite(buf, sizeof(short), nsam, fout); //if this is in a pipeline, we probably don't want the usual //buffering to occur @@ -239,3 +261,31 @@ int main(int argc, char *argv[]) return 0; } + +void print_help(const struct option* long_options, int num_opts, char* argv[]) +{ + int i; + char *option_parameters; + fprintf(stderr, "\nc2dec - Codec 2 decoder and bit error simulation program\n" + "usage: %s 3200|2400|1400}1300|1200 InputFile OutputRawFile [OPTIONS]\n\n" + "Options:\n", argv[0]); + for(i=0; i<num_opts-1; i++) { + if(long_options[i].has_arg == no_argument) { + option_parameters=""; + } else if (strcmp("ber", long_options[i].name) == 0) { + option_parameters = " BER"; + } else if (strcmp("startbit", long_options[i].name) == 0) { + option_parameters = " startBit"; + } else if (strcmp("endbit", long_options[i].name) == 0) { + option_parameters = " endBit"; + } else if (strcmp("berfile", long_options[i].name) == 0) { + option_parameters = " berFileName"; + } else if (strcmp("dump", long_options[i].name) == 0) { + option_parameters = " dumpFilePrefix"; + } else { + option_parameters = " <UNDOCUMENTED parameter>"; + } + fprintf(stderr, "\t--%s%s\n", long_options[i].name, option_parameters); + } + exit(1); +} diff --git a/gr-vocoder/lib/codec2/c2demo.c b/gr-vocoder/lib/codec2/c2demo.c index 0090069c65..9cd11d490e 100644 --- a/gr-vocoder/lib/codec2/c2demo.c +++ b/gr-vocoder/lib/codec2/c2demo.c @@ -33,6 +33,7 @@ #include "codec2.h" #include "sine.h" +#include "dump.h" #include <stdio.h> #include <stdlib.h> @@ -85,7 +86,7 @@ int main(int argc, char *argv[]) while(fread(buf, sizeof(short), nsam, fin) == (size_t)nsam) { codec2_encode(codec2, bits, buf); - codec2_decode(codec2, buf, bits, 0.0); + codec2_decode(codec2, buf, bits); fwrite(buf, sizeof(short), nsam, fout); } diff --git a/gr-vocoder/lib/codec2/c2enc.c b/gr-vocoder/lib/codec2/c2enc.c index ab1ebe4387..1e2760a01f 100644 --- a/gr-vocoder/lib/codec2/c2enc.c +++ b/gr-vocoder/lib/codec2/c2enc.c @@ -41,11 +41,12 @@ int main(int argc, char *argv[]) FILE *fout; short *buf; unsigned char *bits; - int nsam, nbit, nbyte; + int nsam, nbit, nbyte, gray; - if (argc != 4) { - printf("usage: c2enc 3200|2400|1600|1400|1300|1200 InputRawspeechFile OutputBitFile\n"); + if (argc < 4) { + printf("usage: c2enc 3200|2400|1600|1400|1300|1200 InputRawspeechFile OutputBitFile [--natural]\n"); printf("e.g c2enc 1400 ../raw/hts1a.raw hts1a.c2\n"); + printf("e.g c2enc 1300 ../raw/hts1a.raw hts1a.c2 --natural\n"); exit(1); } @@ -88,6 +89,14 @@ int main(int argc, char *argv[]) bits = (unsigned char*)malloc(nbyte*sizeof(char)); + if (argc == 5) { + if (strcmp(argv[4], "--natural") == 0) + gray = 0; + else + gray = 1; + codec2_set_natural_or_gray(codec2, gray); + } + while(fread(buf, sizeof(short), nsam, fin) == (size_t)nsam) { codec2_encode(codec2, bits, buf); fwrite(bits, sizeof(char), nbyte, fout); diff --git a/gr-vocoder/lib/codec2/c2sim.c b/gr-vocoder/lib/codec2/c2sim.c index 8f07299d0d..e68f2aceeb 100644 --- a/gr-vocoder/lib/codec2/c2sim.c +++ b/gr-vocoder/lib/codec2/c2sim.c @@ -587,13 +587,19 @@ int main(int argc, char *argv[]) mel[i]++; } + #ifdef DUMP + dump_mel(mel); + #endif + for(i=0; i<LPC_ORD; i++) { f_ = 700.0*( pow(10.0, (float)mel[i]/100.0) - 1.0); lsps_[i] = f_*(PI/4000.0); } - for(i=5; i<10; i++) { + /* + for(i=5; i<10; i++) { lsps_[i] = lsps[i]; } + */ lsp_to_lpc(lsps_, ak, LPC_ORD); } diff --git a/gr-vocoder/lib/codec2/codec2.c b/gr-vocoder/lib/codec2/codec2.c index bc4a084839..5bf998064b 100644 --- a/gr-vocoder/lib/codec2/codec2.c +++ b/gr-vocoder/lib/codec2/codec2.c @@ -138,6 +138,8 @@ struct CODEC2 * CODEC2_WIN32SUPPORT codec2_create(int mode) return NULL; } + c2->gray = 1; + c2->lpc_pf = 1; c2->bass_boost = 1; c2->beta = LPCPF_BETA; c2->gamma = LPCPF_GAMMA; c2->xq_enc[0] = c2->xq_enc[1] = 0.0; @@ -248,7 +250,12 @@ void CODEC2_WIN32SUPPORT codec2_encode(struct CODEC2 *c2, unsigned char *bits, s codec2_encode_1200(c2, bits, speech); } -void CODEC2_WIN32SUPPORT codec2_decode(struct CODEC2 *c2, short speech[], const unsigned char *bits, float ber_est) +void CODEC2_WIN32SUPPORT codec2_decode(struct CODEC2 *c2, short speech[], const unsigned char *bits) +{ + codec2_decode_ber(c2, speech, bits, 0.0); +} + +void CODEC2_WIN32SUPPORT codec2_decode_ber(struct CODEC2 *c2, short speech[], const unsigned char *bits, float ber_est) { assert(c2 != NULL); assert( @@ -978,36 +985,36 @@ void codec2_encode_1300(struct CODEC2 *c2, unsigned char * bits, short speech[]) /* frame 1: - voicing ---------------------------------------------*/ analyse_one_frame(c2, &model, speech); - pack(bits, &nbit, model.voiced, 1); + pack_natural_or_gray(bits, &nbit, model.voiced, 1, c2->gray); /* frame 2: - voicing ---------------------------------------------*/ analyse_one_frame(c2, &model, &speech[N]); - pack(bits, &nbit, model.voiced, 1); + pack_natural_or_gray(bits, &nbit, model.voiced, 1, c2->gray); /* frame 3: - voicing ---------------------------------------------*/ analyse_one_frame(c2, &model, &speech[2*N]); - pack(bits, &nbit, model.voiced, 1); + pack_natural_or_gray(bits, &nbit, model.voiced, 1, c2->gray); /* frame 4: - voicing, scalar Wo & E, scalar LSPs ------------------*/ analyse_one_frame(c2, &model, &speech[3*N]); - pack(bits, &nbit, model.voiced, 1); + pack_natural_or_gray(bits, &nbit, model.voiced, 1, c2->gray); Wo_index = encode_Wo(model.Wo); - pack(bits, &nbit, Wo_index, WO_BITS); + pack_natural_or_gray(bits, &nbit, Wo_index, WO_BITS, c2->gray); #ifdef TIMER quant_start = machdep_timer_sample(); #endif e = speech_to_uq_lsps(lsps, ak, c2->Sn, c2->w, LPC_ORD); e_index = encode_energy(e); - pack(bits, &nbit, e_index, E_BITS); + pack_natural_or_gray(bits, &nbit, e_index, E_BITS, c2->gray); encode_lsps_scalar(lsp_indexes, lsps, LPC_ORD); for(i=0; i<LSP_SCALAR_INDEXES; i++) { - pack(bits, &nbit, lsp_indexes[i], lsp_bits(i)); + pack_natural_or_gray(bits, &nbit, lsp_indexes[i], lsp_bits(i), c2->gray); } #ifdef TIMER machdep_timer_sample_and_log(quant_start, " quant/packing"); @@ -1054,20 +1061,20 @@ void codec2_decode_1300(struct CODEC2 *c2, short speech[], const unsigned char * /* this will partially fill the model params for the 4 x 10ms frames */ - model[0].voiced = unpack(bits, &nbit, 1); - model[1].voiced = unpack(bits, &nbit, 1); - model[2].voiced = unpack(bits, &nbit, 1); - model[3].voiced = unpack(bits, &nbit, 1); + model[0].voiced = unpack_natural_or_gray(bits, &nbit, 1, c2->gray); + model[1].voiced = unpack_natural_or_gray(bits, &nbit, 1, c2->gray); + model[2].voiced = unpack_natural_or_gray(bits, &nbit, 1, c2->gray); + model[3].voiced = unpack_natural_or_gray(bits, &nbit, 1, c2->gray); - Wo_index = unpack(bits, &nbit, WO_BITS); + Wo_index = unpack_natural_or_gray(bits, &nbit, WO_BITS, c2->gray); model[3].Wo = decode_Wo(Wo_index); model[3].L = PI/model[3].Wo; - e_index = unpack(bits, &nbit, E_BITS); + e_index = unpack_natural_or_gray(bits, &nbit, E_BITS, c2->gray); e[3] = decode_energy(e_index); for(i=0; i<LSP_SCALAR_INDEXES; i++) { - lsp_indexes[i] = unpack(bits, &nbit, lsp_bits(i)); + lsp_indexes[i] = unpack_natural_or_gray(bits, &nbit, lsp_bits(i), c2->gray); } decode_lsps_scalar(&lsps[3][0], lsp_indexes, LPC_ORD); check_lsp_order(&lsps[3][0], LPC_ORD); @@ -1101,6 +1108,10 @@ void codec2_decode_1300(struct CODEC2 *c2, short speech[], const unsigned char * apply_lpc_correction(&model[i]); } TIMER_SAMPLE_AND_LOG2(recover_start, " recover"); + #ifdef DUMP + dump_lsp_(&lsps[3][0]); + dump_ak_(&ak[3][0], LPC_ORD); + #endif /* synthesise ------------------------------------------------*/ @@ -1519,3 +1530,10 @@ int CODEC2_WIN32SUPPORT codec2_rebuild_spare_bit(struct CODEC2 *c2, int unpacked return -1; } + +void CODEC2_WIN32SUPPORT codec2_set_natural_or_gray(struct CODEC2 *c2, int gray) +{ + assert(c2 != NULL); + c2->gray = gray; +} + diff --git a/gr-vocoder/lib/codec2/codec2.h b/gr-vocoder/lib/codec2/codec2.h index 2f0c2b1246..1e870db4f5 100644 --- a/gr-vocoder/lib/codec2/codec2.h +++ b/gr-vocoder/lib/codec2/codec2.h @@ -58,13 +58,15 @@ struct CODEC2; struct CODEC2 * CODEC2_WIN32SUPPORT codec2_create(int mode); void CODEC2_WIN32SUPPORT codec2_destroy(struct CODEC2 *codec2_state); void CODEC2_WIN32SUPPORT codec2_encode(struct CODEC2 *codec2_state, unsigned char * bits, short speech_in[]); - void CODEC2_WIN32SUPPORT codec2_decode(struct CODEC2 *codec2_state, short speech_out[], const unsigned char *bits, float ber_est); +void CODEC2_WIN32SUPPORT codec2_decode(struct CODEC2 *codec2_state, short speech_out[], const unsigned char *bits); +void CODEC2_WIN32SUPPORT codec2_decode_ber(struct CODEC2 *codec2_state, short speech_out[], const unsigned char *bits, float ber_est); int CODEC2_WIN32SUPPORT codec2_samples_per_frame(struct CODEC2 *codec2_state); int CODEC2_WIN32SUPPORT codec2_bits_per_frame(struct CODEC2 *codec2_state); void CODEC2_WIN32SUPPORT codec2_set_lpc_post_filter(struct CODEC2 *codec2_state, int enable, int bass_boost, float beta, float gamma); int CODEC2_WIN32SUPPORT codec2_get_spare_bit_index(struct CODEC2 *codec2_state); int CODEC2_WIN32SUPPORT codec2_rebuild_spare_bit(struct CODEC2 *codec2_state, int unpacked_bits[]); +void CODEC2_WIN32SUPPORT codec2_set_natural_or_gray(struct CODEC2 *codec2_state, int gray); #endif diff --git a/gr-vocoder/lib/codec2/codec2_internal.h b/gr-vocoder/lib/codec2/codec2_internal.h index 246d1ae6af..c4bb1fc42a 100644 --- a/gr-vocoder/lib/codec2/codec2_internal.h +++ b/gr-vocoder/lib/codec2/codec2_internal.h @@ -38,6 +38,7 @@ struct CODEC2 { float Sn[M]; /* input speech */ float hpf_states[2]; /* high pass filter states */ void *nlp; /* pitch predictor states */ + int gray; /* non-zero for gray encoding */ kiss_fft_cfg fft_inv_cfg; /* inverse FFT config */ float Sn_[2*N]; /* synthesised output speech */ diff --git a/gr-vocoder/lib/codec2/dump.c b/gr-vocoder/lib/codec2/dump.c index cc935d73cf..af966e5005 100644 --- a/gr-vocoder/lib/codec2/dump.c +++ b/gr-vocoder/lib/codec2/dump.c @@ -54,6 +54,7 @@ static FILE *frw = NULL; static FILE *flsp = NULL; static FILE *fweights = NULL; static FILE *flsp_ = NULL; +static FILE *fmel = NULL; static FILE *fphase = NULL; static FILE *fphase_ = NULL; static FILE *ffw = NULL; @@ -101,6 +102,8 @@ void dump_off(){ fclose(fweights); if (flsp_ != NULL) fclose(flsp_); + if (fmel != NULL) + fclose(fmel); if (fphase != NULL) fclose(fphase); if (fphase_ != NULL) @@ -453,6 +456,23 @@ void dump_lsp_(float lsp_[]) { fprintf(flsp_,"\n"); } +void dump_mel(int mel[]) { + int i; + char s[MAX_STR]; + + if (!dumpon) return; + + if (fmel == NULL) { + sprintf(s,"%s_mel.txt", prefix); + fmel = fopen(s, "wt"); + assert(fmel != NULL); + } + + for(i=0; i<10; i++) + fprintf(fmel,"%d\t",mel[i]); + fprintf(fmel,"\n"); +} + void dump_ak(float ak[], int order) { int i; char s[MAX_STR]; diff --git a/gr-vocoder/lib/codec2/dump.h b/gr-vocoder/lib/codec2/dump.h index a61fdaab69..dd95f5adad 100644 --- a/gr-vocoder/lib/codec2/dump.h +++ b/gr-vocoder/lib/codec2/dump.h @@ -49,6 +49,7 @@ void dump_Rw(float Rw[]); void dump_lsp(float lsp[]); void dump_weights(float w[], int ndim); void dump_lsp_(float lsp_[]); +void dump_mel(int mel[]); void dump_ak(float ak[], int order); void dump_ak_(float ak[], int order); void dump_E(float E); diff --git a/gr-vocoder/lib/codec2/nlp.c b/gr-vocoder/lib/codec2/nlp.c index cca835b46f..83375dcd78 100644 --- a/gr-vocoder/lib/codec2/nlp.c +++ b/gr-vocoder/lib/codec2/nlp.c @@ -53,7 +53,7 @@ #define CNLP 0.3 /* post processor constant */ #define NLP_NTAP 48 /* Decimation LPF order */ -#undef DUMP +//#undef DUMP /*---------------------------------------------------------------------------*\ diff --git a/gr-vocoder/lib/codec2/pack.c b/gr-vocoder/lib/codec2/pack.c index 3f8f93e422..1c07230a70 100644 --- a/gr-vocoder/lib/codec2/pack.c +++ b/gr-vocoder/lib/codec2/pack.c @@ -52,8 +52,22 @@ pack( unsigned int fieldWidth/* Width of the field in BITS, not bytes. */ ) { - /* Convert the field to Gray code */ - field = (field >> 1) ^ field; + pack_natural_or_gray(bitArray, bitIndex, field, fieldWidth, 1); +} + +void +pack_natural_or_gray( + unsigned char * bitArray, /* The output bit string. */ + unsigned int * bitIndex, /* Index into the string in BITS, not bytes.*/ + int field, /* The bit field to be packed. */ + unsigned int fieldWidth,/* Width of the field in BITS, not bytes. */ + unsigned int gray /* non-zero for gray coding */ + ) +{ + if (gray) { + /* Convert the field to Gray code */ + field = (field >> 1) ^ field; + } do { unsigned int bI = *bitIndex; @@ -81,6 +95,21 @@ unpack( unsigned int fieldWidth/* Width of the field in BITS, not bytes. */ ) { + return unpack_natural_or_gray(bitArray, bitIndex, fieldWidth, 1); +} + +/** Unpack a field from a bit string, to binary, optionally using + * natural or Gray code. + * + */ +int +unpack_natural_or_gray( + const unsigned char * bitArray, /* The input bit string. */ + unsigned int * bitIndex, /* Index into the string in BITS, not bytes.*/ + unsigned int fieldWidth,/* Width of the field in BITS, not bytes. */ + unsigned int gray /* non-zero for Gray coding */ + ) +{ unsigned int field = 0; unsigned int t; @@ -96,10 +125,16 @@ unpack( fieldWidth -= sliceWidth; } while ( fieldWidth != 0 ); - /* Convert from Gray code to binary. Works for maximum 8-bit fields. */ - t = field ^ (field >> 8); - t ^= (t >> 4); - t ^= (t >> 2); - t ^= (t >> 1); + if (gray) { + /* Convert from Gray code to binary. Works for maximum 8-bit fields. */ + t = field ^ (field >> 8); + t ^= (t >> 4); + t ^= (t >> 2); + t ^= (t >> 1); + } + else { + t = field; + } + return t; } diff --git a/gr-vocoder/lib/codec2/quantise.h b/gr-vocoder/lib/codec2/quantise.h index 0932d9d1bd..cb9dd07fdb 100644 --- a/gr-vocoder/lib/codec2/quantise.h +++ b/gr-vocoder/lib/codec2/quantise.h @@ -96,7 +96,9 @@ int encode_energy(float e); float decode_energy(int index); void pack(unsigned char * bits, unsigned int *nbit, int index, unsigned int index_bits); +void pack_natural_or_gray(unsigned char * bits, unsigned int *nbit, int index, unsigned int index_bits, unsigned int gray); int unpack(const unsigned char * bits, unsigned int *nbit, unsigned int index_bits); +int unpack_natural_or_gray(const unsigned char * bits, unsigned int *nbit, unsigned int index_bits, unsigned int gray); int lsp_bits(int i); int lspd_bits(int i); diff --git a/gr-vocoder/lib/codec2_decode_ps_impl.cc b/gr-vocoder/lib/codec2_decode_ps_impl.cc index fa4c1839d0..c3c682bebd 100644 --- a/gr-vocoder/lib/codec2_decode_ps_impl.cc +++ b/gr-vocoder/lib/codec2_decode_ps_impl.cc @@ -85,7 +85,7 @@ namespace gr { for(int i = 0; i < noutput_items; i += d_samples_per_frame) { pack_frame(in, &d_frame_buf[0]); - codec2_decode (d_codec2, out, const_cast<unsigned char*>(&d_frame_buf[0]), 0.0); + codec2_decode (d_codec2, out, const_cast<unsigned char*>(&d_frame_buf[0])); in += d_bits_per_frame * sizeof (char); out += d_samples_per_frame; } diff --git a/gr-wavelet/lib/CMakeLists.txt b/gr-wavelet/lib/CMakeLists.txt index 1fab820dd7..99c32aac19 100644 --- a/gr-wavelet/lib/CMakeLists.txt +++ b/gr-wavelet/lib/CMakeLists.txt @@ -91,3 +91,19 @@ GR_LIBRARY_FOO(gnuradio-wavelet RUNTIME_COMPONENT "wavelet_runtime" DEVEL_COMPON add_dependencies(gnuradio-wavelet wavelet_generated_includes wavelet_generated_swigs gnuradio-runtime) + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-wavelet_static STATIC ${gr_wavelet_sources}) + + add_dependencies(gnuradio-wavelet_static wavelet_generated_includes + gnuradio-runtime_static) + + if(NOT WIN32) + set_target_properties(gnuradio-wavelet_static + PROPERTIES OUTPUT_NAME gnuradio-wavelet) + endif(NOT WIN32) + + install(TARGETS gnuradio-wavelet_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "wavelet_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-wxgui/lib/CMakeLists.txt b/gr-wxgui/lib/CMakeLists.txt index c33a7b9a33..02b2e94dce 100644 --- a/gr-wxgui/lib/CMakeLists.txt +++ b/gr-wxgui/lib/CMakeLists.txt @@ -75,3 +75,16 @@ target_link_libraries(gnuradio-wxgui ${wxgui_libs}) GR_LIBRARY_FOO(gnuradio-wxgui RUNTIME_COMPONENT "wxgui_runtime" DEVEL_COMPONENT "wxgui_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-wxgui_static STATIC ${gr_wxgui_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-wxgui_static + PROPERTIES OUTPUT_NAME gnuradio-wxgui) + endif(NOT WIN32) + + install(TARGETS gnuradio-wxgui_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "wxgui_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-zeromq/lib/CMakeLists.txt b/gr-zeromq/lib/CMakeLists.txt index cc62c79f35..07ac36bc9c 100644 --- a/gr-zeromq/lib/CMakeLists.txt +++ b/gr-zeromq/lib/CMakeLists.txt @@ -69,3 +69,16 @@ list(APPEND zeromq_libs add_library(gnuradio-zeromq SHARED ${zeromq_sources}) target_link_libraries(gnuradio-zeromq ${zeromq_libs}) GR_LIBRARY_FOO(gnuradio-zeromq RUNTIME_COMPONENT "zeromq_runtime" DEVEL_COMPONENT "zeromq_devel") + +if(ENABLE_STATIC_LIBS) + add_library(gnuradio-zeromq_static STATIC ${zeromq_sources}) + + if(NOT WIN32) + set_target_properties(gnuradio-zeromq_static + PROPERTIES OUTPUT_NAME gnuradio-zeromq) + endif(NOT WIN32) + + install(TARGETS gnuradio-zeromq_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "zeromq_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) diff --git a/gr-zeromq/python/zeromq/qa_zeromq_pubsub.py b/gr-zeromq/python/zeromq/qa_zeromq_pubsub.py new file mode 100755 index 0000000000..d49a9a3b4a --- /dev/null +++ b/gr-zeromq/python/zeromq/qa_zeromq_pubsub.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# 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, gr_unittest +from gnuradio import blocks, zeromq +import time + +class qa_zeromq_pubsub (gr_unittest.TestCase): + + def setUp (self): + self.tb = gr.top_block () + + def tearDown (self): + self.tb = None + + def test_001 (self): + vlen = 10 + src_data = range(vlen)*100 + src = blocks.vector_source_f(src_data, False, vlen) + zeromq_pub_sink = zeromq.pub_sink(gr.sizeof_float, vlen, "tcp://127.0.0.1:5555", 0) + zeromq_sub_source = zeromq.sub_source(gr.sizeof_float, vlen, "tcp://127.0.0.1:5555", 0) + sink = blocks.vector_sink_f(vlen) + self.tb.connect(src, zeromq_pub_sink) + self.tb.connect(zeromq_sub_source, sink) + self.tb.start() + time.sleep(0.25) + self.tb.stop() + self.tb.wait() + self.assertFloatTuplesAlmostEqual(sink.data(), src_data) + +if __name__ == '__main__': + gr_unittest.run(qa_zeromq_pubsub) diff --git a/grc/base/Block.py b/grc/base/Block.py index c440f00b6b..a14ffd92fc 100644 --- a/grc/base/Block.py +++ b/grc/base/Block.py @@ -141,6 +141,17 @@ class Block(Element): and (self._key != "pad_source") \ and (self._key != "pad_sink")) + if is_not_virtual_or_pad: + self.get_params().append(self.get_parent().get_parent().Param( + block=self, + n=odict({'name': 'Block Alias', + 'key': 'alias', + 'type': 'string', + 'hide': 'part', + 'tab': ADVANCED_PARAM_TAB + }) + )) + if (len(sources) or len(sinks)) and is_not_virtual_or_pad: self.get_params().append(self.get_parent().get_parent().Param( block=self, @@ -434,5 +445,3 @@ class Block(Element): elif len(bussrcs) > 0: self.bussify({'name':'bus','type':'bus'}, 'source') self.bussify({'name':'bus','type':'bus'}, 'source') - - diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 1db333fc5a..6ad2d5576f 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -49,7 +49,7 @@ class ActionHandler: ActionHandler constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block. - + Args: file_paths: a list of flow graph file passed from command line platform: platform module @@ -81,7 +81,7 @@ class ActionHandler: * some keys are ignored by the accelerators like the direction keys, * some keys are not registered to any accelerators but are still used. When not in focus, gtk and the accelerators handle the the key press. - + Returns: false to let gtk handle the key action """ @@ -95,7 +95,7 @@ class ActionHandler: Handle the delete event from the main window. Generated by pressing X to close, alt+f4, or right click+close. This method in turns calls the state handler to quit. - + Returns: true """ @@ -117,7 +117,7 @@ class ActionHandler: Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY, Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKS_WINDOW, Actions.TOGGLE_REPORTS_WINDOW, Actions.TOGGLE_HIDE_DISABLED_BLOCKS, - Actions.TOOLS_RUN_FDESIGN, + Actions.TOOLS_RUN_FDESIGN, Actions.TOGGLE_SCROLL_LOCK, Actions.CLEAR_REPORTS, ): action.set_sensitive(True) if ParseXML.xml_failures: Messages.send_xml_errors_if_any(ParseXML.xml_failures) @@ -135,6 +135,7 @@ class ActionHandler: self.main_window.btwin.search_entry.hide() Actions.TOGGLE_REPORTS_WINDOW.set_active(Preferences.reports_window_visibility()) Actions.TOGGLE_BLOCKS_WINDOW.set_active(Preferences.blocks_window_visibility()) + Actions.TOGGLE_SCROLL_LOCK.set_active(Preferences.scroll_lock()) elif action == Actions.APPLICATION_QUIT: if self.main_window.close_pages(): gtk.main_quit() @@ -174,14 +175,14 @@ class ActionHandler: self.get_page().get_state_cache().save_new_state(self.get_flow_graph().export_data()) self.get_page().set_saved(False) ################################################## - # Create heir block + # Create heir block ################################################## elif action == Actions.BLOCK_CREATE_HIER: # keeping track of coordinates for pasting later coords = self.get_flow_graph().get_selected_blocks()[0].get_coordinate() x,y = coords - x_min = x + x_min = x y_min = y pads = []; @@ -200,9 +201,9 @@ class ActionHandler: # If a block parameter exists that is a parameter, create a parameter for it if param.get_value() == flow_param.get_id(): params.append(param.get_value()) - - - # keep track of x,y mins for pasting later + + + # keep track of x,y mins for pasting later (x,y) = block.get_coordinate() if x < x_min: x_min = x @@ -214,8 +215,8 @@ class ActionHandler: # Get id of connected blocks source_id = connection.get_source().get_parent().get_id() sink_id = connection.get_sink().get_parent().get_id() - - # If connected block is not in the list of selected blocks create a pad for it + + # If connected block is not in the list of selected blocks create a pad for it if self.get_flow_graph().get_block(source_id) not in self.get_flow_graph().get_selected_blocks(): pads.append({'key': connection.get_sink().get_key(), 'coord': connection.get_source().get_coordinate(), 'block_id' : block.get_id(), 'direction': 'source'}) @@ -241,7 +242,7 @@ class ActionHandler: # Remove the default samp_rate variable block that is created remove_me = self.get_flow_graph().get_block("samp_rate") - self.get_flow_graph().remove_element(remove_me) + self.get_flow_graph().remove_element(remove_me) # Add the param blocks along the top of the window @@ -297,9 +298,9 @@ class ActionHandler: # Connect the pad to the proper sinks new_connection = self.get_flow_graph().connect(pad_source,sink) - # update the new heir block flow graph + # update the new heir block flow graph self.get_flow_graph().update() - + ################################################## # Move/Rotate/Delete/Create @@ -373,6 +374,13 @@ class ActionHandler: else: self.main_window.btwin.hide() Preferences.blocks_window_visibility(visible) + elif action == Actions.TOGGLE_SCROLL_LOCK: + visible = action.get_active() + self.main_window.text_display.scroll_lock = visible + if visible: + self.main_window.text_display.scroll_to_end() + elif action == Actions.CLEAR_REPORTS: + self.main_window.text_display.clear() elif action == Actions.TOGGLE_HIDE_DISABLED_BLOCKS: Actions.NOTHING_SELECT() ################################################## @@ -495,7 +503,7 @@ class ActionHandler: self.get_flow_graph()._old_selected_port = None self.get_flow_graph()._new_selected_port = None Actions.ELEMENT_CREATE() - + elif action == Actions.BUSSIFY_SINKS: n = {'name':'bus', 'type':'bus'} for b in self.get_flow_graph().get_selected_blocks(): @@ -563,7 +571,7 @@ class ExecFlowGraphThread(Thread): def __init__ (self, action_handler): """ ExecFlowGraphThread constructor. - + Args: action_handler: an instance of an ActionHandler """ diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py index af07121f3a..3aa9e61472 100644 --- a/grc/gui/Actions.py +++ b/grc/gui/Actions.py @@ -33,10 +33,10 @@ def handle_key_press(event): """ Call the action associated with the key press event. Both the key value and the mask must have a match. - + Args: event: a gtk key press event - + Returns: true if handled """ @@ -281,6 +281,10 @@ TOGGLE_BLOCKS_WINDOW = ToggleAction( tooltip='Toggle visibility of the block tree widget', keypresses=(gtk.keysyms.b, gtk.gdk.CONTROL_MASK), ) +TOGGLE_SCROLL_LOCK = ToggleAction( + label='_Reports Scroll Lock', + tooltip='Toggle scroll lock for the report window', +) ABOUT_WINDOW_DISPLAY = Action( label='_About', tooltip='About this program', @@ -345,6 +349,11 @@ FIND_BLOCKS = Action( keypresses=(gtk.keysyms.f, gtk.gdk.CONTROL_MASK, gtk.keysyms.slash, NO_MODS_MASK), ) +CLEAR_REPORTS = Action( + label='_Clear Reports', + tooltip='Clear Reports', + stock_id=gtk.STOCK_CLEAR, +) OPEN_HIER = Action( label='Open H_ier', tooltip='Open the source of the selected hierarchical block', diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py index da1b1469e1..11e35c992b 100644 --- a/grc/gui/Bars.py +++ b/grc/gui/Bars.py @@ -55,6 +55,7 @@ TOOLBAR_LIST = ( Actions.RELOAD_BLOCKS, Actions.OPEN_HIER, Actions.BUSSIFY_SOURCES, + Actions.CLEAR_REPORTS, ) ##The list of actions and categories for the menu bar. @@ -91,7 +92,10 @@ MENU_BAR_LIST = ( ]), (gtk.Action('View', '_View', None, None), [ Actions.TOGGLE_BLOCKS_WINDOW, + None, Actions.TOGGLE_REPORTS_WINDOW, + Actions.TOGGLE_SCROLL_LOCK, + Actions.CLEAR_REPORTS, None, Actions.ERRORS_WINDOW_DISPLAY, Actions.FIND_BLOCKS, diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index 873bac9783..0ffba8e0e8 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -21,6 +21,7 @@ import pygtk pygtk.require('2.0') import gtk import Utils +import Actions class TextDisplay(gtk.TextView): """A non editable gtk text view.""" @@ -28,7 +29,7 @@ class TextDisplay(gtk.TextView): def __init__(self, text=''): """ TextDisplay constructor. - + Args: text: the text to display (string) """ @@ -40,11 +41,19 @@ class TextDisplay(gtk.TextView): self.set_cursor_visible(False) self.set_wrap_mode(gtk.WRAP_WORD_CHAR) + # Added for scroll locking + self.scroll_lock = True + + # Add a signal for populating the popup menu + self.connect("populate-popup", self.populate_popup) + def insert(self, line): # make backspaces work line = self._consume_backspaces(line) # add the remaining text to buffer self.get_buffer().insert(self.get_buffer().get_end_iter(), line) + # Automatically scroll on insert + self.scroll_to_end() def _consume_backspaces(self, line): """removes text from the buffer if line starts with \b*""" @@ -61,19 +70,52 @@ class TextDisplay(gtk.TextView): # return remaining text return line[back_count:] + def scroll_to_end(self): + if self.scroll_lock: + buffer = self.get_buffer() + buffer.move_mark(buffer.get_insert(), buffer.get_end_iter()) + self.scroll_to_mark(buffer.get_insert(), 0.0) + + def clear(self): + buffer = self.get_buffer() + buffer.delete(buffer.get_start_iter(), buffer.get_end_iter()) + + # Callback functions to handle the scrolling lock and clear context menus options + # Action functions are set by the ActionHandler's init function + def clear_cb(self, menu_item, web_view): + Actions.CLEAR_REPORTS() + + def scroll_back_cb(self, menu_item, web_view): + Actions.TOGGLE_SCROLL_LOCK() + + def populate_popup(self, view, menu): + """Create a popup menu for the scroll lock and clear functions""" + menu.append(gtk.SeparatorMenuItem()) + + lock = gtk.CheckMenuItem("Scroll Lock") + menu.append(lock) + lock.set_active(self.scroll_lock) + lock.connect('activate', self.scroll_back_cb, view) + + clear = gtk.ImageMenuItem(gtk.STOCK_CLEAR) + menu.append(clear) + clear.connect('activate', self.clear_cb, view) + menu.show_all() + return False + def MessageDialogHelper(type, buttons, title=None, markup=None): """ Create a modal message dialog and run it. - + Args: type: the type of message: gtk.MESSAGE_INFO, gtk.MESSAGE_WARNING, gtk.MESSAGE_QUESTION or gtk.MESSAGE_ERROR buttons: the predefined set of buttons to use: gtk.BUTTONS_NONE, gtk.BUTTONS_OK, gtk.BUTTONS_CLOSE, gtk.BUTTONS_CANCEL, gtk.BUTTONS_YES_NO, gtk.BUTTONS_OK_CANCEL - + Args: tittle: the title of the window (string) markup: the message text with pango markup - + Returns: the gtk response from run() """ diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 067131ec96..f309d34a2e 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -121,7 +121,7 @@ class MainWindow(gtk.Window): Handle the delete event from the main window. Generated by pressing X to close, alt+f4, or right click+close. This method in turns calls the state handler to quit. - + Returns: true """ @@ -133,7 +133,7 @@ class MainWindow(gtk.Window): Handle a page change. When the user clicks on a new tab, reload the flow graph to update the vars window and call handle states (select nothing) to update the buttons. - + Args: notebook: the notebook page: new page @@ -150,12 +150,11 @@ class MainWindow(gtk.Window): def add_report_line(self, line): """ Place line at the end of the text buffer, then scroll its window all the way down. - + Args: line: the new text """ self.text_display.insert(line) - self.text_display.scroll_mark_onscreen(self.text_display.get_buffer().get_insert()) ############################################################ # Pages: create and close @@ -165,7 +164,7 @@ class MainWindow(gtk.Window): """ Create a new notebook page. Set the tab to be selected. - + Args: file_path: optional file to load into the flow graph show: true if the page should be shown after loading @@ -203,7 +202,7 @@ class MainWindow(gtk.Window): def close_pages(self): """ Close all the pages in this notebook. - + Returns: true if all closed """ @@ -228,7 +227,7 @@ class MainWindow(gtk.Window): Close the current page. If the notebook becomes empty, and ensure is true, call new page upon exit to ensure that at least one page exists. - + Args: ensure: boolean """ @@ -258,7 +257,7 @@ class MainWindow(gtk.Window): Set the title of the main window. Set the titles on the page tabs. Show/hide the reports window. - + Args: title: the window title """ @@ -286,7 +285,7 @@ class MainWindow(gtk.Window): def get_page(self): """ Get the selected page. - + Returns: the selected page """ @@ -295,7 +294,7 @@ class MainWindow(gtk.Window): def get_flow_graph(self): """ Get the selected flow graph. - + Returns: the selected flow graph """ @@ -317,7 +316,7 @@ class MainWindow(gtk.Window): def _set_page(self, page): """ Set the current page. - + Args: page: the page widget """ @@ -327,7 +326,7 @@ class MainWindow(gtk.Window): def _save_changes(self): """ Save changes to flow graph? - + Returns: true if yes """ @@ -339,7 +338,7 @@ class MainWindow(gtk.Window): def _get_files(self): """ Get the file names for all the pages, in order. - + Returns: list of file paths """ @@ -348,7 +347,7 @@ class MainWindow(gtk.Window): def _get_pages(self): """ Get a list of all pages in the notebook. - + Returns: list of pages """ diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py index b15fb9738b..a6bd0d6603 100644 --- a/grc/gui/Preferences.py +++ b/grc/gui/Preferences.py @@ -95,3 +95,9 @@ def blocks_window_visibility(visible=None): else: try: return _config_parser.getboolean('main', 'blocks_window_visible') except: return True + +def scroll_lock(visible=None): + if visible is not None: _config_parser.set('main', 'scroll_lock', visible) + else: + try: return _config_parser.getboolean('main', 'scroll_lock') + except: return True diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index e1b091612b..52582384aa 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -161,6 +161,9 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($blk.get_make()) #else self.$blk.get_id() = $indent($blk.get_make()) + #if $blk.has_param('alias') and $blk.get_param('alias').get_evaluated() + (self.$blk.get_id()).set_block_alias("$blk.get_param('alias').get_evaluated()") + #end if #if $blk.has_param('affinity') and $blk.get_param('affinity').get_evaluated() (self.$blk.get_id()).set_processor_affinity($blk.get_param('affinity').get_evaluated()) #end if @@ -329,7 +332,11 @@ if __name__ == '__main__': tb.wait() qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) #for $m in $monitors - (tb.$m.get_id()).start() + if $m.has_param('en'): + if $m.get_param('en').get_value(): + (tb.$m.get_id()).start() + else: + sys.stderr.write("Monitor '{0}' does not have an enable ('en') parameter.".format("tb.$m.get_id()")) #end for qapp.exec_() tb = None #to clean up Qt widgets @@ -360,4 +367,3 @@ if __name__ == '__main__': tb.wait() #end if #end if - diff --git a/volk/CMakeLists.txt b/volk/CMakeLists.txt index cf651edd81..66789e42dd 100644 --- a/volk/CMakeLists.txt +++ b/volk/CMakeLists.txt @@ -73,13 +73,18 @@ if(MSVC) unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link endif(BOOST_ALL_DYN_LINK) endif(MSVC) -include(GrBoost) +include(VolkBoost) if(NOT Boost_FOUND) message(FATAL_ERROR "VOLK Requires boost to build") endif() -find_package(ORC) +option(ENABLE_ORC "Enable Orc" True) +if(ENABLE_ORC) + find_package(ORC) +else(ENABLE_ORC) + message(STATUS "Disabling use of ORC") +endif(ENABLE_ORC) ######################################################################## # Setup the package config file diff --git a/volk/apps/volk_profile.cc b/volk/apps/volk_profile.cc index 97b0a5b7a8..f816c4e95e 100644 --- a/volk/apps/volk_profile.cc +++ b/volk/apps/volk_profile.cc @@ -1,3 +1,25 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-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. + */ + #include "qa_utils.h" #include <volk/volk.h> @@ -67,6 +89,7 @@ int main(int argc, char *argv[]) { //VOLK_PROFILE(volk_16i_x5_add_quad_16i_x4, 1e-4, 2046, 10000, &results, benchmark_mode, kernel_regex); //VOLK_PROFILE(volk_16i_branch_4_state_8, 1e-4, 2046, 10000, &results, benchmark_mode, kernel_regex); + VOLK_PUPPET_PROFILE(volk_8u_conv_k7_r2puppet_8u, volk_8u_x4_conv_k7_r2_8u, 0, 0, 2060, 10000, &results, benchmark_mode, kernel_regex); VOLK_PUPPET_PROFILE(volk_32fc_s32fc_rotatorpuppet_32fc, volk_32fc_s32fc_x2_rotator_32fc, 1e-2, (lv_32fc_t)lv_cmake(0.953939201, 0.3), 20462, 10000, &results, benchmark_mode, kernel_regex); VOLK_PROFILE(volk_16ic_s32f_deinterleave_real_32f, 1e-5, 32768.0, 204602, 10000, &results, benchmark_mode, kernel_regex); VOLK_PROFILE(volk_16ic_deinterleave_real_8i, 0, 0, 204602, 10000, &results, benchmark_mode, kernel_regex); @@ -153,6 +176,7 @@ int main(int argc, char *argv[]) { //VOLK_PROFILE(volk_32fc_s32fc_multiply_32fc, 1e-4, lv_32fc_t(1.0, 0.5), 204602, 1000, &results, benchmark_mode, kernel_regex); VOLK_PROFILE(volk_32fc_s32fc_multiply_32fc, 1e-4, 0, 204602, 1000, &results, benchmark_mode, kernel_regex); VOLK_PROFILE(volk_32f_s32f_multiply_32f, 1e-4, 1.0, 204602, 10000, &results, benchmark_mode, kernel_regex); + VOLK_PROFILE(volk_32f_binary_slicer_32i, 0, 1.0, 204602, 10000, &results, benchmark_mode, kernel_regex); // Until we can update the config on a kernel by kernel basis // do not overwrite volk_config when using a regex. diff --git a/volk/cmake/GrBoost.cmake b/volk/cmake/VolkBoost.cmake index 8b0f07f702..318820e10f 100644 --- a/volk/cmake/GrBoost.cmake +++ b/volk/cmake/VolkBoost.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -if(DEFINED __INCLUDED_GR_BOOST_CMAKE) +if(DEFINED __INCLUDED_VOLK_BOOST_CMAKE) return() endif() -set(__INCLUDED_GR_BOOST_CMAKE TRUE) +set(__INCLUDED_VOLK_BOOST_CMAKE TRUE) ######################################################################## # Setup Boost and handle some system specific things diff --git a/volk/kernels/volk/volk_32f_binary_slicer_32i.h b/volk/kernels/volk/volk_32f_binary_slicer_32i.h new file mode 100644 index 0000000000..911df85ba4 --- /dev/null +++ b/volk/kernels/volk/volk_32f_binary_slicer_32i.h @@ -0,0 +1,237 @@ +#ifndef INCLUDED_volk_32f_binary_slicer_32f_H +#define INCLUDED_volk_32f_binary_slicer_32f_H + + +#ifdef LV_HAVE_GENERIC +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_generic(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + for(number = 0; number < num_points; number++){ + if( *aPtr++ >= 0) { + *cPtr++ = 1; + } + else { + *cPtr++ = 0; + } + } +} +#endif /* LV_HAVE_GENERIC */ + + +#ifdef LV_HAVE_GENERIC +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_generic_branchless(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + for(number = 0; number < num_points; number++){ + *cPtr++ = (*aPtr++ >= 0); + } +} +#endif /* LV_HAVE_GENERIC */ + + +#ifdef LV_HAVE_SSE2 +#include <emmintrin.h> +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_a_sse2(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + unsigned int quarter_points = num_points / 4; + __m128 a_val, res_f; + __m128i res_i, binary_i; + __m128 zero_val; + zero_val = _mm_set1_ps (0.0f); + + for(number = 0; number < quarter_points; number++){ + a_val = _mm_load_ps(aPtr); + + res_f = _mm_cmpge_ps (a_val, zero_val); + res_i = _mm_cvtps_epi32 (res_f); + binary_i = _mm_srli_epi32 (res_i, 31); + + + _mm_store_si128((__m128i*)cPtr, binary_i); + + + cPtr += 4; + aPtr += 4; + } + + for(number = quarter_points * 4; number < num_points; number++){ + if( *aPtr++ >= 0) { + *cPtr++ = 1; + } + else { + *cPtr++ = 0; + } + } +} +#endif /* LV_HAVE_SSE2 */ + + +#ifdef LV_HAVE_AVX +#include <immintrin.h> +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_a_avx(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + unsigned int quarter_points = num_points / 8; + __m256 a_val, res_f, binary_f; + __m256i binary_i; + __m256 zero_val, one_val; + zero_val = _mm256_set1_ps (0.0f); + one_val = _mm256_set1_ps (1.0f); + + for(number = 0; number < quarter_points; number++){ + a_val = _mm256_load_ps(aPtr); + + res_f = _mm256_cmp_ps (a_val, zero_val, 13); + binary_f = _mm256_and_ps (res_f, one_val); + binary_i = _mm256_cvtps_epi32(binary_f); + + + + _mm256_store_si256((__m256i *)cPtr, binary_i); + + + cPtr += 8; + aPtr += 8; + } + + for(number = quarter_points * 8; number < num_points; number++){ + if( *aPtr++ >= 0) { + *cPtr++ = 1; + } + else { + *cPtr++ = 0; + } + } +} +#endif /* LV_HAVE_SSE2 */ + + +#ifdef LV_HAVE_SSE2 +#include <emmintrin.h> +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_u_sse2(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + unsigned int quarter_points = num_points / 4; + __m128 a_val, res_f; + __m128i res_i, binary_i; + __m128 zero_val; + zero_val = _mm_set1_ps (0.0f); + + for(number = 0; number < quarter_points; number++){ + a_val = _mm_loadu_ps(aPtr); + + res_f = _mm_cmpge_ps (a_val, zero_val); + res_i = _mm_cvtps_epi32 (res_f); + binary_i = _mm_srli_epi32 (res_i, 31); + + + _mm_storeu_si128((__m128i*)cPtr, binary_i); + + + cPtr += 4; + aPtr += 4; + } + + for(number = quarter_points * 4; number < num_points; number++){ + if( *aPtr++ >= 0) { + *cPtr++ = 1; + } + else { + *cPtr++ = 0; + } + } +} +#endif /* LV_HAVE_SSE2 */ + + +#ifdef LV_HAVE_AVX +#include <immintrin.h> +/*! + \brief Returns integer 1 if float input is greater than or equal to 0, 1 otherwise + \param cVector The int output (either 0 or 1) + \param aVector The float input + \param num_points The number of values in aVector and stored into cVector +*/ +static inline void volk_32f_binary_slicer_32i_u_avx(int* cVector, const float* aVector, unsigned int num_points){ + int* cPtr = cVector; + const float* aPtr = aVector; + unsigned int number = 0; + + unsigned int quarter_points = num_points / 8; + __m256 a_val, res_f, binary_f; + __m256i binary_i; + __m256 zero_val, one_val; + zero_val = _mm256_set1_ps (0.0f); + one_val = _mm256_set1_ps (1.0f); + + for(number = 0; number < quarter_points; number++){ + a_val = _mm256_loadu_ps(aPtr); + + res_f = _mm256_cmp_ps (a_val, zero_val, 13); + binary_f = _mm256_and_ps (res_f, one_val); + binary_i = _mm256_cvtps_epi32(binary_f); + + + + _mm256_storeu_si256((__m256i*)cPtr, binary_i); + + + cPtr += 8; + aPtr += 8; + } + + for(number = quarter_points * 8; number < num_points; number++){ + if( *aPtr++ >= 0) { + *cPtr++ = 1; + } + else { + *cPtr++ = 0; + } + } +} +#endif /* LV_HAVE_SSE2 */ + + + +#endif /* INCLUDED_volk_32f_binary_slicer_32f_H */ diff --git a/volk/kernels/volk/volk_8u_conv_k7_r2puppet_8u.h b/volk/kernels/volk/volk_8u_conv_k7_r2puppet_8u.h new file mode 100644 index 0000000000..fef9db5de8 --- /dev/null +++ b/volk/kernels/volk/volk_8u_conv_k7_r2puppet_8u.h @@ -0,0 +1,241 @@ +#ifndef INCLUDED_volk_8u_conv_k7_r2puppet_8u_H +#define INCLUDED_volk_8u_conv_k7_r2puppet_8u_H + +#include <volk/volk.h> +#include <volk/volk_8u_x4_conv_k7_r2_8u.h> + +typedef union { + //decision_t is a BIT vector + unsigned char* t; + unsigned int* w; +} p_decision_t; + +static inline int parity(int x, unsigned char* Partab) +{ + x ^= (x >> 16); + x ^= (x >> 8); + return Partab[x]; +} + +static inline int chainback_viterbi(unsigned char* data, + unsigned int nbits, + unsigned int endstate, + unsigned int tailsize, + unsigned char* decisions) +{ + unsigned char* d; + int d_ADDSHIFT = 0; + int d_numstates = (1 << 6); + int d_decision_t_size = d_numstates/8; + unsigned int d_k = 7; + int d_framebits = nbits; + /* ADDSHIFT and SUBSHIFT make sure that the thing returned is a byte. */ + d = decisions; + /* Make room beyond the end of the encoder register so we can + * accumulate a full byte of decoded data + */ + + endstate = (endstate%d_numstates) << d_ADDSHIFT; + + /* The store into data[] only needs to be done every 8 bits. + * But this avoids a conditional branch, and the writes will + * combine in the cache anyway + */ + + d += tailsize * d_decision_t_size ; /* Look past tail */ + int retval; + int dif = tailsize - (d_k - 1); + //printf("break, %d, %d\n", dif, (nbits+dif)%d_framebits); + p_decision_t dec; + while(nbits-- > d_framebits - (d_k - 1)) { + int k; + dec.t = &d[nbits * d_decision_t_size]; + k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1; + + endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT)); + //data[((nbits+dif)%nbits)>>3] = endstate>>d_SUBSHIFT; + //printf("%d, %d\n", k, (nbits+dif)%d_framebits); + data[((nbits+dif)%d_framebits)] = k; + + retval = endstate; + } + nbits += 1; + + while(nbits-- != 0) { + int k; + + dec.t = &d[nbits * d_decision_t_size]; + + k = (dec.w[(endstate>>d_ADDSHIFT)/32] >> ((endstate>>d_ADDSHIFT)%32)) & 1; + + endstate = (endstate >> 1) | (k << (d_k-2+d_ADDSHIFT)); + data[((nbits+dif)%d_framebits)] = k; + } + //printf("%d, %d, %d, %d, %d, %d, %d, %d\n", data[4095],data[4094],data[4093],data[4092],data[4091],data[4090],data[4089],data[4088]); + + + return retval >> d_ADDSHIFT; +} + + +#if LV_HAVE_SSE3 + +#include <pmmintrin.h> +#include <emmintrin.h> +#include <xmmintrin.h> +#include <mmintrin.h> +#include <stdio.h> + + + + + +static inline void volk_8u_conv_k7_r2puppet_8u_spiral(unsigned char* syms, unsigned char* dec, unsigned int framebits) { + + + static int once = 1; + int d_numstates = (1 << 6); + int rate = 2; + static unsigned char* D; + static unsigned char* Y; + static unsigned char* X; + static unsigned int excess = 6; + static unsigned char* Branchtab; + static unsigned char Partab[256]; + + int d_polys[2] = {79, 109}; + + + if(once) { + + X = (unsigned char*)volk_malloc(2*d_numstates, volk_get_alignment()); + Y = X + d_numstates; + Branchtab = (unsigned char*)volk_malloc(d_numstates/2*rate, volk_get_alignment()); + D = (unsigned char*)volk_malloc((d_numstates/8) * (framebits + 6), volk_get_alignment()); + int state, i; + int cnt,ti; + + /* Initialize parity lookup table */ + for(i=0;i<256;i++){ + cnt = 0; + ti = i; + while(ti){ + if(ti & 1) + cnt++; + ti >>= 1; + } + Partab[i] = cnt & 1; + } + /* Initialize the branch table */ + for(state=0;state < d_numstates/2;state++){ + for(i=0; i<rate; i++){ + Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^ parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0; + } + } + + once = 0; + } + + //unbias the old_metrics + memset(X, 31, d_numstates); + + volk_8u_x4_conv_k7_r2_8u_spiral(Y, X, syms, D, framebits/2 - excess, excess, Branchtab); + + unsigned int min = X[0]; + int i = 0, state = 0; + for(i = 0; i < (d_numstates); ++i) { + if(X[i] < min) { + min = X[i]; + state = i; + } + } + + chainback_viterbi(dec, framebits/2 -excess, state, excess, D); + + return; +} + +#endif /*LV_HAVE_SSE3*/ + + + + + +#if LV_HAVE_GENERIC + + +static inline void volk_8u_conv_k7_r2puppet_8u_generic(unsigned char* syms, unsigned char* dec, unsigned int framebits) { + + + + static int once = 1; + int d_numstates = (1 << 6); + int rate = 2; + static unsigned char* Y; + static unsigned char* X; + static unsigned char* D; + static unsigned int excess = 6; + static unsigned char* Branchtab; + static unsigned char Partab[256]; + + int d_polys[2] = {79, 109}; + + + if(once) { + + X = (unsigned char*)volk_malloc(2*d_numstates, volk_get_alignment()); + Y = X + d_numstates; + Branchtab = (unsigned char*)volk_malloc(d_numstates/2*rate, volk_get_alignment()); + D = (unsigned char*)volk_malloc((d_numstates/8) * (framebits + 6), volk_get_alignment()); + + int state, i; + int cnt,ti; + + /* Initialize parity lookup table */ + for(i=0;i<256;i++){ + cnt = 0; + ti = i; + while(ti){ + if(ti & 1) + cnt++; + ti >>= 1; + } + Partab[i] = cnt & 1; + } + /* Initialize the branch table */ + for(state=0;state < d_numstates/2;state++){ + for(i=0; i<rate; i++){ + Branchtab[i*d_numstates/2+state] = (d_polys[i] < 0) ^ parity((2*state) & abs(d_polys[i]), Partab) ? 255 : 0; + } + } + + once = 0; + } + + + + + //unbias the old_metrics + memset(X, 31, d_numstates); + + volk_8u_x4_conv_k7_r2_8u_generic(Y, X, syms, D, framebits/2 - excess, excess, Branchtab); + + unsigned int min = X[0]; + int i = 0, state = 0; + for(i = 0; i < (d_numstates); ++i) { + if(X[i] < min) { + min = X[i]; + state = i; + } + } + + chainback_viterbi(dec, framebits/2 -excess, state, excess, D); + + return; + + +} + +#endif /* LV_HAVE_GENERIC */ + +#endif /*INCLUDED_volk_8u_conv_k7_r2puppet_8u_H*/ diff --git a/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h b/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h new file mode 100644 index 0000000000..dfed73b634 --- /dev/null +++ b/volk/kernels/volk/volk_8u_x4_conv_k7_r2_8u.h @@ -0,0 +1,396 @@ +#ifndef INCLUDED_volk_8u_x4_conv_k7_r2_8u_H +#define INCLUDED_volk_8u_x4_conv_k7_r2_8u_H + + + +typedef union { + unsigned char/*DECISIONTYPE*/ t[64/*NUMSTATES*//8/*DECISIONTYPE_BITSIZE*/]; + unsigned int w[64/*NUMSTATES*//32]; + unsigned short s[64/*NUMSTATES*//16]; + unsigned char c[64/*NUMSTATES*//8]; +} decision_t __attribute__ ((aligned (16))); + +static inline void renormalize(unsigned char* X, unsigned char threshold){ + int NUMSTATES = 64; + int i; + + unsigned char min=X[0]; + //if(min > threshold) { + for(i=0;i<NUMSTATES;i++) + if (min>X[i]) + min=X[i]; + for(i=0;i<NUMSTATES;i++) + X[i]-=min; + //} +} + + + +//helper BFLY for GENERIC version +static inline void BFLY(int i, int s, unsigned char * syms, unsigned char *Y, unsigned char *X, decision_t * d, unsigned char* Branchtab) { + int j, decision0, decision1; + unsigned char metric,m0,m1,m2,m3; + + int NUMSTATES = 64; + int RATE = 2; + int METRICSHIFT = 1; + int PRECISIONSHIFT = 2; + + + + metric =0; + for(j=0;j<RATE;j++) + metric += (Branchtab[i+j*NUMSTATES/2] ^ syms[s*RATE+j])>>METRICSHIFT ; + metric=metric>>PRECISIONSHIFT; + + unsigned char max = ((RATE*((256 -1)>>METRICSHIFT))>>PRECISIONSHIFT); + + m0 = X[i] + metric; + m1 = X[i+NUMSTATES/2] + (max - metric); + m2 = X[i] + (max - metric); + m3 = X[i+NUMSTATES/2] + metric; + + decision0 = (signed int)(m0-m1) > 0; + decision1 = (signed int)(m2-m3) > 0; + + Y[2*i] = decision0 ? m1 : m0; + Y[2*i+1] = decision1 ? m3 : m2; + + d->w[i/(sizeof(unsigned int)*8/2)+s*(sizeof(decision_t)/sizeof(unsigned int))] |= + (decision0|decision1<<1) << ((2*i)&(sizeof(unsigned int)*8-1)); +} + + +#if LV_HAVE_SSE3 + +#include <pmmintrin.h> +#include <emmintrin.h> +#include <xmmintrin.h> +#include <mmintrin.h> +#include <stdio.h> + +static inline void volk_8u_x4_conv_k7_r2_8u_spiral(unsigned char* Y, unsigned char* X, unsigned char* syms, unsigned char* dec, unsigned int framebits, unsigned int excess, unsigned char* Branchtab) { + unsigned int i9; + for(i9 = 0; i9 < ((framebits + excess) >> 1); i9++) { + unsigned char a75, a81; + int a73, a92; + short int s20, s21, s26, s27; + unsigned char *a74, *a80, *b6; + short int *a110, *a111, *a91, *a93, *a94; + __m128i *a102, *a112, *a113, *a71, *a72, *a77, *a83 + , *a95, *a96, *a97, *a98, *a99; + __m128i a105, a106, a86, a87; + __m128i a100, a101, a103, a104, a107, a108, a109 + , a76, a78, a79, a82, a84, a85, a88, a89 + , a90, d10, d11, d12, d9, m23, m24, m25 + , m26, m27, m28, m29, m30, s18, s19, s22 + , s23, s24, s25, s28, s29, t13, t14, t15 + , t16, t17, t18; + a71 = ((__m128i *) X); + s18 = *(a71); + a72 = (a71 + 2); + s19 = *(a72); + a73 = (4 * i9); + a74 = (syms + a73); + a75 = *(a74); + a76 = _mm_set1_epi8(a75); + a77 = ((__m128i *) Branchtab); + a78 = *(a77); + a79 = _mm_xor_si128(a76, a78); + b6 = (a73 + syms); + a80 = (b6 + 1); + a81 = *(a80); + a82 = _mm_set1_epi8(a81); + a83 = (a77 + 2); + a84 = *(a83); + a85 = _mm_xor_si128(a82, a84); + t13 = _mm_avg_epu8(a79,a85); + a86 = ((__m128i ) t13); + a87 = _mm_srli_epi16(a86, 2); + a88 = ((__m128i ) a87); + t14 = _mm_and_si128(a88, _mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63)); + t15 = _mm_subs_epu8(_mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63), t14); + m23 = _mm_adds_epu8(s18, t14); + m24 = _mm_adds_epu8(s19, t15); + m25 = _mm_adds_epu8(s18, t15); + m26 = _mm_adds_epu8(s19, t14); + a89 = _mm_min_epu8(m24, m23); + d9 = _mm_cmpeq_epi8(a89, m24); + a90 = _mm_min_epu8(m26, m25); + d10 = _mm_cmpeq_epi8(a90, m26); + s20 = _mm_movemask_epi8(_mm_unpacklo_epi8(d9,d10)); + a91 = ((short int *) dec); + a92 = (8 * i9); + a93 = (a91 + a92); + *(a93) = s20; + s21 = _mm_movemask_epi8(_mm_unpackhi_epi8(d9,d10)); + a94 = (a93 + 1); + *(a94) = s21; + s22 = _mm_unpacklo_epi8(a89, a90); + s23 = _mm_unpackhi_epi8(a89, a90); + a95 = ((__m128i *) Y); + *(a95) = s22; + a96 = (a95 + 1); + *(a96) = s23; + a97 = (a71 + 1); + s24 = *(a97); + a98 = (a71 + 3); + s25 = *(a98); + a99 = (a77 + 1); + a100 = *(a99); + a101 = _mm_xor_si128(a76, a100); + a102 = (a77 + 3); + a103 = *(a102); + a104 = _mm_xor_si128(a82, a103); + t16 = _mm_avg_epu8(a101,a104); + a105 = ((__m128i ) t16); + a106 = _mm_srli_epi16(a105, 2); + a107 = ((__m128i ) a106); + t17 = _mm_and_si128(a107, _mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63)); + t18 = _mm_subs_epu8(_mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63), t17); + m27 = _mm_adds_epu8(s24, t17); + m28 = _mm_adds_epu8(s25, t18); + m29 = _mm_adds_epu8(s24, t18); + m30 = _mm_adds_epu8(s25, t17); + a108 = _mm_min_epu8(m28, m27); + d11 = _mm_cmpeq_epi8(a108, m28); + a109 = _mm_min_epu8(m30, m29); + d12 = _mm_cmpeq_epi8(a109, m30); + s26 = _mm_movemask_epi8(_mm_unpacklo_epi8(d11,d12)); + a110 = (a93 + 2); + *(a110) = s26; + s27 = _mm_movemask_epi8(_mm_unpackhi_epi8(d11,d12)); + a111 = (a93 + 3); + *(a111) = s27; + s28 = _mm_unpacklo_epi8(a108, a109); + s29 = _mm_unpackhi_epi8(a108, a109); + a112 = (a95 + 2); + *(a112) = s28; + a113 = (a95 + 3); + *(a113) = s29; + if ((((unsigned char *) Y)[0]>210)) { + __m128i m5, m6; + m5 = ((__m128i *) Y)[0]; + m5 = _mm_min_epu8(m5, ((__m128i *) Y)[1]); + m5 = _mm_min_epu8(m5, ((__m128i *) Y)[2]); + m5 = _mm_min_epu8(m5, ((__m128i *) Y)[3]); + __m128i m7; + m7 = _mm_min_epu8(_mm_srli_si128(m5, 8), m5); + m7 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m7, 32)), ((__m128i ) m7))); + m7 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m7, 16)), ((__m128i ) m7))); + m7 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m7, 8)), ((__m128i ) m7))); + m7 = _mm_unpacklo_epi8(m7, m7); + m7 = _mm_shufflelo_epi16(m7, _MM_SHUFFLE(0, 0, 0, 0)); + m6 = _mm_unpacklo_epi64(m7, m7); + ((__m128i *) Y)[0] = _mm_subs_epu8(((__m128i *) Y)[0], m6); + ((__m128i *) Y)[1] = _mm_subs_epu8(((__m128i *) Y)[1], m6); + ((__m128i *) Y)[2] = _mm_subs_epu8(((__m128i *) Y)[2], m6); + ((__m128i *) Y)[3] = _mm_subs_epu8(((__m128i *) Y)[3], m6); + } + unsigned char a188, a194; + int a186, a205; + short int s48, s49, s54, s55; + unsigned char *a187, *a193, *b15; + short int *a204, *a206, *a207, *a223, *a224, *b16; + __m128i *a184, *a185, *a190, *a196, *a208, *a209, *a210 + , *a211, *a212, *a215, *a225, *a226; + __m128i a199, a200, a218, a219; + __m128i a189, a191, a192, a195, a197, a198, a201 + , a202, a203, a213, a214, a216, a217, a220, a221 + , a222, d17, d18, d19, d20, m39, m40, m41 + , m42, m43, m44, m45, m46, s46, s47, s50 + , s51, s52, s53, s56, s57, t25, t26, t27 + , t28, t29, t30; + a184 = ((__m128i *) Y); + s46 = *(a184); + a185 = (a184 + 2); + s47 = *(a185); + a186 = (4 * i9); + b15 = (a186 + syms); + a187 = (b15 + 2); + a188 = *(a187); + a189 = _mm_set1_epi8(a188); + a190 = ((__m128i *) Branchtab); + a191 = *(a190); + a192 = _mm_xor_si128(a189, a191); + a193 = (b15 + 3); + a194 = *(a193); + a195 = _mm_set1_epi8(a194); + a196 = (a190 + 2); + a197 = *(a196); + a198 = _mm_xor_si128(a195, a197); + t25 = _mm_avg_epu8(a192,a198); + a199 = ((__m128i ) t25); + a200 = _mm_srli_epi16(a199, 2); + a201 = ((__m128i ) a200); + t26 = _mm_and_si128(a201, _mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63)); + t27 = _mm_subs_epu8(_mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63), t26); + m39 = _mm_adds_epu8(s46, t26); + m40 = _mm_adds_epu8(s47, t27); + m41 = _mm_adds_epu8(s46, t27); + m42 = _mm_adds_epu8(s47, t26); + a202 = _mm_min_epu8(m40, m39); + d17 = _mm_cmpeq_epi8(a202, m40); + a203 = _mm_min_epu8(m42, m41); + d18 = _mm_cmpeq_epi8(a203, m42); + s48 = _mm_movemask_epi8(_mm_unpacklo_epi8(d17,d18)); + a204 = ((short int *) dec); + a205 = (8 * i9); + b16 = (a204 + a205); + a206 = (b16 + 4); + *(a206) = s48; + s49 = _mm_movemask_epi8(_mm_unpackhi_epi8(d17,d18)); + a207 = (b16 + 5); + *(a207) = s49; + s50 = _mm_unpacklo_epi8(a202, a203); + s51 = _mm_unpackhi_epi8(a202, a203); + a208 = ((__m128i *) X); + *(a208) = s50; + a209 = (a208 + 1); + *(a209) = s51; + a210 = (a184 + 1); + s52 = *(a210); + a211 = (a184 + 3); + s53 = *(a211); + a212 = (a190 + 1); + a213 = *(a212); + a214 = _mm_xor_si128(a189, a213); + a215 = (a190 + 3); + a216 = *(a215); + a217 = _mm_xor_si128(a195, a216); + t28 = _mm_avg_epu8(a214,a217); + a218 = ((__m128i ) t28); + a219 = _mm_srli_epi16(a218, 2); + a220 = ((__m128i ) a219); + t29 = _mm_and_si128(a220, _mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63)); + t30 = _mm_subs_epu8(_mm_set_epi8(63, 63, 63, 63, 63, 63, 63 + , 63, 63, 63, 63, 63, 63, 63, 63 + , 63), t29); + m43 = _mm_adds_epu8(s52, t29); + m44 = _mm_adds_epu8(s53, t30); + m45 = _mm_adds_epu8(s52, t30); + m46 = _mm_adds_epu8(s53, t29); + a221 = _mm_min_epu8(m44, m43); + d19 = _mm_cmpeq_epi8(a221, m44); + a222 = _mm_min_epu8(m46, m45); + d20 = _mm_cmpeq_epi8(a222, m46); + s54 = _mm_movemask_epi8(_mm_unpacklo_epi8(d19,d20)); + a223 = (b16 + 6); + *(a223) = s54; + s55 = _mm_movemask_epi8(_mm_unpackhi_epi8(d19,d20)); + a224 = (b16 + 7); + *(a224) = s55; + s56 = _mm_unpacklo_epi8(a221, a222); + s57 = _mm_unpackhi_epi8(a221, a222); + a225 = (a208 + 2); + *(a225) = s56; + a226 = (a208 + 3); + *(a226) = s57; + if ((((unsigned char *) X)[0]>210)) { + __m128i m12, m13; + m12 = ((__m128i *) X)[0]; + m12 = _mm_min_epu8(m12, ((__m128i *) X)[1]); + m12 = _mm_min_epu8(m12, ((__m128i *) X)[2]); + m12 = _mm_min_epu8(m12, ((__m128i *) X)[3]); + __m128i m14; + m14 = _mm_min_epu8(_mm_srli_si128(m12, 8), m12); + m14 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m14, 32)), ((__m128i ) m14))); + m14 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m14, 16)), ((__m128i ) m14))); + m14 = ((__m128i ) _mm_min_epu8(((__m128i ) _mm_srli_epi64(m14, 8)), ((__m128i ) m14))); + m14 = _mm_unpacklo_epi8(m14, m14); + m14 = _mm_shufflelo_epi16(m14, _MM_SHUFFLE(0, 0, 0, 0)); + m13 = _mm_unpacklo_epi64(m14, m14); + ((__m128i *) X)[0] = _mm_subs_epu8(((__m128i *) X)[0], m13); + ((__m128i *) X)[1] = _mm_subs_epu8(((__m128i *) X)[1], m13); + ((__m128i *) X)[2] = _mm_subs_epu8(((__m128i *) X)[2], m13); + ((__m128i *) X)[3] = _mm_subs_epu8(((__m128i *) X)[3], m13); + } + } + + renormalize(X, 210); + + /*int ch; + for(ch = 0; ch < 64; ch++) { + printf("%d,", X[ch]); + } + printf("\n");*/ + + unsigned int j; + for(j=0; j < (framebits + excess) % 2; ++j) { + int i; + for(i=0;i<64/2;i++){ + BFLY(i, (((framebits+excess) >> 1) << 1) + j , syms, Y, X, (decision_t *)dec, Branchtab); + } + + + renormalize(Y, 210); + + /*printf("\n"); + for(ch = 0; ch < 64; ch++) { + printf("%d,", Y[ch]); + } + printf("\n");*/ + + } + /*skip*/ + return; +} + +#endif /*LV_HAVE_SSE3*/ + + + + + + + +#if LV_HAVE_GENERIC + + +static inline void volk_8u_x4_conv_k7_r2_8u_generic(unsigned char* Y, unsigned char* X, unsigned char* syms, unsigned char* dec, unsigned int framebits, unsigned int excess, unsigned char* Branchtab) { + int nbits = framebits + excess; + int NUMSTATES = 64; + int RENORMALIZE_THRESHOLD = 210; + + + int s,i; + + + + for (s=0;s<nbits;s++){ + void *tmp; + for(i=0;i<NUMSTATES/2;i++){ + BFLY(i, s, syms, Y, X, (decision_t *)dec, Branchtab); + } + + + + renormalize(Y, RENORMALIZE_THRESHOLD); + + /// Swap pointers to old and new metrics + tmp = (void *)X; + X = Y; + Y = (unsigned char*)tmp; + } + + + return; +} + +#endif /* LV_HAVE_GENERIC */ + +#endif /*INCLUDED_volk_8u_x4_conv_k7_r2_8u_H*/ diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index e25c5c65c7..d72eb726e4 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -472,6 +472,19 @@ install(TARGETS volk RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file ) +if(ENABLE_STATIC_LIBS) + add_library(volk_static STATIC ${volk_sources}) + + if(NOT WIN32) + set_target_properties(volk_static + PROPERTIES OUTPUT_NAME volk) + endif(NOT WIN32) + + install(TARGETS volk_static + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel" # .lib file + ) +endif(ENABLE_STATIC_LIBS) + ######################################################################## # Build the QA test application ######################################################################## @@ -495,4 +508,3 @@ if(Boost_FOUND) add_test(qa_volk_test_all test_all) endif(Boost_FOUND) - diff --git a/volk/lib/testqa.cc b/volk/lib/testqa.cc index f97a6462e4..fc54b35a72 100644 --- a/volk/lib/testqa.cc +++ b/volk/lib/testqa.cc @@ -1,3 +1,25 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-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. + */ + #include "qa_utils.h" #include <volk/volk.h> #include <boost/test/unit_test.hpp> @@ -88,4 +110,6 @@ VOLK_RUN_TESTS(volk_32f_x2_multiply_32f, 1e-4, 0, 20462, 1); VOLK_RUN_TESTS(volk_32fc_s32fc_multiply_32fc, 1e-4, 0, 20462, 1); VOLK_RUN_TESTS(volk_32f_s32f_multiply_32f, 1e-4, 0, 20462, 1); VOLK_RUN_TESTS(volk_32fc_s32fc_rotatorpuppet_32fc, 1e-3, (lv_32fc_t)lv_cmake(0.953939201, 0.3), 20462, 1); +VOLK_RUN_TESTS(volk_8u_conv_k7_r2puppet_8u, 0, 0, 2060, 1); VOLK_RUN_TESTS(volk_32f_invsqrt_32f, 1e-2, 0, 20462, 1); +VOLK_RUN_TESTS(volk_32f_binary_slicer_32i, 0, 0, 20462, 1); diff --git a/volk/lib/volk_rank_archs.c b/volk/lib/volk_rank_archs.c index 6ab013f269..0e98ac0709 100644 --- a/volk/lib/volk_rank_archs.c +++ b/volk/lib/volk_rank_archs.c @@ -74,6 +74,13 @@ int volk_rank_archs( prefs_loaded = 1; } + // If we've defined VOLK_GENERIC to be anything, always return the + // 'generic' kernel. Used in GR's QA code. + char *gen_env = getenv("VOLK_GENERIC"); + if(gen_env) { + return volk_get_index(impl_names, n_impls, "generic"); + } + //now look for the function name in the prefs list for(i = 0; i < n_arch_prefs; i++) { |