|
gr-baz Package
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2006,2013 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 /* 00024 * gr-baz by Balint Seeber (http://spench.net/contact) 00025 * Information, documentation & samples: http://wiki.spench.net/wiki/gr-baz 00026 */ 00027 00028 // THIS IS EXPERIMENTAL AND UNFINISHED 00029 00030 #ifndef INCLUDED_BAZ_AGC_CC_H 00031 #define INCLUDED_BAZ_AGC_CC_H 00032 00033 #include <gr_sync_block.h> 00034 00035 //#include <gri_agc_cc.h> 00036 00037 class BAZ_API baz_agc_cc; 00038 typedef boost::shared_ptr<baz_agc_cc> baz_agc_cc_sptr; 00039 00040 BAZ_API baz_agc_cc_sptr 00041 baz_make_agc_cc (float rate = 1e-4, float reference = 1.0, float gain = 1.0, float max_gain = 0.0); 00042 /*! 00043 * \brief high performance Automatic Gain Control class 00044 * \ingroup level_blk 00045 * 00046 * For Power the absolute value of the complex number is used. 00047 */ 00048 00049 class BAZ_API baz_agc_cc : public gr_sync_block//, public gri_agc_cc 00050 { 00051 friend BAZ_API baz_agc_cc_sptr baz_make_agc_cc (float rate, float reference, float gain, float max_gain); 00052 baz_agc_cc (float rate, float reference, float gain, float max_gain); 00053 00054 protected: 00055 float _rate; // adjustment rate 00056 /*float*/double _reference; // reference value 00057 /*float*/double _gain; // current gain 00058 float _max_gain; // max allowable gain 00059 unsigned long long _count; 00060 double _env; 00061 00062 public: 00063 virtual int work (int noutput_items, 00064 gr_vector_const_void_star &input_items, 00065 gr_vector_void_star &output_items); 00066 }; 00067 00068 #endif /* INCLUDED_BAZ_AGC_CC_H */