GNU Radio 3.7.2 C++ API
ofdm_carrier_allocator_cvc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 
24 #ifndef INCLUDED_DIGITAL_OFDM_CARRIER_ALLOCATOR_CVC_H
25 #define INCLUDED_DIGITAL_OFDM_CARRIER_ALLOCATOR_CVC_H
26 
27 #include <gnuradio/digital/api.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief Create frequency domain OFDM symbols from complex values, add pilots.
35  * \ingroup ofdm_blk
36  *
37  * \details
38  * This block turns a stream of complex, scalar modulation symbols into vectors
39  * which are the input for an IFFT in an OFDM transmitter. It also supports the
40  * possibility of placing pilot symbols onto the carriers.
41  *
42  * The carriers can be allocated freely, if a carrier is not allocated, it is set
43  * to zero. This allows doing OFDMA-style carrier allocations.
44  *
45  * Input: A tagged stream of complex scalars. The first item must have a tag
46  * containing the number of complex symbols in this frame.
47  * Output: A tagged stream of complex vectors of length fft_len. This can directly
48  * be connected to an FFT block. Make sure to set this block to 'reverse'
49  * for the IFFT. If \p output_is_shifted is true, the FFT block must activate
50  * FFT shifting, otherwise, set shifting to false. If given, sync words are
51  * prepended to the output. Note that sync words are prepended verbatim,
52  * make sure they are shifted (or not).
53  *
54  * Carrier indexes are always such that index 0 is the DC carrier (note: you should
55  * not allocate this carrier). The carriers below the DC carrier are either indexed
56  * with negative numbers, or with indexes larger than \p fft_len/2. Index -1 and index
57  * \p fft_len-1 both identify the carrier below the DC carrier.
58  *
59  * Tags are propagated such that a tag on an incoming complex symbol is mapped to the
60  * corresponding OFDM symbol. There is one exception: If a tag is on the first OFDM
61  * symbol, it is assumed that this tag should stay there, so it is moved to the front
62  * even if a sync word is included (any other tags will never be attached to the
63  * sync word). This allows tags to control the transmit timing to pass through in the
64  * correct position.
65  */
67  {
68  public:
70 
71  virtual std::string len_tag_key() = 0;
72  virtual const int fft_len() = 0;
73  virtual std::vector<std::vector<int> > occupied_carriers() = 0;
74 
75  /*
76  * \param fft_len FFT length, is also the maximum width of the OFDM symbols, the
77  * output vector size and maximum value for elements in
78  * \p occupied_carriers and \p pilot_carriers.
79  * \param occupied_carriers A vector of vectors of indexes. Example: if
80  * occupied_carriers = ((1, 2, 3), (1, 2, 4)), the first
81  * three input symbols will be mapped to carriers 1, 2
82  * and 3. After that, a new OFDM symbol is started. The next
83  * three input symbols will be placed onto carriers 1, 2
84  * and 4 of the second OFDM symbol. The allocation then
85  * starts from the beginning.
86  * Order matters! The first input symbol is always mapped
87  * onto occupied_carriers[0][0].
88  * \param pilot_carriers The position of the pilot symbols. Same as occupied_carriers,
89  * but the actual symbols are taken from pilot_symbols instead
90  * of the input stream.
91  * \param pilot_symbols The pilot symbols which are placed onto the pilot carriers.
92  * pilot_symbols[0][0] is placed onto the first OFDM symbol, on
93  * carrier index pilot_carriers[0][0] etc.
94  * \param sync_words OFDM symbols that are prepended to the OFDM frame (usually for
95  * synchronisation purposes, e.g. OFDM symbols with every second
96  * sub-carrier being idle). Is a vector of complex vectors of length
97  * \p fft_len
98  * \param len_tag_key The key of the tag identifying the length of the input packet.
99  */
100  static sptr make(
101  int fft_len,
102  const std::vector<std::vector<int> > &occupied_carriers,
103  const std::vector<std::vector<int> > &pilot_carriers,
104  const std::vector<std::vector<gr_complex> > &pilot_symbols,
105  const std::vector<std::vector<gr_complex> > &sync_words,
106  const std::string &len_tag_key = "packet_len",
107  const bool output_is_shifted=true);
108  };
109 
110  } // namespace digital
111 } // namespace gr
112 
113 #endif /* INCLUDED_DIGITAL_OFDM_CARRIER_ALLOCATOR_CVC_H */
114 
Block that operates on PDUs in form of tagged streamsOverride work to provide the signal processing i...
Definition: tagged_stream_block.h:37
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
boost::shared_ptr< ofdm_carrier_allocator_cvc > sptr
Definition: ofdm_carrier_allocator_cvc.h:69
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
Create frequency domain OFDM symbols from complex values, add pilots.
Definition: ofdm_carrier_allocator_cvc.h:66