GNU Radio 3.5.3.2 C++ API
gr_fft_filter_ccc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2005 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 #ifndef INCLUDED_GR_FFT_FILTER_CCC_H
00023 #define INCLUDED_GR_FFT_FILTER_CCC_H
00024 
00025 #include <gr_core_api.h>
00026 #include <gr_sync_decimator.h>
00027 
00028 class gr_fft_filter_ccc;
00029 typedef boost::shared_ptr<gr_fft_filter_ccc> gr_fft_filter_ccc_sptr;
00030 GR_CORE_API gr_fft_filter_ccc_sptr
00031 gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
00032                         int nthreads=1);
00033 
00034 //class gri_fft_filter_ccc_sse;
00035 class gri_fft_filter_ccc_generic;
00036 
00037 /*!
00038  * \brief Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps
00039  * \ingroup filter_blk
00040  */
00041 class GR_CORE_API gr_fft_filter_ccc : public gr_sync_decimator
00042 {
00043  private:
00044   friend GR_CORE_API gr_fft_filter_ccc_sptr
00045     gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
00046                             int nthreads);
00047 
00048   int                      d_nsamples;
00049   bool                     d_updated;
00050 #if 1  // don't enable the sse version until handling it is worked out
00051   gri_fft_filter_ccc_generic  *d_filter;  
00052 #else
00053   gri_fft_filter_ccc_sse  *d_filter;  
00054 #endif
00055   std::vector<gr_complex>  d_new_taps;
00056 
00057   /*!
00058    * Construct a FFT filter with the given taps
00059    *
00060    * \param decimation  >= 1
00061    * \param taps        complex filter taps
00062    * \param nthreads    number of threads for the FFT to use
00063    */
00064   gr_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
00065                      int nthreads=1);
00066 
00067  public:
00068   ~gr_fft_filter_ccc ();
00069 
00070   void set_taps (const std::vector<gr_complex> &taps);
00071   std::vector<gr_complex> taps () const;
00072 
00073   /*!
00074    * \brief Set number of threads to use.
00075    */
00076   void set_nthreads(int n);
00077 
00078   /*!
00079    * \brief Get number of threads being used.
00080    */
00081   int nthreads() const;
00082 
00083   int work (int noutput_items,
00084             gr_vector_const_void_star &input_items,
00085             gr_vector_void_star &output_items);
00086 };
00087 
00088 
00089 
00090 #endif /* INCLUDED_GR_FFT_FILTER_CCC_H */