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_SYNC_SC_CFB_H 00023 #define INCLUDED_DIGITAL_OFDM_SYNC_SC_CFB_H 00024 00025 #include <digital_api.h> 00026 #include <gr_hier_block2.h> 00027 00028 class digital_ofdm_sync_sc_cfb; 00029 typedef boost::shared_ptr<digital_ofdm_sync_sc_cfb> digital_ofdm_sync_sc_cfb_sptr; 00030 00031 /*! \param fft_len FFT length 00032 * \param cp_len Length of the guard interval (cyclic prefix) in samples 00033 * \param use_even_carriers If true, the carriers in the sync preamble are occupied such 00034 * that the even carriers are used (0, 2, 4, ...). If you use all 00035 * carriers, that would include the DC carrier, so be careful. 00036 */ 00037 DIGITAL_API digital_ofdm_sync_sc_cfb_sptr 00038 digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len, bool use_even_carriers=false); 00039 00040 /*! 00041 * \brief Schmidl & Cox synchronisation for OFDM 00042 * \ingroup ofdm_blk 00043 * \ingroup synchronizers_blk 00044 * 00045 * \details 00046 * Input: complex samples. 00047 * Output 0: Fine frequency offset, scaled by the OFDM symbol duration. 00048 * This is \f$\hat{\varphi}\f$ in [1]. The normalized frequency 00049 * offset is then 2.0*output0/fft_len. 00050 * Output 1: Beginning of the first OFDM symbol after the first (doubled) OFDM 00051 * symbol. The beginning is marked with a 1 (it's 0 everywhere else). 00052 * 00053 * The evaluation of the coarse frequency offset is *not* done in this block. 00054 * Also, the initial equalizer taps are not calculated here. 00055 * 00056 * Note that we use a different normalization factor in the timing metric than 00057 * the authors do in their original work[1]. If the timing metric (8) is 00058 * \f[ 00059 * M(d) = \frac{|P(d)|^2}{(R(d))^2}, 00060 * \f] 00061 * we calculate the normalization as 00062 * \f[ 00063 * R(d) = \frac{1}{2} \sum_{k=0}^{N-1} |r_{k+d}|^2, 00064 * \f] 00065 * i.e., we estimate the energy from *both* half-symbols. This avoids spurious detects 00066 * at the end of a burst, when the energy level suddenly drops. 00067 * 00068 * [1] Schmidl, T.M. and Cox, D.C., "Robust frequency and timing synchronization for OFDM", 00069 * Communications, IEEE Transactions on, 1997. 00070 */ 00071 class DIGITAL_API digital_ofdm_sync_sc_cfb : public gr_hier_block2 00072 { 00073 private: 00074 friend DIGITAL_API digital_ofdm_sync_sc_cfb_sptr digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len, bool use_even_carriers); 00075 digital_ofdm_sync_sc_cfb(int fft_len, int cp_len, bool use_even_carriers); 00076 00077 public: 00078 ~digital_ofdm_sync_sc_cfb(); 00079 00080 }; 00081 00082 #endif /* INCLUDED_DIGITAL_OFDM_SYNC_SC_CFB_H */ 00083