From 630cd06cb33d628fa6426866f006580aad30f84b Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 5 May 2012 13:21:38 -0700 Subject: blocks: adds new top-level component gr-blocks with first block gr::blocks::add_XX --- gr-blocks/include/blocks/CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++ gr-blocks/include/blocks/add_XX.h.t | 53 +++++++++++++++++++++ gr-blocks/include/blocks/add_ff.h | 49 ++++++++++++++++++++ gr-blocks/include/blocks/api.h | 33 +++++++++++++ 4 files changed, 217 insertions(+) create mode 100644 gr-blocks/include/blocks/CMakeLists.txt create mode 100644 gr-blocks/include/blocks/add_XX.h.t create mode 100644 gr-blocks/include/blocks/add_ff.h create mode 100644 gr-blocks/include/blocks/api.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt new file mode 100644 index 000000000..f11db5fc0 --- /dev/null +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -0,0 +1,82 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# generate helper scripts to expand templated files +######################################################################## +include(GrPython) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " +#!${PYTHON_EXECUTABLE} + +import sys, os, re +sys.path.append('${GR_CORE_PYTHONPATH}') +os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}' +os.chdir('${CMAKE_CURRENT_BINARY_DIR}') + +if __name__ == '__main__': + import build_utils + root, inp = sys.argv[1:3] + for sig in sys.argv[3:]: + name = re.sub ('X+', sig, root) + d = build_utils.standard_dict(name, sig, 'blocks') + build_utils.expand_template(d, inp) + +") + +macro(expand_h root) + #make a list of all the generated files + unset(expanded_files_h) + foreach(sig ${ARGN}) + 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} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t + COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} + ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py + ${root} ${root}.h.t ${ARGN} + ) + + #install rules for the generated h files + list(APPEND generated_includes ${expanded_files_h}) +endmacro(expand_h) + +######################################################################## +# Invoke macro to generate various sources +######################################################################## +expand_h(add_XX ss ii cc) + +add_custom_target(blocks_generated_includes DEPENDS + ${generated_includes} +) + +######################################################################## +# Install header files +######################################################################## +install(FILES + ${generated_includes} + api.h + add_ff.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks + COMPONENT "blocks_devel" +) diff --git a/gr-blocks/include/blocks/add_XX.h.t b/gr-blocks/include/blocks/add_XX.h.t new file mode 100644 index 000000000..607b82066 --- /dev/null +++ b/gr-blocks/include/blocks/add_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2009,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = sum (input_0, input_1, ...) + * \ingroup math_blk + * + * Add across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/add_ff.h b/gr-blocks/include/blocks/add_ff.h new file mode 100644 index 000000000..22d382c4a --- /dev/null +++ b/gr-blocks/include/blocks/add_ff.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_ADD_FF_H +#define INCLUDED_BLOCKS_ADD_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + class BLOCKS_API add_ff : virtual public gr_sync_block + { + public: + + // gr::blocks::add_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Add streams of complex values + * \ingroup math_blk + */ + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_ADD_FF_H */ diff --git a/gr-blocks/include/blocks/api.h b/gr-blocks/include/blocks/api.h new file mode 100644 index 000000000..45fbc0d21 --- /dev/null +++ b/gr-blocks/include/blocks/api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_API_H +#define INCLUDED_BLOCKS_API_H + +#include + +#ifdef gnuradio_blocks_EXPORTS +# define BLOCKS_API __GR_ATTR_EXPORT +#else +# define BLOCKS_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_BLOCKS_API_H */ -- cgit From 9752fabd851d05c77b0526e7a28c9c7099e54fc6 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Fri, 8 Jun 2012 14:48:46 -0700 Subject: blocks: added blocks_add_const_xx --- gr-blocks/include/blocks/CMakeLists.txt | 3 +- gr-blocks/include/blocks/add_const_XX.h.t | 65 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 gr-blocks/include/blocks/add_const_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index f11db5fc0..68002588b 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -64,7 +64,8 @@ endmacro(expand_h) ######################################################################## # Invoke macro to generate various sources ######################################################################## -expand_h(add_XX ss ii cc) +expand_h(add_XX ss ii cc) +expand_h(add_const_XX ss ii ff cc) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} diff --git a/gr-blocks/include/blocks/add_const_XX.h.t b/gr-blocks/include/blocks/add_const_XX.h.t new file mode 100644 index 000000000..ab7952033 --- /dev/null +++ b/gr-blocks/include/blocks/add_const_XX.h.t @@ -0,0 +1,65 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input + constant + * \ingroup math_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + /*! + * \brief Create an instance of @NAME@ + * \param k additive constant + */ + static sptr make(@O_TYPE@ k); + + /*! + * \brief Return additive constant + */ + virtual @O_TYPE@ k() const = 0; + + /*! + * \brief Set additive constant + */ + virtual void set_k(@O_TYPE@ k) = 0; + }; + + } +} + +#endif /* @GUARD_NAME */ -- cgit From 6a2d514fab10f692d49f724d1d09afce1c603fa0 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 14 Jun 2012 10:09:14 -0700 Subject: blocks: added multiply_xx, some cleanup on add_xx --- gr-blocks/include/blocks/CMakeLists.txt | 3 ++ gr-blocks/include/blocks/add_ff.h | 3 +- gr-blocks/include/blocks/multiply_XX.h.t | 53 ++++++++++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_cc.h | 50 ++++++++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_ff.h | 50 ++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 gr-blocks/include/blocks/multiply_XX.h.t create mode 100644 gr-blocks/include/blocks/multiply_cc.h create mode 100644 gr-blocks/include/blocks/multiply_ff.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 68002588b..77dd91e28 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -66,6 +66,7 @@ endmacro(expand_h) ######################################################################## expand_h(add_XX ss ii cc) expand_h(add_const_XX ss ii ff cc) +expand_h(multiply_XX ss ii) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} @@ -78,6 +79,8 @@ install(FILES ${generated_includes} api.h add_ff.h + multiply_cc.h + multiply_ff.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/add_ff.h b/gr-blocks/include/blocks/add_ff.h index 22d382c4a..1e7350c1b 100644 --- a/gr-blocks/include/blocks/add_ff.h +++ b/gr-blocks/include/blocks/add_ff.h @@ -37,7 +37,8 @@ namespace gr { typedef boost::shared_ptr sptr; /*! - * \brief Add streams of complex values + * \brief Add streams of float values + * \param vlen Vector length * \ingroup math_blk */ static sptr make(size_t vlen=1); diff --git a/gr-blocks/include/blocks/multiply_XX.h.t b/gr-blocks/include/blocks/multiply_XX.h.t new file mode 100644 index 000000000..47ed3746c --- /dev/null +++ b/gr-blocks/include/blocks/multiply_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004, 2009, 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = prod (input_0, input_1, ...) + * \ingroup math_blk + * + * Multiply across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/multiply_cc.h b/gr-blocks/include/blocks/multiply_cc.h new file mode 100644 index 000000000..559fcda57 --- /dev/null +++ b/gr-blocks/include/blocks/multiply_cc.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_MULTIPLY_CC_H +#define INCLUDED_GR_MULTIPLY_CC_H + +#include +#include + +namespace gr { + namespace blocks { + + class BLOCKS_API multiply_cc : virtual public gr_sync_block + { + public: + + // gr::blocks::multiply_cc::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Multiply streams of complex values + * \param vlen Vector length + * \ingroup math_blk + */ + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_MULTIPLY_CC_H */ diff --git a/gr-blocks/include/blocks/multiply_ff.h b/gr-blocks/include/blocks/multiply_ff.h new file mode 100644 index 000000000..683b540bb --- /dev/null +++ b/gr-blocks/include/blocks/multiply_ff.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_MULTIPLY_FF_H +#define INCLUDED_GR_MULTIPLY_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + class BLOCKS_API multiply_ff : virtual public gr_sync_block + { + public: + + // gr::blocks::multiply_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Multiply streams of float values + * \param vlen Vector length + * \ingroup math_blk + */ + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_MULTIPLY_FF_H */ -- cgit From 59f49f4663d5795adc7d7cc573d24c0747afad0f Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 16 Jun 2012 12:07:58 -0700 Subject: blocks: completed transition of add and multiply blocks * gr::blocks::add_* * gr::blocks::add_const_* * gr::blocks::add_const_v* * gr::blocks::multiply_* * gr::blocks::multiply_const_* * gr::blocks::multiply_const_v* Each of these has ss, ii, ff, and cc versions, for a total of 24 blocks. --- gr-blocks/include/blocks/CMakeLists.txt | 11 +++-- gr-blocks/include/blocks/add_const_XX.h.t | 2 +- gr-blocks/include/blocks/add_const_vXX.h.t | 66 +++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_const_XX.h.t | 66 +++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_const_cc.h | 66 +++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_const_ff.h | 66 +++++++++++++++++++++++++ gr-blocks/include/blocks/multiply_const_vXX.h.t | 66 +++++++++++++++++++++++++ 7 files changed, 339 insertions(+), 4 deletions(-) create mode 100644 gr-blocks/include/blocks/add_const_vXX.h.t create mode 100644 gr-blocks/include/blocks/multiply_const_XX.h.t create mode 100644 gr-blocks/include/blocks/multiply_const_cc.h create mode 100644 gr-blocks/include/blocks/multiply_const_ff.h create mode 100644 gr-blocks/include/blocks/multiply_const_vXX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 77dd91e28..79761e496 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -64,9 +64,12 @@ endmacro(expand_h) ######################################################################## # Invoke macro to generate various sources ######################################################################## -expand_h(add_XX ss ii cc) -expand_h(add_const_XX ss ii ff cc) -expand_h(multiply_XX ss ii) +expand_h(add_XX ss ii cc) +expand_h(add_const_XX ss ii ff cc) +expand_h(add_const_vXX ss ii ff cc) +expand_h(multiply_XX ss ii) +expand_h(multiply_const_XX ss ii) +expand_h(multiply_const_vXX ss ii ff cc) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} @@ -81,6 +84,8 @@ install(FILES add_ff.h multiply_cc.h multiply_ff.h + multiply_const_cc.h + multiply_const_ff.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/add_const_XX.h.t b/gr-blocks/include/blocks/add_const_XX.h.t index ab7952033..df968feac 100644 --- a/gr-blocks/include/blocks/add_const_XX.h.t +++ b/gr-blocks/include/blocks/add_const_XX.h.t @@ -62,4 +62,4 @@ namespace gr { } } -#endif /* @GUARD_NAME */ +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/add_const_vXX.h.t b/gr-blocks/include/blocks/add_const_vXX.h.t new file mode 100644 index 000000000..c4cd49fa4 --- /dev/null +++ b/gr-blocks/include/blocks/add_const_vXX.h.t @@ -0,0 +1,66 @@ +/* -*- 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, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input + constant vector + * \ingroup math_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + /*! + * \brief Create an instance of @NAME@ + * \param k additive constant vector + */ + static sptr make(std::vector<@O_TYPE@> k); + + /*! + * \brief Return additive constant vector + */ + virtual std::vector<@O_TYPE@> k() const = 0; + + /*! + * \brief Set additive constant vector + */ + virtual void set_k(std::vector<@O_TYPE@> k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/multiply_const_XX.h.t b/gr-blocks/include/blocks/multiply_const_XX.h.t new file mode 100644 index 000000000..a7cd3a858 --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_XX.h.t @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input * constant + * \ingroup math_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + /*! + * \brief Create an instance of @NAME@ + * \param k multiplicative constant + */ + static sptr make(@O_TYPE@ k); + + /*! + * \brief Return multiplicative constant + */ + virtual @O_TYPE@ k() const = 0; + + /*! + * \brief Set multiplicative constant + */ + virtual void set_k(@O_TYPE@ k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME */ diff --git a/gr-blocks/include/blocks/multiply_const_cc.h b/gr-blocks/include/blocks/multiply_const_cc.h new file mode 100644 index 000000000..032a765a4 --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_cc.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef INCLUDED_MULTIPLY_CONST_CC_H +#define INCLUDED_MULTIPLY_CONST_CC_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input * complex constant + * \ingroup math_blk + */ + class BLOCKS_API multiply_const_cc : virtual public gr_sync_block + { + + public: + + // gr::blocks::multiply_const_cc::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Create an instance of multiply_const_cc + * \param k complex multiplicative constant + */ + static sptr make(gr_complex k, size_t vlen=1); + + /*! + * \brief Return complex multiplicative constant + */ + virtual gr_complex k() const = 0; + + /*! + * \brief Set complex multiplicative constant + */ + virtual void set_k(gr_complex k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_MULTIPLY_CONST_CC_H */ diff --git a/gr-blocks/include/blocks/multiply_const_ff.h b/gr-blocks/include/blocks/multiply_const_ff.h new file mode 100644 index 000000000..e755f59bf --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_ff.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef INCLUDED_MULTIPLY_CONST_FF_H +#define INCLUDED_MULTIPLY_CONST_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input * real constant + * \ingroup math_blk + */ + class BLOCKS_API multiply_const_ff : virtual public gr_sync_block + { + + public: + + // gr::blocks::multiply_const_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Create an instance of multiply_const_ff + * \param k real multiplicative constant + */ + static sptr make(float k, size_t vlen=1); + + /*! + * \brief Return real multiplicative constant + */ + virtual float k() const = 0; + + /*! + * \brief Set real multiplicative constant + */ + virtual void set_k(float k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_MULTIPLY_CONST_FF_H */ diff --git a/gr-blocks/include/blocks/multiply_const_vXX.h.t b/gr-blocks/include/blocks/multiply_const_vXX.h.t new file mode 100644 index 000000000..4cd479f00 --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_vXX.h.t @@ -0,0 +1,66 @@ +/* -*- 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, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input * constant vector (element-wise) + * \ingroup math_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + /*! + * \brief Create an instance of @NAME@ + * \param k multiplicative constant vector + */ + static sptr make(std::vector<@O_TYPE@> k); + + /*! + * \brief Return multiplicative constant vector + */ + virtual std::vector<@O_TYPE@> k() const = 0; + + /*! + * \brief Set multiplicative constant vector + */ + virtual void set_k(std::vector<@O_TYPE@> k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 24962cd24c623c6822733fed4c911a4adabbdd57 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 18 Jun 2012 12:28:48 -0700 Subject: blocks: added div_XX and sub_XX blocks --- gr-blocks/include/blocks/CMakeLists.txt | 2 ++ gr-blocks/include/blocks/divide_XX.h.t | 53 +++++++++++++++++++++++++++++++++ gr-blocks/include/blocks/sub_XX.h.t | 53 +++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 gr-blocks/include/blocks/divide_XX.h.t create mode 100644 gr-blocks/include/blocks/sub_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 79761e496..c54e10fac 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -67,9 +67,11 @@ endmacro(expand_h) expand_h(add_XX ss ii cc) expand_h(add_const_XX ss ii ff cc) expand_h(add_const_vXX ss ii ff cc) +expand_h(divide_XX ss ii ff cc) expand_h(multiply_XX ss ii) expand_h(multiply_const_XX ss ii) expand_h(multiply_const_vXX ss ii ff cc) +expand_h(sub_XX ss ii ff cc) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} diff --git a/gr-blocks/include/blocks/divide_XX.h.t b/gr-blocks/include/blocks/divide_XX.h.t new file mode 100644 index 000000000..9a382e4a0 --- /dev/null +++ b/gr-blocks/include/blocks/divide_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2009,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input_0 / input_1 / input_x ...) + * \ingroup math_blk + * + * Divide across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/sub_XX.h.t b/gr-blocks/include/blocks/sub_XX.h.t new file mode 100644 index 000000000..8202ac54b --- /dev/null +++ b/gr-blocks/include/blocks/sub_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2009,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input_0 - input_1 - ...) + * \ingroup math_blk + * + * Subtract across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 439b427e80ebc767db6e4e732213d89c2a6febd4 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 19 Jun 2012 10:00:28 -0700 Subject: blocks: added gr::blocks::char_to_float --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/char_to_float.h | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/char_to_float.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index c54e10fac..bfdde9701 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -84,6 +84,7 @@ install(FILES ${generated_includes} api.h add_ff.h + char_to_float.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/char_to_float.h b/gr-blocks/include/blocks/char_to_float.h new file mode 100644 index 000000000..92a2dbf80 --- /dev/null +++ b/gr-blocks/include/blocks/char_to_float.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_CHAR_TO_FLOAT_H +#define INCLUDED_BLOCKS_CHAR_TO_FLOAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of chars to a stream of float + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar divider to change the output signal scale. + */ + class BLOCKS_API char_to_float : virtual public gr_sync_block + { + public: + + // gr::blocks::char_to_float_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar divider value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar divider value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_CHAR_TO_FLOAT_H */ -- cgit From 75f11771a9ee4b2854297fdb2c9db5761bde1c45 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Fri, 22 Jun 2012 16:58:50 -0700 Subject: blocks: added gr::blocks:char_to_short --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/char_to_short.h | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gr-blocks/include/blocks/char_to_short.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index bfdde9701..7f29e5a7b 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -85,6 +85,7 @@ install(FILES api.h add_ff.h char_to_float.h + char_to_short.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/char_to_short.h b/gr-blocks/include/blocks/char_to_short.h new file mode 100644 index 000000000..e2bb3a859 --- /dev/null +++ b/gr-blocks/include/blocks/char_to_short.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_CHAR_TO_SHORT_H +#define INCLUDED_BLOCKS_CHAR_TO_SHORT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of chars to a stream of short + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + */ + class BLOCKS_API char_to_short : virtual public gr_sync_block + { + public: + + // gr::blocks::char_to_short_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_CHAR_TO_SHORT_H */ -- cgit From c16e6eba638ebe3bdf5ee4770ce409481c8e1c7a Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 07:46:42 -0700 Subject: blocks: added gr::blocks::complex_to_interleaved_short --- gr-blocks/include/blocks/CMakeLists.txt | 1 + .../include/blocks/complex_to_interleaved_short.h | 49 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_interleaved_short.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 7f29e5a7b..783680253 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -86,6 +86,7 @@ install(FILES add_ff.h char_to_float.h char_to_short.h + complex_to_interleaved_short.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_interleaved_short.h b/gr-blocks/include/blocks/complex_to_interleaved_short.h new file mode 100644 index 000000000..33cbddf6b --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_interleaved_short.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_INTERLEAVED_SHORT_H +#define INCLUDED_BLOCKS_COMPLEX_TO_INTERLEAVED_SHORT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of complex to a stream of interleaved shorts + * \ingroup converter_blk + */ + class BLOCKS_API complex_to_interleaved_short : virtual public gr_sync_interpolator + { + public: + + // gr::blocks::complex_to_interleaved_short_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_INTERLEAVED_SHORT_H */ -- cgit From 6eb1447df04883af78ed78eb8449378e67d67bf6 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 08:12:30 -0700 Subject: blocks: added gr::blocks::complex_to_float --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_float.h | 50 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_float.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 783680253..d26512a39 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -87,6 +87,7 @@ install(FILES char_to_float.h char_to_short.h complex_to_interleaved_short.h + complex_to_float.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_float.h b/gr-blocks/include/blocks/complex_to_float.h new file mode 100644 index 000000000..322f67b62 --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_float.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_FLOAT_H +#define INCLUDED_BLOCKS_COMPLEX_TO_FLOAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief convert a stream of gr_complex to 1 or 2 streams of float + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_float : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_float_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_FLOAT_H */ -- cgit From 11a702b94a43cac127c146654f5fc10415f2bb6e Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 08:32:59 -0700 Subject: blocks: added gr::blocks::complex_to_real --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_real.h | 50 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_real.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index d26512a39..9967273b3 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -88,6 +88,7 @@ install(FILES char_to_short.h complex_to_interleaved_short.h complex_to_float.h + complex_to_real.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_real.h b/gr-blocks/include/blocks/complex_to_real.h new file mode 100644 index 000000000..a891c2e08 --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_real.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_REAL_H +#define INCLUDED_BLOCKS_COMPLEX_TO_REAL_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief complex in, real out (float) + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_real : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_real_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_REAL_H */ -- cgit From ed0dffa3c1a84a4b8f3201969896f61af39b86a3 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 08:44:47 -0700 Subject: blocks: added gr::blocks::complex_to_imag --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_imag.h | 50 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_imag.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 9967273b3..d0929cfbc 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -88,6 +88,7 @@ install(FILES char_to_short.h complex_to_interleaved_short.h complex_to_float.h + complex_to_imag.h complex_to_real.h multiply_cc.h multiply_ff.h diff --git a/gr-blocks/include/blocks/complex_to_imag.h b/gr-blocks/include/blocks/complex_to_imag.h new file mode 100644 index 000000000..71353a94a --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_imag.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_IMAG_H +#define INCLUDED_BLOCKS_COMPLEX_TO_IMAG_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief complex in, imag out (float) + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_imag : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_imag_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_IMAG_H */ -- cgit From 48ba99044710dc69c0ebdd3fbe97798622713a9f Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 09:06:19 -0700 Subject: blocks: added gr::blocks::complex_to_mag --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_mag.h | 50 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_mag.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index d0929cfbc..c8f837d68 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -90,6 +90,7 @@ install(FILES complex_to_float.h complex_to_imag.h complex_to_real.h + complex_to_mag.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_mag.h b/gr-blocks/include/blocks/complex_to_mag.h new file mode 100644 index 000000000..7e03c1cac --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_mag.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_MAG_H +#define INCLUDED_BLOCKS_COMPLEX_TO_MAG_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief complex in, magnitude out (float) + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_mag : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_mag_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_MAG_H */ -- cgit From 737b3dc0c41a867ea38c1475a3877bc0fb6f3ee2 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 09:25:42 -0700 Subject: blocks: added gr::blocks::complex_to_mag_squared --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_mag_squared.h | 50 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_mag_squared.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index c8f837d68..59cf455a1 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -91,6 +91,7 @@ install(FILES complex_to_imag.h complex_to_real.h complex_to_mag.h + complex_to_mag_squared.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_mag_squared.h b/gr-blocks/include/blocks/complex_to_mag_squared.h new file mode 100644 index 000000000..9e122b4b1 --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_mag_squared.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_MAG_SQUARED_H +#define INCLUDED_BLOCKS_COMPLEX_TO_MAG_SQUARED_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief complex in, magnitude squared out (float) + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_mag_squared : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_mag_squared_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_MAG_SQUARED_H */ -- cgit From 80aa560bbb59cad4d4d351a1e9c8c1fb56897397 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 23 Jun 2012 09:57:06 -0700 Subject: blocks: added gr::blocks::complex_to_arg --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/complex_to_arg.h | 50 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/complex_to_arg.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 59cf455a1..3593a9d27 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -92,6 +92,7 @@ install(FILES complex_to_real.h complex_to_mag.h complex_to_mag_squared.h + complex_to_arg.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_arg.h b/gr-blocks/include/blocks/complex_to_arg.h new file mode 100644 index 000000000..5d38161d4 --- /dev/null +++ b/gr-blocks/include/blocks/complex_to_arg.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_COMPLEX_TO_ARG_H +#define INCLUDED_BLOCKS_COMPLEX_TO_ARG_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief complex in, arg out (float) + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API complex_to_arg : virtual public gr_sync_block + { + public: + + // gr::blocks::complex_to_arg_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_ARG_H */ -- cgit From b48716fe0b666cf2be605c0c7d79111c6caf96c5 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 24 Jun 2012 11:20:03 -0700 Subject: blocks: added gr::blocks::float_to_char --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/float_to_char.h | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/float_to_char.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 3593a9d27..374ecadf5 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -93,6 +93,7 @@ install(FILES complex_to_mag.h complex_to_mag_squared.h complex_to_arg.h + float_to_char.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/float_to_char.h b/gr-blocks/include/blocks/float_to_char.h new file mode 100644 index 000000000..de9ea85e3 --- /dev/null +++ b/gr-blocks/include/blocks/float_to_char.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FLOAT_TO_CHAR_H +#define INCLUDED_BLOCKS_FLOAT_TO_CHAR_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of floats to a stream of char + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar multiplier to change the output signal scale. + */ + class BLOCKS_API float_to_char : virtual public gr_sync_block + { + public: + + // gr::blocks::float_to_char_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar multiplier value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar multiplier value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_CHAR_H */ -- cgit From 8c23d9f9ebfe04b60d59efc636c6d5b02baacc99 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 24 Jun 2012 11:42:20 -0700 Subject: blocks: added gr::blocks::float_to_complex --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/float_to_complex.h | 50 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/float_to_complex.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 374ecadf5..96f42a699 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -94,6 +94,7 @@ install(FILES complex_to_mag_squared.h complex_to_arg.h float_to_char.h + float_to_complex.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/float_to_complex.h b/gr-blocks/include/blocks/float_to_complex.h new file mode 100644 index 000000000..48c5b6ead --- /dev/null +++ b/gr-blocks/include/blocks/float_to_complex.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FLOAT_TO_COMPLEX_H +#define INCLUDED_BLOCKS_FLOAT_TO_COMPLEX_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief one or two floats in, complex out + * \ingroup converter_blk + * \param vlen vector len (default 1) + */ + class BLOCKS_API float_to_complex : virtual public gr_sync_block + { + public: + + // gr::blocks::float_to_complex_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_COMPLEX_H */ -- cgit From 31c61c16e2073f0c3f54a8d0523d8c4f10ca5dd2 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 25 Jun 2012 06:25:04 -0700 Subject: blocks: added gr::blocks::float_to_int --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/float_to_int.h | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/float_to_int.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 96f42a699..3171a4d02 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -95,6 +95,7 @@ install(FILES complex_to_arg.h float_to_char.h float_to_complex.h + float_to_int.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/float_to_int.h b/gr-blocks/include/blocks/float_to_int.h new file mode 100644 index 000000000..95c62e516 --- /dev/null +++ b/gr-blocks/include/blocks/float_to_int.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FLOAT_TO_INT_H +#define INCLUDED_BLOCKS_FLOAT_TO_INT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of floats to a stream of char + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar multiplier to change the output signal scale. + */ + class BLOCKS_API float_to_int : virtual public gr_sync_block + { + public: + + // gr::blocks::float_to_int_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar multiplier value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar multiplier value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_INT_H */ -- cgit From 86f15ba3488cde9eededa2af5af8dcadc01e9e47 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 26 Jun 2012 06:47:26 -0700 Subject: blocks: added gr::blocks::float_to_short --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/float_to_short.h | 62 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/float_to_short.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 3171a4d02..bf7ea230a 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -96,6 +96,7 @@ install(FILES float_to_char.h float_to_complex.h float_to_int.h + float_to_short.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/float_to_short.h b/gr-blocks/include/blocks/float_to_short.h new file mode 100644 index 000000000..5f1ab3f95 --- /dev/null +++ b/gr-blocks/include/blocks/float_to_short.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FLOAT_TO_SHORT_H +#define INCLUDED_BLOCKS_FLOAT_TO_SHORT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of floats to a stream of shorts + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar multiplier to change the output signal scale. + */ + class BLOCKS_API float_to_short : virtual public gr_sync_block + { + public: + + // gr::blocks::float_to_short_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar multiplier value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar multiplier value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_SHORT_H */ -- cgit From 0b7655a76e5c73b8f5a8310909cf038f12cbb869 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 26 Jun 2012 07:06:53 -0700 Subject: blocks: added gr::blocks::float_to_uchar --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/float_to_uchar.h | 49 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/float_to_uchar.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index bf7ea230a..a688168d0 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -97,6 +97,7 @@ install(FILES float_to_complex.h float_to_int.h float_to_short.h + float_to_uchar.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/float_to_uchar.h b/gr-blocks/include/blocks/float_to_uchar.h new file mode 100644 index 000000000..b5d0d08f7 --- /dev/null +++ b/gr-blocks/include/blocks/float_to_uchar.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FLOAT_TO_UCHAR_H +#define INCLUDED_BLOCKS_FLOAT_TO_UCHAR_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of floats to a stream of unsigned chars + * \ingroup converter_blk + */ + class BLOCKS_API float_to_uchar : virtual public gr_sync_block + { + public: + + // gr::blocks::float_to_uchar_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_UCHAR_H */ -- cgit From 3de0c77ed91e417c0b54972a78ffbad62f4bbb87 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 26 Jun 2012 19:43:01 -0700 Subject: blocks: added gr::blocks::float_to_int --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/int_to_float.h | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/int_to_float.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index a688168d0..e56c7b87c 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -98,6 +98,7 @@ install(FILES float_to_int.h float_to_short.h float_to_uchar.h + int_to_float.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/int_to_float.h b/gr-blocks/include/blocks/int_to_float.h new file mode 100644 index 000000000..ebee1c3c9 --- /dev/null +++ b/gr-blocks/include/blocks/int_to_float.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_INT_TO_FLOAT_H +#define INCLUDED_BLOCKS_INT_TO_FLOAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of ints to a stream of floats + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar divider to change the output signal scale. + */ + class BLOCKS_API int_to_float : virtual public gr_sync_block + { + public: + + // gr::blocks::int_to_float_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar divider value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar divider value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_INT_TO_FLOAT_H */ -- cgit From be1219b0623bbceb5bca6a6f6774f0669f52bdde Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 27 Jun 2012 06:50:22 -0700 Subject: blocks: added gr::blocks::interleaved_short_to_complex --- gr-blocks/include/blocks/CMakeLists.txt | 1 + .../include/blocks/complex_to_interleaved_short.h | 2 +- .../include/blocks/interleaved_short_to_complex.h | 49 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gr-blocks/include/blocks/interleaved_short_to_complex.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index e56c7b87c..9616db3a6 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -99,6 +99,7 @@ install(FILES float_to_short.h float_to_uchar.h int_to_float.h + interleaved_complex_to_short.h multiply_cc.h multiply_ff.h multiply_const_cc.h diff --git a/gr-blocks/include/blocks/complex_to_interleaved_short.h b/gr-blocks/include/blocks/complex_to_interleaved_short.h index 33cbddf6b..f5e91123c 100644 --- a/gr-blocks/include/blocks/complex_to_interleaved_short.h +++ b/gr-blocks/include/blocks/complex_to_interleaved_short.h @@ -37,7 +37,7 @@ namespace gr { { public: - // gr::blocks::complex_to_interleaved_short_ff::sptr + // gr::blocks::complex_to_interleaved_short::sptr typedef boost::shared_ptr sptr; static sptr make(); diff --git a/gr-blocks/include/blocks/interleaved_short_to_complex.h b/gr-blocks/include/blocks/interleaved_short_to_complex.h new file mode 100644 index 000000000..40e96fc46 --- /dev/null +++ b/gr-blocks/include/blocks/interleaved_short_to_complex.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_INTERLEAVED_SHORT_TO_COMPLEX_H +#define INCLUDED_BLOCKS_INTERLEAVED_SHORT_TO_COMPLEX_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of interleaved shorts to a stream of complex + * \ingroup converter_blk + */ + class BLOCKS_API interleaved_short_to_complex : virtual public gr_sync_decimator + { + public: + + // gr::blocks::interleaved_short_to_complex::sptr + typedef boost::shared_ptr sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_INTERLEAVED_SHORT_TO_COMPLEX_H */ -- cgit From c128e5aee66838c849ffc2ac45217ff1efab42e8 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 28 Jun 2012 09:02:58 -0700 Subject: blocks: added gr::blocks::short_to_char --- gr-blocks/include/blocks/CMakeLists.txt | 3 +- gr-blocks/include/blocks/short_to_char.h | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 gr-blocks/include/blocks/short_to_char.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 9616db3a6..00df9511e 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -99,11 +99,12 @@ install(FILES float_to_short.h float_to_uchar.h int_to_float.h - interleaved_complex_to_short.h + interleaved_short_to_complex.h multiply_cc.h multiply_ff.h multiply_const_cc.h multiply_const_ff.h + short_to_char.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/short_to_char.h b/gr-blocks/include/blocks/short_to_char.h new file mode 100644 index 000000000..eeb053b0e --- /dev/null +++ b/gr-blocks/include/blocks/short_to_char.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_SHORT_TO_CHAR_H +#define INCLUDED_BLOCKS_SHORT_TO_CHAR_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of shorts to a stream of chars + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + */ + class BLOCKS_API short_to_char : virtual public gr_sync_block + { + public: + + // gr::blocks::short_to_char_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_SHORT_TO_CHAR_H */ -- cgit From 9482c8986d0a7bd4772a78972880a9e574531052 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 28 Jun 2012 09:27:59 -0700 Subject: blocks: added gr::blocks::short_to_float --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/short_to_float.h | 62 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gr-blocks/include/blocks/short_to_float.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 00df9511e..8c39acb81 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -105,6 +105,7 @@ install(FILES multiply_const_cc.h multiply_const_ff.h short_to_char.h + short_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/short_to_float.h b/gr-blocks/include/blocks/short_to_float.h new file mode 100644 index 000000000..c26addcd0 --- /dev/null +++ b/gr-blocks/include/blocks/short_to_float.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_SHORT_TO_FLOAT_H +#define INCLUDED_BLOCKS_SHORT_TO_FLOAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of shorts to a stream of floats + * \ingroup converter_blk + * + * \param vlen vector length of data streams. + * \param scale a scalar divider to change the output signal scale. + */ + class BLOCKS_API short_to_float : virtual public gr_sync_block + { + public: + + // gr::blocks::short_to_float_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t vlen=1, float scale=1.0); + + /*! + * Get the scalar divider value. + */ + virtual float scale() const = 0; + + /*! + * Set the scalar divider value. + */ + virtual void set_scale(float scale) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_SHORT_TO_FLOAT_H */ -- cgit From a3b74a25fcba67f61bf3cabb25286201f1263b0a Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 28 Jun 2012 09:46:38 -0700 Subject: blocks: added gr::blocks::uchar_to_float --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/uchar_to_float.h | 49 +++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/uchar_to_float.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 8c39acb81..7cd8a5483 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -106,6 +106,7 @@ install(FILES multiply_const_ff.h short_to_char.h short_to_float.h + uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/uchar_to_float.h b/gr-blocks/include/blocks/uchar_to_float.h new file mode 100644 index 000000000..033037e49 --- /dev/null +++ b/gr-blocks/include/blocks/uchar_to_float.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_UCHAR_TO_FLOAT_H +#define INCLUDED_BLOCKS_UCHAR_TO_FLOAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of unsigned chars to a stream of floats + * \ingroup converter_blk + */ + class BLOCKS_API uchar_to_float : virtual public gr_sync_block + { + public: + + // gr::blocks::uchar_to_float_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_UCHAR_TO_FLOAT_H */ -- cgit From f2e815329402f170231c054e108b531094d046be Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Fri, 29 Jun 2012 08:10:15 -0700 Subject: blocks: added gr::blocks::conjugate_cc --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/conjugate_cc.h | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/conjugate_cc.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 7cd8a5483..3110e2abb 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -93,6 +93,7 @@ install(FILES complex_to_mag.h complex_to_mag_squared.h complex_to_arg.h + conjugate_cc.h float_to_char.h float_to_complex.h float_to_int.h diff --git a/gr-blocks/include/blocks/conjugate_cc.h b/gr-blocks/include/blocks/conjugate_cc.h new file mode 100644 index 000000000..02297c56e --- /dev/null +++ b/gr-blocks/include/blocks/conjugate_cc.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_CONJUGATE_CC_H +#define INCLUDED_BLOCKS_CONJUGATE_CC_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = complex conjugate of input + * \ingroup math_blk + */ + class BLOCKS_API conjugate_cc : virtual public gr_sync_block + { + public: + + // gr::blocks::conjugate_cc_ff::sptr + typedef boost::shared_ptr sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_CONJUGATE_CC_H */ -- cgit From bfcc9dc634cc8d7da77b109a7ad9cd90714fd768 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Fri, 29 Jun 2012 08:30:23 -0700 Subject: blocks: added gr::blocks::integrate_XX with ss ii ff cc --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/integrate_XX.h.t | 51 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gr-blocks/include/blocks/integrate_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 3110e2abb..9f1af046d 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -68,6 +68,7 @@ expand_h(add_XX ss ii cc) expand_h(add_const_XX ss ii ff cc) expand_h(add_const_vXX ss ii ff cc) expand_h(divide_XX ss ii ff cc) +expand_h(integrate_XX ss ii ff cc) expand_h(multiply_XX ss ii) expand_h(multiply_const_XX ss ii) expand_h(multiply_const_vXX ss ii ff cc) diff --git a/gr-blocks/include/blocks/integrate_XX.h.t b/gr-blocks/include/blocks/integrate_XX.h.t new file mode 100644 index 000000000..8a313a0ba --- /dev/null +++ b/gr-blocks/include/blocks/integrate_XX.h.t @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2009,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Integrate successive samples and decimate + * \ingroup math_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_decimator + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(int decim); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From ee1a53b4a971e4b9623f504628231a273157f462 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 30 Jun 2012 08:26:58 -0700 Subject: blocks: aded gr::blocks::multiply_conjugate_cc --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/multiply_conjugate_cc.h | 50 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/multiply_conjugate_cc.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 9f1af046d..f8e775397 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -104,6 +104,7 @@ install(FILES interleaved_short_to_complex.h multiply_cc.h multiply_ff.h + multiply_conjugate_cc.h multiply_const_cc.h multiply_const_ff.h short_to_char.h diff --git a/gr-blocks/include/blocks/multiply_conjugate_cc.h b/gr-blocks/include/blocks/multiply_conjugate_cc.h new file mode 100644 index 000000000..fc587ae2f --- /dev/null +++ b/gr-blocks/include/blocks/multiply_conjugate_cc.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_MULTIPLY_CONJUGATE_CC_H +#define INCLUDED_GR_MULTIPLY_CONJUGATE_CC_H + +#include +#include + +namespace gr { + namespace blocks { + + class BLOCKS_API multiply_conjugate_cc : virtual public gr_sync_block + { + public: + + // gr::blocks::multiply_conjugate_cc::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Multiplies a streams by the conjugate of a second stream + * \param vlen Vector length + * \ingroup math_blk + */ + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_MULTIPLY_CONJUGATE_CC_H */ -- cgit From 70d89e2051264876055fe9f73cbcb2823806b3ee Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 1 Jul 2012 09:15:14 -0700 Subject: blocks: added gr::blocks::nlog10_ff --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/nlog10_ff.h | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 gr-blocks/include/blocks/nlog10_ff.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index f8e775397..b816544be 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -107,6 +107,7 @@ install(FILES multiply_conjugate_cc.h multiply_const_cc.h multiply_const_ff.h + nlog10_ff.h short_to_char.h short_to_float.h uchar_to_float.h diff --git a/gr-blocks/include/blocks/nlog10_ff.h b/gr-blocks/include/blocks/nlog10_ff.h new file mode 100644 index 000000000..cedd620fa --- /dev/null +++ b/gr-blocks/include/blocks/nlog10_ff.h @@ -0,0 +1,55 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_NLOG10_FF_H +#define INCLUDED_BLOCKS_NLOG10_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = n*log10(input) + k + * \ingroup math_blk + */ + class BLOCKS_API nlog10_ff : virtual public gr_sync_block + { + public: + + // gr::blocks::nlog10_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make an instance of an nlog10_ff block. + * \param n Scalar multiplicative constant + * \param vlen Input vector length + * \param k Scalar additive constant + */ + static sptr make(float n=1.0, size_t vlen=1, float k=0.0); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_NLOG10_FF_H */ -- cgit From cc085e128901a9f3e8bfcc45d1834a62d747726c Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 2 Jul 2012 08:36:46 -0700 Subject: blocks: added gr::blocks::add_XX (bb ss ii) --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/and_XX.h.t | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gr-blocks/include/blocks/and_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index b816544be..1db3eab2f 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -67,6 +67,7 @@ endmacro(expand_h) expand_h(add_XX ss ii cc) expand_h(add_const_XX ss ii ff cc) expand_h(add_const_vXX ss ii ff cc) +expand_h(and_XX bb ss ii) expand_h(divide_XX ss ii ff cc) expand_h(integrate_XX ss ii ff cc) expand_h(multiply_XX ss ii) diff --git a/gr-blocks/include/blocks/and_XX.h.t b/gr-blocks/include/blocks/and_XX.h.t new file mode 100644 index 000000000..68ddcc33d --- /dev/null +++ b/gr-blocks/include/blocks/and_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input_0 & input_1 & , ... & input_N) + * \ingroup math_blk + * + * bitwise boolean and across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 025f323d9857715a31a1117693c5debd19393a46 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 2 Jul 2012 09:13:13 -0700 Subject: blocks: added gr::blocks::and_const_XX (bb ss ii) --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/and_const_XX.h.t | 68 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 gr-blocks/include/blocks/and_const_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 1db3eab2f..5b29219cc 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -68,6 +68,7 @@ expand_h(add_XX ss ii cc) expand_h(add_const_XX ss ii ff cc) expand_h(add_const_vXX ss ii ff cc) expand_h(and_XX bb ss ii) +expand_h(and_const_XX bb ss ii) expand_h(divide_XX ss ii ff cc) expand_h(integrate_XX ss ii ff cc) expand_h(multiply_XX ss ii) diff --git a/gr-blocks/include/blocks/and_const_XX.h.t b/gr-blocks/include/blocks/and_const_XX.h.t new file mode 100644 index 000000000..945a1f48b --- /dev/null +++ b/gr-blocks/include/blocks/and_const_XX.h.t @@ -0,0 +1,68 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output_N = input_N & value + * \ingroup math_blk + * + * bitwise boolean and of const to the data stream. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + /*! + * \brief Create an instance of @NAME@ + * \param k AND constant + */ + static sptr make(@O_TYPE@ k); + + /*! + * \brief Return AND constant + */ + virtual @O_TYPE@ k() const = 0; + + /*! + * \brief Set AND constant + */ + virtual void set_k(@O_TYPE@ k) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 84f9822b4a8fe4290e971c09b2bd99f1bf59517b Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 3 Jul 2012 09:49:20 -0700 Subject: blocks: added gr::blocks::not_XX (bb ss ii) --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/not_XX.h.t | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gr-blocks/include/blocks/not_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 5b29219cc..f6be20235 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -74,6 +74,7 @@ expand_h(integrate_XX ss ii ff cc) expand_h(multiply_XX ss ii) expand_h(multiply_const_XX ss ii) expand_h(multiply_const_vXX ss ii ff cc) +expand_h(not_XX bb ss ii) expand_h(sub_XX ss ii ff cc) add_custom_target(blocks_generated_includes DEPENDS diff --git a/gr-blocks/include/blocks/not_XX.h.t b/gr-blocks/include/blocks/not_XX.h.t new file mode 100644 index 000000000..e406c82dc --- /dev/null +++ b/gr-blocks/include/blocks/not_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = ~input + * \ingroup math_blk + * + * bitwise boolean not of input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 4c85f46aee089432b090b988dedbc42091084ba3 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 4 Jul 2012 07:11:51 -0700 Subject: blocks: added gr::blocks::or_XX (bb ss ii) --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/or_XX.h.t | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gr-blocks/include/blocks/or_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index f6be20235..434fb2944 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -75,6 +75,7 @@ expand_h(multiply_XX ss ii) expand_h(multiply_const_XX ss ii) expand_h(multiply_const_vXX ss ii ff cc) expand_h(not_XX bb ss ii) +expand_h(or_XX bb ss ii) expand_h(sub_XX ss ii ff cc) add_custom_target(blocks_generated_includes DEPENDS diff --git a/gr-blocks/include/blocks/or_XX.h.t b/gr-blocks/include/blocks/or_XX.h.t new file mode 100644 index 000000000..8bc9a080f --- /dev/null +++ b/gr-blocks/include/blocks/or_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input_0 | input_1 | , ... | input_N) + * \ingroup math_blk + * + * Bitwise boolean or across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From a76cd7d47576054d7fac37710a8f79b908d18b00 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 4 Jul 2012 07:22:49 -0700 Subject: blocks: added gr::blocks::xor_XX (bb ss ii) --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/xor_XX.h.t | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gr-blocks/include/blocks/xor_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 434fb2944..523ac2bb3 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -77,6 +77,7 @@ expand_h(multiply_const_vXX ss ii ff cc) expand_h(not_XX bb ss ii) expand_h(or_XX bb ss ii) expand_h(sub_XX ss ii ff cc) +expand_h(xor_XX bb ss ii) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} diff --git a/gr-blocks/include/blocks/xor_XX.h.t b/gr-blocks/include/blocks/xor_XX.h.t new file mode 100644 index 000000000..ba0c508f6 --- /dev/null +++ b/gr-blocks/include/blocks/xor_XX.h.t @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief output = input_0 ^ input_1 ^ , ... ^ input_N) + * \ingroup math_blk + * + * Bitwise boolean xor across all input streams. + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From 44647064669928517b233ca26bd97cd87847a235 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 5 Jul 2012 09:25:29 -0700 Subject: blocks: added gr::blocks::deinterleave --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/deinterleave.h | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/deinterleave.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 523ac2bb3..c3ad9d033 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -100,6 +100,7 @@ install(FILES complex_to_mag_squared.h complex_to_arg.h conjugate_cc.h + deinterleave.h float_to_char.h float_to_complex.h float_to_int.h diff --git a/gr-blocks/include/blocks/deinterleave.h b/gr-blocks/include/blocks/deinterleave.h new file mode 100644 index 000000000..24074d2fc --- /dev/null +++ b/gr-blocks/include/blocks/deinterleave.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_DEINTERLEAVE_H +#define INCLUDED_BLOCKS_DEINTERLEAVE_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief deinterleave a single input into N outputs + * \ingroup slicedice_blk + * \param itemsize stream itemsize + */ + class BLOCKS_API deinterleave : virtual public gr_sync_decimator + { + public: + + // gr::blocks::deinterleave::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_DEINTERLEAVE_H */ -- cgit From 27694edd168bc1260ff04950e837a6580afc49ab Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Fri, 6 Jul 2012 08:17:40 -0700 Subject: blocks: added gr::blocks::interleave --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/interleave.h | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gr-blocks/include/blocks/interleave.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index c3ad9d033..a8a1c5a62 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -107,6 +107,7 @@ install(FILES float_to_short.h float_to_uchar.h int_to_float.h + interleave.h interleaved_short_to_complex.h multiply_cc.h multiply_ff.h diff --git a/gr-blocks/include/blocks/interleave.h b/gr-blocks/include/blocks/interleave.h new file mode 100644 index 000000000..e98d01df9 --- /dev/null +++ b/gr-blocks/include/blocks/interleave.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_INTERLEAVE_H +#define INCLUDED_BLOCKS_INTERLEAVE_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief interleave N inputs into a single output + * \ingroup slicedice_blk + * \param itemsize stream itemsize + */ + class BLOCKS_API interleave : virtual public gr_sync_interpolator + { + public: + + // gr::blocks::interleave::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_INTERLEAVE_H */ -- cgit From 4e06f35f611aff2e1d4983327da54cf63e5b9ada Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 7 Jul 2012 07:06:51 -0700 Subject: blocks: added gr::blocks::keep_one_in_n --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/keep_one_in_n.h | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gr-blocks/include/blocks/keep_one_in_n.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index a8a1c5a62..5b4c0e437 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -109,6 +109,7 @@ install(FILES int_to_float.h interleave.h interleaved_short_to_complex.h + keep_one_in_n.h multiply_cc.h multiply_ff.h multiply_conjugate_cc.h diff --git a/gr-blocks/include/blocks/keep_one_in_n.h b/gr-blocks/include/blocks/keep_one_in_n.h new file mode 100644 index 000000000..c48784994 --- /dev/null +++ b/gr-blocks/include/blocks/keep_one_in_n.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_KEEP_ONE_IN_N_H +#define INCLUDED_BLOCKS_KEEP_ONE_IN_N_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief decimate a stream, keeping one item out of every n. + * \ingroup slicedice_blk + */ + class BLOCKS_API keep_one_in_n : virtual public gr_block + { + public: + + // gr::blocks::keep_one_in_n::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, int n); + + virtual void set_n(int n) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_KEEP_ONE_IN_N_H */ -- cgit From bbd91d7a08bfc0c229267e5dc848d1f57d629373 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 19 Jul 2012 06:27:19 -0700 Subject: blocks: added gr::blocks::keep_m_in_n --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/keep_m_in_n.h | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gr-blocks/include/blocks/keep_m_in_n.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 5b4c0e437..0db0eebd2 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -109,6 +109,7 @@ install(FILES int_to_float.h interleave.h interleaved_short_to_complex.h + keep_m_in_n.h keep_one_in_n.h multiply_cc.h multiply_ff.h diff --git a/gr-blocks/include/blocks/keep_m_in_n.h b/gr-blocks/include/blocks/keep_m_in_n.h new file mode 100644 index 000000000..806ec3de5 --- /dev/null +++ b/gr-blocks/include/blocks/keep_m_in_n.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_KEEP_M_IN_N_H +#define INCLUDED_BLOCKS_KEEP_M_IN_N_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief decimate a stream, keeping one item out of every n. + * \ingroup slicedice_blk + */ + class BLOCKS_API keep_m_in_n : virtual public gr_block + { + public: + + // gr::blocks::keep_m_in_n::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, int m, int n, int offset); + + virtual void set_m(int m) = 0; + virtual void set_n(int n) = 0; + virtual void set_offset(int offset) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_KEEP_M_IN_N_H */ -- cgit From 66f49de1986dd531bee011299d4b1f7c62872d39 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 19 Jul 2012 07:02:45 -0700 Subject: blocks: added gr::blocks::repeat --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/repeat.h | 51 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 gr-blocks/include/blocks/repeat.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 0db0eebd2..8c14d5a49 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -117,6 +117,7 @@ install(FILES multiply_const_cc.h multiply_const_ff.h nlog10_ff.h + repeat.h short_to_char.h short_to_float.h uchar_to_float.h diff --git a/gr-blocks/include/blocks/repeat.h b/gr-blocks/include/blocks/repeat.h new file mode 100644 index 000000000..3f9f8e6fc --- /dev/null +++ b/gr-blocks/include/blocks/repeat.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_REPEAT_H +#define INCLUDED_BLOCKS_REPEAT_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief repeat each input 'interp' times + * \ingroup slicedice_blk + * \param itemsize stream itemsize + * \param interp number of times to repeat + */ + class BLOCKS_API repeat : virtual public gr_sync_interpolator + { + public: + + // gr::blocks::repeat::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, int repeat); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_REPEAT_H */ -- cgit From 0a5bb996ca4f4bb350cf91b00b4c3db5a5c4eb75 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 29 Aug 2012 09:29:50 -0700 Subject: blocks: added gr::blocks::stream_mux --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/stream_mux.h | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 gr-blocks/include/blocks/stream_mux.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 8c14d5a49..7ec0524ae 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -120,6 +120,7 @@ install(FILES repeat.h short_to_char.h short_to_float.h + stream_mux.h uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" diff --git a/gr-blocks/include/blocks/stream_mux.h b/gr-blocks/include/blocks/stream_mux.h new file mode 100644 index 000000000..905ea3c9f --- /dev/null +++ b/gr-blocks/include/blocks/stream_mux.h @@ -0,0 +1,69 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_STREAM_MUX_H +#define INCLUDED_BLOCKS_STREAM_MUX_H + +#include +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Stream muxing block to multiplex many streams into + * one with a specified format. + * + * Muxes N streams together producing an output stream that + * contains N0 items from the first stream, N1 items from the second, + * etc. and repeats: + * + * [N0, N1, N2, ..., Nm, N0, N1, ...] + */ + class BLOCKS_API stream_mux : virtual public gr_block + { + public: + + // gr::blocks::stream_mux::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Creates a stream muxing block to multiplex many streams into + * one with a specified format. + * \ingroup converter_blk + * + * \param itemsize the item size of the stream + * \param length a vector (list/tuple) specifying the number of + * items from each stream the mux together. + * Warning: this requires that at least as many items + * per stream are available or the system will wait + * indefinitely for the items. + * + */ + static sptr make(size_t itemsize, const std::vector &lengths); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_MUX_H */ -- cgit From b434b7329301fee49ab82a81ac68517f8ab042eb Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 30 Aug 2012 14:29:28 -0700 Subject: blocks: added gr::blocks::stream_to_streams --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/stream_to_streams.h | 52 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gr-blocks/include/blocks/stream_to_streams.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 7ec0524ae..191f15031 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -121,6 +121,7 @@ install(FILES short_to_char.h short_to_float.h stream_mux.h + stream_to_streams.h uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" diff --git a/gr-blocks/include/blocks/stream_to_streams.h b/gr-blocks/include/blocks/stream_to_streams.h new file mode 100644 index 000000000..fc39f1687 --- /dev/null +++ b/gr-blocks/include/blocks/stream_to_streams.h @@ -0,0 +1,52 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_STREAM_TO_STREAMS_H +#define INCLUDED_BLOCKS_STREAM_TO_STREAMS_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief convert a stream of items into a N streams of items + * \ingroup slicedice_blk + * + * Converts a stream of N items into N streams of 1 item. + * Repeat ad infinitum. + */ + class BLOCKS_API stream_to_streams : virtual public gr_sync_decimator + { + public: + + // gr::blocks::stream_to_streams::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_TO_STREAMS_H */ -- cgit From 0aec5b7f568b0cfc320a202631757efc247aca6e Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 4 Sep 2012 15:21:35 -0700 Subject: blocks: added gr::blocks::stream_to_vector --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/stream_to_vector.h | 49 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/stream_to_vector.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 191f15031..1612ea7ec 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -122,6 +122,7 @@ install(FILES short_to_float.h stream_mux.h stream_to_streams.h + stream_to_vector.h uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" diff --git a/gr-blocks/include/blocks/stream_to_vector.h b/gr-blocks/include/blocks/stream_to_vector.h new file mode 100644 index 000000000..8311eb350 --- /dev/null +++ b/gr-blocks/include/blocks/stream_to_vector.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_STREAM_TO_VECTOR_H +#define INCLUDED_BLOCKS_STREAM_TO_VECTOR_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief convert a stream of items into a stream of blocks containing nitems_per_block + * \ingroup slicedice_blk + */ + class BLOCKS_API stream_to_vector : virtual public gr_sync_decimator + { + public: + + // gr::blocks::stream_to_vector::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nitems_per_block); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_TO_VECTOR_H */ -- cgit From 2065177207d9f504fdcd374ed6567379c51c7a06 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 4 Sep 2012 15:38:17 -0700 Subject: blocks: added gr::blocks::streams_to_stream --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/streams_to_stream.h | 52 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gr-blocks/include/blocks/streams_to_stream.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 1612ea7ec..d7d13c4e0 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -123,6 +123,7 @@ install(FILES stream_mux.h stream_to_streams.h stream_to_vector.h + streams_to_stream.h uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" diff --git a/gr-blocks/include/blocks/streams_to_stream.h b/gr-blocks/include/blocks/streams_to_stream.h new file mode 100644 index 000000000..01dcd1be3 --- /dev/null +++ b/gr-blocks/include/blocks/streams_to_stream.h @@ -0,0 +1,52 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_STREAMS_TO_STREAM_H +#define INCLUDED_BLOCKS_STREAMS_TO_STREAM_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert N streams of 1 item into a 1 stream of N items + * \ingroup slicedice_blk + * + * Convert N streams of 1 item into 1 stream of N items. + * Repeat ad infinitum. + */ + class BLOCKS_API streams_to_stream : virtual public gr_sync_interpolator + { + public: + + // gr::blocks::streams_to_stream::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAMS_TO_STREAM_H */ -- cgit From 14a6b7beb247128408a98acd77cef66eaef2b4c3 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 4 Sep 2012 16:01:42 -0700 Subject: blocks: added gr::blocks::streams_to_vector --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/streams_to_vector.h | 49 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/streams_to_vector.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index d7d13c4e0..fbd47aceb 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -124,6 +124,7 @@ install(FILES stream_to_streams.h stream_to_vector.h streams_to_stream.h + streams_to_vector.h uchar_to_float.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" diff --git a/gr-blocks/include/blocks/streams_to_vector.h b/gr-blocks/include/blocks/streams_to_vector.h new file mode 100644 index 000000000..ad55ac31f --- /dev/null +++ b/gr-blocks/include/blocks/streams_to_vector.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_STREAMS_TO_VECTOR_H +#define INCLUDED_BLOCKS_STREAMS_TO_VECTOR_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief convert N streams of items to 1 stream of vector length N + * \ingroup slicedice_blk + */ + class BLOCKS_API streams_to_vector : virtual public gr_sync_block + { + public: + + // gr::blocks::streams_to_vector::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAMS_TO_VECTOR_H */ -- cgit From 73d59860c4cc0e2b22c21d56cd5cdfcb969263eb Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 4 Sep 2012 16:25:00 -0700 Subject: blocks: added gr::blocks::vector_to_stream --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/vector_to_stream.h | 49 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/vector_to_stream.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index fbd47aceb..df69ae4b0 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -126,6 +126,7 @@ install(FILES streams_to_stream.h streams_to_vector.h uchar_to_float.h + vector_to_stream.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/vector_to_stream.h b/gr-blocks/include/blocks/vector_to_stream.h new file mode 100644 index 000000000..1e72f6d50 --- /dev/null +++ b/gr-blocks/include/blocks/vector_to_stream.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_VECTOR_TO_STREAM_H +#define INCLUDED_BLOCKS_VECTOR_TO_STREAM_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief convert a stream of blocks of nitems_per_block items into a stream of items + * \ingroup slicedice_blk + */ + class BLOCKS_API vector_to_stream : virtual public gr_sync_interpolator + { + public: + + // gr::blocks::vector_to_stream::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nitems_per_block); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_VECTOR_TO_STREAM_H */ -- cgit From c5ddf4c26bf8bc049622b2e9ffcdcdba3265b580 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 4 Sep 2012 16:39:30 -0700 Subject: blocks: added gr::blocks::vector_to_streams --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/vector_to_streams.h | 49 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gr-blocks/include/blocks/vector_to_streams.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index df69ae4b0..366bf1110 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -127,6 +127,7 @@ install(FILES streams_to_vector.h uchar_to_float.h vector_to_stream.h + vector_to_streams.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/blocks COMPONENT "blocks_devel" ) diff --git a/gr-blocks/include/blocks/vector_to_streams.h b/gr-blocks/include/blocks/vector_to_streams.h new file mode 100644 index 000000000..1bc075879 --- /dev/null +++ b/gr-blocks/include/blocks/vector_to_streams.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_VECTOR_TO_STREAMS_H +#define INCLUDED_BLOCKS_VECTOR_TO_STREAMS_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert 1 stream of vectors of length N to N streams of items + * \ingroup slicedice_blk + */ + class BLOCKS_API vector_to_streams : virtual public gr_sync_block + { + public: + + // gr::blocks::vector_to_streams::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_VECTOR_TO_STREAMS_H */ -- cgit From 2d2afd3b387bd3426cc30239f679d48cefe9eb93 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 5 Sep 2012 12:42:10 -0700 Subject: blocks: added gr::blocks::file_source --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/file_source.h | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 gr-blocks/include/blocks/file_source.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 366bf1110..ac674528f 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -101,6 +101,7 @@ install(FILES complex_to_arg.h conjugate_cc.h deinterleave.h + file_source.h float_to_char.h float_to_complex.h float_to_int.h diff --git a/gr-blocks/include/blocks/file_source.h b/gr-blocks/include/blocks/file_source.h new file mode 100644 index 000000000..6207cdf70 --- /dev/null +++ b/gr-blocks/include/blocks/file_source.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FILE_SOURCE_H +#define INCLUDED_BLOCKS_FILE_SOURCE_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Read stream from file + * \ingroup source_blk + */ + class BLOCKS_API file_source : virtual public gr_sync_block + { + public: + + // gr::blocks::file_source::sptr + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, const char *filename, bool repeat = false); + + /*! + * \brief seek file to \p seek_point relative to \p whence + * + * \param seek_point sample offset in file + * \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek) + */ + virtual bool seek(long seek_point, int whence) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FILE_SOURCE_H */ -- cgit From ff81c844713b5234622ceb906af219a569d0914f Mon Sep 17 00:00:00 2001 From: Tim O'Shea Date: Wed, 28 Nov 2012 14:52:36 -0800 Subject: adding patterned interleaver block --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/patterned_interleaver.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gr-blocks/include/blocks/patterned_interleaver.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index ac674528f..787fddba3 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -118,6 +118,7 @@ install(FILES multiply_const_cc.h multiply_const_ff.h nlog10_ff.h + patterned_interleaver.h repeat.h short_to_char.h short_to_float.h diff --git a/gr-blocks/include/blocks/patterned_interleaver.h b/gr-blocks/include/blocks/patterned_interleaver.h new file mode 100644 index 000000000..cfcdac6e7 --- /dev/null +++ b/gr-blocks/include/blocks/patterned_interleaver.h @@ -0,0 +1,23 @@ +#ifndef INCLUDED_BLOCKS_PATTERNED_INTERLEAVER_H +#define INCLUDED_BLOCKS_PATTERNED_INTERLEAVER_H + +#include +#include + +namespace gr { + namespace blocks { + + class BLOCKS_API patterned_interleaver : virtual public gr_block + { + public: + + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, std::vector pattern); + }; + + } +} + +#endif + -- cgit From 197aa3c917c8750729e20ead831bb3a3dbce322e Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 3 Dec 2012 14:57:00 -0500 Subject: Docs: Fixing Doxygen markup for missing constructor parameters. --- gr-blocks/include/blocks/multiply_const_cc.h | 1 + gr-blocks/include/blocks/multiply_const_ff.h | 1 + gr-blocks/include/blocks/stream_mux.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/multiply_const_cc.h b/gr-blocks/include/blocks/multiply_const_cc.h index 032a765a4..9572eaec7 100644 --- a/gr-blocks/include/blocks/multiply_const_cc.h +++ b/gr-blocks/include/blocks/multiply_const_cc.h @@ -46,6 +46,7 @@ namespace gr { /*! * \brief Create an instance of multiply_const_cc * \param k complex multiplicative constant + * \param vlen Vector length of incoming stream */ static sptr make(gr_complex k, size_t vlen=1); diff --git a/gr-blocks/include/blocks/multiply_const_ff.h b/gr-blocks/include/blocks/multiply_const_ff.h index e755f59bf..d2d5e805c 100644 --- a/gr-blocks/include/blocks/multiply_const_ff.h +++ b/gr-blocks/include/blocks/multiply_const_ff.h @@ -46,6 +46,7 @@ namespace gr { /*! * \brief Create an instance of multiply_const_ff * \param k real multiplicative constant + * \param vlen Vector length of incoming stream */ static sptr make(float k, size_t vlen=1); diff --git a/gr-blocks/include/blocks/stream_mux.h b/gr-blocks/include/blocks/stream_mux.h index 905ea3c9f..58d564f9f 100644 --- a/gr-blocks/include/blocks/stream_mux.h +++ b/gr-blocks/include/blocks/stream_mux.h @@ -53,7 +53,7 @@ namespace gr { * \ingroup converter_blk * * \param itemsize the item size of the stream - * \param length a vector (list/tuple) specifying the number of + * \param lengths a vector (list/tuple) specifying the number of * items from each stream the mux together. * Warning: this requires that at least as many items * per stream are available or the system will wait -- cgit From 95968f9e32cf8ea7b8f632f431f91adf49a353a7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 11 Dec 2012 22:48:03 -0500 Subject: blocks: apply changes to file source in core to one in gr-blocks. --- gr-blocks/include/blocks/file_source.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/file_source.h b/gr-blocks/include/blocks/file_source.h index 6207cdf70..1a12aa905 100644 --- a/gr-blocks/include/blocks/file_source.h +++ b/gr-blocks/include/blocks/file_source.h @@ -40,6 +40,21 @@ namespace gr { // gr::blocks::file_source::sptr typedef boost::shared_ptr sptr; + /*! + * \brief Create a file source. + * + * Opens \p filename as a source of items into a flowgraph. The + * data is expected to be in binary format, item after item. The + * \p itemsize of the block determines the conversion from bits + * to items. + * + * If \p repeat is turned on, the file will repeat the file after + * it's reached the end. + * + * \param itemsize the size of each item in the file, in bytes + * \param filename name of the file to source from + * \param repeat repeat file from start + */ static sptr make(size_t itemsize, const char *filename, bool repeat = false); /*! @@ -49,6 +64,19 @@ namespace gr { * \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek) */ virtual bool seek(long seek_point, int whence) = 0; + + /*! + * \brief Opens a new file. + * + * \param filename name of the file to source from + * \param repeat repeat file from start + */ + virtual void open(const char *filename, bool repeat) = 0; + + /*! + * \brief Close the file handle. + */ + virtual void close() = 0; }; } /* namespace blocks */ -- cgit From 461ece56b36a44b2405282630157739c7f9a26ba Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 14 Dec 2012 16:10:30 -0500 Subject: blocks: moving file metadata sink/source to gr-blocks. --- gr-blocks/include/blocks/CMakeLists.txt | 2 + gr-blocks/include/blocks/file_meta_sink.h | 111 ++++++++++++++++++++++++++++ gr-blocks/include/blocks/file_meta_source.h | 81 ++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 gr-blocks/include/blocks/file_meta_sink.h create mode 100644 gr-blocks/include/blocks/file_meta_source.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 787fddba3..0459097b0 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -102,6 +102,8 @@ install(FILES conjugate_cc.h deinterleave.h file_source.h + file_meta_sink.h + file_meta_source.h float_to_char.h float_to_complex.h float_to_int.h diff --git a/gr-blocks/include/blocks/file_meta_sink.h b/gr-blocks/include/blocks/file_meta_sink.h new file mode 100644 index 000000000..ef64887cf --- /dev/null +++ b/gr-blocks/include/blocks/file_meta_sink.h @@ -0,0 +1,111 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FILE_META_SINK_H +#define INCLUDED_BLOCKS_FILE_META_SINK_H + +#include +#include + +namespace gr { + namespace blocks { + + const char METADATA_VERSION = 0; + const size_t METADATA_HEADER_SIZE = 149; + + enum gr_file_types { + GR_FILE_BYTE=0, + GR_FILE_CHAR=0, + GR_FILE_SHORT=1, + GR_FILE_INT, + GR_FILE_LONG, + GR_FILE_LONG_LONG, + GR_FILE_FLOAT, + GR_FILE_DOUBLE, + }; + + /*! + * \brief Write stream to file with meta-data headers. + * \ingroup sink_blk + * + * These files represent data as binary information in between + * meta-data headers. The headers contain information about the + * type of data and properties of the data in the next segment of + * samples. The information includes: + * + * rx_rate (double): sample rate of data. + * rx_time (uint64_t, double): time stamp of first sample in segment. + * size (uint32_t): item size in bytes. + * type (gr_file_types as int32_t): data type. + * cplx (bool): Is data complex? + * strt (uint64_t): Starting byte of data in this segment. + * bytes (uint64_t): Size in bytes of data in this segment. + * + * Tags can be sent to the file to update the information, which + * will create a new header. Headers are found by searching from + * the first header (at position 0 in the file) and reading where + * the data segment starts plus the data segment size. Following + * will either be a new header or EOF. + */ + class BLOCKS_API file_meta_sink : virtual public gr_sync_block + { + public: + // gr::blocks::file_meta_sink::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Create a meta-data file sink. + * + * \param itemsize (size_t): Size of data type. + * \param filename (string): Name of file to write data to. + * \param samp_rate (double): Sample rate of data. If sample rate will be + * set by a tag, such as rx_tag from a UHD source, this is + * basically ignored. + * \param relative_rate (double): Rate chance from source of sample + * rate tag to sink. + * \param type (gr_file_types): Data type (int, float, etc.) + * \param complex (bool): If data stream is complex + * \param max_segment_size (size_t): Length of a single segment + * before the header is repeated (in items). + * \param extra_dict (string): a serialized PMT dictionary of extra + * information. Currently not supported. + * \param detached_header (bool): Set to true to store the header + * info in a separate file (named filename.hdr) + */ + static sptr make(size_t itemsize, const std::string &filename, + double samp_rate=1, double relative_rate=1, + gr_file_types type=GR_FILE_FLOAT, bool complex=true, + size_t max_segment_size=1000000, + const std::string &extra_dict="", + bool detached_header=false); + + virtual bool open(const std::string &filename) = 0; + virtual void close() = 0; + virtual void do_update() = 0; + + virtual void set_unbuffered(bool unbuffered) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FILE_META_SINK_H */ diff --git a/gr-blocks/include/blocks/file_meta_source.h b/gr-blocks/include/blocks/file_meta_source.h new file mode 100644 index 000000000..a992d5243 --- /dev/null +++ b/gr-blocks/include/blocks/file_meta_source.h @@ -0,0 +1,81 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_BLOCKS_FILE_META_SOURCE_H +#define INCLUDED_BLOCKS_FILE_META_SOURCE_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Reads stream from file with meta-data headers. Headers + * are parsed into tags. + * \ingroup source_blk + * + * The information in the metadata headers includes: + * + * rx_rate (double): sample rate of data. + * rx_time (uint64_t, double): time stamp of first sample in segment. + * size (uint32_t): item size in bytes. + * type (gr_file_types as int32_t): data type. + * cplx (bool): Is data complex? + * strt (uint64_t): Starting byte of data in this segment. + * bytes (uint64_t): Size in bytes of data in this segment. + * + * Any item inside of the extra header dictionary is ready out and + * made into a stream tag. + */ + class BLOCKS_API file_meta_source : virtual public gr_sync_block + { + public: + // gr::blocks::file_meta_source::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Create a meta-data file source. + * + * \param filename (string): Name of file to write data to. + * \param repeat (bool): Repeats file when EOF is found. + * \param detached_header (bool): Set to true if header + * info is stored in a separate file (usually named filename.hdr) + * \param hdr_filename (string): Name of detached header file if used. + * Defaults to 'filename.hdr' if detached_header is true but this + * field is an empty string. + */ + static sptr make(const std::string &filename, + bool repeat=false, + bool detached_header=false, + const std::string &hdr_filename=""); + + virtual bool open(const std::string &filename, + const std::string &hdr_filename="") = 0; + virtual void close() = 0; + virtual void do_update() = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FILE_META_SOURCE_H */ -- cgit From 2e2ed85be902b5ddae91bf22d9051554b1bdfd0b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Wed, 20 Feb 2013 11:47:19 -0500 Subject: blocks: adding count_bits code to gr-blocks. --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/count_bits.h | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gr-blocks/include/blocks/count_bits.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 0459097b0..37790b7cf 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -89,6 +89,7 @@ add_custom_target(blocks_generated_includes DEPENDS install(FILES ${generated_includes} api.h + count_bits.h add_ff.h char_to_float.h char_to_short.h diff --git a/gr-blocks/include/blocks/count_bits.h b/gr-blocks/include/blocks/count_bits.h new file mode 100644 index 000000000..ceb882f67 --- /dev/null +++ b/gr-blocks/include/blocks/count_bits.h @@ -0,0 +1,46 @@ +/* -*- c++ -*- */ +/* + * Copyright 2003,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. + */ + +#ifndef _GR_COUNT_BITS_H_ +#define _GR_COUNT_BITS_H_ + +#include + +namespace gr { + namespace blocks { + + //! return number of set bits in the low 8 bits of x + BLOCKS_API unsigned int count_bits8(unsigned int x); + + //! return number of set bits in the low 16 bits of x + BLOCKS_API unsigned int count_bits16(unsigned int x); + + //! return number of set bits in the low 32 bits of x + BLOCKS_API unsigned int count_bits32(unsigned int x); + + //! return number of set bits in a 64-bit word + BLOCKS_API unsigned int count_bits64(unsigned long long int x); + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* _GR_COUNT_BITS_H_ */ -- cgit From f42ef36d60348965936ede158886c1847670f774 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 21 Feb 2013 18:24:02 -0500 Subject: blocks: converting blocks to v3.7 style in gr-blocks. delay, rms, unpacked_to_packed, packed_to_unpacked --- gr-blocks/include/blocks/CMakeLists.txt | 6 ++ gr-blocks/include/blocks/delay.h | 57 +++++++++++++++++ gr-blocks/include/blocks/log2_const.h | 53 ++++++++++++++++ gr-blocks/include/blocks/packed_to_unpacked_XX.h.t | 73 ++++++++++++++++++++++ gr-blocks/include/blocks/rms_cf.h | 54 ++++++++++++++++ gr-blocks/include/blocks/rms_ff.h | 53 ++++++++++++++++ gr-blocks/include/blocks/unpacked_to_packed_XX.h.t | 72 +++++++++++++++++++++ 7 files changed, 368 insertions(+) create mode 100644 gr-blocks/include/blocks/delay.h create mode 100644 gr-blocks/include/blocks/log2_const.h create mode 100644 gr-blocks/include/blocks/packed_to_unpacked_XX.h.t create mode 100644 gr-blocks/include/blocks/rms_cf.h create mode 100644 gr-blocks/include/blocks/rms_ff.h create mode 100644 gr-blocks/include/blocks/unpacked_to_packed_XX.h.t (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 37790b7cf..a6608696a 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -78,6 +78,8 @@ expand_h(not_XX bb ss ii) expand_h(or_XX bb ss ii) expand_h(sub_XX ss ii ff cc) 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) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} @@ -90,6 +92,7 @@ install(FILES ${generated_includes} api.h count_bits.h + log2_const.h add_ff.h char_to_float.h char_to_short.h @@ -102,6 +105,7 @@ install(FILES complex_to_arg.h conjugate_cc.h deinterleave.h + delay.h file_source.h file_meta_sink.h file_meta_source.h @@ -123,6 +127,8 @@ install(FILES nlog10_ff.h patterned_interleaver.h repeat.h + rms_cf.h + rms_ff.h short_to_char.h short_to_float.h stream_mux.h diff --git a/gr-blocks/include/blocks/delay.h b/gr-blocks/include/blocks/delay.h new file mode 100644 index 000000000..2a59fa0fc --- /dev/null +++ b/gr-blocks/include/blocks/delay.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007,2012-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. + */ + +#ifndef INCLUDED_BLOCKS_DELAY_H +#define INCLUDED_BLOCKS_DELAY_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief delay the input by a certain number of samples + * \ingroup misc_blk + */ + class BLOCKS_API delay : virtual public gr_block + { + public: + // gr::blocks::delay::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make a delay block. + * \param itemsize size of the data items. + * \param delay number of samples to delay stream. + */ + static sptr make(size_t itemsize, int delay); + + virtual int dly() const = 0; + virtual void set_dly(int d) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_DELAY_H */ + diff --git a/gr-blocks/include/blocks/log2_const.h b/gr-blocks/include/blocks/log2_const.h new file mode 100644 index 000000000..67d63810f --- /dev/null +++ b/gr-blocks/include/blocks/log2_const.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,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. + */ + + +/* + * a bit of template hackery... + */ +#ifndef INCLUDED_BLOCKS_LOG2_CONST_H +#define INCLUDED_BLOCKS_LOG2_CONST_H + +#include +#include + +namespace gr { + namespace blocks { + + template static inline int log2_const() { assert(0); return 0; } + + template<> inline int log2_const<1>() { return 0; } + template<> inline int log2_const<2>() { return 1; } + template<> inline int log2_const<4>() { return 2; } + template<> inline int log2_const<8>() { return 3; } + template<> inline int log2_const<16>() { return 4; } + template<> inline int log2_const<32>() { return 5; } + template<> inline int log2_const<64>() { return 6; } + template<> inline int log2_const<128>() { return 7; } + template<> inline int log2_const<256>() { return 8; } + template<> inline int log2_const<512>() { return 9; } + template<> inline int log2_const<1024>(){ return 10; } + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_LOG2_CONST_H */ diff --git a/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t new file mode 100644 index 000000000..9ab8b8bdf --- /dev/null +++ b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t @@ -0,0 +1,73 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,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. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. + * \ingroup converter_blk + * + * input: stream of @I_TYPE@; output: stream of @O_TYPE@ + * + * This is the inverse of gr::blocks::unpacked_to_packed_XX. + * + * The bits in the bytes or shorts input stream are grouped into + * chunks of \p bits_per_chunk bits and each resulting chunk is + * written right- justified to the output stream of bytes or + * shorts. All b or 16 bits of the each input bytes or short are + * processed. The right thing is done if bits_per_chunk is not a + * power of two. + * + * The combination of gr_packed_to_unpacked_XX_ followed by + * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the + * general case of mapping from a stream of bytes or shorts into + * arbitrary float or complex symbols. + * + * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb, + * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss, + * \sa gr::blocks::chunks_to_symbols_bf, gr::blocks::chunks_to_symbols_bc. + * \sa gr::blocks::chunks_to_symbols_sf, gr::blocks::chunks_to_symbols_sc. + */ + class BLOCKS_API @NAME@ : virtual public gr_block + { + public: + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(unsigned int bits_per_chunk, + gr_endianness_t endianness); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/rms_cf.h b/gr-blocks/include/blocks/rms_cf.h new file mode 100644 index 000000000..e73be6923 --- /dev/null +++ b/gr-blocks/include/blocks/rms_cf.h @@ -0,0 +1,54 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,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. + */ + +#ifndef INCLUDED_BLOCKS_RMS_CF_H +#define INCLUDED_BLOCKS_RMS_CF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief RMS average power + * \ingroup math_blk + */ + class BLOCKS_API rms_cf : virtual public gr_sync_block + { + public: + // gr::blocks::rms_cf::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make an RMS calc. block. + * \param alpha gain for running average filter. + */ + static sptr make(double alpha = 0.0001); + + virtual void set_alpha(double alpha) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_RMS_CF_H */ diff --git a/gr-blocks/include/blocks/rms_ff.h b/gr-blocks/include/blocks/rms_ff.h new file mode 100644 index 000000000..19fb0016d --- /dev/null +++ b/gr-blocks/include/blocks/rms_ff.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,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. + */ +#ifndef INCLUDED_BLOCKS_RMS_FF_H +#define INCLUDED_BLOCKS_RMS_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief RMS average power + * \ingroup math_blk + */ + class BLOCKS_API rms_ff : virtual public gr_sync_block + { + public: + // gr::blocks::rms_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make an RMS calc. block. + * \param alpha gain for running average filter. + */ + static sptr make(double alpha = 0.0001); + + virtual void set_alpha(double alpha) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_RMS_FF_H */ diff --git a/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t new file mode 100644 index 000000000..749f0e00f --- /dev/null +++ b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t @@ -0,0 +1,72 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,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. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. + * \ingroup converter_blk + * + * input: stream of @I_TYPE@; output: stream of @O_TYPE@ + * + * This is the inverse of gr::blocks::packed_to_unpacked_XX. + * + * The low \p bits_per_chunk bits are extracted from each input + * byte or short. These bits are then packed densely into the + * output bytes or shorts, such that all 8 or 16 bits of the + * output bytes or shorts are filled with valid input bits. The + * right thing is done if bits_per_chunk is not a power of two. + * + * The combination of gr_packed_to_unpacked_XX followed by + * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the + * general case of mapping from a stream of bytes or shorts into + * arbitrary float or complex symbols. + * + * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb, + * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss, + * \sa gr::blocks::chunks_to_symbols_bf, gr::blocks::chunks_to_symbols_bc. + * \sa gr::blocks::chunks_to_symbols_sf, gr::blocks::chunks_to_symbols_sc. + */ + class BLOCKS_API @NAME@ : virtual public gr_block + { + public: + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(unsigned int bits_per_chunk, + gr_endianness_t endianness); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ -- cgit From ffcaa3436cc8e608cb51bad78ca669b90bd110f2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 24 Feb 2013 14:15:05 -0500 Subject: blocks: converted peak_detector2 and regenerate to v3.7. --- gr-blocks/include/blocks/CMakeLists.txt | 2 + gr-blocks/include/blocks/peak_detector2_fb.h | 91 ++++++++++++++++++++++++++++ gr-blocks/include/blocks/regenerate_bb.h | 80 ++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 gr-blocks/include/blocks/peak_detector2_fb.h create mode 100644 gr-blocks/include/blocks/regenerate_bb.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index a6608696a..cd2fea672 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -126,6 +126,8 @@ install(FILES multiply_const_ff.h nlog10_ff.h patterned_interleaver.h + peak_detector2_fb.h + regenerate_bb.h repeat.h rms_cf.h rms_ff.h diff --git a/gr-blocks/include/blocks/peak_detector2_fb.h b/gr-blocks/include/blocks/peak_detector2_fb.h new file mode 100644 index 000000000..71afc3287 --- /dev/null +++ b/gr-blocks/include/blocks/peak_detector2_fb.h @@ -0,0 +1,91 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007,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. + */ + +#ifndef INCLUDED_GR_PEAK_DETECTOR2_FB_H +#define INCLUDED_GR_PEAK_DETECTOR2_FB_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Detect the peak of a signal + * \ingroup level_blk + * + * If a peak is detected, this block outputs a 1, or it outputs + * 0's. A separate debug output may be connected, to view the + * internal EWMA described below. + * + * \param threshold_factor_rise The threshold factor determins + * when a peak is present. An EWMA average of the signal is + * calculated and when the value of the signal goes over + * threshold_factor_rise*average, we call the peak. + * \param look_ahead The look-ahead value is used when the + * threshold is found to locate the peak within this range. + * \param alpha The gain value of a single-pole moving average filter. + */ + class BLOCKS_API peak_detector2_fb : virtual public gr_sync_block + { + public: + // gr::blocks::peak_detector2_fb::sptr + typedef boost::shared_ptr sptr; + + static sptr make(float threshold_factor_rise=7, + int look_ahead=1000, float alpha=0.001); + + /*! \brief Set the threshold factor value for the rise time + * \param thr new threshold factor + */ + virtual void set_threshold_factor_rise(float thr) = 0; + + /*! \brief Set the look-ahead factor + * \param look new look-ahead factor + */ + virtual void set_look_ahead(int look) = 0; + + /*! \brief Set the running average alpha + * \param alpha new alpha for running average + */ + virtual void set_alpha(int alpha) = 0; + + /*! \brief Get the threshold factor value for the rise time + * \return threshold factor + */ + virtual float threshold_factor_rise() = 0; + + /*! \brief Get the look-ahead factor value + * \return look-ahead factor + */ + virtual int look_ahead() = 0; + + /*! \brief Get the alpha value of the running average + * \return alpha + */ + virtual float alpha() = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_PEAK_DETECTOR2_FB_H */ diff --git a/gr-blocks/include/blocks/regenerate_bb.h b/gr-blocks/include/blocks/regenerate_bb.h new file mode 100644 index 000000000..3063e70a7 --- /dev/null +++ b/gr-blocks/include/blocks/regenerate_bb.h @@ -0,0 +1,80 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007,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. + */ + +#ifndef INCLUDED_GR_REGENERATE_BB_H +#define INCLUDED_GR_REGENERATE_BB_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Detect the peak of a signal and repeat every period samples + * \ingroup level_blk + * + * If a peak is detected, this block outputs a 1 repeated every + * period samples until reset by detection of another 1 on the + * input or stopped after max_regen regenerations have occurred. + * + * Note that if max_regen=(-1)/ULONG_MAX then the regeneration + * will run forever. + */ + class BLOCKS_API regenerate_bb : virtual public gr_sync_block + { + public: + // gr::blocks::regenerate_bb::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make a regenerate block + * \param period The number of samples between regenerations + * \param max_regen The maximum number of regenerations to + * perform; if set to ULONG_MAX, it will regenerate + * continuously. + */ + static sptr make(int period, unsigned int max_regen=500); + + /*! \brief Reset the maximum regeneration count; this will reset + the current regen. + */ + virtual void set_max_regen(unsigned int regen) = 0; + + /*! \brief Reset the period of regenerations; this will reset + the current regen. + */ + virtual void set_period(int period) = 0; + + /*! \brief return the maximum regeneration count. + */ + virtual unsigned int max_regen() const = 0; + + /*! \brief return the regeneration period. + */ + virtual int period() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_REGENERATE_BB_H */ -- cgit From a54dc5bab6cc38513e9732be9f5c2670145b160f Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 24 Feb 2013 18:55:04 -0500 Subject: blocks: adding threshold, strech, and throttle to gr-blocks. --- gr-blocks/include/blocks/CMakeLists.txt | 3 ++ gr-blocks/include/blocks/stretch_ff.h | 59 +++++++++++++++++++++++++++++ gr-blocks/include/blocks/threshold_ff.h | 66 +++++++++++++++++++++++++++++++++ gr-blocks/include/blocks/throttle.h | 62 +++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 gr-blocks/include/blocks/stretch_ff.h create mode 100644 gr-blocks/include/blocks/threshold_ff.h create mode 100644 gr-blocks/include/blocks/throttle.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index cd2fea672..8d5fe9b13 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -138,6 +138,9 @@ install(FILES stream_to_vector.h streams_to_stream.h streams_to_vector.h + stretch_ff.h + threshold_ff.h + throttle.h uchar_to_float.h vector_to_stream.h vector_to_streams.h diff --git a/gr-blocks/include/blocks/stretch_ff.h b/gr-blocks/include/blocks/stretch_ff.h new file mode 100644 index 000000000..5f98452a4 --- /dev/null +++ b/gr-blocks/include/blocks/stretch_ff.h @@ -0,0 +1,59 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008,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. + */ + +#ifndef INCLUDED_GR_STRETCH_FF_H +#define INCLUDED_GR_STRETCH_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief adjust y-range of an input vector by mapping to range + * (max-of-input, stipulated-min). Primarily for spectral + * signature matching by normalizing spectrum dynamic ranges. + * \ingroup misc_blk + */ + class BLOCKS_API stretch_ff : virtual public gr_sync_block + { + public: + // gr::blocks::stretch_ff::sptr + typedef boost::shared_ptr sptr; + + /*! + * \brief Make a stretch block. + * \param lo Set low value for range. + * \param vlen vector length of input stream. + */ + static sptr make(float lo, size_t vlen=1); + + virtual float lo() const = 0; + virtual void set_lo(float lo) = 0; + virtual size_t vlen() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_STRETCH_FF_H */ diff --git a/gr-blocks/include/blocks/threshold_ff.h b/gr-blocks/include/blocks/threshold_ff.h new file mode 100644 index 000000000..900e5c5bd --- /dev/null +++ b/gr-blocks/include/blocks/threshold_ff.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,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. + */ + +#ifndef INCLUDED_GR_THRESHOLD_FF_H +#define INCLUDED_GR_THRESHOLD_FF_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief Output a 1 or zero based on a threshold value. + * \ingroup misc_blk + * + * Test the incoming signal against a threshold. If the signal + * excedes the \p hi value, it will output a 1 until the signal + * falls below the \p lo value. + */ + class BLOCKS_API threshold_ff : virtual public gr_sync_block + { + public: + // gr::blocks::threshold_ff::sptr + typedef boost::shared_ptr sptr; + + /* \brief Create a threadshold block. + * \param lo Threshold input signal needs to drop below to + * change state to 0. + * \param hi Threshold input signal needs to rise above to + * change state to 1. + * \param initial_state Initial state of the block (0 or 1). + */ + static sptr make(float lo, float hi, float initial_state=0); + + virtual float lo () const = 0; + virtual void set_lo (float lo) = 0; + virtual float hi () const = 0; + virtual void set_hi (float hi) = 0; + virtual float last_state () const = 0; + virtual void set_last_state (float last_state) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_THRESHOLD_FF_H */ diff --git a/gr-blocks/include/blocks/throttle.h b/gr-blocks/include/blocks/throttle.h new file mode 100644 index 000000000..20d8037e1 --- /dev/null +++ b/gr-blocks/include/blocks/throttle.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005-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. + */ + +#ifndef INCLUDED_GR_THROTTLE_H +#define INCLUDED_GR_THROTTLE_H + +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief throttle flow of samples such that the average rate does + * not exceed samples_per_sec. + * \ingroup misc_blk + * + * input: one stream of itemsize; output: one stream of itemsize + * + * N.B. this should only be used in GUI apps where there is no + * other rate limiting block. It is not intended nor effective at + * precisely controlling the rate of samples. That should be + * controlled by a source or sink tied to sample clock. E.g., a + * USRP or audio card. + */ + class BLOCKS_API throttle : virtual public gr_sync_block + { + public: + typedef boost::shared_ptr sptr; + + static sptr make(size_t itemsize, double samples_per_sec); + + //! Sets the sample rate in samples per second. + virtual void set_sample_rate(double rate) = 0; + + //! Get the sample rate in samples per second. + virtual double sample_rate() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_THROTTLE_H */ -- cgit From 5c7b8118d4d0f8413d64933cabec84b18cdaf193 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 25 Feb 2013 21:16:19 -0500 Subject: blocks: moved transcendental block to gr-blocks. --- gr-blocks/include/blocks/CMakeLists.txt | 1 + gr-blocks/include/blocks/transcendental.h | 56 +++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 gr-blocks/include/blocks/transcendental.h (limited to 'gr-blocks/include/blocks') diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 8d5fe9b13..d3c08f6e6 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -141,6 +141,7 @@ install(FILES stretch_ff.h threshold_ff.h throttle.h + transcendental.h uchar_to_float.h vector_to_stream.h vector_to_streams.h diff --git a/gr-blocks/include/blocks/transcendental.h b/gr-blocks/include/blocks/transcendental.h new file mode 100644 index 000000000..f8a0d5d80 --- /dev/null +++ b/gr-blocks/include/blocks/transcendental.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ +/* + * Copyright 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. + */ + +#ifndef INCLUDED_GR_TRANSCENDENTAL_H +#define INCLUDED_GR_TRANSCENDENTAL_H + +#include +#include +#include + +namespace gr { + namespace blocks { + + /*! + * \brief A block that performs various transcendental math operations. + * + * Possible function names can be found in the cmath library. IO + * may be either complex or real, double or single precision. + * + * Possible type strings: float, double, complex_float, complex_double + * + * output[i] = trans_fcn(input[i]) + */ + class BLOCKS_API transcendental : virtual public gr_sync_block + { + public: + // gr::blocks::transcendental::sptr + typedef boost::shared_ptr sptr; + + static sptr make(const std::string &name, + const std::string &type="float"); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_TRANSCENDENTAL_H */ -- cgit