Imported Upstream version 3.2.2
[debian/gnuradio] / gnuradio-core / src / lib / hier / gr_channel_model.h
1 /*
2  * Copyright 2009 Free Software Foundation, Inc.
3  * 
4  * This file is part of GNU Radio
5  * 
6  * GNU Radio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  * 
11  * GNU Radio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with GNU Radio; see the file COPYING.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #include <gr_top_block.h>
23 #include <gr_fractional_interpolator_cc.h>
24 #include <gr_sig_source_c.h>
25 #include <gr_fir_filter_ccc.h>
26 #include <gr_add_cc.h>
27 #include <gr_noise_source_c.h>
28 #include <gr_multiply_cc.h>
29
30 class gr_channel_model;
31 typedef boost::shared_ptr<gr_channel_model> gr_channel_model_sptr;
32
33
34 gr_channel_model_sptr gr_make_channel_model(double noise_voltage=0.0,
35                                             double frequency_offset=0.0,
36                                             double epsilon=1.0,
37                                             const std::vector<gr_complex> &taps=std::vector<gr_complex>(1, 1),
38                                             double noise_seed=3021);
39
40 /*!
41  * \brief channel simulator
42  * \ingroup misc_blk
43  */
44 class gr_channel_model : public gr_hier_block2
45 {
46  private:
47   gr_channel_model(double noise_voltage,
48                    double frequency_offset,
49                    double epsilon,
50                    const std::vector<gr_complex> &taps,
51                    double noise_seed);
52
53   friend gr_channel_model_sptr gr_make_channel_model(double noise_voltage,
54                                                      double frequency_offset,
55                                                      double epsilon,
56                                                      const std::vector<gr_complex> &taps,
57                                                      double noise_seed);
58   
59   gr_fractional_interpolator_cc_sptr d_timing_offset;
60   gr_sig_source_c_sptr d_freq_offset;
61   gr_fir_filter_ccc_sptr d_multipath;
62   gr_add_cc_sptr d_noise_adder;
63   gr_noise_source_c_sptr d_noise;
64   gr_multiply_cc_sptr d_mixer_offset;
65   
66   std::vector<gr_complex> d_taps;
67   
68  public:
69   void set_noise_voltage(double noise_voltage);
70   void set_frequency_offset(double frequency_offset);
71   void set_taps(const std::vector<gr_complex> &taps);
72   void set_timing_offset(double epsilon);
73 };