2 * Copyright 2009 Free Software Foundation, Inc.
4 * This file is part of GNU Radio
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)
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.
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.
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>
30 class gr_channel_model;
31 typedef boost::shared_ptr<gr_channel_model> gr_channel_model_sptr;
34 gr_channel_model_sptr gr_make_channel_model(double noise_voltage=0.0,
35 double frequency_offset=0.0,
37 const std::vector<gr_complex> &taps=std::vector<gr_complex>(1, 1),
38 double noise_seed=3021);
41 * \brief channel simulator
44 class gr_channel_model : public gr_hier_block2
47 gr_channel_model(double noise_voltage,
48 double frequency_offset,
50 const std::vector<gr_complex> &taps,
53 friend gr_channel_model_sptr gr_make_channel_model(double noise_voltage,
54 double frequency_offset,
56 const std::vector<gr_complex> &taps,
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;
66 std::vector<gr_complex> d_taps;
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);