GNU Radio 3.4.2 C++ API
|
00001 /* 00002 * Copyright 2009 Free Software Foundation, Inc. 00003 * 00004 * This file is part of GNU Radio 00005 * 00006 * GNU Radio is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3, or (at your option) 00009 * any later version. 00010 * 00011 * GNU Radio is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with GNU Radio; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #include <gr_top_block.h> 00023 #include <gr_fractional_interpolator_cc.h> 00024 #include <gr_sig_source_c.h> 00025 #include <gr_fir_filter_ccc.h> 00026 #include <gr_add_cc.h> 00027 #include <gr_noise_source_c.h> 00028 #include <gr_multiply_cc.h> 00029 00030 class gr_channel_model; 00031 typedef boost::shared_ptr<gr_channel_model> gr_channel_model_sptr; 00032 00033 00034 gr_channel_model_sptr gr_make_channel_model(double noise_voltage=0.0, 00035 double frequency_offset=0.0, 00036 double epsilon=1.0, 00037 const std::vector<gr_complex> &taps=std::vector<gr_complex>(1, 1), 00038 double noise_seed=3021); 00039 00040 /*! 00041 * \brief channel simulator 00042 * \ingroup misc_blk 00043 */ 00044 class gr_channel_model : public gr_hier_block2 00045 { 00046 private: 00047 gr_channel_model(double noise_voltage, 00048 double frequency_offset, 00049 double epsilon, 00050 const std::vector<gr_complex> &taps, 00051 double noise_seed); 00052 00053 friend gr_channel_model_sptr gr_make_channel_model(double noise_voltage, 00054 double frequency_offset, 00055 double epsilon, 00056 const std::vector<gr_complex> &taps, 00057 double noise_seed); 00058 00059 gr_fractional_interpolator_cc_sptr d_timing_offset; 00060 gr_sig_source_c_sptr d_freq_offset; 00061 gr_fir_filter_ccc_sptr d_multipath; 00062 gr_add_cc_sptr d_noise_adder; 00063 gr_noise_source_c_sptr d_noise; 00064 gr_multiply_cc_sptr d_mixer_offset; 00065 00066 std::vector<gr_complex> d_taps; 00067 00068 public: 00069 void set_noise_voltage(double noise_voltage); 00070 void set_frequency_offset(double frequency_offset); 00071 void set_taps(const std::vector<gr_complex> &taps); 00072 void set_timing_offset(double epsilon); 00073 };