GNU Radio 3.6.5 C++ API

peak_detector2_fb_impl.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2007,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 #ifndef INCLUDED_GR_PEAK_DETECTOR2_FB_IMPL_H
00024 #define INCLUDED_GR_PEAK_DETECTOR2_FB_IMPL_H
00025 
00026 #include <blocks/peak_detector2_fb.h>
00027 
00028 namespace gr {
00029   namespace blocks {
00030 
00031     class peak_detector2_fb_impl : public peak_detector2_fb
00032     {
00033     private:
00034       float d_threshold_factor_rise;
00035       int d_look_ahead;
00036       int d_look_ahead_remaining;
00037       int d_peak_ind;
00038       float d_peak_val;
00039       float d_alpha;
00040       float d_avg;
00041       bool d_found;
00042 
00043     public:
00044       peak_detector2_fb_impl(float threshold_factor_rise,
00045                              int look_ahead, float alpha);
00046       ~peak_detector2_fb_impl();
00047 
00048       void set_threshold_factor_rise(float thr) { d_threshold_factor_rise = thr; }
00049       void set_look_ahead(int look) { d_look_ahead = look; }
00050       void set_alpha(int alpha) { d_alpha = alpha; }
00051 
00052       float threshold_factor_rise() { return d_threshold_factor_rise; }
00053       int look_ahead() { return d_look_ahead; }
00054       float alpha() { return d_alpha; }
00055 
00056       int work(int noutput_items,
00057                gr_vector_const_void_star &input_items,
00058                gr_vector_void_star &output_items);
00059     };
00060 
00061   } /* namespace blocks */
00062 } /* namespace gr */
00063 
00064 #endif /* INCLUDED_GR_PEAK_DETECTOR2_FB_IMPL_H */