GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
interleave.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012,2014 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_BLOCKS_INTERLEAVE_H
12#define INCLUDED_BLOCKS_INTERLEAVE_H
13
14#include <gnuradio/block.h>
15#include <gnuradio/blocks/api.h>
16
17namespace gr {
18namespace blocks {
19
20/*!
21 * \brief interleave N inputs into a single output
22 * \ingroup stream_operators_blk
23 *
24 * \details
25 *
26 * This block interleaves blocks of samples. For each input
27 * connection, the samples are interleaved successively to the
28 * output connection. By default, the block interleaves a single
29 * sample from each input to the output unless blocksize is given
30 * in the constructor.
31 *
32 * \code
33 * blocksize = 1
34 * connections = 2
35 * input[0] = [a, c, e, g]
36 * input[1] = [b, d, f, h]
37 * output = [a, b, c, d, e, f, g, h]
38 * \endcode
39 *
40 * \code
41 * blocksize = 2
42 * connections = 2
43 * input[0] = [a, b, e, f]
44 * input[1] = [c, d, g, h]
45 * output = [a, b, c, d, e, f, g, h]
46 * \endcode
47 */
48class BLOCKS_API interleave : virtual public block
49{
50public:
51 // gr::blocks::interleave::sptr
52 typedef std::shared_ptr<interleave> sptr;
53
54 /*!
55 * Make a stream interleave block.
56 *
57 * \param itemsize stream itemsize
58 * \param blocksize size of block of samples to interleave
59 */
60 static sptr make(size_t itemsize, unsigned int blocksize = 1);
61};
62
63} /* namespace blocks */
64} /* namespace gr */
65
66#endif /* INCLUDED_BLOCKS_INTERLEAVE_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
interleave N inputs into a single output
Definition: interleave.h:49
std::shared_ptr< interleave > sptr
Definition: interleave.h:52
static sptr make(size_t itemsize, unsigned int blocksize=1)
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GR_RUNTIME_API size_t itemsize(types::vector_type type)
GNU Radio logging wrapper.
Definition: basic_block.h:29