GNU Radio 3.7.1 C++ API
ofdm_sync_sc_cfb.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /* 
00003  * Copyright 2013 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 
00024 #ifndef INCLUDED_DIGITAL_OFDM_SYNC_SC_CFB_H
00025 #define INCLUDED_DIGITAL_OFDM_SYNC_SC_CFB_H
00026 
00027 #include <gnuradio/digital/api.h>
00028 #include <gnuradio/hier_block2.h>
00029 
00030 namespace gr {
00031   namespace digital {
00032 
00033     /*!
00034      * \brief Schmidl & Cox synchronisation for OFDM
00035      * \ingroup ofdm_blk
00036      * \ingroup synchronizers_blk
00037      *
00038      * \details
00039      * Input: complex samples.
00040      * Output 0: Fine frequency offset, scaled by the OFDM symbol duration.
00041      *           This is \f$\hat{\varphi}\f$ in [1]. The normalized frequency
00042      *           offset is then 2.0*output0/fft_len.
00043      * Output 1: Beginning of the first OFDM symbol after the first (doubled) OFDM
00044      *           symbol. The beginning is marked with a 1 (it's 0 everywhere else).
00045      *
00046      * The evaluation of the coarse frequency offset is *not* done in this block.
00047      * Also, the initial equalizer taps are not calculated here.
00048      *
00049      * Note that we use a different normalization factor in the timing metric than
00050      * the authors do in their original work[1]. If the timing metric (8) is
00051      * \f[
00052      * M(d) = \frac{|P(d)|^2}{(R(d))^2},
00053      * \f]
00054      * we calculate the normalization as
00055      * \f[
00056      * R(d) = \frac{1}{2} \sum_{k=0}^{N-1} |r_{k+d}|^2,
00057      * \f]
00058      * i.e., we estimate the energy from *both* half-symbols. This avoids spurious detects
00059      * at the end of a burst, when the energy level suddenly drops.
00060      *
00061      * [1] Schmidl, T.M. and Cox, D.C., "Robust frequency and timing synchronization for OFDM",
00062      *     Communications, IEEE Transactions on, 1997.
00063      */
00064     class DIGITAL_API ofdm_sync_sc_cfb : virtual public hier_block2
00065     {
00066      public:
00067       typedef boost::shared_ptr<ofdm_sync_sc_cfb> sptr;
00068 
00069       /*! \param fft_len FFT length
00070        *  \param cp_len Length of the guard interval (cyclic prefix) in samples
00071        *  \param use_even_carriers If true, the carriers in the sync preamble are occupied such
00072        *                     that the even carriers are used (0, 2, 4, ...). If you use all
00073        *                     carriers, that would include the DC carrier, so be careful.
00074        */
00075       static sptr make(int fft_len, int cp_len, bool use_even_carriers=false);
00076     };
00077 
00078   } // namespace digital
00079 } // namespace gr
00080 
00081 #endif /* INCLUDED_DIGITAL_OFDM_SYNC_SC_CFB_H */
00082