GNU Radio's DAB Package
ofdm_sampler_impl.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_SAMPLER_IMPL_H
23 #define INCLUDED_DAB_OFDM_SAMPLER_IMPL_H
24 
25 #include <grdab/ofdm_sampler.h>
26 
27 namespace gr {
28  namespace dab {
29 
30 /*!
31  * \brief cuts stream of DAB samples into symbol vectors
32  * \ingroup DAB
33  * \param fft_length length of the output vectors - number of samples per symbol without cyclic prefix
34  * \param cp_length lengith of the cyclic prefix
35  * \param symbols_per_frame number of symbols in a DAB frame, without Null symbol
36  * \param gap If the gap is > 0, leave a gap at the end of the symbol, i.e. return some of the cyclic prefix instead of the end of the symbol
37  *
38  * input: port 0: complex - actual data; port 1: byte stream with trigger signal indicating the start of a frame
39  * output: port 0: complex vectors - sampled data; port 1: byte stream with trigger signal indicating the start of a frame
40  */
42 {
43  private:
44 
45  enum state_t {STATE_NS, STATE_CP, STATE_SYM};
46 
47  state_t d_state;
48  unsigned int d_pos; // position inside OFDM symbol
49  unsigned int d_fft_length;
50  unsigned int d_cp_length;
51  unsigned int d_symbols_per_frame; // total number of symbols in a DAB frame
52  unsigned int d_sym_nr; // number of symbol inside DAB frame
53  unsigned int d_gap; // gap from next symbol -> if gap>0: sample before end of frame
54  unsigned int d_gap_left; // gap left to next symbol?
55 
56  public:
57  ofdm_sampler_impl(unsigned int fft_length, unsigned int cp_length, unsigned int symbols_per_frame,unsigned int gap);
58  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
59 
60  int general_work (int noutput_items,
61  gr_vector_int &ninput_items,
62  gr_vector_const_void_star &input_items,
63  gr_vector_void_star &output_items);
64 };
65 
66 }
67 }
68 
69 #endif /* INCLUDED_DAB_OFDM_SAMPLER_H */
gr::dab::ofdm_sampler_impl::general_work
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::dab::ofdm_sampler_impl::ofdm_sampler_impl
ofdm_sampler_impl(unsigned int fft_length, unsigned int cp_length, unsigned int symbols_per_frame, unsigned int gap)
gr::dab::ofdm_sampler
<+description of block+>
Definition: ofdm_sampler.h:36
ofdm_sampler.h
gr::dab::ofdm_sampler_impl::forecast
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
gr
Definition: complex_to_interleaved_float_vcf.h:28
gr::dab::ofdm_sampler_impl
cuts stream of DAB samples into symbol vectors
Definition: ofdm_sampler_impl.h:41