diff options
author | eb | 2006-09-27 05:14:03 +0000 |
---|---|---|
committer | eb | 2006-09-27 05:14:03 +0000 |
commit | f1c41f807cb29472d0924149e39d6ec8ad90e6a2 (patch) | |
tree | 47e42f8cdfc83aaa3b706e06862c3efa4ba16745 /gnuradio-core/src/lib/general | |
parent | 04bb51ec4f1539c51c861b7fcad2ca8047a872a3 (diff) | |
download | gnuradio-f1c41f807cb29472d0924149e39d6ec8ad90e6a2.tar.gz gnuradio-f1c41f807cb29472d0924149e39d6ec8ad90e6a2.tar.bz2 gnuradio-f1c41f807cb29472d0924149e39d6ec8ad90e6a2.zip |
Merged changes from eb/digital-wip into trunk.
This includes:
* renaming gnuradio-examples/python/gmsk2 to gnuradio-examples/python/digital
* refactoring the digital data tx and rx test code into benchmark_tx
and benchmark_rx. These accept a -m <modulation> argument.
<modulation> can currently be selected from gmsk, dbpsk, dqpsk
* Two new AGC blocks: gr_agc2: separate attack and delay rates;
gr_feedforward_agc: FIR-ish compressor. Normalizes to peak envelope.
* Working DBPSK mod/demod (works fine)
* Working DQPSK mod/demod (works, but still needs more work)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3662 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/general')
28 files changed, 830 insertions, 45 deletions
diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index c22d8a7c0..ace399ab3 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -95,6 +95,8 @@ libgeneral_la_SOURCES = \ $(GENERATED_CC) \ gr_agc_cc.cc \ gr_agc_ff.cc \ + gr_agc2_cc.cc \ + gr_agc2_ff.cc \ gr_align_on_samplenumbers_ss.cc \ gr_binary_slicer_fb.cc \ gr_bytes_to_syms.cc \ @@ -120,6 +122,7 @@ libgeneral_la_SOURCES = \ gr_diff_phasor_cc.cc \ gr_fake_channel_coder_pp.cc \ gr_fast_atan2f.cc \ + gr_feedforward_agc_cc.cc \ gr_feval.cc \ gr_fft_vcc.cc \ gr_fft_vfc.cc \ @@ -213,6 +216,8 @@ grinclude_HEADERS = \ $(GENERATED_H) \ gr_agc_cc.h \ gr_agc_ff.h \ + gr_agc2_cc.h \ + gr_agc2_ff.h \ gr_align_on_samplenumbers_ss.h \ gr_binary_slicer_fb.h \ gr_bytes_to_syms.h \ @@ -239,6 +244,7 @@ grinclude_HEADERS = \ gr_endianness.h \ gr_expj.h \ gr_fake_channel_coder_pp.h \ + gr_feedforward_agc_cc.h \ gr_feval.h \ gr_fft_vcc.h \ gr_fft_vfc.h \ @@ -315,8 +321,10 @@ grinclude_HEADERS = \ gr_vector_to_stream.h \ gr_vector_to_streams.h \ gri_add_const_ss.h \ - gri_agc.h \ gri_agc_cc.h \ + gri_agc_ff.h \ + gri_agc2_cc.h \ + gri_agc2_ff.h \ gri_char_to_float.h \ gri_debugger_hook.h \ gri_fft.h \ @@ -348,6 +356,8 @@ swiginclude_HEADERS = \ general_generated.i \ gr_agc_cc.i \ gr_agc_ff.i \ + gr_agc2_cc.i \ + gr_agc2_ff.i \ gr_align_on_samplenumbers_ss.i \ gr_binary_slicer_fb.i \ gr_bytes_to_syms.i \ @@ -371,6 +381,7 @@ swiginclude_HEADERS = \ gr_deinterleave.i \ gr_endianness.i \ gr_fake_channel_coder_pp.i \ + gr_feedforward_agc_cc.i \ gr_feval.i \ gr_fft_vcc.i \ gr_fft_vfc.i \ @@ -432,9 +443,11 @@ swiginclude_HEADERS = \ gr_vco_f.i \ gr_vector_to_stream.i \ gr_vector_to_streams.i \ - gri_agc.i \ - gri_agc_cc.i \ - gr_unpack_k_bits_bb.i + gr_unpack_k_bits_bb.i \ + gri_agc_cc.i \ + gri_agc_ff.i \ + gri_agc2_cc.i \ + gri_agc2_ff.i CLEANFILES = $(BUILT_SOURCES) *.pyc diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 2247a3e61..691cd8332 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -64,6 +64,8 @@ #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> @@ -109,6 +111,7 @@ #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_sync_block.i" @@ -154,6 +157,8 @@ %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" @@ -199,5 +204,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 "general_generated.i" diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.cc b/gnuradio-core/src/lib/general/gr_agc2_cc.cc new file mode 100644 index 000000000..16bd64e3e --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_cc.cc @@ -0,0 +1,56 @@ +/* -*- 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 2, 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 gr_agc2_cc_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 new file mode 100644 index 000000000..d022b780c --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_cc.h @@ -0,0 +1,54 @@ +/* -*- 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 2, 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_sync_block.h> +#include <gri_agc2_cc.h> + +class gr_agc2_cc; +typedef boost::shared_ptr<gr_agc2_cc> gr_agc2_cc_sptr; + +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 + * + * For Power the absolute value of the complex number is used. + */ + +class gr_agc2_cc : public gr_sync_block, public gri_agc2_cc +{ + friend 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 new file mode 100644 index 000000000..666738ea7 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_cc.i @@ -0,0 +1,35 @@ +/* -*- 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 2, 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 new file mode 100644 index 000000000..23809934a --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_ff.cc @@ -0,0 +1,57 @@ +/* -*- 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 2, 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 gr_agc2_ff_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 new file mode 100644 index 000000000..25aa1d366 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_ff.h @@ -0,0 +1,52 @@ +/* -*- 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 2, 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_sync_block.h> +#include <gri_agc2_ff.h> +class gr_agc2_ff; +typedef boost::shared_ptr<gr_agc2_ff> gr_agc2_ff_sptr; + +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 + * + * Power is approximated by absolute value + */ + +class gr_agc2_ff : public gr_sync_block, public gri_agc2_ff +{ + friend 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 new file mode 100644 index 000000000..527dc61ae --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_agc2_ff.i @@ -0,0 +1,35 @@ +/* -*- 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 2, 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 index 6c6c4356d..1aaa917e4 100644 --- a/gnuradio-core/src/lib/general/gr_agc_cc.cc +++ b/gnuradio-core/src/lib/general/gr_agc_cc.cc @@ -29,23 +29,25 @@ #include <gri_agc_cc.h> gr_agc_cc_sptr -gr_make_agc_cc (float rate, float reference, float gain, float max_gain) +gr_make_agc_cc (float rate, float reference, + float gain, float max_gain) { return gr_agc_cc_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_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) + 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) + 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]; diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.h b/gnuradio-core/src/lib/general/gr_agc_cc.h index 7bddd4999..18145da4b 100644 --- a/gnuradio-core/src/lib/general/gr_agc_cc.h +++ b/gnuradio-core/src/lib/general/gr_agc_cc.h @@ -29,7 +29,8 @@ class gr_agc_cc; typedef boost::shared_ptr<gr_agc_cc> gr_agc_cc_sptr; 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); +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 * @@ -38,8 +39,10 @@ gr_make_agc_cc (float rate = 1e-4, float reference = 1.0, float gain = 1.0, floa class gr_agc_cc : public gr_sync_block, public gri_agc_cc { - friend 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); + friend 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, diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.i b/gnuradio-core/src/lib/general/gr_agc_cc.i index aae327d83..c936f03f0 100644 --- a/gnuradio-core/src/lib/general/gr_agc_cc.i +++ b/gnuradio-core/src/lib/general/gr_agc_cc.i @@ -25,9 +25,11 @@ 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); +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); + 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 index 0fa2bc5b0..581b78c8b 100644 --- a/gnuradio-core/src/lib/general/gr_agc_ff.cc +++ b/gnuradio-core/src/lib/general/gr_agc_ff.cc @@ -26,7 +26,7 @@ #include <gr_agc_ff.h> #include <gr_io_signature.h> -#include <gri_agc.h> +#include <gri_agc_ff.h> gr_agc_ff_sptr gr_make_agc_ff (float rate, float reference, float gain, float max_gain) @@ -38,7 +38,7 @@ 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 (rate, reference, gain, max_gain) + , gri_agc_ff (rate, reference, gain, max_gain) { } diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.h b/gnuradio-core/src/lib/general/gr_agc_ff.h index 8931b5afe..a12026b62 100644 --- a/gnuradio-core/src/lib/general/gr_agc_ff.h +++ b/gnuradio-core/src/lib/general/gr_agc_ff.h @@ -24,21 +24,24 @@ #define INCLUDED_GR_AGC_FF_H #include <gr_sync_block.h> -#include <gri_agc.h> +#include <gri_agc_ff.h> class gr_agc_ff; typedef boost::shared_ptr<gr_agc_ff> gr_agc_ff_sptr; 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); +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 * * Power is approximated by absolute value */ -class gr_agc_ff : public gr_sync_block, public gri_agc +class gr_agc_ff : public gr_sync_block, public gri_agc_ff { - friend gr_agc_ff_sptr gr_make_agc_ff (float rate, float reference, float gain, float max_gain); + friend 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: diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.i b/gnuradio-core/src/lib/general/gr_agc_ff.i index d3ba28287..8abea082a 100644 --- a/gnuradio-core/src/lib/general/gr_agc_ff.i +++ b/gnuradio-core/src/lib/general/gr_agc_ff.i @@ -22,12 +22,13 @@ GR_SWIG_BLOCK_MAGIC(gr,agc_ff) -%include <gri_agc.i> +%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); +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 +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_clock_recovery_mm_cc.cc b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc index 31338e940..88cd14077 100644 --- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc +++ b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc @@ -48,7 +48,7 @@ gr_clock_recovery_mm_cc::gr_clock_recovery_mm_cc (float omega, float gain_omega, float gain_mu, float omega_relative_limit) : gr_block ("clock_recovery_mm_cc", gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), + gr_make_io_signature (1, 2, sizeof (gr_complex))), d_mu (mu), d_omega(omega), d_gain_omega(gain_omega), d_omega_relative_limit(omega_relative_limit), d_gain_mu(gain_mu), d_last_sample(0), d_interp(new gri_mmse_fir_interpolator_cc()), @@ -119,6 +119,9 @@ gr_clock_recovery_mm_cc::general_work (int noutput_items, { const gr_complex *in = (const gr_complex *) input_items[0]; gr_complex *out = (gr_complex *) output_items[0]; + gr_complex *foptr = (gr_complex *) output_items[1]; + + bool write_foptr = output_items.size() >= 2; int ii = 0; // input index int oo = 0; // output index @@ -165,6 +168,10 @@ gr_clock_recovery_mm_cc::general_work (int noutput_items, printf("%f\t%f\n", d_omega, d_mu); } + // write the error signal to the second output + if (write_foptr) + foptr[oo-1] = gr_complex(d_mu,0); + if (ii < 0) // clamp it. This should only happen with bogus input ii = 0; } diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc b/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc index 1c2e4a3ee..f06be47eb 100644 --- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc +++ b/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc @@ -49,7 +49,7 @@ gr_costas_loop_cc::gr_costas_loop_cc (float alpha, float beta, ) throw (std::invalid_argument) : gr_sync_block ("costas_loop_cc", gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), + gr_make_io_signature (1, 2, sizeof (gr_complex))), d_alpha(alpha), d_beta(beta), d_max_freq(max_freq), d_min_freq(min_freq), d_phase(0), d_freq((max_freq+min_freq)/2), @@ -92,6 +92,9 @@ gr_costas_loop_cc::work (int noutput_items, { const gr_complex *iptr = (gr_complex *) input_items[0]; gr_complex *optr = (gr_complex *) output_items[0]; + gr_complex *foptr = (gr_complex *) output_items[1]; + + bool write_foptr = output_items.size() >= 2; float error; gr_complex nco_out; @@ -101,18 +104,28 @@ gr_costas_loop_cc::work (int noutput_items, optr[i] = iptr[i] * nco_out; error = (*this.*d_phase_detector)(optr[i]); + if (error > 1) + error = 1; + else if (error < -1) + error = -1; d_freq = d_freq + d_beta * error; d_phase = d_phase + d_freq + d_alpha * error; + while(d_phase>M_TWOPI) d_phase -= M_TWOPI; while(d_phase<-M_TWOPI) d_phase += M_TWOPI; - if (d_freq > d_max_freq) + if (d_freq > d_max_freq) d_freq = d_max_freq; else if (d_freq < d_min_freq) d_freq = d_min_freq; + + if (write_foptr){ + foptr[i] = gr_complex(d_freq,0); + //foptr[i] = gr_complex(error, 0); + } } return noutput_items; } diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.h b/gnuradio-core/src/lib/general/gr_costas_loop_cc.h index 46d73b816..d7d0db67b 100644 --- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.h +++ b/gnuradio-core/src/lib/general/gr_costas_loop_cc.h @@ -26,6 +26,7 @@ #include <gr_sync_block.h> #include <stdexcept> +#include <fstream> class gr_costas_loop_cc; typedef boost::shared_ptr<gr_costas_loop_cc> gr_costas_loop_cc_sptr; diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc new file mode 100644 index 000000000..7d15e1d77 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc @@ -0,0 +1,91 @@ +/* -*- 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 2, 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 gr_feedforward_agc_cc_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 new file mode 100644 index 000000000..ba7c83669 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h @@ -0,0 +1,55 @@ +/* -*- 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 2, 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_sync_block.h> + +class gr_feedforward_agc_cc; +typedef boost::shared_ptr<gr_feedforward_agc_cc> gr_feedforward_agc_cc_sptr; + +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 + */ +class gr_feedforward_agc_cc : public gr_sync_block +{ + friend 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 new file mode 100644 index 000000000..064e72e65 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i @@ -0,0 +1,34 @@ +/* -*- 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 2, 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 new file mode 100644 index 000000000..a8ca699c5 --- /dev/null +++ b/gnuradio-core/src/lib/general/gri_agc2_cc.h @@ -0,0 +1,91 @@ +/* -*- 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 2, 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 <math.h> + +/*! + * \brief high performance Automatic Gain Control class + * + * 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) + : _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 _decay_rate; // decay rate for slow changing signals + float _attack_rate; // attack rate for fast 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 new file mode 100644 index 000000000..0257e905f --- /dev/null +++ b/gnuradio-core/src/lib/general/gri_agc2_cc.i @@ -0,0 +1,42 @@ +/* -*- 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 2, 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 (); + }; diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.h b/gnuradio-core/src/lib/general/gri_agc2_ff.h new file mode 100644 index 000000000..b0bff04c3 --- /dev/null +++ b/gnuradio-core/src/lib/general/gri_agc2_ff.h @@ -0,0 +1,89 @@ +/* -*- 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 2, 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 <math.h> + +/*! + * \brief high performance Automatic Gain Control class with attack and decay rate + * + * 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) + : _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; } + + 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 _decay_rate; // decay rate for slow changing signals + float _attack_rate; // attack_rate for fast 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 new file mode 100644 index 000000000..56bb3651d --- /dev/null +++ b/gnuradio-core/src/lib/general/gri_agc2_ff.i @@ -0,0 +1,37 @@ +/* -*- 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 2, 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); + }; diff --git a/gnuradio-core/src/lib/general/gri_agc_cc.h b/gnuradio-core/src/lib/general/gri_agc_cc.h index f68eec4cf..5ebd67ccf 100644 --- a/gnuradio-core/src/lib/general/gri_agc_cc.h +++ b/gnuradio-core/src/lib/general/gri_agc_cc.h @@ -20,8 +20,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef _GRI_AGC_CC_H_ -#define _GRI_AGC_CC_H_ +#ifndef INCLUDED_GRI_AGC_CC_H +#define INCLUDED_GRI_AGC_CC_H #include <math.h> @@ -34,8 +34,10 @@ 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) - : _rate(rate), _reference(reference), _gain(gain), _max_gain(max_gain) {}; + 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; } @@ -46,11 +48,12 @@ class gri_agc_cc { 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 += (_reference - sqrt(output.real()*output.real()+output.imag()*output.imag())) * _rate; //use abs or cabs to get approximation by absolute value, - //note that abs is computationally more intensive then norm for a complex number + + _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; @@ -68,4 +71,4 @@ class gri_agc_cc { float _max_gain; // max allowable gain }; -#endif /* _GRI_AGC_CC_H_ */ +#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 index 88473bc5e..7e109ea5b 100644 --- a/gnuradio-core/src/lib/general/gri_agc_cc.i +++ b/gnuradio-core/src/lib/general/gri_agc_cc.i @@ -32,7 +32,8 @@ 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); + 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 (); diff --git a/gnuradio-core/src/lib/general/gri_agc.h b/gnuradio-core/src/lib/general/gri_agc_ff.h index aff81c35d..cdf1b23af 100644 --- a/gnuradio-core/src/lib/general/gri_agc.h +++ b/gnuradio-core/src/lib/general/gri_agc_ff.h @@ -20,8 +20,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef _GRI_AGC_H_ -#define _GRI_AGC_H_ +#ifndef INCLUDED_GRI_AGC_FF_H +#define INCLUDED_GRI_AGC_FF_H #include <math.h> @@ -31,10 +31,11 @@ * Power is approximated by absolute value */ -class gri_agc { +class gri_agc_ff { public: - gri_agc (float rate = 1e-4, float reference = 1.0, float gain = 1.0, float max_gain = 0.0) + 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; } @@ -67,4 +68,5 @@ class gri_agc { float _max_gain; // maximum gain }; -#endif /* _GRI_AGC_H_ */ +#endif /* INCLUDED_GRI_AGC_FF_H */ + diff --git a/gnuradio-core/src/lib/general/gri_agc.i b/gnuradio-core/src/lib/general/gri_agc_ff.i index 037813883..20bd6c051 100644 --- a/gnuradio-core/src/lib/general/gri_agc.i +++ b/gnuradio-core/src/lib/general/gri_agc_ff.i @@ -28,9 +28,9 @@ * Power is approximated by absolute value */ - -class gri_agc { +class gri_agc_ff { public: - gri_agc (float rate = 1e-4, float reference = 1.0, float gain = 1.0, float max_gain = 0.0); - }; + gri_agc_ff (float rate = 1e-4, float reference = 1.0, + float gain = 1.0, float max_gain = 0.0); +}; |