diff options
Diffstat (limited to 'gr-blocks/include')
59 files changed, 3358 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt new file mode 100644 index 000000000..0459097b0 --- /dev/null +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -0,0 +1,137 @@ +# 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) +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) +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) +expand_h(xor_XX bb ss ii) + +add_custom_target(blocks_generated_includes DEPENDS + ${generated_includes} +) + +######################################################################## +# Install header files +######################################################################## +install(FILES + ${generated_includes} + api.h + add_ff.h + char_to_float.h + char_to_short.h + complex_to_interleaved_short.h + complex_to_float.h + complex_to_imag.h + complex_to_real.h + complex_to_mag.h + complex_to_mag_squared.h + complex_to_arg.h + 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 + float_to_short.h + float_to_uchar.h + 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 + multiply_conjugate_cc.h + multiply_const_cc.h + multiply_const_ff.h + nlog10_ff.h + patterned_interleaver.h + repeat.h + short_to_char.h + short_to_float.h + stream_mux.h + stream_to_streams.h + stream_to_vector.h + streams_to_stream.h + 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/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 <blocks/api.h> +#include <gr_sync_block.h> + +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_const_XX.h.t b/gr-blocks/include/blocks/add_const_XX.h.t new file mode 100644 index 000000000..df968feac --- /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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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/add_ff.h b/gr-blocks/include/blocks/add_ff.h new file mode 100644 index 000000000..1e7350c1b --- /dev/null +++ b/gr-blocks/include/blocks/add_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_BLOCKS_ADD_FF_H +#define INCLUDED_BLOCKS_ADD_FF_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + class BLOCKS_API add_ff : virtual public gr_sync_block + { + public: + + // gr::blocks::add_ff::sptr + typedef boost::shared_ptr<add_ff> sptr; + + /*! + * \brief Add 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_ADD_FF_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <gruel/attributes.h> + +#ifdef gnuradio_blocks_EXPORTS +# define BLOCKS_API __GR_ATTR_EXPORT +#else +# define BLOCKS_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_BLOCKS_API_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<char_to_float> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<char_to_short> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_CHAR_TO_SHORT_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_arg> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_ARG_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_float> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_FLOAT_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_imag> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_IMAG_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..f5e91123c --- /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 <blocks/api.h> +#include <gr_sync_interpolator.h> + +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::sptr + typedef boost::shared_ptr<complex_to_interleaved_short> sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_INTERLEAVED_SHORT_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_mag> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_MAG_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_mag_squared> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_MAG_SQUARED_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<complex_to_real> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_COMPLEX_TO_REAL_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<conjugate_cc> sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_CONJUGATE_CC_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 <blocks/api.h> +#include <gr_sync_decimator.h> + +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<deinterleave> sptr; + + static sptr make(size_t itemsize); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_DEINTERLEAVE_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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/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 <blocks/api.h> +#include <gr_sync_block.h> + +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<file_meta_sink> 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<file_meta_source> 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 */ diff --git a/gr-blocks/include/blocks/file_source.h b/gr-blocks/include/blocks/file_source.h new file mode 100644 index 000000000..1a12aa905 --- /dev/null +++ b/gr-blocks/include/blocks/file_source.h @@ -0,0 +1,85 @@ +/* -*- 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<file_source> 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); + + /*! + * \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; + + /*! + * \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 */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FILE_SOURCE_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<float_to_char> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<float_to_complex> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_COMPLEX_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<float_to_int> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<float_to_short> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<float_to_uchar> sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_FLOAT_TO_UCHAR_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<int_to_float> 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 */ 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 <blocks/api.h> +#include <gr_sync_decimator.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_interpolator.h> + +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<interleave> sptr; + + static sptr make(size_t itemsize); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_INTERLEAVE_H */ 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 <blocks/api.h> +#include <gr_sync_decimator.h> + +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<interleaved_short_to_complex> sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_INTERLEAVED_SHORT_TO_COMPLEX_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 <blocks/api.h> +#include <gr_block.h> + +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<keep_m_in_n> 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 */ 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 <blocks/api.h> +#include <gr_block.h> + +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<keep_one_in_n> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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 <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + class BLOCKS_API multiply_cc : virtual public gr_sync_block + { + public: + + // gr::blocks::multiply_cc::sptr + typedef boost::shared_ptr<multiply_cc> 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_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 <blocks/api.h> +#include <gr_sync_block.h> + +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<multiply_conjugate_cc> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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..9572eaec7 --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_cc.h @@ -0,0 +1,67 @@ +/* -*- 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<multiply_const_cc> sptr; + + /*! + * \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); + + /*! + * \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..d2d5e805c --- /dev/null +++ b/gr-blocks/include/blocks/multiply_const_ff.h @@ -0,0 +1,67 @@ +/* -*- 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<multiply_const_ff> sptr; + + /*! + * \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); + + /*! + * \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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + class BLOCKS_API multiply_ff : virtual public gr_sync_block + { + public: + + // gr::blocks::multiply_ff::sptr + typedef boost::shared_ptr<multiply_ff> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<nlog10_ff> 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 */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_block.h> + +namespace gr { + namespace blocks { + + class BLOCKS_API patterned_interleaver : virtual public gr_block + { + public: + + typedef boost::shared_ptr<patterned_interleaver> sptr; + + static sptr make(size_t itemsize, std::vector<int> pattern); + }; + + } +} + +#endif + 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 <blocks/api.h> +#include <gr_sync_interpolator.h> + +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<repeat> sptr; + + static sptr make(size_t itemsize, int repeat); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_REPEAT_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<short_to_char> sptr; + + static sptr make(size_t vlen=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_SHORT_TO_CHAR_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<short_to_float> 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 */ diff --git a/gr-blocks/include/blocks/stream_mux.h b/gr-blocks/include/blocks/stream_mux.h new file mode 100644 index 000000000..58d564f9f --- /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 <blocks/api.h> +#include <gr_block.h> +#include <vector> + +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<stream_mux> 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 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 + * indefinitely for the items. + * + */ + static sptr make(size_t itemsize, const std::vector<int> &lengths); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_MUX_H */ 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 <blocks/api.h> +#include <gr_sync_decimator.h> + +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<stream_to_streams> sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_TO_STREAMS_H */ 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 <blocks/api.h> +#include <gr_sync_decimator.h> + +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<stream_to_vector> sptr; + + static sptr make(size_t itemsize, size_t nitems_per_block); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAM_TO_VECTOR_H */ 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 <blocks/api.h> +#include <gr_sync_interpolator.h> + +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<streams_to_stream> sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAMS_TO_STREAM_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<streams_to_vector> sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_STREAMS_TO_VECTOR_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<uchar_to_float> sptr; + + static sptr make(); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_UCHAR_TO_FLOAT_H */ 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 <blocks/api.h> +#include <gr_sync_interpolator.h> + +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<vector_to_stream> sptr; + + static sptr make(size_t itemsize, size_t nitems_per_block); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_VECTOR_TO_STREAM_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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<vector_to_streams> sptr; + + static sptr make(size_t itemsize, size_t nstreams); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_BLOCKS_VECTOR_TO_STREAMS_H */ 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 <blocks/api.h> +#include <gr_sync_block.h> + +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@ */ |