GNU Radio 3.6.5 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* Copyright 2012 Free Software Foundation, Inc. 00003 * 00004 * This file is part of GNU Radio 00005 * 00006 * GNU Radio is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3, or (at your option) 00009 * any later version. 00010 * 00011 * GNU Radio is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with GNU Radio; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H 00023 #define INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H 00024 00025 #include <digital/api.h> 00026 #include <gr_tagged_stream_block.h> 00027 #include <digital_ofdm_carrier_allocator_cvc.h> 00028 00029 namespace gr { 00030 namespace digital { 00031 00032 /*! 00033 * \brief Serializes complex modulations symbols from OFDM sub-carriers 00034 * \ingroup ofdm_blk 00035 * 00036 * This is the inverse block to the carrier_allocator_cvc. It outputs the 00037 * complex data symbols as a tagged stream, discarding the pilot symbols. 00038 * 00039 * If given, two different tags are parsed: The first key (\p len_tag_key) 00040 * specifies the number of OFDM symbols in the frame at the input. The 00041 * second key (\p packet_len_tag_key) specifies the number of complex symbols 00042 * that are coded into this frame. If given, this second key is then used 00043 * at the output, otherwise, \p len_tag_key is used. 00044 * If both are given, the packet length specifies the maximum number of 00045 * output items, and the frame length specifies the exact number of 00046 * consumed input items. 00047 * 00048 * It is possible to correct a carrier offset in this function by passing 00049 * another tag with said offset. 00050 * 00051 * Input: Complex vectors of length \p fft_len 00052 * Output: Complex scalars, in the same order as specified in occupied_carriers. 00053 */ 00054 class DIGITAL_API ofdm_serializer_vcc : virtual public gr_tagged_stream_block 00055 { 00056 public: 00057 typedef boost::shared_ptr<ofdm_serializer_vcc> sptr; 00058 00059 /*! 00060 * \param fft_len FFT length 00061 * \param occupied_carriers See ofdm_carrier_allocator_cvc. 00062 * \param len_tag_key The key of the tag identifying the length of the input frame in OFDM symbols. 00063 * \param packet_len_tag_key The key of the tag identifying the number of complex symbols in this packet. 00064 * \param symbols_skipped If the first symbol is not allocated as in \p occupied_carriers[0], set this 00065 * \param carr_offset_key When this block should correct a carrier offset, specify the tag key of the offset here (not necessary if following an ofdm_frame_equalizer_vcvc) 00066 * \param input_is_shifted If the input has the DC carrier on index 0 (i.e. it is not FFT shifted), set this to false 00067 */ 00068 static sptr make( 00069 int fft_len, 00070 const std::vector<std::vector<int> > &occupied_carriers, 00071 const std::string &len_tag_key="frame_len", 00072 const std::string &packet_len_tag_key="", 00073 int symbols_skipped=0, 00074 const std::string &carr_offset_key="", 00075 bool input_is_shifted=true 00076 ); 00077 00078 /*! 00079 * \param allocator The carrier allocator block of which this shall be the inverse 00080 * \param packet_len_tag_key The key of the tag identifying the number of complex symbols in this packet. 00081 * \param symbols_skipped If the first symbol is not allocated as in \p occupied_carriers[0], set this 00082 * \param carr_offset_key When this block should correct a carrier offset, specify the tag key of the offset here (not necessary if following an ofdm_frame_equalizer_vcvc) 00083 * \param input_is_shifted If the input has the DC carrier on index 0 (i.e. it is not FFT shifted), set this to false 00084 */ 00085 static sptr make( 00086 const digital_ofdm_carrier_allocator_cvc_sptr &allocator, 00087 const std::string &packet_len_tag_key="", 00088 int symbols_skipped=0, 00089 const std::string &carr_offset_key="", 00090 bool input_is_shifted=true 00091 ); 00092 }; 00093 00094 } // namespace digital 00095 } // namespace gr 00096 00097 #endif /* INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H */ 00098