GNU Radio's DAB Package
dab_ofdm_coarse_frequency_correct.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 #ifndef INCLUDED_DAB_OFDM_COARSE_FREQUENCY_CORRECT_H
23 #define INCLUDED_DAB_OFDM_COARSE_FREQUENCY_CORRECT_H
24 
25 #include <gr_sync_block.h>
26 
28 
29 typedef boost::shared_ptr<dab_ofdm_coarse_frequency_correct> dab_ofdm_coarse_frequency_correct_sptr;
30 
31 dab_ofdm_coarse_frequency_correct_sptr
32 dab_make_ofdm_coarse_frequency_correct (unsigned int fft_length,
33  unsigned int num_carriers);
34 
35 /*!
36  * \brief Corrects coarse frequency offset in the frequency spectrum.
37  * \ingroup DAB
38  *
39  * \param fft_length total number of fft bins
40  * \param num_carriers number of carriers with OFDM symbols, not including the zero carrier
41  *
42  * This block detects where the signal is (coarse frequency offset) by looking
43  * at the energy and returns only the carriers containing information (i.e. it
44  * removes the zeros on the left, the zeros on the right and the one zero
45  * carrier in the middle).
46  */
47 class dab_ofdm_coarse_frequency_correct : public gr_sync_block
48 {
49  private:
50  // The friend declaration allows dab_make_ofdm_coarse_frequency_correct to
51  // access the private constructor.
52 
53  friend dab_ofdm_coarse_frequency_correct_sptr
54  dab_make_ofdm_coarse_frequency_correct (unsigned int fft_length, unsigned int num_carriers);
55 
56  float mag_squared(const gr_complex sample);
57  dab_ofdm_coarse_frequency_correct (unsigned int fft_length, unsigned int num_carriers); // private constructor
58  void correlate_energy(const gr_complex *symbol);
59 
60  unsigned int d_fft_length;
61  unsigned int d_num_carriers;
62  unsigned int d_zeros_on_left;
63  unsigned int d_freq_offset;
64 
65  public:
66  int work (int noutput_items,
67  gr_vector_const_void_star &input_items,
68  gr_vector_void_star &output_items);
69 };
70 
71 #endif /* INCLUDED_DAB_OFDM_COARSE_FREQUENCY_CORRECT_H */
dab_ofdm_coarse_frequency_correct
Corrects coarse frequency offset in the frequency spectrum.
Definition: dab_ofdm_coarse_frequency_correct.h:48
dab_ofdm_coarse_frequency_correct::dab_make_ofdm_coarse_frequency_correct
friend dab_ofdm_coarse_frequency_correct_sptr dab_make_ofdm_coarse_frequency_correct(unsigned int fft_length, unsigned int num_carriers)
dab_ofdm_coarse_frequency_correct::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
dab_make_ofdm_coarse_frequency_correct
dab_ofdm_coarse_frequency_correct_sptr dab_make_ofdm_coarse_frequency_correct(unsigned int fft_length, unsigned int num_carriers)