diff options
17 files changed, 4 insertions, 657 deletions
diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst index 8f99ea4e9d..df218ab9f8 100644 --- a/docs/sphinx/source/gr/index.rst +++ b/docs/sphinx/source/gr/index.rst @@ -52,9 +52,6 @@ Signal Sinks gnuradio.gr.check_counting_s gnuradio.gr.check_lfsr_32k_s gnuradio.gr.null_sink - gnuradio.gr.probe_avg_mag_sqrd_c - gnuradio.gr.probe_avg_mag_sqrd_cf - gnuradio.gr.probe_avg_mag_sqrd_f gnuradio.gr.probe_signal_f gnuradio.gr.vector_sink_b gnuradio.gr.vector_sink_c diff --git a/docs/sphinx/source/gr/sink_blk.rst b/docs/sphinx/source/gr/sink_blk.rst index 80b66370c5..5e396d895a 100644 --- a/docs/sphinx/source/gr/sink_blk.rst +++ b/docs/sphinx/source/gr/sink_blk.rst @@ -5,9 +5,6 @@ gnuradio.gr: Signal Sinks .. autooldblock:: gnuradio.gr.check_counting_s .. autooldblock:: gnuradio.gr.check_lfsr_32k_s .. autooldblock:: gnuradio.gr.null_sink -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_c -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_cf -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_f .. autooldblock:: gnuradio.gr.probe_signal_f .. autooldblock:: gnuradio.gr.vector_sink_b .. autooldblock:: gnuradio.gr.vector_sink_c diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index 42c32b54c4..ced366903c 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -216,9 +216,6 @@ set(gr_core_general_triple_threats gr_peak_detector2_fb gr_phase_modulator_fc gr_prefs - gr_probe_avg_mag_sqrd_c - gr_probe_avg_mag_sqrd_cf - gr_probe_avg_mag_sqrd_f gr_pwr_squelch_cc gr_pwr_squelch_ff gr_quadrature_demod_cf diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index a8799e5c01..6cac23aac4 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -77,9 +77,6 @@ #include <gr_vco_f.h> #include <gr_threshold_ff.h> #include <gr_fmdet_cf.h> -#include <gr_probe_avg_mag_sqrd_c.h> -#include <gr_probe_avg_mag_sqrd_cf.h> -#include <gr_probe_avg_mag_sqrd_f.h> #include <gr_regenerate_bb.h> #include <gr_pa_2x2_phase_combiner.h> #include <gr_kludge_copy.h> @@ -173,9 +170,6 @@ %include "gr_vco_f.i" %include "gr_threshold_ff.i" %include "gr_fmdet_cf.i" -%include "gr_probe_avg_mag_sqrd_c.i" -%include "gr_probe_avg_mag_sqrd_cf.i" -%include "gr_probe_avg_mag_sqrd_f.i" %include "gr_regenerate_bb.i" %include "gr_pa_2x2_phase_combiner.i" %include "gr_kludge_copy.i" diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc deleted file mode 100644 index 6430d2753d..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,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_probe_avg_mag_sqrd_c.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_c::gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_c", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(0, 0, 0)), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_c::~gr_probe_avg_mag_sqrd_c() -{ -} - - -int -gr_probe_avg_mag_sqrd_c::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]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_c::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_c::set_threshold(double decibels) -{ - // convert to absolute threshold (mag squared) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_c::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h deleted file mode 100644 index 2811677cfc..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h +++ /dev/null @@ -1,75 +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_PROBE_AVG_MAG_SQRD_C_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_C_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_c; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_c> gr_probe_avg_mag_sqrd_c_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: gr_complex - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_c : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_c_sptr - gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_c (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_C_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i deleted file mode 100644 index bce244c127..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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,probe_avg_mag_sqrd_c); - -gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_c : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - void set_alpha (double alpha); - void set_threshold (double decibels); - double threshold(); -}; diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc deleted file mode 100644 index b5946283b8..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_probe_avg_mag_sqrd_cf.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_cf::gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_cf", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_cf::~gr_probe_avg_mag_sqrd_cf() -{ -} - - -int -gr_probe_avg_mag_sqrd_cf::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]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - out[i] = d_iir.prev_output(); - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_cf::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_cf::set_threshold(double decibels) -{ - // convert to absolute threshold (mag squared) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_cf::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h deleted file mode 100644 index bb5d1ebf91..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h +++ /dev/null @@ -1,77 +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_PROBE_AVG_MAG_SQRD_CF_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_cf; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_cf> gr_probe_avg_mag_sqrd_cf_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: gr_complex - * output: gr_float - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - * - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_cf : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_cf_sptr - gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_cf (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_CF_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i deleted file mode 100644 index bf76d973b7..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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,probe_avg_mag_sqrd_cf); - -gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_cf : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - void set_alpha (double alpha); - void set_threshold (double decibels); - double threshold(); -}; diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc deleted file mode 100644 index 4ed40743fc..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,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_probe_avg_mag_sqrd_f.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_f::gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_f", - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(0, 0, 0)), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_f::~gr_probe_avg_mag_sqrd_f() -{ -} - - -int -gr_probe_avg_mag_sqrd_f::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]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i]*in[i]; - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_f::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_f::set_threshold(double decibels) -{ - // convert to absolute threshold (mag sqrd) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_f::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h deleted file mode 100644 index b2efcc64eb..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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_PROBE_AVG_MAG_SQRD_F_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_F_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_f; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_f> gr_probe_avg_mag_sqrd_f_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: float - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_f : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_f_sptr - gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_f (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_F_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i deleted file mode 100644 index 1c63ae8e9d..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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,probe_avg_mag_sqrd_f); - -gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_f : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - double threshold() const; - void set_alpha (double alpha); - void set_threshold (double decibels); -}; diff --git a/gr-digital/examples/narrowband/receive_path.py b/gr-digital/examples/narrowband/receive_path.py index 308f955645..a1a07b5f26 100644 --- a/gr-digital/examples/narrowband/receive_path.py +++ b/gr-digital/examples/narrowband/receive_path.py @@ -23,6 +23,7 @@ from gnuradio import gr, gru, filter from gnuradio import eng_notation from gnuradio import digital +from gnuradio import analog import copy import sys @@ -78,7 +79,7 @@ class receive_path(gr.hier_block2): # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust - self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha) + self.probe = analog.probe_avg_mag_sqrd_c(thresh,alpha) # Display some information about the setup if self._verbose: diff --git a/gr-digital/examples/ofdm/receive_path.py b/gr-digital/examples/ofdm/receive_path.py index b5094ac24d..2a6813f8f9 100644 --- a/gr-digital/examples/ofdm/receive_path.py +++ b/gr-digital/examples/ofdm/receive_path.py @@ -22,6 +22,7 @@ from gnuradio import gr from gnuradio import eng_notation from gnuradio import digital +from gnuradio import analog import copy import sys @@ -51,7 +52,7 @@ class receive_path(gr.hier_block2): # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust - self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha) + self.probe = analog.probe_avg_mag_sqrd_c(thresh,alpha) self.connect(self, self.ofdm_rx) self.connect(self.ofdm_rx, self.probe) diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 9feeaf1190..e9caa1006d 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -180,7 +180,6 @@ </cat> <cat> <name>Probes</name> - <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_signal_f</block> </cat> <cat> diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml deleted file mode 100644 index 6bf706ae1c..0000000000 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe Average Magnitude Squared -################################################### - --> -<block> - <name>Probe Avg Mag^2</name> - <key>gr_probe_avg_mag_sqrd_x</key> - <import>from gnuradio import gr</import> - <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha)</make> - <callback>set_alpha($alpha)</callback> - <callback>set_threshold($threshold)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>input:complex</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>input:float</opt> - </option> - </param> - <param> - <name>Threshold (dB)</name> - <key>threshold</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>1</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type.input</type> - </sink> - <doc> -Available functions to probe: level() - -Use with the function probe block. - </doc> -</block> |