GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
ofdm_cyclic_prefixer.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013, 2018 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_DIGITAL_OFDM_CYCLIC_PREFIXER_H
12 #define INCLUDED_DIGITAL_OFDM_CYCLIC_PREFIXER_H
13 
14 #include <gnuradio/digital/api.h>
16 
17 namespace gr {
18 namespace digital {
19 
20 /*!
21  * \brief Adds a cyclic prefix and performs optional pulse shaping on OFDM symbols.
22  * \ingroup ofdm_blk
23  *
24  * \details
25  * Input: OFDM symbols (in the time domain, i.e. after the IFFT). Optionally,
26  * entire frames can be processed. In this case, \p len_tag_key must be
27  * specified which holds the key of the tag that denotes how
28  * many OFDM symbols are in a frame.
29  * Output: A stream of (scalar) complex symbols, which include the cyclic prefix
30  * and the pulse shaping.
31  * Note: If complete frames are processed, and \p rolloff_len is greater
32  * than zero, the final OFDM symbol is followed by the delay line of
33  * the pulse shaping.
34  *
35  * The pulse shape is a raised cosine in the time domain.
36  *
37  * Different CP lengths as for instance needed in LTE are supported. This
38  * is why one of the inputs is std::vector<int>. After every CP given has
39  * been prepended to symbols, each with the length of the IFFT operation,
40  * the mechanism will wrap around and start over. To give an example, the
41  * input tuple for LTE with an FFT length of 2048 would be (160,) +
42  * (144,)*6, which is equal to (160, 144, 144, 144, 144, 144, 144). A
43  * uniform CP would be indicated by (uniform_cp_length, ).
44  *
45  * This block does some sanity checking: 1. It is not allowed to have a
46  * vector of CP lengths, which are only 0. 2. Not a single CP in the
47  * vector must be longer than the rolloff. 3. Not a single CP is allowed to
48  * be < 0.
49  */
51 {
52 public:
53  typedef std::shared_ptr<ofdm_cyclic_prefixer> sptr;
54 
55  /*!
56  * \param input_size IFFT length (i.e. length of the OFDM symbols).
57  * \param output_size FFT length + cyclic prefix length (in samples).
58  * \param rolloff_len Length of the rolloff flank in samples.
59  * \param len_tag_key For framed processing the key of the length tag.
60  */
61  static sptr make(size_t input_size,
62  size_t output_size,
63  int rolloff_len = 0,
64  const std::string& len_tag_key = "");
65 
66  /*!
67  * \param fft_len IFFT length (i.e. length of the OFDM symbols).
68  * \param cp_lengths CP lengths. Wraps around after reaching the end.
69  * \param rolloff_len Length of the rolloff flank in samples.
70  * \param len_tag_key For framed processing the key of the length tag.
71  */
72  static sptr make(int fft_len,
73  const std::vector<int>& cp_lengths,
74  int rolloff_len = 0,
75  const std::string& len_tag_key = "");
76 };
77 
78 } // namespace digital
79 } // namespace gr
80 
81 #endif /* INCLUDED_DIGITAL_OFDM_CYCLIC_PREFIXER_H */
Adds a cyclic prefix and performs optional pulse shaping on OFDM symbols.
Definition: ofdm_cyclic_prefixer.h:51
static sptr make(int fft_len, const std::vector< int > &cp_lengths, int rolloff_len=0, const std::string &len_tag_key="")
static sptr make(size_t input_size, size_t output_size, int rolloff_len=0, const std::string &len_tag_key="")
std::shared_ptr< ofdm_cyclic_prefixer > sptr
Definition: ofdm_cyclic_prefixer.h:53
Block that operates on PDUs in form of tagged streams.
Definition: tagged_stream_block.h:26
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29