GNU Radio 3.6.5.1 C++ API
gr_channel_model.h
Go to the documentation of this file.
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_core_api.h>
23 #include <gr_top_block.h>
25 #include <gr_sig_source_c.h>
26 #include <gr_fir_filter_ccc.h>
27 #include <gr_add_cc.h>
28 #include <gr_fastnoise_source_c.h>
29 #include <gr_multiply_cc.h>
30 
31 class gr_channel_model;
33 
34 
36  double frequency_offset=0.0,
37  double epsilon=1.0,
38  const std::vector<gr_complex> &taps=std::vector<gr_complex>(1, 1),
39  double noise_seed=0);
40 
41 /*!
42  * \brief channel simulator
43  */
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_CORE_API 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_fastnoise_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 
74  double noise_voltage() const;
75  double frequency_offset() const;
76  std::vector<gr_complex> taps() const;
77  double timing_offset() const;
78 };