Merging OFDM features branch r5661:5759 into trunk. OFDM works over the air with...
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_ofdm_correlator.h
index 44a6847af3ffb106a297ef38ff438bdd5f94a738..36aa1f0b690834123964f30c4aa426476a7b2812 100644 (file)
@@ -34,7 +34,8 @@ gr_ofdm_correlator_sptr
 gr_make_ofdm_correlator (unsigned int occupied_carriers, unsigned int fft_length,
                         unsigned int cplen,
                         const std::vector<gr_complex> &known_symbol1, 
-                        const std::vector<gr_complex> &known_symbol2);
+                        const std::vector<gr_complex> &known_symbol2,
+                        unsigned int max_fft_shift_len=4);
 
 /*!
  * \brief take a vector of complex constellation points in from an FFT
@@ -65,18 +66,21 @@ class gr_ofdm_correlator : public gr_block
    *                            start of a frame after known_symbol1 (usually a BPSK PN sequence). 
    *                            Both of these start symbols are differentially correlated to compensate
    *                            for phase changes between symbols. 
+   * \param max_fft_shift_len   Set's the maximum distance you can look between bins for correlation
    */
   friend gr_ofdm_correlator_sptr
   gr_make_ofdm_correlator (unsigned int occupied_carriers, unsigned int fft_length,
                           unsigned int cplen,
                           const std::vector<gr_complex> &known_symbol1, 
-                          const std::vector<gr_complex> &known_symbol2);
+                          const std::vector<gr_complex> &known_symbol2,
+                          unsigned int max_fft_shift_len);
   
  protected:
   gr_ofdm_correlator (unsigned int occupied_carriers, unsigned int fft_length,
                      unsigned int cplen,
                      const std::vector<gr_complex> &known_symbol1, 
-                     const std::vector<gr_complex> &known_symbol2);
+                     const std::vector<gr_complex> &known_symbol2,
+                     unsigned int max_fft_shift_len);
   
  private:
   unsigned char slicer(gr_complex x);
@@ -96,6 +100,8 @@ class gr_ofdm_correlator : public gr_block
   unsigned int d_phase_count;           // !< \brief accumulator for coarse freq correction
   float d_snr_est;                      // !< an estimation of the signal to noise ratio
 
+  gr_complex *d_phase_lut;  // !< look-up table for coarse frequency compensation
+
   void forecast(int noutput_items, gr_vector_int &ninput_items_required);
 
  public: