GNU Radio 3.4.2 C++ API
pager_slicer_fb.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006,2007 Free Software Foundation, Inc.
00003  * 
00004  * This file is part of GNU Radio
00005  * 
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  * 
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_PAGER_SLICER_FB_H
00023 #define INCLUDED_PAGER_SLICER_FB_H
00024 
00025 #include <gr_sync_block.h>
00026 
00027 class pager_slicer_fb;
00028 typedef boost::shared_ptr<pager_slicer_fb> pager_slicer_fb_sptr;
00029 
00030 pager_slicer_fb_sptr pager_make_slicer_fb(float alpha);
00031 
00032 /*!
00033  * \brief slicer description
00034  * \ingroup pager_blk
00035  */
00036 class pager_slicer_fb : public gr_sync_block
00037 {
00038 private:
00039     friend pager_slicer_fb_sptr pager_make_slicer_fb(float alpha);
00040     pager_slicer_fb(float alpha);
00041 
00042     unsigned char slice(float sample);
00043 
00044     float d_alpha;      // DC removal time constant
00045     float d_beta;       // 1.0-d_alpha
00046     float d_avg;        // Average value for DC offset subtraction
00047 
00048 public:
00049     int work (int noutput_items,
00050               gr_vector_const_void_star &input_items, 
00051               gr_vector_void_star &output_items);
00052 
00053     float dc_offset() const { return d_avg; }
00054 };
00055 
00056 #endif /* INCLUDED_PAGER_SLICER_FB_H */