GNU Radio 3.6.5 C++ API
|
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 */ 00040 class GR_CORE_API gr_fft_filter_ccc : public gr_sync_decimator 00041 { 00042 private: 00043 friend GR_CORE_API gr_fft_filter_ccc_sptr 00044 gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps, 00045 int nthreads); 00046 00047 int d_nsamples; 00048 bool d_updated; 00049 #if 1 // don't enable the sse version until handling it is worked out 00050 gri_fft_filter_ccc_generic *d_filter; 00051 #else 00052 gri_fft_filter_ccc_sse *d_filter; 00053 #endif 00054 std::vector<gr_complex> d_new_taps; 00055 00056 /*! 00057 * Construct a FFT filter with the given taps 00058 * 00059 * \param decimation >= 1 00060 * \param taps complex filter taps 00061 * \param nthreads number of threads for the FFT to use 00062 */ 00063 gr_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps, 00064 int nthreads=1); 00065 00066 public: 00067 ~gr_fft_filter_ccc (); 00068 00069 void set_taps (const std::vector<gr_complex> &taps); 00070 std::vector<gr_complex> taps () const; 00071 00072 /*! 00073 * \brief Set number of threads to use. 00074 */ 00075 void set_nthreads(int n); 00076 00077 /*! 00078 * \brief Get number of threads being used. 00079 */ 00080 int nthreads() const; 00081 00082 int work (int noutput_items, 00083 gr_vector_const_void_star &input_items, 00084 gr_vector_void_star &output_items); 00085 }; 00086 00087 00088 00089 #endif /* INCLUDED_GR_FFT_FILTER_CCC_H */