GNU Radio 3.6.0 C++ API
|
00001 /* 00002 * Copyright 2011 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 #ifndef INCLUDED_GR_EXTRAS_NOISE_SOURCE_H 00023 #define INCLUDED_GR_EXTRAS_NOISE_SOURCE_H 00024 00025 #include <gnuradio/extras/api.h> 00026 #include <gr_sync_block.h> 00027 #include <complex> 00028 00029 namespace gnuradio{ namespace extras{ 00030 00031 /*! 00032 * \brief random number source 00033 * \ingroup source_blk 00034 */ 00035 class GR_EXTRAS_API noise_source : virtual public gr_sync_block{ 00036 public: 00037 typedef boost::shared_ptr<noise_source> sptr; 00038 00039 static sptr make_fc32(const long seed = 42); 00040 static sptr make_sc32(const long seed = 42); 00041 static sptr make_sc16(const long seed = 42); 00042 static sptr make_sc8(const long seed = 42); 00043 static sptr make_f32(const long seed = 42); 00044 static sptr make_s32(const long seed = 42); 00045 static sptr make_s16(const long seed = 42); 00046 static sptr make_s8(const long seed = 42); 00047 00048 //! Set the waveform type (UNIFORM, GAUSSIAN, LAPLACIAN, IMPULSE) 00049 virtual void set_waveform(const std::string &) = 0; 00050 00051 //! Get the current waveform setting 00052 virtual std::string get_waveform(void) = 0; 00053 00054 //! Set the offset, this is a free addition operation 00055 virtual void set_offset(const std::complex<double> &) = 0; 00056 00057 //! Get the current offset setting 00058 virtual std::complex<double> get_offset(void) = 0; 00059 00060 //! Set the scalar, this is a free multiply scalar operation 00061 virtual void set_amplitude(const std::complex<double> &) = 0; 00062 00063 //! Get the current amplitude setting 00064 virtual std::complex<double> get_amplitude(void) = 0; 00065 00066 //! Set the factor, this is used for the IMPULSE waveform 00067 virtual void set_factor(const double &factor) = 0; 00068 00069 //! Get the current factor setting 00070 virtual double get_factor(void) = 0; 00071 00072 }; 00073 00074 }} 00075 00076 #endif /* INCLUDED_GR_EXTRAS_NOISE_SOURCE_H */