root / gnuradio-core / src / lib / filter / gri_fft_filter_ccc_sse.h @ bea38e03
History | View | Annotate | Download (2.7 kB)
| 1 | c7b26f66 | Tom Rondeau | /* -*- c++ -*- */
|
|---|---|---|---|
| 2 | c7b26f66 | Tom Rondeau | /*
|
| 3 | c7b26f66 | Tom Rondeau | * Copyright 2010 Free Software Foundation, Inc. |
| 4 | c7b26f66 | Tom Rondeau | * |
| 5 | c7b26f66 | Tom Rondeau | * This file is part of GNU Radio |
| 6 | c7b26f66 | Tom Rondeau | * |
| 7 | c7b26f66 | Tom Rondeau | * GNU Radio is free software; you can redistribute it and/or modify |
| 8 | c7b26f66 | Tom Rondeau | * it under the terms of the GNU General Public License as published by |
| 9 | c7b26f66 | Tom Rondeau | * the Free Software Foundation; either version 3, or (at your option) |
| 10 | c7b26f66 | Tom Rondeau | * any later version. |
| 11 | c7b26f66 | Tom Rondeau | * |
| 12 | c7b26f66 | Tom Rondeau | * GNU Radio is distributed in the hope that it will be useful, |
| 13 | c7b26f66 | Tom Rondeau | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | c7b26f66 | Tom Rondeau | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | c7b26f66 | Tom Rondeau | * GNU General Public License for more details. |
| 16 | c7b26f66 | Tom Rondeau | * |
| 17 | c7b26f66 | Tom Rondeau | * You should have received a copy of the GNU General Public License |
| 18 | c7b26f66 | Tom Rondeau | * along with GNU Radio; see the file COPYING. If not, write to |
| 19 | c7b26f66 | Tom Rondeau | * the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | c7b26f66 | Tom Rondeau | * Boston, MA 02110-1301, USA. |
| 21 | c7b26f66 | Tom Rondeau | */ |
| 22 | c7b26f66 | Tom Rondeau | |
| 23 | c7b26f66 | Tom Rondeau | #ifndef INCLUDED_GRI_FFT_FILTER_CCC_SSE_H
|
| 24 | c7b26f66 | Tom Rondeau | #define INCLUDED_GRI_FFT_FILTER_CCC_SSE_H
|
| 25 | c7b26f66 | Tom Rondeau | |
| 26 | f914499f | Josh Blum | #include <gr_core_api.h> |
| 27 | c7b26f66 | Tom Rondeau | #include <gr_complex.h> |
| 28 | c7b26f66 | Tom Rondeau | #include <vector> |
| 29 | c7b26f66 | Tom Rondeau | |
| 30 | c7b26f66 | Tom Rondeau | class gri_fft_complex; |
| 31 | c7b26f66 | Tom Rondeau | |
| 32 | c7b26f66 | Tom Rondeau | /*!
|
| 33 | c7b26f66 | Tom Rondeau | * \brief Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps |
| 34 | c7b26f66 | Tom Rondeau | * \ingroup filter_blk |
| 35 | c7b26f66 | Tom Rondeau | */ |
| 36 | f914499f | Josh Blum | class GR_CORE_API gri_fft_filter_ccc_sse |
| 37 | c7b26f66 | Tom Rondeau | {
|
| 38 | c7b26f66 | Tom Rondeau | private:
|
| 39 | c7b26f66 | Tom Rondeau | int d_ntaps;
|
| 40 | c7b26f66 | Tom Rondeau | int d_nsamples;
|
| 41 | c7b26f66 | Tom Rondeau | int d_fftsize; // fftsize = ntaps + nsamples - 1 |
| 42 | c7b26f66 | Tom Rondeau | int d_decimation;
|
| 43 | c7b26f66 | Tom Rondeau | gri_fft_complex *d_fwdfft; // forward "plan"
|
| 44 | c7b26f66 | Tom Rondeau | gri_fft_complex *d_invfft; // inverse "plan"
|
| 45 | c7b26f66 | Tom Rondeau | std::vector<gr_complex> d_tail; // state carried between blocks for overlap-add
|
| 46 | c7b26f66 | Tom Rondeau | gr_complex *d_xformed_taps; |
| 47 | c7b26f66 | Tom Rondeau | std::vector<gr_complex> d_new_taps; |
| 48 | c7b26f66 | Tom Rondeau | |
| 49 | c7b26f66 | Tom Rondeau | void compute_sizes(int ntaps); |
| 50 | c7b26f66 | Tom Rondeau | int tailsize() const { return d_ntaps - 1; } |
| 51 | c7b26f66 | Tom Rondeau | |
| 52 | c7b26f66 | Tom Rondeau | public:
|
| 53 | c7b26f66 | Tom Rondeau | /*!
|
| 54 | c7b26f66 | Tom Rondeau | * \brief Construct an FFT filter for complex vectors with the given taps and decimation rate. |
| 55 | c7b26f66 | Tom Rondeau | * |
| 56 | c7b26f66 | Tom Rondeau | * This is the basic implementation for performing FFT filter for fast convolution |
| 57 | c7b26f66 | Tom Rondeau | * in other blocks for complex vectors (such as gr_fft_filter_ccc). |
| 58 | c7b26f66 | Tom Rondeau | * \param decimation The decimation rate of the filter (int) |
| 59 | c7b26f66 | Tom Rondeau | * \param taps The filter taps (complex) |
| 60 | c7b26f66 | Tom Rondeau | */ |
| 61 | c7b26f66 | Tom Rondeau | gri_fft_filter_ccc_sse (int decimation, const std::vector<gr_complex> &taps); |
| 62 | c7b26f66 | Tom Rondeau | ~gri_fft_filter_ccc_sse (); |
| 63 | c7b26f66 | Tom Rondeau | |
| 64 | c7b26f66 | Tom Rondeau | /*!
|
| 65 | c7b26f66 | Tom Rondeau | * \brief Set new taps for the filter. |
| 66 | c7b26f66 | Tom Rondeau | * |
| 67 | c7b26f66 | Tom Rondeau | * Sets new taps and resets the class properties to handle different sizes |
| 68 | c7b26f66 | Tom Rondeau | * \param taps The filter taps (complex) |
| 69 | c7b26f66 | Tom Rondeau | */ |
| 70 | c7b26f66 | Tom Rondeau | int set_taps (const std::vector<gr_complex> &taps); |
| 71 | c7b26f66 | Tom Rondeau | |
| 72 | c7b26f66 | Tom Rondeau | /*!
|
| 73 | c7b26f66 | Tom Rondeau | * \brief Perform the filter operation |
| 74 | c7b26f66 | Tom Rondeau | * |
| 75 | c7b26f66 | Tom Rondeau | * \param nitems The number of items to produce |
| 76 | c7b26f66 | Tom Rondeau | * \param input The input vector to be filtered |
| 77 | c7b26f66 | Tom Rondeau | * \param output The result of the filter operation |
| 78 | c7b26f66 | Tom Rondeau | */ |
| 79 | c7b26f66 | Tom Rondeau | int filter (int nitems, const gr_complex *input, gr_complex *output); |
| 80 | c7b26f66 | Tom Rondeau | |
| 81 | c7b26f66 | Tom Rondeau | }; |
| 82 | c7b26f66 | Tom Rondeau | |
| 83 | c7b26f66 | Tom Rondeau | #endif /* INCLUDED_GRI_FFT_FILTER_CCC_SSE_H */ |