GNU Radio 3.5.1 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_core_api.h> 00023 #include <gr_top_block.h> 00024 #include <gr_fractional_interpolator_cc.h> 00025 #include <gr_sig_source_c.h> 00026 #include <gr_fir_filter_ccc.h> 00027 #include <gr_add_cc.h> 00028 #include <gr_noise_source_c.h> 00029 #include <gr_multiply_cc.h> 00030 00031 class gr_channel_model; 00032 typedef boost::shared_ptr<gr_channel_model> gr_channel_model_sptr; 00033 00034 00035 GR_CORE_API gr_channel_model_sptr gr_make_channel_model(double noise_voltage=0.0, 00036 double frequency_offset=0.0, 00037 double epsilon=1.0, 00038 const std::vector<gr_complex> &taps=std::vector<gr_complex>(1, 1), 00039 double noise_seed=3021); 00040 00041 /*! 00042 * \brief channel simulator 00043 * \ingroup misc_blk 00044 */ 00045 class GR_CORE_API gr_channel_model : public gr_hier_block2 00046 { 00047 private: 00048 gr_channel_model(double noise_voltage, 00049 double frequency_offset, 00050 double epsilon, 00051 const std::vector<gr_complex> &taps, 00052 double noise_seed); 00053 00054 friend GR_CORE_API gr_channel_model_sptr gr_make_channel_model(double noise_voltage, 00055 double frequency_offset, 00056 double epsilon, 00057 const std::vector<gr_complex> &taps, 00058 double noise_seed); 00059 00060 gr_fractional_interpolator_cc_sptr d_timing_offset; 00061 gr_sig_source_c_sptr d_freq_offset; 00062 gr_fir_filter_ccc_sptr d_multipath; 00063 gr_add_cc_sptr d_noise_adder; 00064 gr_noise_source_c_sptr d_noise; 00065 gr_multiply_cc_sptr d_mixer_offset; 00066 00067 std::vector<gr_complex> d_taps; 00068 00069 public: 00070 void set_noise_voltage(double noise_voltage); 00071 void set_frequency_offset(double frequency_offset); 00072 void set_taps(const std::vector<gr_complex> &taps); 00073 void set_timing_offset(double epsilon); 00074 00075 double noise_voltage() const; 00076 double frequency_offset() const; 00077 std::vector<gr_complex> taps() const; 00078 double timing_offset() const; 00079 };