1 /* -*- c++ -*- */
2 /*
3  * Copyright 2009,2012,2013 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 
23 #ifndef INCLUDED_CHANNELS_CHANNEL_MODEL2_IMPL_H
24 #define INCLUDED_CHANNELS_CHANNEL_MODEL2_IMPL_H
25 
26 #include <gnuradio/analog/fastnoise_source.h>
27 #include <gnuradio/analog/sig_source.h>
28 #include <gnuradio/blocks/add_blk.h>
29 #include <gnuradio/blocks/multiply.h>
30 #include <gnuradio/blocks/vco_c.h>
31 #include <gnuradio/channels/channel_model2.h>
32 #include <gnuradio/filter/fir_filter_blk.h>
33 #include <gnuradio/filter/mmse_resampler_cc.h>
34 #include <gnuradio/top_block.h>
35 
36 namespace gr {
37 namespace channels {
38 
39 class CHANNELS_API channel_model2_impl : public channel_model2
40 {
41 private:
42     blocks::add_cc::sptr d_noise_adder;
43     blocks::multiply_cc::sptr d_mixer_offset;
44 
45     blocks::vco_c::sptr d_freq_gen;
46 
47     analog::fastnoise_source_c::sptr d_noise;
48 
49     filter::mmse_resampler_cc::sptr d_timing_offset;
50     filter::fir_filter_ccc::sptr d_multipath;
51 
52     std::vector<gr_complex> d_taps;
53 
54 public:
55     channel_model2_impl(double noise_voltage,
56                         double epsilon,
57                         const std::vector<gr_complex>& taps,
58                         double noise_seed,
59                         bool block_tags);
60 
61     ~channel_model2_impl();
62 
63     void setup_rpc();
64 
65     void set_noise_voltage(double noise_voltage);
66     void set_taps(const std::vector<gr_complex>& taps);
67     void set_timing_offset(double epsilon);
68 
69     double noise_voltage() const;
70     std::vector<gr_complex> taps() const;
71     double timing_offset() const;
72 };
73 
74 } /* namespace channels */
75 } /* namespace gr */
76 
77 #endif /* INCLUDED_CHANNELS_CHANNEL_MODEL2_IMPL_H */
78