GNU Radio 3.6.5 C++ API

gr_channel_model.h

Go to the documentation of this file.
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_fastnoise_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=0);
00040 
00041 /*!
00042  * \brief channel simulator
00043  */
00044 class GR_CORE_API 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_CORE_API 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_fastnoise_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 
00074   double noise_voltage() const;
00075   double frequency_offset() const;
00076   std::vector<gr_complex> taps() const;
00077   double timing_offset() const;
00078 };