GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sro_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_SRO_MODEL_H
24 #define INCLUDED_CHANNELS_SRO_MODEL_H
25 
26 #include <gnuradio/channels/api.h>
27 #include <gnuradio/block.h>
28 #include <gnuradio/types.h>
29 
30 namespace gr {
31  namespace channels {
32 
33  /*!
34  * \brief Sample Rate Offset Model
35  * \ingroup channel_models_blk
36  *
37  * \details
38  * This block implements a model that varies sample rate offset
39  * with respect to time by performing a random walk on the
40  * interpolation rate.
41  */
42  class CHANNELS_API sro_model : virtual public block
43  {
44  public:
45  // gr::channels::sro_model::sptr
46  typedef boost::shared_ptr<sro_model> sptr;
47 
48  /*! \brief Build the sample rate offset model
49  *
50  * \param sample_rate_hz Sample rate of the input signal in Hz
51  * \param std_dev_hz Desired standard deviation of the random walk
52  process every sample in Hz
53  * \param max_dev_hz Maximum sample rate deviation from zero in Hz.
54  * \param noise_seed A random number generator seed for the noise source.
55  */
56  static sptr make(
57  double sample_rate_hz,
58  double std_dev_hz,
59  double max_dev_hz,
60  double noise_seed=0);
61 
62  virtual void set_std_dev(double _dev) = 0;
63  virtual void set_max_dev(double _dev) = 0;
64  virtual void set_samp_rate(double _rate) = 0;
65 
66  virtual double std_dev() const = 0;
67  virtual double max_dev() const = 0;
68  virtual double samp_rate() const = 0;
69 
70  };
71 
72  } /* namespace channels */
73 } /* namespace gr */
74 
75 #endif /* INCLUDED_CHANNELS_SRO_MODEL_H */
Include this header to use the message passing features.
Definition: logger.h:131
Sample Rate Offset Model.
Definition: sro_model.h:42
#define CHANNELS_API
Definition: gr-channels/include/gnuradio/channels/api.h:30
boost::shared_ptr< sro_model > sptr
Definition: sro_model.h:46
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60