commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3611 - gnuradio/branches/developers/eb/digital-wip/gn


From: eb
Subject: [Commit-gnuradio] r3611 - gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general
Date: Fri, 22 Sep 2006 00:19:47 -0600 (MDT)

Author: eb
Date: 2006-09-22 00:19:46 -0600 (Fri, 22 Sep 2006)
New Revision: 3611

Added:
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.h
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.i
Removed:
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.h
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.i
Modified:
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/Makefile.am
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.cc
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.h
   
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.i
Log:
renamed gri_agc.* gri_agc_ff.*

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/Makefile.am
       2006-09-22 05:55:41 UTC (rev 3610)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/Makefile.am
       2006-09-22 06:19:46 UTC (rev 3611)
@@ -319,7 +319,7 @@
        gr_vector_to_stream.h           \
        gr_vector_to_streams.h          \
        gri_add_const_ss.h              \
-       gri_agc.h                       \
+       gri_agc_ff.h                    \
        gri_agc_cc.h                    \
        gri_agc2_cc.h                   \
        gri_agc2_ff.h                   \
@@ -441,7 +441,7 @@
        gr_vector_to_stream.i           \
        gr_vector_to_streams.i          \
        gr_unpack_k_bits_bb.i           \
-       gri_agc.i                       \
+       gri_agc_ff.i                    \
        gri_agc_cc.i                    \
        gri_agc2_cc.i                   \
        gri_agc2_ff.i                   

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.cc
      2006-09-22 05:55:41 UTC (rev 3610)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.cc
      2006-09-22 06:19:46 UTC (rev 3611)
@@ -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_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)
 {
 }
 

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.h
       2006-09-22 05:55:41 UTC (rev 3610)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.h
       2006-09-22 06:19:46 UTC (rev 3611)
@@ -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:

Modified: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.i
       2006-09-22 05:55:41 UTC (rev 3610)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gr_agc_ff.i
       2006-09-22 06:19:46 UTC (rev 3611)
@@ -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);
 };

Deleted: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.h

Deleted: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.i

Copied: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.h
 (from rev 3603, 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.h)
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.h
                              (rev 0)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.h
      2006-09-22 06:19:46 UTC (rev 3611)
@@ -0,0 +1,71 @@
+/* -*- 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_AGC_H_
+#define _GRI_AGC_H_
+
+#include <math.h>
+
+/*!
+ * \brief high performance Automatic Gain Control class
+ *
+ * Power is approximated by absolute value
+ */
+
+class gri_agc_ff {
+
+ public:
+  gri_agc_ff (float rate = 1e-4, float reference = 1.0,
+             float gain = 1.0, float max_gain = 0.0)
+    : _rate(rate), _reference(reference), _gain(gain), _max_gain(max_gain) {};
+
+  float rate () const      { return _rate; }
+  float reference () const { return _reference; }
+  float gain () const     { return _gain;  }
+  float max_gain () const  { return _max_gain; }
+  
+  void set_rate (float rate) { _rate = rate; }
+  void set_reference (float reference) { _reference = reference; }
+  void set_gain (float gain) { _gain = gain; }
+  void set_max_gain (float max_gain) { _max_gain = max_gain; }
+  
+  float scale (float input){
+    float output = input * _gain;
+    _gain += (_reference - fabsf (output)) * _rate;
+    if (_max_gain > 0.0 && _gain > _max_gain)
+      _gain = _max_gain;
+    return output;
+  }
+
+  void scaleN (float output[], const float input[], unsigned n){
+    for (unsigned i = 0; i < n; i++)
+      output[i] = scale (input[i]);
+  }
+  
+ protected:
+  float _rate;                 // adjustment rate
+  float        _reference;             // reference value
+  float        _gain;                  // current gain
+  float _max_gain;             // maximum gain
+};
+
+#endif /* _GRI_AGC_FF_H_ */

Copied: 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.i
 (from rev 3603, 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc.i)
===================================================================
--- 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.i
                              (rev 0)
+++ 
gnuradio/branches/developers/eb/digital-wip/gnuradio-core/src/lib/general/gri_agc_ff.i
      2006-09-22 06:19:46 UTC (rev 3611)
@@ -0,0 +1,36 @@
+/* -*- 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_agc_ff {
+
+ public:
+  gri_agc_ff (float rate = 1e-4, float reference = 1.0,
+             float gain = 1.0, float max_gain = 0.0);
+};





reply via email to

[Prev in Thread] Current Thread [Next in Thread]