Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / filter / gr_fft_filter_ccc.h @ 7fda6b2c

History | View | Annotate | Download (2.5 kB)

1 5d69a524 jcorgan
/* -*- c++ -*- */
2 5d69a524 jcorgan
/*
3 5d69a524 jcorgan
 * Copyright 2005 Free Software Foundation, Inc.
4 5d69a524 jcorgan
 * 
5 5d69a524 jcorgan
 * This file is part of GNU Radio
6 5d69a524 jcorgan
 * 
7 5d69a524 jcorgan
 * GNU Radio is free software; you can redistribute it and/or modify
8 5d69a524 jcorgan
 * it under the terms of the GNU General Public License as published by
9 937b719d eb
 * the Free Software Foundation; either version 3, or (at your option)
10 5d69a524 jcorgan
 * any later version.
11 5d69a524 jcorgan
 * 
12 5d69a524 jcorgan
 * GNU Radio is distributed in the hope that it will be useful,
13 5d69a524 jcorgan
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 5d69a524 jcorgan
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 5d69a524 jcorgan
 * GNU General Public License for more details.
16 5d69a524 jcorgan
 * 
17 5d69a524 jcorgan
 * You should have received a copy of the GNU General Public License
18 5d69a524 jcorgan
 * along with GNU Radio; see the file COPYING.  If not, write to
19 86f5c924 eb
 * the Free Software Foundation, Inc., 51 Franklin Street,
20 86f5c924 eb
 * Boston, MA 02110-1301, USA.
21 5d69a524 jcorgan
 */
22 5d69a524 jcorgan
#ifndef INCLUDED_GR_FFT_FILTER_CCC_H
23 5d69a524 jcorgan
#define INCLUDED_GR_FFT_FILTER_CCC_H
24 5d69a524 jcorgan
25 f914499f Josh Blum
#include <gr_core_api.h>
26 5d69a524 jcorgan
#include <gr_sync_decimator.h>
27 5d69a524 jcorgan
28 5d69a524 jcorgan
class gr_fft_filter_ccc;
29 5d69a524 jcorgan
typedef boost::shared_ptr<gr_fft_filter_ccc> gr_fft_filter_ccc_sptr;
30 7e10a264 Tom Rondeau
GR_CORE_API gr_fft_filter_ccc_sptr
31 7e10a264 Tom Rondeau
gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
32 7e10a264 Tom Rondeau
                        int nthreads=1);
33 5d69a524 jcorgan
34 a34f397a Tom Rondeau
//class gri_fft_filter_ccc_sse;
35 c7b26f66 Tom Rondeau
class gri_fft_filter_ccc_generic;
36 5d69a524 jcorgan
37 5d69a524 jcorgan
/*!
38 5d69a524 jcorgan
 * \brief Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps
39 ed236703 eb
 * \ingroup filter_blk
40 5d69a524 jcorgan
 */
41 f914499f Josh Blum
class GR_CORE_API gr_fft_filter_ccc : public gr_sync_decimator
42 5d69a524 jcorgan
{
43 5d69a524 jcorgan
 private:
44 7e10a264 Tom Rondeau
  friend GR_CORE_API gr_fft_filter_ccc_sptr
45 7e10a264 Tom Rondeau
    gr_make_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
46 7e10a264 Tom Rondeau
                            int nthreads);
47 5d69a524 jcorgan
48 5d69a524 jcorgan
  int                           d_nsamples;
49 5d69a524 jcorgan
  bool                           d_updated;
50 a34f397a Tom Rondeau
#if 1  // don't enable the sse version until handling it is worked out
51 c7b26f66 Tom Rondeau
  gri_fft_filter_ccc_generic  *d_filter;  
52 c7b26f66 Tom Rondeau
#else
53 1933148c Tom Rondeau
  gri_fft_filter_ccc_sse  *d_filter;  
54 c7b26f66 Tom Rondeau
#endif
55 72c47024 Tom Rondeau
  std::vector<gr_complex>  d_new_taps;
56 5d69a524 jcorgan
57 5d69a524 jcorgan
  /*!
58 5d69a524 jcorgan
   * Construct a FFT filter with the given taps
59 5d69a524 jcorgan
   *
60 5d69a524 jcorgan
   * \param decimation        >= 1
61 5d69a524 jcorgan
   * \param taps        complex filter taps
62 7e10a264 Tom Rondeau
   * \param nthreads    number of threads for the FFT to use
63 5d69a524 jcorgan
   */
64 7e10a264 Tom Rondeau
  gr_fft_filter_ccc (int decimation, const std::vector<gr_complex> &taps,
65 7e10a264 Tom Rondeau
                     int nthreads=1);
66 5d69a524 jcorgan
67 5d69a524 jcorgan
 public:
68 5d69a524 jcorgan
  ~gr_fft_filter_ccc ();
69 5d69a524 jcorgan
70 5d69a524 jcorgan
  void set_taps (const std::vector<gr_complex> &taps);
71 5faab4fb Tom Rondeau
  std::vector<gr_complex> taps () const;
72 5d69a524 jcorgan
73 7e10a264 Tom Rondeau
  /*!
74 7e10a264 Tom Rondeau
   * \brief Set number of threads to use.
75 7e10a264 Tom Rondeau
   */
76 7e10a264 Tom Rondeau
  void set_nthreads(int n);
77 7e10a264 Tom Rondeau
78 7e10a264 Tom Rondeau
  /*!
79 7e10a264 Tom Rondeau
   * \brief Get number of threads being used.
80 7e10a264 Tom Rondeau
   */
81 7e10a264 Tom Rondeau
  int nthreads() const;
82 7e10a264 Tom Rondeau
83 5d69a524 jcorgan
  int work (int noutput_items,
84 5d69a524 jcorgan
            gr_vector_const_void_star &input_items,
85 5d69a524 jcorgan
            gr_vector_void_star &output_items);
86 5d69a524 jcorgan
};
87 5d69a524 jcorgan
88 5d69a524 jcorgan
89 5d69a524 jcorgan
90 5d69a524 jcorgan
#endif /* INCLUDED_GR_FFT_FILTER_CCC_H */