GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
channel_model.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2009,2012 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_MODEL_H
24 #define INCLUDED_CHANNELS_CHANNEL_MODEL_H
25 
26 #include <gnuradio/channels/api.h>
27 #include <gnuradio/hier_block2.h>
28 #include <gnuradio/types.h>
29 
30 namespace gr {
31  namespace channels {
32 
33  /*!
34  * \brief Basic channel simulator.
35  * \ingroup channel_models_blk
36  *
37  * \details
38  * This block implements a basic channel model simulator that can
39  * be used to help evaluate, design, and test various signals,
40  * waveforms, and algorithms.
41  *
42  * This model allows the user to set the voltage of an AWGN noise
43  * source (\p noise_voltage), a (normalized) frequency offset (\p
44  * frequency_offset), a sample timing offset (\p epsilon), and a
45  * seed (\p noise_seed) to randomize or make reproducable the AWGN
46  * noise source.
47  *
48  * Multipath can be approximated in this model by using a FIR
49  * filter representation of a multipath delay profile with the
50  * parameter \p taps.
51  *
52  * To simulate a channel with time-variant channel, use
53  * gr::channels::channel_model2.
54  */
55  class CHANNELS_API channel_model : virtual public hier_block2
56  {
57  public:
58  // gr::channels::channel_model::sptr
60 
61  /*! \brief Build the channel simulator.
62  *
63  * \param noise_voltage The AWGN noise level as a voltage (to be
64  * calculated externally to meet, say, a
65  * desired SNR).
66  * \param frequency_offset The normalized frequency offset. 0 is
67  * no offset; 0.25 would be, for a digital
68  * modem, one quarter of the symbol rate.
69  * \param epsilon The sample timing offset to emulate the
70  * different rates between the sample clocks of
71  * the transmitter and receiver. 1.0 is no difference.
72  * \param taps Taps of a FIR filter to emulate a multipath delay profile.
73  * \param noise_seed A random number generator seed for the noise source.
74  * \param block_tags If true, tags will not be able to propagate through this block.
75  */
76  static sptr make(double noise_voltage=0.0,
77  double frequency_offset=0.0,
78  double epsilon=1.0,
79  const std::vector<gr_complex> &taps=std::vector<gr_complex>(1,1),
80  double noise_seed=0,
81  bool block_tags=false);
82 
83  virtual void set_noise_voltage(double noise_voltage) = 0;
84  virtual void set_frequency_offset(double frequency_offset) = 0;
85  virtual void set_taps(const std::vector<gr_complex> &taps) = 0;
86  virtual void set_timing_offset(double epsilon) = 0;
87 
88  virtual double noise_voltage() const = 0;
89  virtual double frequency_offset() const = 0;
90  virtual std::vector<gr_complex> taps() const = 0;
91  virtual double timing_offset() const = 0;
92  };
93 
94  } /* namespace channels */
95 } /* namespace gr */
96 
97 #endif /* INCLUDED_CHANNELS_CHANNEL_MODEL_H */
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
Basic channel simulator.
Definition: channel_model.h:55
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
boost::shared_ptr< channel_model > sptr
Definition: channel_model.h:59
#define CHANNELS_API
Definition: gr-channels/include/gnuradio/channels/api.h:30
Hierarchical container class for gr::block's and gr::hier_block2's.
Definition: hier_block2.h:46