diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-04-11 21:31:25 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-04-11 21:31:25 +0000 |
commit | c989df7703fb0c2869dc1de7e18df311e2bf626a (patch) | |
tree | 2b4f504ae311ed1912ba7ce59af048767ecf8be0 /gnuradio-core/src/lib/general/gr_repeat.h | |
parent | a761af14ad4a589637658f20ed3e58fcf7131bdd (diff) |
Adds gr.repeat(), an interpolating block to repeat a sample N times on the output.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8186 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/general/gr_repeat.h')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_repeat.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gr_repeat.h b/gnuradio-core/src/lib/general/gr_repeat.h new file mode 100644 index 0000000000..62b397c54b --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_repeat.h @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008 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_REPEAT_H +#define INCLUDED_GR_REPEAT_H + +#include <gr_sync_interpolator.h> + +class gr_repeat; + +typedef boost::shared_ptr<gr_repeat> gr_repeat_sptr; + +gr_repeat_sptr gr_make_repeat(size_t itemsize, int decim); + +/*! + * \brief Repeat a sample 'interp' times in output stream + * \ingroup converter + */ + +class gr_repeat : public gr_sync_interpolator +{ +private: + friend gr_repeat_sptr gr_make_repeat(size_t itemsize, int interp); + + gr_repeat(size_t itemsize, int interp); + + int d_interp; + int d_itemsize; + + public: + ~gr_repeat(); + + int work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + +#endif /* INCLUDED_GR_REPEAT_H */ |