GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
delay.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2007,2012-2013 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_DELAY_H
12#define INCLUDED_BLOCKS_DELAY_H
13
14#include <gnuradio/block.h>
15#include <gnuradio/blocks/api.h>
16
17namespace gr {
18namespace blocks {
19
20/*!
21 * \brief delay the input by a certain number of samples
22 * \ingroup misc_blk
23 *
24 * Positive delays insert zero items at the beginning of the stream.
25 * Negative delays discard items from the stream.
26 *
27 * You cannot initialize this block with a negative delay,
28 * however. That leads to a causality issue with the buffers when
29 * they are initialized. If you need to negetively delay one path,
30 * then put the positive delay on the other path instead.
31 */
32class BLOCKS_API delay : virtual public block
33{
34public:
35 // gr::blocks::delay::sptr
36 typedef std::shared_ptr<delay> sptr;
37
38 /*!
39 * \brief Make a delay block.
40 * \param itemsize size of the data items.
41 * \param delay number of samples to delay stream (>= 0).
42 */
43 static sptr make(size_t itemsize, int delay);
44
45 virtual int dly() const = 0;
46
47 /*!
48 * \brief Reset the delay.
49 * \param d change the delay value. This can be a positive or
50 * negative value.
51 */
52 virtual void set_dly(int d) = 0;
53};
54
55} /* namespace blocks */
56} /* namespace gr */
57
58#endif /* INCLUDED_BLOCKS_DELAY_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
delay the input by a certain number of samples
Definition: delay.h:33
std::shared_ptr< delay > sptr
Definition: delay.h:36
virtual int dly() const =0
virtual void set_dly(int d)=0
Reset the delay.
static sptr make(size_t itemsize, int delay)
Make a delay block.
#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