GNU Radio 3.4.2 C++ API
gr_freq_xlating_fir_filter_ccf.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002,2004 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  * WARNING: This file is automatically generated by
00025  * generate_gr_freq_xlating_fir_filter_XXX.py  Any changes made to this file
00026  * will be overwritten.
00027  */
00028 
00029 #ifndef INCLUDED_GR_FREQ_XLATING_FIR_FILTER_CCF_H
00030 #define INCLUDED_GR_FREQ_XLATING_FIR_FILTER_CCF_H
00031 
00032 #include <gr_sync_decimator.h>
00033 #include <gr_rotator.h>
00034 
00035 class gr_freq_xlating_fir_filter_ccf;
00036 typedef boost::shared_ptr<gr_freq_xlating_fir_filter_ccf> gr_freq_xlating_fir_filter_ccf_sptr;
00037 
00038 /*!
00039  * Construct a FIR filter with the given taps and a composite frequency
00040  * translation that shifts center_freq down to zero Hz.  The frequency 
00041  * translation logically comes before the filtering operation.
00042  */
00043 gr_freq_xlating_fir_filter_ccf_sptr 
00044 gr_make_freq_xlating_fir_filter_ccf (int decimation, const std::vector<float> &taps,
00045                      double center_freq, double sampling_freq);
00046 
00047 
00048 class gr_fir_ccc;
00049 
00050 /*!
00051  * \brief FIR filter combined with frequency translation with gr_complex input, gr_complex output and float taps
00052  * \ingroup filter_blk
00053  *
00054  * This class efficiently combines a frequency translation
00055  * (typically "down conversion") with a FIR filter (typically low-pass)
00056  * and decimation.  It is ideally suited for a "channel selection filter"
00057  * and can be efficiently used to select and decimate a narrow band signal
00058  * out of wide bandwidth input.
00059  *
00060  * Uses a single input array to produce a single output array.
00061  * Additional inputs and/or outputs are ignored.
00062  */
00063 class gr_freq_xlating_fir_filter_ccf : public gr_sync_decimator
00064 {
00065  public:
00066   virtual ~gr_freq_xlating_fir_filter_ccf ();
00067 
00068   void set_center_freq (double center_freq);
00069   void set_taps (const std::vector<float> &taps);
00070 
00071   int work (int noutput_items,
00072             gr_vector_const_void_star &input_items,
00073             gr_vector_void_star &output_items);
00074 
00075  private:
00076   friend gr_freq_xlating_fir_filter_ccf_sptr 
00077   gr_make_freq_xlating_fir_filter_ccf (int decimation, const std::vector<float> &taps,
00078                        double center_freq, double sampling_freq);
00079 
00080  protected:
00081   std::vector<float>    d_proto_taps;
00082   gr_fir_ccc                   *d_composite_fir;
00083   gr_rotator                    d_r;
00084   double                        d_center_freq;
00085   double                        d_sampling_freq;
00086   bool                          d_updated;
00087 
00088   virtual void build_composite_fir ();
00089 
00090   /*!
00091    * Construct a FIR filter with the given taps and a composite frequency
00092    * translation that shifts center_freq down to zero Hz.  The frequency 
00093    * translation logically comes before the filtering operation.
00094    */
00095   gr_freq_xlating_fir_filter_ccf (int decimation,
00096                           const std::vector<float> &taps,
00097                           double center_freq, double sampling_freq);
00098 };
00099 
00100 #endif /* _gr_freq_xlating_fir_filter_ccf_H_ */