diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-11-09 22:30:01 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-11-10 14:39:41 -0500 |
commit | cbc7960a4facfc50c3861ca96e51348802d457cc (patch) | |
tree | f2b0c58eedc052ca399bde721d6bf054b4e0819b /gnuradio-core/src | |
parent | 6be5d93ab0e9ec205f1cb72f8d2d60006b08e7f2 (diff) |
analog: removed noise and sig sources from core.
Fixed QA code for components that do not use gr-analog.
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/lib/general/general_generated.i | 16 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | gnuradio-core/src/lib/gengen/generate_common.py | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gengen.i | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t | 99 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t | 83 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t | 40 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_noise_type.h | 30 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t | 241 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t | 82 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t | 52 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h | 29 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_noise.py | 51 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py | 157 |
14 files changed, 0 insertions, 890 deletions
diff --git a/gnuradio-core/src/lib/general/general_generated.i b/gnuradio-core/src/lib/general/general_generated.i index 43828e7f71..5671570a6f 100644 --- a/gnuradio-core/src/lib/general/general_generated.i +++ b/gnuradio-core/src/lib/general/general_generated.i @@ -38,10 +38,6 @@ #include <gr_mute_ff.h> #include <gr_mute_ii.h> #include <gr_mute_ss.h> -#include <gr_noise_source_c.h> -#include <gr_noise_source_f.h> -#include <gr_noise_source_i.h> -#include <gr_noise_source_s.h> #include <gr_packed_to_unpacked_bb.h> #include <gr_packed_to_unpacked_ii.h> #include <gr_packed_to_unpacked_ss.h> @@ -55,10 +51,6 @@ #include <gr_probe_signal_vi.h> #include <gr_probe_signal_vf.h> #include <gr_probe_signal_vc.h> -#include <gr_sig_source_c.h> -#include <gr_sig_source_f.h> -#include <gr_sig_source_i.h> -#include <gr_sig_source_s.h> #include <gr_sub_cc.h> #include <gr_sub_ff.h> #include <gr_sub_ii.h> @@ -114,10 +106,6 @@ %include <gr_mute_ff.i> %include <gr_mute_ii.i> %include <gr_mute_ss.i> -%include <gr_noise_source_c.i> -%include <gr_noise_source_f.i> -%include <gr_noise_source_i.i> -%include <gr_noise_source_s.i> %include <gr_packed_to_unpacked_bb.i> %include <gr_packed_to_unpacked_ii.i> %include <gr_packed_to_unpacked_ss.i> @@ -131,10 +119,6 @@ %include <gr_probe_signal_vi.i> %include <gr_probe_signal_vf.i> %include <gr_probe_signal_vc.i> -%include <gr_sig_source_c.i> -%include <gr_sig_source_f.i> -%include <gr_sig_source_i.i> -%include <gr_sig_source_s.i> %include <gr_sub_cc.i> %include <gr_sub_ff.i> %include <gr_sub_ii.i> diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index ed49cf07e5..03f39d358d 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -84,8 +84,6 @@ endmacro(expand_h_cc_i) expand_h_cc_i(gr_vector_source_X b s i f c) expand_h_cc_i(gr_vector_insert_X b) expand_h_cc_i(gr_vector_sink_X b s i f c) -expand_h_cc_i(gr_noise_source_X s i f c) -expand_h_cc_i(gr_sig_source_X s i f c) expand_h_cc_i(gr_probe_signal_X b s i f c) expand_h_cc_i(gr_probe_signal_vX b s i f c) @@ -155,8 +153,6 @@ list(APPEND gnuradio_core_sources install(FILES ${generated_gengen_includes} ${CMAKE_CURRENT_SOURCE_DIR}/gr_endianness.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_type.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sig_source_waveform.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" ) diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 37d8944f5b..d04df6bda5 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -32,8 +32,6 @@ ss_signatures = ['s', 'i', 'f', 'c'] ss_roots = [ 'gr_vector_source_X', 'gr_vector_sink_X', - 'gr_noise_source_X', - 'gr_sig_source_X', 'gr_probe_signal_X', 'gr_probe_signal_vX' ] diff --git a/gnuradio-core/src/lib/gengen/gengen.i b/gnuradio-core/src/lib/gengen/gengen.i index d1895bfa83..7d8c27fe68 100644 --- a/gnuradio-core/src/lib/gengen/gengen.i +++ b/gnuradio-core/src/lib/gengen/gengen.i @@ -22,12 +22,8 @@ %{ #include "gr_endianness.h" -#include "gr_sig_source_waveform.h" -#include "gr_noise_type.h" %} %include "gr_endianness.i" -%include "gr_sig_source_waveform.h" -%include "gr_noise_type.h" %include "gengen_generated.i" diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t deleted file mode 100644 index 3078f6366e..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <stdexcept> - - -@NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed) -{ - return gnuradio::get_initial_sptr(new @NAME@ (type, ampl, seed)); -} - - -@NAME@::@NAME@ (gr_noise_type_t type, float ampl, long seed) - : gr_sync_block ("@BASE_NAME@", - gr_make_io_signature (0, 0, 0), - gr_make_io_signature (1, 1, sizeof (@TYPE@))), - d_type (type), - d_ampl (ampl), - d_rng (seed) -{ -} - -int -@NAME@::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - @TYPE@ *out = (@TYPE@ *) output_items[0]; - - switch (d_type){ -#if @IS_COMPLEX@ // complex? - - case GR_UNIFORM: - for (int i = 0; i < noutput_items; i++) - out[i] = gr_complex (d_ampl * ((d_rng.ran1 () * 2.0) - 1.0), - d_ampl * ((d_rng.ran1 () * 2.0) - 1.0)); - break; - - case GR_GAUSSIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = d_ampl * d_rng.rayleigh_complex (); - break; - -#else // nope... - - case GR_UNIFORM: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * ((d_rng.ran1 () * 2.0) - 1.0)); - break; - - case GR_GAUSSIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.gasdev ()); - break; - - case GR_LAPLACIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.laplacian ()); - break; - - case GR_IMPULSE: // FIXME changeable impulse settings - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.impulse (9)); - break; -#endif - - default: - throw std::runtime_error ("invalid type"); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t deleted file mode 100644 index 31ffb2b169..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_noise_type.h> -#include <gr_random.h> - - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -/*! \brief Make a noise source - * \param type the random distribution to use (see gr_noise_type.h) - * \param ampl a scaling factor for the output - * \param seed seed for random generators. Note that for uniform and - * Gaussian distributions, this should be a negative number. - */ -GR_CORE_API @NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - -/*! - * \brief Random number source - * \ingroup source_blk - * - * \details - * Generate random values from different distributions. - * Currently, only Gaussian and uniform are enabled. - * - * \param type the random distribution to use (see gr_noise_type.h) - * \param ampl a scaling factor for the output - * \param seed seed for random generators. Note that for uniform and - * Gaussian distributions, this should be a negative number. - */ -class GR_CORE_API @NAME@ : public gr_sync_block { - friend GR_CORE_API @NAME@_sptr - - gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed); - - gr_noise_type_t d_type; - float d_ampl; - gr_random d_rng; - - @NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - - public: - void set_type (gr_noise_type_t type) { d_type = type; } - void set_amplitude (float ampl) { d_ampl = ampl; } - - gr_noise_type_t type () const { return d_type; } - float amplitude () const { return d_ampl; } - - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t deleted file mode 100644 index df27ab79b6..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - -class @NAME@ : public gr_block { - private: - @NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - - public: - void set_type (gr_noise_type_t type) { d_type = type; } - void set_amplitude (float ampl) { d_ampl = ampl; } - - gr_noise_type_t type () const { return d_type; } - float amplitude () const { return d_ampl; } -}; diff --git a/gnuradio-core/src/lib/gengen/gr_noise_type.h b/gnuradio-core/src/lib/gengen/gr_noise_type.h deleted file mode 100644 index d2aba9b0c7..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_type.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_NOISE_TYPE_H -#define INCLUDED_GR_NOISE_TYPE_H - -typedef enum { - GR_UNIFORM = 200, GR_GAUSSIAN, GR_LAPLACIAN, GR_IMPULSE -} gr_noise_type_t; - -#endif /* INCLUDED_GR_NOISE_TYPE_H */ diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t deleted file mode 100644 index 6959eac824..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <@NAME@.h> -#include <algorithm> -#include <gr_io_signature.h> -#include <stdexcept> -#include <algorithm> -#include <gr_complex.h> - - -@NAME@::@NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset) - : gr_sync_block ("@BASE_NAME@", - gr_make_io_signature (0, 0, 0), - gr_make_io_signature (1, 1, sizeof (@TYPE@))), - d_sampling_freq (sampling_freq), d_waveform (waveform), d_frequency (frequency), - d_ampl (ampl), d_offset (offset) -{ - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -@NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset) -{ - return gnuradio::get_initial_sptr(new @NAME@ (sampling_freq, waveform, frequency, ampl, offset)); -} - -int -@NAME@::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - @TYPE@ *optr = (@TYPE@ *) output_items[0]; - @TYPE@ t; - - switch (d_waveform){ - -#if @IS_COMPLEX@ // complex? - - case GR_CONST_WAVE: - t = (gr_complex) d_ampl + d_offset; - std::fill_n(optr, noutput_items, t); - break; - - case GR_SIN_WAVE: - case GR_COS_WAVE: - d_nco.sincos (optr, noutput_items, d_ampl); - if (d_offset == gr_complex(0,0)) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - /* Implements a real square wave high from -PI to 0. - * The imaginary square wave leads by 90 deg. - */ - case GR_SQR_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2) - optr[i] = gr_complex(d_ampl, 0)+d_offset; - else if (d_nco.get_phase() < 0) - optr[i] = gr_complex(d_ampl, d_ampl)+d_offset; - else if (d_nco.get_phase() < M_PI/2) - optr[i] = gr_complex(0, d_ampl)+d_offset; - else - optr[i] = d_offset; - d_nco.step(); - } - break; - - /* Implements a real triangle wave rising from -PI to 0 and - * falling from 0 to PI. The imaginary triangle wave leads by 90 deg. - */ - case GR_TRI_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/M_PI + d_ampl, - -1*d_ampl*d_nco.get_phase()/M_PI - d_ampl/2)+d_offset; - } - else if (d_nco.get_phase() < 0){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/M_PI + d_ampl, - d_ampl*d_nco.get_phase()/M_PI + d_ampl/2)+d_offset; - } - else if (d_nco.get_phase() < M_PI/2){ - optr[i] = gr_complex(-1*d_ampl*d_nco.get_phase()/M_PI + d_ampl, - d_ampl*d_nco.get_phase()/M_PI + d_ampl/2)+d_offset; - } - else{ - optr[i] = gr_complex(-1*d_ampl*d_nco.get_phase()/M_PI + d_ampl, - -1*d_ampl*d_nco.get_phase()/M_PI + 3*d_ampl/2)+d_offset; - } - d_nco.step(); - } - break; - - /* Implements a real saw tooth wave rising from -PI to PI. - * The imaginary saw tooth wave leads by 90 deg. - */ - case GR_SAW_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2, - d_ampl*d_nco.get_phase()/(2*M_PI) + 5*d_ampl/4)+d_offset; - } - else{ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2, - d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/4)+d_offset; - } - d_nco.step(); - } - break; - -#else // nope... - - case GR_CONST_WAVE: - t = (@TYPE@) d_ampl + d_offset; - std::fill_n(optr, noutput_items, t); - break; - - case GR_SIN_WAVE: - d_nco.sin (optr, noutput_items, d_ampl); - if (d_offset == 0) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - case GR_COS_WAVE: - d_nco.cos (optr, noutput_items, d_ampl); - if (d_offset == 0) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - /* The square wave is high from -PI to 0. */ - case GR_SQR_WAVE: - t = (@TYPE@) d_ampl + d_offset; - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < 0) - optr[i] = t; - else - optr[i] = d_offset; - d_nco.step(); - } - break; - - /* The triangle wave rises from -PI to 0 and falls from 0 to PI. */ - case GR_TRI_WAVE: - for (int i = 0; i < noutput_items; i++){ - double t = d_ampl*d_nco.get_phase()/M_PI; - if (d_nco.get_phase() < 0) - optr[i] = static_cast<@TYPE@>(t + d_ampl + d_offset); - else - optr[i] = static_cast<@TYPE@>(-1*t + d_ampl + d_offset); - d_nco.step(); - } - break; - - /* The saw tooth wave rises from -PI to PI. */ - case GR_SAW_WAVE: - for (int i = 0; i < noutput_items; i++){ - t = static_cast<@TYPE@>(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2 + d_offset); - optr[i] = t; - d_nco.step(); - } - break; - -#endif - - default: - throw std::runtime_error ("gr_sig_source: invalid waveform"); - } - - return noutput_items; -} - -void -@NAME@::set_sampling_freq (double sampling_freq) -{ - d_sampling_freq = sampling_freq; - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -void -@NAME@::set_waveform (gr_waveform_t waveform) -{ - d_waveform = waveform; -} - -void -@NAME@::set_frequency (double frequency) -{ - d_frequency = frequency; - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -void -@NAME@::set_amplitude (double ampl) -{ - d_ampl = ampl; -} - -void -@NAME@::set_offset (@TYPE@ offset) -{ - d_offset = offset; -} - diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t deleted file mode 100644 index baa82dbe20..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_sig_source_waveform.h> -#include <gr_fxpt_nco.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -/*! - * \brief signal generator with @TYPE@ output. - * \ingroup source_blk - */ - -class GR_CORE_API @NAME@ : public gr_sync_block { - friend GR_CORE_API @NAME@_sptr - gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset); - - double d_sampling_freq; - gr_waveform_t d_waveform; - double d_frequency; - double d_ampl; - @TYPE@ d_offset; - gr_fxpt_nco d_nco; - - - @NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - double sampling_freq () const { return d_sampling_freq; } - gr_waveform_t waveform () const { return d_waveform; } - double frequency () const { return d_frequency; } - double amplitude () const { return d_ampl; } - @TYPE@ offset () const { return d_offset; } - - // MANIPULATORS - void set_sampling_freq (double sampling_freq); - void set_waveform (gr_waveform_t waveform); - void set_frequency (double frequency); - void set_amplitude (double ampl); - void set_offset (@TYPE@ offset); -}; - -GR_CORE_API @NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset = 0); - - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t deleted file mode 100644 index 7bd85fcb81..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset = 0); - - -class @NAME@ : public gr_sync_block { - private: - @NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset); - - public: - - // ACCESSORS - double sampling_freq () const { return d_sampling_freq; } - gr_waveform_t waveform () const { return d_waveform; } - double frequency () const { return d_frequency; } - double amplitude () const { return d_ampl; } - @TYPE@ offset () const { return d_offset; } - - // MANIPULATORS - void set_sampling_freq (double sampling_freq); - void set_waveform (gr_waveform_t waveform); - void set_frequency (double frequency); - void set_amplitude (double ampl); - void set_offset (@TYPE@ offset); -}; diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h b/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h deleted file mode 100644 index 9fe233ba4a..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_SIG_SOURCE_WAVEFORM_H -#define INCLUDED_GR_SIG_SOURCE_WAVEFORM_H - -typedef enum { - GR_CONST_WAVE = 100, GR_SIN_WAVE, GR_COS_WAVE, GR_SQR_WAVE, GR_TRI_WAVE, GR_SAW_WAVE -} gr_waveform_t; - -#endif /* INCLUDED_GR_SIG_SOURCE_WAVEFORM_H */ diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py deleted file mode 100755 index e875191507..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest - -class test_noise_source(gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_001(self): - # Just confirm that we can instantiate a noise source - op = gr.noise_source_f(gr.GR_GAUSSIAN, 10, 10) - - def test_002(self): - # Test get methods - set_type = gr.GR_GAUSSIAN - set_ampl = 10 - op = gr.noise_source_f(set_type, set_ampl, 10) - get_type = op.type() - get_ampl = op.amplitude() - - self.assertEqual(get_type, set_type) - self.assertEqual(get_ampl, set_ampl) - - -if __name__ == '__main__': - gr_unittest.run(test_noise_source, "test_noise_source.xml") - diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py deleted file mode 100755 index 122b169b7e..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_sig_source (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_const_f (self): - tb = self.tb - expected_result = (1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5) - src1 = gr.sig_source_f (1e6, gr.GR_CONST_WAVE, 0, 1.5) - op = gr.head (gr.sizeof_float, 10) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_const_i (self): - tb = self.tb - expected_result = (1, 1, 1, 1) - src1 = gr.sig_source_i (1e6, gr.GR_CONST_WAVE, 0, 1) - op = gr.head (gr.sizeof_int, 4) - dst1 = gr.vector_sink_i () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_sine_f (self): - tb = self.tb - sqrt2 = math.sqrt(2) / 2 - expected_result = (0, sqrt2, 1, sqrt2, 0, -sqrt2, -1, -sqrt2, 0) - src1 = gr.sig_source_f (8, gr.GR_SIN_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_cosine_f (self): - tb = self.tb - sqrt2 = math.sqrt(2) / 2 - expected_result = (1, sqrt2, 0, -sqrt2, -1, -sqrt2, 0, sqrt2, 1) - src1 = gr.sig_source_f (8, gr.GR_COS_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_sqr_c (self): - tb = self.tb #arg6 is a bit before -PI/2 - expected_result = (1j, 1j, 0, 0, 1, 1, 1+0j, 1+1j, 1j) - src1 = gr.sig_source_c (8, gr.GR_SQR_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_tri_c (self): - tb = self.tb - expected_result = (1+.5j, .75+.75j, .5+1j, .25+.75j, 0+.5j, .25+.25j, .5+0j, .75+.25j, 1+.5j) - src1 = gr.sig_source_c (8, gr.GR_TRI_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_saw_c (self): - tb = self.tb - expected_result = (.5+.25j, .625+.375j, .75+.5j, .875+.625j, 0+.75j, .125+.875j, .25+1j, .375+.125j, .5+.25j) - src1 = gr.sig_source_c (8, gr.GR_SAW_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_sqr_f (self): - tb = self.tb - expected_result = (0, 0, 0, 0, 1, 1, 1, 1, 0) - src1 = gr.sig_source_f (8, gr.GR_SQR_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_tri_f (self): - tb = self.tb - expected_result = (1, .75, .5, .25, 0, .25, .5, .75, 1) - src1 = gr.sig_source_f (8, gr.GR_TRI_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_saw_f (self): - tb = self.tb - expected_result = (.5, .625, .75, .875, 0, .125, .25, .375, .5) - src1 = gr.sig_source_f (8, gr.GR_SAW_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - -if __name__ == '__main__': - gr_unittest.run(test_sig_source, "test_sig_source.xml") |