GNU Radio 3.6.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_noise_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=3021);
40 
41 /*!
42  * \brief channel simulator
43  * \ingroup misc_blk
44  */
46 {
47  private:
48  gr_channel_model(double noise_voltage,
49  double frequency_offset,
50  double epsilon,
51  const std::vector<gr_complex> &taps,
52  double noise_seed);
53 
54  friend GR_CORE_API gr_channel_model_sptr gr_make_channel_model(double noise_voltage,
55  double frequency_offset,
56  double epsilon,
57  const std::vector<gr_complex> &taps,
58  double noise_seed);
59 
60  gr_fractional_interpolator_cc_sptr d_timing_offset;
61  gr_sig_source_c_sptr d_freq_offset;
62  gr_fir_filter_ccc_sptr d_multipath;
63  gr_add_cc_sptr d_noise_adder;
64  gr_noise_source_c_sptr d_noise;
65  gr_multiply_cc_sptr d_mixer_offset;
66 
67  std::vector<gr_complex> d_taps;
68 
69  public:
70  void set_noise_voltage(double noise_voltage);
71  void set_frequency_offset(double frequency_offset);
72  void set_taps(const std::vector<gr_complex> &taps);
73  void set_timing_offset(double epsilon);
74 
75  double noise_voltage() const;
76  double frequency_offset() const;
77  std::vector<gr_complex> taps() const;
78  double timing_offset() const;
79 };