GNU Radio 3.7.0 C++ API
ofdm_frame_acquisition.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2006,2007,2011,2012 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 #ifndef INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H
00024 #define INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H
00025 
00026 #include <gnuradio/digital/api.h>
00027 #include <gnuradio/block.h>
00028 #include <vector>
00029 
00030 namespace gr {
00031   namespace digital {
00032     
00033     /*!
00034      * \brief take a vector of complex constellation points in from an
00035      * FFT and performs a correlation and equalization.
00036      * \ingroup ofdm_blk
00037      *
00038      * \details
00039      * This block takes the output of an FFT of a received OFDM symbol
00040      * and finds the start of a frame based on two known symbols. It
00041      * also looks at the surrounding bins in the FFT output for the
00042      * correlation in case there is a large frequency shift in the
00043      * data. This block assumes that the fine frequency shift has
00044      * already been corrected and that the samples fall in the middle
00045      * of one FFT bin.
00046      *
00047      * It then uses one of those known symbols to estimate the channel
00048      * response over all subcarriers and does a simple 1-tap
00049      * equalization on all subcarriers. This corrects for the phase
00050      * and amplitude distortion caused by the channel.
00051      */
00052     class DIGITAL_API ofdm_frame_acquisition : virtual public block
00053     {
00054     public:
00055       // gr::digital::ofdm_frame_acquisition::sptr
00056       typedef boost::shared_ptr<ofdm_frame_acquisition> sptr;
00057 
00058       /*! 
00059        * Make an OFDM correlator and equalizer.
00060        *
00061        * \param occupied_carriers   The number of subcarriers with data in the received symbol
00062        * \param fft_length          The size of the FFT vector (occupied_carriers + unused carriers)
00063        * \param cplen               The length of the cycle prefix
00064        * \param known_symbol        A vector of complex numbers representing a known symbol at the
00065        *                            start of a frame (usually a BPSK PN sequence)
00066        * \param max_fft_shift_len   Set's the maximum distance you can look between bins for correlation
00067        */
00068       static sptr make(unsigned int occupied_carriers, unsigned int fft_length,
00069                        unsigned int cplen,
00070                        const std::vector<gr_complex> &known_symbol, 
00071                        unsigned int max_fft_shift_len=4);
00072   
00073       /*!
00074        * \brief Return an estimate of the SNR of the channel
00075        */
00076       virtual float snr() = 0;
00077     };
00078 
00079   } /* namespace digital */
00080 } /* namespace gr */
00081 
00082 #endif /* INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H */