diff options
-rw-r--r-- | docs/sphinx/source/gr/index.rst | 2 | ||||
-rw-r--r-- | docs/sphinx/source/gr/level_blk.rst | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 4 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc | 107 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_peak_detector2_fb.h | 109 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_peak_detector2_fb.i | 45 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_regenerate_bb.cc | 90 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_regenerate_bb.h | 76 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_regenerate_bb.i | 38 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py | 90 | ||||
-rw-r--r-- | gr-digital/python/ofdm_sync_pn.py | 4 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 1 | ||||
-rw-r--r-- | grc/blocks/gr_peak_detector2_fb.xml | 38 | ||||
-rw-r--r-- | grc/blocks/gr_peak_detector_xb.xml | 64 |
15 files changed, 2 insertions, 670 deletions
diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst index f4804f1fd0..1617d709bb 100644 --- a/docs/sphinx/source/gr/index.rst +++ b/docs/sphinx/source/gr/index.rst @@ -140,8 +140,6 @@ Signal Level Control (AGC) .. autosummary:: :nosignatures: - gnuradio.gr.peak_detector2_fb - gnuradio.gr.regenerate_bb gnuradio.gr.mute_cc gnuradio.gr.mute_ff gnuradio.gr.mute_ii diff --git a/docs/sphinx/source/gr/level_blk.rst b/docs/sphinx/source/gr/level_blk.rst index 0eacb67230..bfc9801838 100644 --- a/docs/sphinx/source/gr/level_blk.rst +++ b/docs/sphinx/source/gr/level_blk.rst @@ -2,8 +2,6 @@ gnuradio.gr: Signal Level Control (AGC) ======================================= .. autooldblock:: gnuradio.gr.dpll_bb -.. autooldblock:: gnuradio.gr.peak_detector2_fb -.. autooldblock:: gnuradio.gr.regenerate_bb .. autooldblock:: gnuradio.gr.mute_cc .. autooldblock:: gnuradio.gr.mute_ff .. autooldblock:: gnuradio.gr.mute_ii diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index de75dee7b8..581d57f8d8 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -163,10 +163,8 @@ set(gr_core_general_triple_threats gr_null_sink gr_null_source gr_pa_2x2_phase_combiner - gr_peak_detector2_fb gr_prefs gr_random_pdu - gr_regenerate_bb gr_remez gr_skiphead gr_stretch_ff diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 092582475d..64b2816327 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -44,7 +44,6 @@ #include <gr_transcendental.h> #include <gr_vco_f.h> #include <gr_threshold_ff.h> -#include <gr_regenerate_bb.h> #include <gr_pa_2x2_phase_combiner.h> #include <gr_kludge_copy.h> #include <gr_prefs.h> @@ -55,7 +54,6 @@ #include <gr_pack_k_bits_bb.h> #include <gr_feval.h> #include <gr_bin_statistics_f.h> -#include <gr_peak_detector2_fb.h> #include <gr_stretch_ff.h> #include <gr_copy.h> #include <complex_vec_test.h> @@ -90,7 +88,6 @@ %include "gr_transcendental.i" %include "gr_vco_f.i" %include "gr_threshold_ff.i" -%include "gr_regenerate_bb.i" %include "gr_pa_2x2_phase_combiner.i" %include "gr_kludge_copy.i" %include "gr_prefs.i" @@ -101,7 +98,6 @@ %include "gr_pack_k_bits_bb.i" %include "gr_feval.i" %include "gr_bin_statistics_f.i" -%include "gr_peak_detector2_fb.i" %include "gr_stretch_ff.i" %include "gr_copy.i" %include "complex_vec_test.i" diff --git a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc b/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc deleted file mode 100644 index a4179a8c2a..0000000000 --- a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_peak_detector2_fb.h> -#include <gr_io_signature.h> -#include <string.h> - -gr_peak_detector2_fb_sptr -gr_make_peak_detector2_fb (float threshold_factor_rise, - int look_ahead, float alpha) -{ - return gnuradio::get_initial_sptr(new gr_peak_detector2_fb (threshold_factor_rise, - look_ahead, alpha)); -} - -gr_peak_detector2_fb::gr_peak_detector2_fb (float threshold_factor_rise, - int look_ahead, float alpha) - : gr_sync_block ("peak_detector2_fb", - gr_make_io_signature (1, 1, sizeof(float)), - gr_make_io_signature2 (1, 2, sizeof(char), sizeof(float))), - d_threshold_factor_rise(threshold_factor_rise), - d_look_ahead(look_ahead), d_alpha(alpha), d_avg(0.0f), d_found(false) -{ -} - -int -gr_peak_detector2_fb::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) { - float *iptr = (float *) input_items[0]; - char *optr = (char *) output_items[0]; - - assert(noutput_items >= 2); - - memset(optr, 0, noutput_items*sizeof(char)); - - for (int i = 0; i < noutput_items; i++) { - - if (!d_found) { - // Have not yet detected presence of peak - if (iptr[i] > d_avg * (1.0f + d_threshold_factor_rise)) { - d_found = true; - d_look_ahead_remaining = d_look_ahead; - d_peak_val = -(float)INFINITY; - } - else { - d_avg = d_alpha*iptr[i] + (1.0f - d_alpha)*d_avg; - } - } - else { - // Detected presence of peak - if (iptr[i] > d_peak_val) { - d_peak_val = iptr[i]; - d_peak_ind = i; - } - else if (d_look_ahead_remaining <= 0) { - optr[d_peak_ind] = 1; - d_found = false; - d_avg = iptr[i]; - } - - // Have not yet located peak, loop and keep searching. - d_look_ahead_remaining--; - } - - // Every iteration of the loop, write debugging signal out if - // connected: - if (output_items.size() == 2) { - float *sigout = (float *) output_items[1]; - sigout[i] = d_avg; - } - } // loop - - if (!d_found) - return noutput_items; - - // else if detected presence, keep searching during the next call to work. - int tmp = d_peak_ind; - d_peak_ind = 1; - - return tmp - 1; -} - - diff --git a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.h b/gnuradio-core/src/lib/general/gr_peak_detector2_fb.h deleted file mode 100644 index 665a6b882c..0000000000 --- a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 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_peak_detector2_FB_H -#define INCLUDED_gr_peak_detector2_FB_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_peak_detector2_fb; -typedef boost::shared_ptr<gr_peak_detector2_fb> gr_peak_detector2_fb_sptr; - -GR_CORE_API gr_peak_detector2_fb_sptr gr_make_peak_detector2_fb (float threshold_factor_rise = 7, - int look_ahead = 1000, - float alpha = 0.001); - -/*! - * \brief Detect the peak of a signal - * \ingroup level_blk - * - * If a peak is detected, this block outputs a 1, - * or it outputs 0's. A separate debug output may be connected, to - * view the internal EWMA described below. - * - * \param threshold_factor_rise The threshold factor determins when a peak - * is present. An EWMA average of the signal is calculated and when the - * value of the signal goes over threshold_factor_rise*average, we - * call the peak. - * \param look_ahead The look-ahead value is used when the threshold is - * found to locate the peak within this range. - * \param alpha The gain value of a single-pole moving average filter - */ - -class GR_CORE_API gr_peak_detector2_fb : public gr_sync_block -{ - friend GR_CORE_API gr_peak_detector2_fb_sptr - gr_make_peak_detector2_fb (float threshold_factor_rise, int look_ahead, float alpha); - - gr_peak_detector2_fb (float threshold_factor_rise, int look_ahead, float alpha); - -private: - float d_threshold_factor_rise; - int d_look_ahead; - int d_look_ahead_remaining; - int d_peak_ind; - float d_peak_val; - float d_alpha; - float d_avg; - bool d_found; - -public: - - /*! \brief Set the threshold factor value for the rise time - * \param thr new threshold factor - */ - void set_threshold_factor_rise(float thr) { d_threshold_factor_rise = thr; } - - /*! \brief Set the look-ahead factor - * \param look new look-ahead factor - */ - void set_look_ahead(int look) { d_look_ahead = look; } - - /*! \brief Set the running average alpha - * \param alpha new alpha for running average - */ - void set_alpha(int alpha) { d_alpha = alpha; } - - /*! \brief Get the threshold factor value for the rise time - * \return threshold factor - */ - float threshold_factor_rise() { return d_threshold_factor_rise; } - - /*! \brief Get the look-ahead factor value - * \return look-ahead factor - */ - int look_ahead() { return d_look_ahead; } - - /*! \brief Get the alpha value of the running average - * \return alpha - */ - float alpha() { return d_alpha; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif - - diff --git a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.i b/gnuradio-core/src/lib/general/gr_peak_detector2_fb.i deleted file mode 100644 index ec7227e690..0000000000 --- a/gnuradio-core/src/lib/general/gr_peak_detector2_fb.i +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 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,peak_detector2_fb) - - gr_peak_detector2_fb_sptr gr_make_peak_detector2_fb (float threshold_factor_rise = 7, - int look_ahead = 1000, - float alpha=0.001); - -class gr_peak_detector2_fb : public gr_sync_block -{ -private: - gr_peak_detector2_fb (float threshold_factor_rise, int look_ahead, float alpha); - -public: - void set_threshold_factor_rise(float thr) { d_threshold_factor_rise = thr; } - void set_look_ahead(int look) { d_look_ahead = look; } - void set_alpha(int alpha) { d_avg_alpha = alpha; } - - float threshold_factor_rise() { return d_threshold_factor_rise; } - int look_ahead() { return d_look_ahead; } - float alpha() { return d_avg_alpha; } -}; - - diff --git a/gnuradio-core/src/lib/general/gr_regenerate_bb.cc b/gnuradio-core/src/lib/general/gr_regenerate_bb.cc deleted file mode 100644 index c96cf247d0..0000000000 --- a/gnuradio-core/src/lib/general/gr_regenerate_bb.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_regenerate_bb.h> -#include <gr_io_signature.h> - -gr_regenerate_bb_sptr -gr_make_regenerate_bb (int period, unsigned int max_regen) -{ - return gnuradio::get_initial_sptr(new gr_regenerate_bb (period, max_regen)); -} - -gr_regenerate_bb::gr_regenerate_bb (int period, unsigned int max_regen) - : gr_sync_block ("regenerate_bb", - gr_make_io_signature (1, 1, sizeof (char)), - gr_make_io_signature (1, 1, sizeof (char))), - d_period(period), - d_countdown(0), - d_max_regen(max_regen), - d_regen_count(max_regen) -{ -} - -void gr_regenerate_bb::set_max_regen(unsigned int regen) -{ - d_max_regen = regen; - d_countdown = 0; - d_regen_count = d_max_regen; -} - -void gr_regenerate_bb::set_period(int period) -{ - d_period = period; - d_countdown = 0; - d_regen_count = d_max_regen; -} - -int -gr_regenerate_bb::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const char *iptr = (const char *) input_items[0]; - char *optr = (char *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - optr[i] = 0; - - if(d_regen_count < d_max_regen) { - d_countdown--; - - if(d_countdown == 0) { - optr[i] = 1; - d_countdown = d_period; - d_regen_count++; - } - } - - if(iptr[i] == 1) { - d_countdown = d_period; - optr[i] = 1; - d_regen_count = 0; - } - - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_regenerate_bb.h b/gnuradio-core/src/lib/general/gr_regenerate_bb.h deleted file mode 100644 index e820db69e8..0000000000 --- a/gnuradio-core/src/lib/general/gr_regenerate_bb.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 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_REGENERATE_BB_H -#define INCLUDED_GR_REGENERATE_BB_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_regenerate_bb; -typedef boost::shared_ptr<gr_regenerate_bb> gr_regenerate_bb_sptr; - -GR_CORE_API gr_regenerate_bb_sptr gr_make_regenerate_bb (int period, unsigned int max_regen=500); - -/*! - * \brief Detect the peak of a signal and repeat every period samples - * \ingroup level_blk - * - * If a peak is detected, this block outputs a 1 repeated every period samples - * until reset by detection of another 1 on the input or stopped after max_regen - * regenerations have occurred. - * - * Note that if max_regen=(-1)/ULONG_MAX then the regeneration will run forever. - */ -class GR_CORE_API gr_regenerate_bb : public gr_sync_block -{ - /*! - * \brief Make a regenerate block - * \param period The number of samples between regenerations - * \param max_regen The maximum number of regenerations to perform; if set to - * ULONG_MAX, it will regenerate continuously. - */ - friend GR_CORE_API gr_regenerate_bb_sptr gr_make_regenerate_bb (int period, unsigned int max_regen); - - gr_regenerate_bb (int period, unsigned int max_regen); - - private: - int d_period; - int d_countdown; - unsigned int d_max_regen; - unsigned int d_regen_count; - - public: - /*! \brief Reset the maximum regeneration count; this will reset the current regen. - */ - void set_max_regen(unsigned int regen); - - /*! \brief Reset the period of regenerations; this will reset the current regen. - */ - void set_period(int period); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_regenerate_bb.i b/gnuradio-core/src/lib/general/gr_regenerate_bb.i deleted file mode 100644 index 064b0a2789..0000000000 --- a/gnuradio-core/src/lib/general/gr_regenerate_bb.i +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 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,regenerate_bb) - -gr_regenerate_bb_sptr gr_make_regenerate_bb (int period, unsigned int max_regen=500); - -class gr_regenerate_bb : public gr_sync_block -{ - private: - gr_regenerate_bb (int period, unsigned int max_regen); - -public: - void set_max_regen(unsigned int regen); - - /*! \brief Reset the period of regenerations; this will reset the current regen. - */ - void set_period(int period); -}; diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py b/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py deleted file mode 100755 index 5aca03b777..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_regenerate (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_regen1 (self): - tb = self.tb - - data = [0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - - expected_result = (0, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - - - src = gr.vector_source_b(data, False) - regen = gr.regenerate_bb(5, 2) - dst = gr.vector_sink_b() - - tb.connect (src, regen) - tb.connect (regen, dst) - tb.run () - - dst_data = dst.data () - - self.assertEqual (expected_result, dst_data) - - def test_regen2 (self): - tb = self.tb - - data = 200*[0,] - data[9] = 1 - data[99] = 1 - - expected_result = 200*[0,] - expected_result[9] = 1 - expected_result[19] = 1 - expected_result[29] = 1 - expected_result[39] = 1 - - expected_result[99] = 1 - expected_result[109] = 1 - expected_result[119] = 1 - expected_result[129] = 1 - - src = gr.vector_source_b(data, False) - regen = gr.regenerate_bb(10, 3) - dst = gr.vector_sink_b() - - tb.connect (src, regen) - tb.connect (regen, dst) - tb.run () - - dst_data = dst.data () - - self.assertEqual (tuple(expected_result), dst_data) - - -if __name__ == '__main__': - gr_unittest.run(test_regenerate, "test_regenerate.xml") diff --git a/gr-digital/python/ofdm_sync_pn.py b/gr-digital/python/ofdm_sync_pn.py index cddd1b31da..fbf6b6cb07 100644 --- a/gr-digital/python/ofdm_sync_pn.py +++ b/gr-digital/python/ofdm_sync_pn.py @@ -86,8 +86,8 @@ class ofdm_sync_pn(gr.hier_block2): #ML measurements input to sampler block and detect self.sub1 = blocks.add_const_ff(-1) - self.pk_detect = gr.peak_detector_fb(0.20, 0.20, 30, 0.001) - #self.pk_detect = gr.peak_detector2_fb(9) + self.pk_detect = blocks.peak_detector_fb(0.20, 0.20, 30, 0.001) + #self.pk_detect = blocks.peak_detector2_fb(9) self.connect(self, self.input) diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index d9b5eb80d8..f066af1dc6 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -86,7 +86,6 @@ <cat> <name>Level Controls</name> <block>gr_peak_detector_xb</block> - <block>gr_peak_detector2_fb</block> <block>gr_sample_and_hold_xx</block> <block>gr_mute_xx</block> diff --git a/grc/blocks/gr_peak_detector2_fb.xml b/grc/blocks/gr_peak_detector2_fb.xml deleted file mode 100644 index 128c6244f7..0000000000 --- a/grc/blocks/gr_peak_detector2_fb.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Peak Detector2 -################################################### - --> -<block> - <name>Peak Detector2</name> - <key>gr_peak_detector2_fb</key> - <import>from gnuradio import gr</import> - <make>gr.peak_detector2_fb($threshold_factor_rise, $look_ahead, $alpha)</make> - <callback>set_threshold_factor_rise($threshold_factor_rise)</callback> - <callback>set_look_ahead($look_ahead)</callback> - <callback>set_alpha($alpha)</callback> - <param> - <name>TH Factor Rise</name> - <key>threshold_factor_rise</key> - <type>real</type> - </param> - <param> - <name>Look Ahead</name> - <key>look_ahead</key> - <type>int</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> diff --git a/grc/blocks/gr_peak_detector_xb.xml b/grc/blocks/gr_peak_detector_xb.xml deleted file mode 100644 index 394b0697f8..0000000000 --- a/grc/blocks/gr_peak_detector_xb.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Peak Detector -################################################### - --> -<block> - <name>Peak Detector</name> - <key>gr_peak_detector_xb</key> - <import>from gnuradio import gr</import> - <make>gr.peak_detector_$(type.fcn)b($threshold_factor_rise, $threshold_factor_fall, $look_ahead, $alpha)</make> - <callback>set_threshold_factor_rise($threshold_factor_rise)</callback> - <callback>set_threshold_factor_fall($threshold_factor_fall)</callback> - <callback>set_look_ahead($look_ahead)</callback> - <callback>set_alpha($alpha)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>TH Factor Rise</name> - <key>threshold_factor_rise</key> - <type>real</type> - </param> - <param> - <name>TH Factor Fall</name> - <key>threshold_factor_fall</key> - <type>real</type> - </param> - <param> - <name>Look Ahead</name> - <key>look_ahead</key> - <type>int</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> |