diff options
36 files changed, 13 insertions, 1871 deletions
diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst index 53ceba08e7..5e15be4466 100644 --- a/docs/sphinx/source/gr/index.rst +++ b/docs/sphinx/source/gr/index.rst @@ -255,13 +255,8 @@ Signal Level Control (AGC) .. autosummary:: :nosignatures: - gnuradio.gr.agc2_cc - gnuradio.gr.agc2_ff - gnuradio.gr.agc_cc - gnuradio.gr.agc_ff gnuradio.gr.ctcss_squelch_ff gnuradio.gr.dpll_bb - gnuradio.gr.feedforward_agc_cc gnuradio.gr.peak_detector2_fb gnuradio.gr.pwr_squelch_cc gnuradio.gr.pwr_squelch_ff diff --git a/docs/sphinx/source/gr/level_blk.rst b/docs/sphinx/source/gr/level_blk.rst index d6c565c65d..1be9f2ffaa 100644 --- a/docs/sphinx/source/gr/level_blk.rst +++ b/docs/sphinx/source/gr/level_blk.rst @@ -1,13 +1,8 @@ gnuradio.gr: Signal Level Control (AGC) ======================================= -.. autooldblock:: gnuradio.gr.agc2_cc -.. autooldblock:: gnuradio.gr.agc2_ff -.. autooldblock:: gnuradio.gr.agc_cc -.. autooldblock:: gnuradio.gr.agc_ff .. autooldblock:: gnuradio.gr.ctcss_squelch_ff .. autooldblock:: gnuradio.gr.dpll_bb -.. autooldblock:: gnuradio.gr.feedforward_agc_cc .. autooldblock:: gnuradio.gr.peak_detector2_fb .. autooldblock:: gnuradio.gr.pwr_squelch_cc .. autooldblock:: gnuradio.gr.pwr_squelch_ff diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index 7173246ea0..726f190ec3 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -127,10 +127,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_test_types.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_vco.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_add_const_ss.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_cc.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_ff.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_cc.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_ff.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_char_to_float.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_debugger_hook.h @@ -159,10 +155,6 @@ if(ENABLE_PYTHON) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/general.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_constants.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_cc.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_ff.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_cc.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_ff.i ${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" @@ -175,10 +167,6 @@ endif(ENABLE_PYTHON) set(gr_core_general_triple_threats complex_vec_test gr_add_ff - gr_agc_cc - gr_agc_ff - gr_agc2_cc - gr_agc2_ff gr_align_on_samplenumbers_ss gr_bin_statistics_f gr_char_to_float @@ -199,7 +187,6 @@ set(gr_core_general_triple_threats gr_encode_ccsds_27_bb gr_endian_swap gr_fake_channel_coder_pp - gr_feedforward_agc_cc gr_feval gr_firdes gr_float_to_char diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index b8d567b7cf..1007b7f1a8 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -62,10 +62,6 @@ #include <gr_deinterleave.h> #include <gr_delay.h> #include <gr_simple_squelch_cc.h> -#include <gr_agc_ff.h> -#include <gr_agc_cc.h> -#include <gr_agc2_ff.h> -#include <gr_agc2_cc.h> #include <gr_rms_cf.h> #include <gr_rms_ff.h> #include <gr_nlog10_ff.h> @@ -106,7 +102,6 @@ #include <gr_pwr_squelch_cc.h> #include <gr_pwr_squelch_ff.h> #include <gr_ctcss_squelch_ff.h> -#include <gr_feedforward_agc_cc.h> #include <gr_bin_statistics_f.h> #include <gr_peak_detector2_fb.h> #include <gr_repeat.h> @@ -167,10 +162,6 @@ %include "gr_deinterleave.i" %include "gr_delay.i" %include "gr_simple_squelch_cc.i" -%include "gr_agc_ff.i" -%include "gr_agc_cc.i" -%include "gr_agc2_ff.i" -%include "gr_agc2_cc.i" %include "gr_rms_cf.i" %include "gr_rms_ff.i" %include "gr_nlog10_ff.i" @@ -211,7 +202,6 @@ %include "gr_pwr_squelch_cc.i" %include "gr_pwr_squelch_ff.i" %include "gr_ctcss_squelch_ff.i" -%include "gr_feedforward_agc_cc.i" %include "gr_bin_statistics_f.i" %include "gr_peak_detector2_fb.i" %include "gr_repeat.i" diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.cc b/gnuradio-core/src/lib/general/gr_agc2_cc.cc deleted file mode 100644 index 5097babc9b..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc2_cc.h> -#include <gr_io_signature.h> -#include <gri_agc2_cc.h> - -gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain)); -} - -gr_agc2_cc::gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc2_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain) -{ -} - -int -gr_agc2_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.h b/gnuradio-core/src/lib/general/gr_agc2_cc.h deleted file mode 100644 index 54bae1aae9..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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_AGC2_CC_H -#define INCLUDED_GR_AGC2_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc2_cc.h> - -class gr_agc2_cc; -typedef boost::shared_ptr<gr_agc2_cc> gr_agc2_cc_sptr; - -GR_CORE_API gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gr_agc2_cc : public gr_sync_block, public gri_agc2_cc -{ - friend GR_CORE_API gr_agc2_cc_sptr gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); - gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_AGC2_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.i b/gnuradio-core/src/lib/general/gr_agc2_cc.i deleted file mode 100644 index 6d7b221010..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc2_cc) - -%include <gri_agc2_cc.i> - -gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc2_cc : public gr_sync_block , public gri_agc2_cc -{ - gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.cc b/gnuradio-core/src/lib/general/gr_agc2_ff.cc deleted file mode 100644 index 792ee1c6be..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc2_ff.h> -#include <gr_io_signature.h> -#include <gri_agc2_ff.h> - -gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc2_ff (attack_rate, decay_rate, reference, - gain, max_gain)); -} - -gr_agc2_ff::gr_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc2_ff", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (float))) - , gri_agc2_ff (attack_rate, decay_rate, reference, gain, max_gain) -{ -} - -int -gr_agc2_ff::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.h b/gnuradio-core/src/lib/general/gr_agc2_ff.h deleted file mode 100644 index 48529948c0..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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_AGC2_FF_H -#define INCLUDED_GR_AGC2_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc2_ff.h> -class gr_agc2_ff; -typedef boost::shared_ptr<gr_agc2_ff> gr_agc2_ff_sptr; - -GR_CORE_API gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * - * \ingroup level_blk - * Power is approximated by absolute value - */ - -class GR_CORE_API gr_agc2_ff : public gr_sync_block, public gri_agc2_ff -{ - friend GR_CORE_API gr_agc2_ff_sptr gr_make_agc2_ff (float attack_rate, float decay_rate, - float reference, float gain, float max_gain); - gr_agc2_ff (float attack_rate, float decay_rate, float reference, float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FLOAT_AGC2_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.i b/gnuradio-core/src/lib/general/gr_agc2_ff.i deleted file mode 100644 index 646391aa7f..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc2_ff) - -%include <gri_agc2_ff.i> - -gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc2_ff : public gr_sync_block , public gri_agc2_ff -{ - gr_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.cc b/gnuradio-core/src/lib/general/gr_agc_cc.cc deleted file mode 100644 index e98f3a303f..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc_cc.h> -#include <gr_io_signature.h> -#include <gri_agc_cc.h> - -gr_agc_cc_sptr -gr_make_agc_cc (float rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc_cc (rate, reference, gain, max_gain)); -} - -gr_agc_cc::gr_agc_cc (float rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_agc_cc (rate, reference, gain, max_gain) -{ -} - -int -gr_agc_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.h b/gnuradio-core/src/lib/general/gr_agc_cc.h deleted file mode 100644 index 9f35350dbd..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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_AGC_CC_H -#define INCLUDED_GR_AGC_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc_cc.h> -class gr_agc_cc; -typedef boost::shared_ptr<gr_agc_cc> gr_agc_cc_sptr; - -GR_CORE_API gr_agc_cc_sptr -gr_make_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gr_agc_cc : public gr_sync_block, public gri_agc_cc -{ - friend GR_CORE_API gr_agc_cc_sptr gr_make_agc_cc (float rate, float reference, - float gain, float max_gain); - gr_agc_cc (float rate, float reference, - float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.i b/gnuradio-core/src/lib/general/gr_agc_cc.i deleted file mode 100644 index f942713b08..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc_cc) - -%include <gri_agc_cc.i> - -gr_agc_cc_sptr -gr_make_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc_cc : public gr_sync_block , public gri_agc_cc -{ - gr_agc_cc (float rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.cc b/gnuradio-core/src/lib/general/gr_agc_ff.cc deleted file mode 100644 index 6050dc7f0a..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc_ff.h> -#include <gr_io_signature.h> -#include <gri_agc_ff.h> - -gr_agc_ff_sptr -gr_make_agc_ff (float rate, float reference, float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc_ff (rate, reference, gain, max_gain)); -} - -gr_agc_ff::gr_agc_ff (float rate, float reference, float gain, float max_gain) - : gr_sync_block ("gr_agc_ff", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (float))) - , gri_agc_ff (rate, reference, gain, max_gain) -{ -} - -int -gr_agc_ff::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.h b/gnuradio-core/src/lib/general/gr_agc_ff.h deleted file mode 100644 index dc618213bb..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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_AGC_FF_H -#define INCLUDED_GR_AGC_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc_ff.h> -class gr_agc_ff; -typedef boost::shared_ptr<gr_agc_ff> gr_agc_ff_sptr; - -GR_CORE_API gr_agc_ff_sptr -gr_make_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * Power is approximated by absolute value - */ - -class GR_CORE_API gr_agc_ff : public gr_sync_block, public gri_agc_ff -{ - friend GR_CORE_API gr_agc_ff_sptr gr_make_agc_ff (float rate, float reference, - float gain, float max_gain); - gr_agc_ff (float rate, float reference, float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FLOAT_AGC_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.i b/gnuradio-core/src/lib/general/gr_agc_ff.i deleted file mode 100644 index 03c571e1a4..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc_ff) - -%include <gri_agc_ff.i> - -gr_agc_ff_sptr -gr_make_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc_ff : public gr_sync_block , public gri_agc_ff -{ - gr_agc_ff (float rate, float reference, float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc deleted file mode 100644 index 147b64e9bf..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_feedforward_agc_cc.h> -#include <gr_io_signature.h> -#include <stdexcept> - -gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference) -{ - return gnuradio::get_initial_sptr(new gr_feedforward_agc_cc (nsamples, reference)); -} - -gr_feedforward_agc_cc::gr_feedforward_agc_cc (int nsamples, float reference) - : gr_sync_block ("gr_feedforward_agc_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - d_nsamples(nsamples), d_reference(reference) -{ - if (nsamples < 1) - throw std::invalid_argument("gr_feedforward_agc_cc: nsamples must be >= 1"); - - set_history(nsamples); -} - -gr_feedforward_agc_cc::~gr_feedforward_agc_cc() -{ -} - -inline static float -mag_squared(gr_complex x) -{ - return x.real() * x.real() + x.imag() * x.imag(); -} - -// approximate sqrt(x^2 + y^2) -inline static float -envelope(gr_complex x) -{ - float r_abs = std::fabs(x.real()); - float i_abs = std::fabs(x.imag()); - - if (r_abs > i_abs) - return r_abs + 0.4 * i_abs; - else - return i_abs + 0.4 * r_abs; -} - -int -gr_feedforward_agc_cc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int nsamples = d_nsamples; - float gain; - - for (int i = 0; i < noutput_items; i++){ - //float max_env = 1e-12; // avoid divide by zero - float max_env = 1e-4; // avoid divide by zero, indirectly set max gain - for (int j = 0; j < nsamples; j++) - max_env = std::max(max_env, envelope(in[i+j])); - gain = d_reference / max_env; - out[i] = gain * in[i]; - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h deleted file mode 100644 index 63e5e4c436..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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_FEEDFORWARD_AGC_CC_H -#define INCLUDED_GR_FEEDFORWARD_AGC_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_feedforward_agc_cc; -typedef boost::shared_ptr<gr_feedforward_agc_cc> gr_feedforward_agc_cc_sptr; - -GR_CORE_API gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference = 1.0); - -/*! - * \brief Non-causal AGC which computes required gain based on max absolute value over nsamples - * \ingroup level_blk - */ -class GR_CORE_API gr_feedforward_agc_cc : public gr_sync_block -{ - friend GR_CORE_API gr_feedforward_agc_cc_sptr - gr_make_feedforward_agc_cc(int nsamples, float reference); - - int d_nsamples; - float d_reference; - - gr_feedforward_agc_cc(int nsamples, float reference); - - public: - ~gr_feedforward_agc_cc(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FEEDFORWARD_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i deleted file mode 100644 index 1fd5a2c26d..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -GR_SWIG_BLOCK_MAGIC(gr,feedforward_agc_cc); - -gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference = 1.0); - -class gr_feedforward_agc_cc : public gr_sync_block -{ - gr_feedforward_agc_cc(int nsamples, float reference); - - public: - ~gr_feedforward_agc_cc(); -}; diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.h b/gnuradio-core/src/lib/general/gri_agc2_cc.h deleted file mode 100644 index 55aa19b9ae..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_cc.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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 _GRI_AGC2_CC_H_ -#define _GRI_AGC2_CC_H_ - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ -class GR_CORE_API gri_agc2_cc { - - public: - gri_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _attack_rate(attack_rate), _decay_rate(decay_rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float decay_rate () const { return _decay_rate; } - float attack_rate () const { return _attack_rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain() const { return _max_gain; } - - void set_decay_rate (float rate) { _decay_rate = rate; } - void set_attack_rate (float rate) { _attack_rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain(float max_gain) { _max_gain = max_gain; } - - gr_complex scale (gr_complex input){ - gr_complex output = input * _gain; - - float tmp = -_reference + sqrt(output.real()*output.real() + - output.imag()*output.imag()); - float rate = _decay_rate; - if((tmp) > _gain) - rate = _attack_rate; - _gain -= tmp*rate; - -#if 0 - fprintf(stdout, "rate = %f\ttmp = %f\t gain = %f\n", rate, tmp, _gain); -#endif - - // Not sure about this; will blow up if _gain < 0 (happens when rates are too high), - // but is this the solution? - if (_gain < 0.0) - _gain = 10e-5; - - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (gr_complex output[], const gr_complex input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _attack_rate; // attack rate for fast changing signals - float _decay_rate; // decay rate for slow changing signals - float _reference; // reference value - float _gain; // current gain - float _max_gain; // max allowable gain -}; - -#endif /* _GRI_AGC2_CC_H_ */ diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.i b/gnuradio-core/src/lib/general/gri_agc2_cc.i deleted file mode 100644 index 08716c6edc..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_cc.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class with attack and decay rates - * - * For Power the absolute value of the complex number is used. - */ - - -class gri_agc2_cc { - - public: - gri_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - float decay_rate (); - float attack_rate (); - float reference (); - float gain (); - float max_gain (); - void set_decay_rate (float rate); - void set_attack_rate (float rate); - void set_reference (float reference); - void set_gain (float gain); - void set_max_gain(float max_gain); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.h b/gnuradio-core/src/lib/general/gri_agc2_ff.h deleted file mode 100644 index a8b46bec5c..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_ff.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 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 _GRI_AGC2_FF_H_ -#define _GRI_AGC2_FF_H_ - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class with attack and decay rate - * - * Power is approximated by absolute value - */ - -class GR_CORE_API gri_agc2_ff { - - public: - gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _attack_rate(attack_rate), _decay_rate(decay_rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float attack_rate () const { return _attack_rate; } - float decay_rate () const { return _decay_rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain () const { return _max_gain; } - - void set_attack_rate (float rate) { _attack_rate = rate; } - void set_decay_rate (float rate) { _decay_rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain (float max_gain) { _max_gain = max_gain; } - - float scale (float input){ - float output = input * _gain; - - float tmp = (fabsf(output)) - _reference; - float rate = _decay_rate; - if(fabsf(tmp) > _gain) - rate = _attack_rate; - _gain -= tmp*rate; - -#if 0 - fprintf(stdout, "rate = %f\ttmp = %f\t gain = %f\n", rate, tmp, _gain); -#endif - - // Not sure about this - if (_gain < 0.0) - _gain = 10e-5; - - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (float output[], const float input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _attack_rate; // attack_rate for fast changing signals - float _decay_rate; // decay rate for slow changing signals - float _reference; // reference value - float _gain; // current gain - float _max_gain; // maximum gain -}; - -#endif /* _GRI_AGC2_FF_H_ */ diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.i b/gnuradio-core/src/lib/general/gri_agc2_ff.i deleted file mode 100644 index 9f97d8f0dd..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_ff.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ - - -class gri_agc2_ff { - - public: - gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, - float reference = 1.0, float gain = 1.0, float max_gain = 0.0); - float attack_rate (); - float decay_rate (); - float reference (); - float gain (); - float max_gain (); - void set_attack_rate (float rate); - void set_decay_rate (float rate); - void set_reference (float reference); - void set_gain (float gain); - void set_max_gain (float max_gain); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc_cc.h b/gnuradio-core/src/lib/general/gri_agc_cc.h deleted file mode 100644 index 90edc5dcd2..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_cc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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_GRI_AGC_CC_H -#define INCLUDED_GRI_AGC_CC_H - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gri_agc_cc { - - public: - gri_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _rate(rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float rate () const { return _rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain() const { return _max_gain; } - - void set_rate (float rate) { _rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain(float max_gain) { _max_gain = max_gain; } - - gr_complex scale (gr_complex input){ - gr_complex output = input * _gain; - - _gain += _rate * (_reference - sqrt(output.real()*output.real() + - output.imag()*output.imag())); - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (gr_complex output[], const gr_complex input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _rate; // adjustment rate - float _reference; // reference value - float _gain; // current gain - float _max_gain; // max allowable gain -}; - -#endif /* INCLUDED_GRI_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gri_agc_cc.i b/gnuradio-core/src/lib/general/gri_agc_cc.i deleted file mode 100644 index d3dd9b61bc..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_cc.i +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ - - -class gri_agc_cc { - - public: - gri_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - float rate (); - float reference (); - float gain (); - float max_gain (); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc_ff.h b/gnuradio-core/src/lib/general/gri_agc_ff.h deleted file mode 100644 index 1c233c7461..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_ff.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 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_GRI_AGC_FF_H -#define INCLUDED_GRI_AGC_FF_H - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ -class GR_CORE_API gri_agc_ff { - - public: - gri_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _rate(rate), _reference(reference), _gain(gain), _max_gain(max_gain) {}; - - float rate () const { return _rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain () const { return _max_gain; } - - void set_rate (float rate) { _rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain (float max_gain) { _max_gain = max_gain; } - - float scale (float input){ - float output = input * _gain; - _gain += (_reference - fabsf (output)) * _rate; - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (float output[], const float input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _rate; // adjustment rate - float _reference; // reference value - float _gain; // current gain - float _max_gain; // maximum gain -}; - -#endif /* INCLUDED_GRI_AGC_FF_H */ - diff --git a/gnuradio-core/src/lib/general/gri_agc_ff.i b/gnuradio-core/src/lib/general/gri_agc_ff.i deleted file mode 100644 index df4acf7af8..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_ff.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 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. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ - -class gri_agc_ff { - - public: - gri_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -}; diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py b/gnuradio-core/src/python/gnuradio/gr/qa_agc.py deleted file mode 100755 index 9fd633576e..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py +++ /dev/null @@ -1,433 +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 - -test_output = False - -class test_agc (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - - def test_001(self): - ''' Test the complex AGC loop (single rate input) ''' - tb = self.tb - - expected_result = ( - (100.000244140625+7.2191943445432116e-07j), - (72.892257690429688+52.959323883056641j), - (25.089065551757812+77.216217041015625j), - (-22.611061096191406+69.589706420898438j), - (-53.357715606689453+38.766635894775391j), - (-59.458671569824219+3.4792964243024471e-07j), - (-43.373462677001953-31.512666702270508j), - (-14.94139289855957-45.984889984130859j), - (13.478158950805664-41.48150634765625j), - (31.838506698608398-23.132022857666016j), - (35.519271850585938-3.1176801940091536e-07j), - (25.942903518676758+18.848621368408203j), - (8.9492912292480469+27.5430908203125j), - (-8.0852642059326172+24.883890151977539j), - (-19.131628036499023+13.899936676025391j), - (-21.383295059204102+3.1281737733479531e-07j), - (-15.650330543518066-11.370632171630859j), - (-5.4110145568847656-16.65339469909668j), - (4.9008159637451172-15.083160400390625j), - (11.628337860107422-8.4484796524047852j), - (13.036135673522949-2.288476110834381e-07j), - (9.5726661682128906+6.954948902130127j), - (3.3216962814331055+10.223132133483887j), - (-3.0204284191131592+9.2959251403808594j), - (-7.1977195739746094+5.2294478416442871j), - (-8.1072216033935547+1.8976157889483147e-07j), - (-5.9838657379150391-4.3475332260131836j), - (-2.0879747867584229-6.4261269569396973j), - (1.9100792407989502-5.8786196708679199j), - (4.5814824104309082-3.3286411762237549j), - (5.1967458724975586-1.3684227440080576e-07j), - (3.8647139072418213+2.8078789710998535j), - (1.3594740629196167+4.1840314865112305j), - (-1.2544282674789429+3.8607344627380371j), - (-3.0366206169128418+2.2062335014343262j), - (-3.4781389236450195+1.1194014604143376e-07j), - (-2.6133756637573242-1.8987287282943726j), - (-0.9293016791343689-2.8600969314575195j), - (0.86727333068847656-2.6691930294036865j), - (2.1243946552276611-1.5434627532958984j), - (2.4633183479309082-8.6486437567145913e-08j), - (1.8744727373123169+1.3618841171264648j), - (0.67528903484344482+2.0783262252807617j), - (-0.63866174221038818+1.965599536895752j), - (-1.5857341289520264+1.152103066444397j), - (-1.8640764951705933+7.6355092915036948e-08j), - (-1.4381576776504517-1.0448826551437378j), - (-0.52529704570770264-1.6166983842849731j), - (0.50366902351379395-1.5501341819763184j), - (1.26766037940979-0.92100900411605835j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc_cc(1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_002(self): - ''' Test the floating point AGC loop (single rate input) ''' - tb = self.tb - - expected_result = ( - 7.2191943445432116e-07, - 58.837181091308594, - 89.700050354003906, - 81.264183044433594, - 45.506141662597656, - 4.269894304798072e-07, - -42.948936462402344, - -65.50335693359375, - -59.368724822998047, - -33.261005401611328, - -4.683740257860336e-07, - 31.423542022705078, - 47.950984954833984, - 43.485683441162109, - 24.378345489501953, - 5.7254135299444897e-07, - -23.062990188598633, - -35.218441009521484, - -31.964075088500977, - -17.934831619262695, - -5.0591745548445033e-07, - 16.998210906982422, - 25.982204437255859, - 23.606258392333984, - 13.260685920715332, - 4.9936483037527069e-07, - -12.59880542755127, - -19.28221321105957, - -17.54347038269043, - -9.8700437545776367, - -4.188150626305287e-07, - 9.4074573516845703, - 14.422011375427246, - 13.145503044128418, - 7.41046142578125, - 3.8512698097292741e-07, - -7.0924453735351562, - -10.896408081054688, - -9.9552040100097656, - -5.6262712478637695, - -3.1982864356905338e-07, - 5.4131259918212891, - 8.3389215469360352, - 7.6409502029418945, - 4.3320145606994629, - 2.882407841298118e-07, - -4.194943904876709, - -6.4837145805358887, - -5.9621825218200684, - -3.3931560516357422) - - sampling_freq = 100 - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) - dst1 = gr.vector_sink_f () - head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) - - agc = gr.agc_ff(1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_float, "test_agc_ff.dat")) - - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_003(self): - ''' Test the complex AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - ((100.000244140625+7.2191943445432116e-07j), - (0.80881959199905396+0.58764183521270752j), - (0.30894950032234192+0.95084899663925171j), - (-0.30895623564720154+0.95086973905563354j), - (-0.80887287855148315+0.58768033981323242j), - (-0.99984413385391235+5.850709250410091e-09j), - (-0.80889981985092163-0.58770018815994263j), - (-0.30897706747055054-0.95093393325805664j), - (0.30898112058639526-0.95094609260559082j), - (0.80893135070800781-0.58772283792495728j), - (0.99990922212600708-8.7766354184282136e-09j), - (0.80894720554351807+0.58773452043533325j), - (0.30899339914321899+0.95098406076431274j), - (-0.30899572372436523+0.95099133253097534j), - (-0.80896598100662231+0.58774799108505249j), - (-0.99994778633117676+1.4628290578855285e-08j), - (-0.80897533893585205-0.58775502443313599j), - (-0.30900305509567261-0.95101380348205566j), - (0.30900448560714722-0.95101797580718994j), - (0.80898630619049072-0.58776277303695679j), - (0.99997037649154663-1.7554345532744264e-08j), - (0.80899184942245483+0.58776694536209106j), - (0.30900871753692627+0.95103120803833008j), - (-0.30900952219963074+0.95103377103805542j), - (-0.8089984655380249+0.58777159452438354j), - (-0.99998390674591064+2.3406109050938539e-08j), - (-0.809001624584198-0.58777409791946411j), - (-0.30901208519935608-0.95104163885116577j), - (0.30901262164115906-0.95104306936264038j), - (0.80900543928146362-0.587776780128479j), - (0.99999171495437622-2.6332081404234486e-08j), - (0.80900734663009644+0.58777821063995361j), - (0.30901408195495605+0.95104765892028809j), - (-0.30901429057121277+0.95104855298995972j), - (-0.80900967121124268+0.58777981996536255j), - (-0.99999648332595825+3.2183805842578295e-08j), - (-0.80901080369949341-0.58778077363967896j), - (-0.30901527404785156-0.95105135440826416j), - (0.30901545286178589-0.95105189085006714j), - (0.80901217460632324-0.58778166770935059j), - (0.99999916553497314-3.5109700036173308e-08j), - (0.809012770652771+0.58778214454650879j), - (0.30901595950126648+0.9510534405708313j), - (-0.30901598930358887+0.95105385780334473j), - (-0.80901366472244263+0.58778274059295654j), - (-1.0000008344650269+4.0961388947380328e-08j), - (-0.8090139627456665-0.58778303861618042j), - (-0.30901634693145752-0.95105475187301636j), - (0.30901640653610229-0.95105493068695068j), - (0.80901449918746948-0.5877833366394043j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_004(self): - ''' Test the floating point AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - (7.2191943445432116e-07, - 58.837181091308594, - 40.194305419921875, - 2.9183335304260254, - 0.67606079578399658, - 8.6260438791896377e-09, - -1.4542514085769653, - -1.9210131168365479, - -1.0450780391693115, - -0.61939650774002075, - -1.2590258613442984e-08, - 1.4308931827545166, - 1.9054338932037354, - 1.0443156957626343, - 0.61937344074249268, - 2.0983527804219193e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443152189254761, - -0.61937344074249268, - -2.5180233009791664e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443154573440552, - 0.61937344074249268, - 3.3573645197293445e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443152189254761, - -0.61937350034713745, - -3.7770352179222755e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443154573440552, - 0.61937350034713745, - 4.6163762590367696e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443153381347656, - -0.61937344074249268, - -5.0360466019583328e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443155765533447, - 0.61937344074249268, - 5.8753879983441948e-08, - -1.4308837652206421, - -1.9054274559020996, - -1.0443153381347656, - -0.61937344074249268) - - sampling_freq = 100 - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_f () - head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_ff(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_float, "test_agc2_ff.dat")) - - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4) - - - def test_005(self): - ''' Test the complex AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - ((100.000244140625+7.2191943445432116e-07j), - (0.80881959199905396+0.58764183521270752j), - (0.30894950032234192+0.95084899663925171j), - (-0.30895623564720154+0.95086973905563354j), - (-0.80887287855148315+0.58768033981323242j), - (-0.99984413385391235+5.850709250410091e-09j), - (-0.80889981985092163-0.58770018815994263j), - (-0.30897706747055054-0.95093393325805664j), - (0.30898112058639526-0.95094609260559082j), - (0.80893135070800781-0.58772283792495728j), - (0.99990922212600708-8.7766354184282136e-09j), - (0.80894720554351807+0.58773452043533325j), - (0.30899339914321899+0.95098406076431274j), - (-0.30899572372436523+0.95099133253097534j), - (-0.80896598100662231+0.58774799108505249j), - (-0.99994778633117676+1.4628290578855285e-08j), - (-0.80897533893585205-0.58775502443313599j), - (-0.30900305509567261-0.95101380348205566j), - (0.30900448560714722-0.95101797580718994j), - (0.80898630619049072-0.58776277303695679j), - (0.99997037649154663-1.7554345532744264e-08j), - (0.80899184942245483+0.58776694536209106j), - (0.30900871753692627+0.95103120803833008j), - (-0.30900952219963074+0.95103377103805542j), - (-0.8089984655380249+0.58777159452438354j), - (-0.99998390674591064+2.3406109050938539e-08j), - (-0.809001624584198-0.58777409791946411j), - (-0.30901208519935608-0.95104163885116577j), - (0.30901262164115906-0.95104306936264038j), - (0.80900543928146362-0.587776780128479j), - (0.99999171495437622-2.6332081404234486e-08j), - (0.80900734663009644+0.58777821063995361j), - (0.30901408195495605+0.95104765892028809j), - (-0.30901429057121277+0.95104855298995972j), - (-0.80900967121124268+0.58777981996536255j), - (-0.99999648332595825+3.2183805842578295e-08j), - (-0.80901080369949341-0.58778077363967896j), - (-0.30901527404785156-0.95105135440826416j), - (0.30901545286178589-0.95105189085006714j), - (0.80901217460632324-0.58778166770935059j), - (0.99999916553497314-3.5109700036173308e-08j), - (0.809012770652771+0.58778214454650879j), - (0.30901595950126648+0.9510534405708313j), - (-0.30901598930358887+0.95105385780334473j), - (-0.80901366472244263+0.58778274059295654j), - (-1.0000008344650269+4.0961388947380328e-08j), - (-0.8090139627456665-0.58778303861618042j), - (-0.30901634693145752-0.95105475187301636j), - (0.30901640653610229-0.95105493068695068j), - (0.80901449918746948-0.5877833366394043j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - - def test_100(self): # FIXME needs work - ''' Test complex feedforward agc with constant input ''' - input_data = 16*(0.0,) + 64*(1.0,) + 64*(0.0,) - expected_result = () - - src = gr.vector_source_c(input_data) - agc = gr.feedforward_agc_cc(16, 2.0) - dst = gr.vector_sink_c () - self.tb.connect (src, agc, dst) - - if test_output == True: - self.tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_feedforward_cc.dat")) - - self.tb.run () - dst_data = dst.data () - #self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - -if __name__ == '__main__': - gr_unittest.run(test_agc, "test_agc.xml") diff --git a/gr-digital/python/generic_mod_demod.py b/gr-digital/python/generic_mod_demod.py index 855249dc63..f8e4c27fa4 100644 --- a/gr-digital/python/generic_mod_demod.py +++ b/gr-digital/python/generic_mod_demod.py @@ -25,7 +25,7 @@ Generic modulation and demodulation. """ -from gnuradio import gr +from gnuradio import gr, analog from modulation_utils import extract_kwargs_from_options_for_class from utils import mod_codes import digital_swig as digital @@ -264,7 +264,7 @@ class generic_demod(gr.hier_block2): ntaps = 11 * int(self._samples_per_symbol*nfilts) # Automatic gain control - self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100) + self.agc = analog.agc2_cc(0.6e-1, 1e-3, 1, 1, 100) # Frequency correction fll_ntaps = 55 diff --git a/gr-uhd/apps/uhd_rx_nogui b/gr-uhd/apps/uhd_rx_nogui index 9977f55a3c..cb6238353e 100755 --- a/gr-uhd/apps/uhd_rx_nogui +++ b/gr-uhd/apps/uhd_rx_nogui @@ -21,6 +21,7 @@ # from gnuradio import gr, gru, uhd, optfir, audio, blks2 +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -159,10 +160,10 @@ class app_top_block(gr.top_block): int(channel_rate/20), # 50ms rise/fall False) # Zero, not gate output - AGC = gr.agc_cc(1.0/channel_rate, # Time constant - 1.0, # Reference power - 1.0, # Initial gain - 1.0) # Maximum gain + AGC = analog.agc_cc(1.0/channel_rate, # Time constant + 1.0, # Reference power + 1.0, # Initial gain + 1.0) # Maximum gain DEMOD = demod(channel_rate, audio_decim) diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 40a7fee68d..6965ef5af9 100755 --- a/gr-uhd/examples/python/usrp_am_mw_rcv.py +++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py @@ -21,6 +21,7 @@ # from gnuradio import gr, eng_notation, optfir +from gnuradio import analog from gnuradio import audio from gnuradio import uhd from gnuradio import blks2 @@ -113,7 +114,7 @@ class wfm_rx_block (stdgui2.std_top_block): else: self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs) - self.agc = gr.agc_cc(0.1, 1, 1, 100000) + self.agc = analog.agc_cc(0.1, 1, 1, 100000) self.am_demod = gr.complex_to_mag() self.volume_control = gr.multiply_const_ff(self.vol) diff --git a/gr-uhd/examples/python/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py index b42cf57992..794fec4e1f 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv.py +++ b/gr-uhd/examples/python/usrp_tv_rcv.py @@ -47,6 +47,7 @@ except: print "FYI: gr-video-sdl is not installed" print "realtime SDL video output window will not be available" from gnuradio import uhd +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -194,7 +195,7 @@ class tv_rx_block (stdgui2.std_top_block): file_sink=gr.file_sink(gr.sizeof_char, options.out_filename) self.dst =file_sink - self.agc=gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () self.set_blacklevel=gr.add_const_ff(0.0) self.invert_and_scale = gr.multiply_const_ff (0.0) #-self.contrast *128.0*255.0/(200.0) diff --git a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py index cfb36222cb..54275bb037 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py @@ -35,6 +35,7 @@ development but not yet in cvs. """ from gnuradio import gr, eng_notation +from gnuradio import analog from gnuradio import audio from gnuradio import uhd from gnuradio.eng_option import eng_option @@ -158,7 +159,7 @@ class my_top_block(gr.top_block): raise SystemExit, 1 - self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () self.set_blacklevel = gr.add_const_ff(options.brightness +255.0) self.invert_and_scale = gr.multiply_const_ff (-options.contrast *128.0*255.0/(200.0)) diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 31298a2288..1b0c7cb13e 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -139,10 +139,6 @@ <block>gr_peak_detector2_fb</block> <block>gr_sample_and_hold_xx</block> - <block>gr_agc_xx</block> - <block>gr_agc2_xx</block> - <block>gr_feedforward_agc_cc</block> - <block>gr_mute_xx</block> <block>gr_simple_squelch_cc</block> <block>blks2_standard_squelch</block> diff --git a/grc/blocks/gr_agc2_xx.xml b/grc/blocks/gr_agc2_xx.xml deleted file mode 100644 index 55b20d4e82..0000000000 --- a/grc/blocks/gr_agc2_xx.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##AGC2 -################################################### - --> -<block> - <name>AGC2</name> - <key>gr_agc2_xx</key> - <import>from gnuradio import gr</import> - <make>gr.agc2_$(type.fcn)($attack_rate, $decay_rate, $reference, $gain, $max_gain)</make> - <callback>set_attack_rate($attack_rate)</callback> - <callback>set_decay_rate($decay_rate)</callback> - <callback>set_reference($reference)</callback> - <callback>set_gain($gain)</callback> - <callback>set_max_gain($max_gain)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:cc</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - <param> - <name>Attack Rate</name> - <key>attack_rate</key> - <value>1e-1</value> - <type>real</type> - </param> - <param> - <name>Decay Rate</name> - <key>decay_rate</key> - <value>1e-2</value> - <type>real</type> - </param> - <param> - <name>Reference</name> - <key>reference</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Gain</name> - <key>gain</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Max Gain</name> - <key>max_gain</key> - <value>0.0</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_agc_xx.xml b/grc/blocks/gr_agc_xx.xml deleted file mode 100644 index c87d239edd..0000000000 --- a/grc/blocks/gr_agc_xx.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##AGC -################################################### - --> -<block> - <name>AGC</name> - <key>gr_agc_xx</key> - <import>from gnuradio import gr</import> - <make>gr.agc_$(type.fcn)($rate, $reference, $gain, $max_gain)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:cc</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - <param> - <name>Rate</name> - <key>rate</key> - <value>1e-4</value> - <type>real</type> - </param> - <param> - <name>Reference</name> - <key>reference</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Gain</name> - <key>gain</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Max Gain</name> - <key>max_gain</key> - <value>0.0</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> |