diff options
author | Tom Rondeau | 2012-06-15 08:43:20 -0400 |
---|---|---|
committer | Tom Rondeau | 2012-06-15 08:43:20 -0400 |
commit | 5585c71229cfa7886e0bd090828cd1f5104f6b27 (patch) | |
tree | c80bcc8821fb10a44c073ce1fa2a0f4816027bef /gr-filter/include/filter | |
parent | a74286a2aa7fcddb52c165ba2c17cb2f55b5b592 (diff) | |
download | gnuradio-5585c71229cfa7886e0bd090828cd1f5104f6b27.tar.gz gnuradio-5585c71229cfa7886e0bd090828cd1f5104f6b27.tar.bz2 gnuradio-5585c71229cfa7886e0bd090828cd1f5104f6b27.zip |
filter: adding ssc and fsf versions of filter with associated new Volk kernels.
These routines work and pass QA. They could use some performance work. the FSF is just slightly slower than before; the SCC version is more noticably slower.
Both could benefit, probably, by using SSE2 intrinsics to handle the shorts.
Diffstat (limited to 'gr-filter/include/filter')
-rw-r--r-- | gr-filter/include/filter/CMakeLists.txt | 2 | ||||
-rw-r--r-- | gr-filter/include/filter/fir_filter.h | 62 |
2 files changed, 63 insertions, 1 deletions
diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt index 5b209873c..2620d3f54 100644 --- a/gr-filter/include/filter/CMakeLists.txt +++ b/gr-filter/include/filter/CMakeLists.txt @@ -64,7 +64,7 @@ endmacro(expand_h) ######################################################################## # Invoke macro to generate various sources ####################################################################### -expand_h(fir_filter_XXX fff ccf ccc) +expand_h(fir_filter_XXX fff ccf ccc scc fsf) add_custom_target(filter_generated_includes DEPENDS ${generated_includes} diff --git a/gr-filter/include/filter/fir_filter.h b/gr-filter/include/filter/fir_filter.h index 8bfaa4f50..1fb3afb4d 100644 --- a/gr-filter/include/filter/fir_filter.h +++ b/gr-filter/include/filter/fir_filter.h @@ -122,6 +122,68 @@ namespace gr { int d_naligned; }; + /**************************************************************/ + + class FILTER_API fir_filter_scc + { + public: + fir_filter_scc(int decimation, + const std::vector<gr_complex> &taps); + ~fir_filter_scc(); + + void set_taps(const std::vector<gr_complex> &taps); + std::vector<gr_complex> taps() const; + unsigned int ntaps() const; + + gr_complex filter(const short input[]); + void filterN(gr_complex output[], + const short input[], + unsigned long n); + void filterNdec(gr_complex output[], + const short input[], + unsigned long n, + unsigned int decimate); + + private: + unsigned int d_ntaps; + gr_complex *d_taps; + gr_complex **d_aligned_taps; + gr_complex *d_output; + int d_align; + int d_naligned; + }; + + /**************************************************************/ + + class FILTER_API fir_filter_fsf + { + public: + fir_filter_fsf(int decimation, + const std::vector<float> &taps); + ~fir_filter_fsf(); + + void set_taps(const std::vector<float> &taps); + std::vector<float> taps() const; + unsigned int ntaps() const; + + short filter(const float input[]); + void filterN(short output[], + const float input[], + unsigned long n); + void filterNdec(short output[], + const float input[], + unsigned long n, + unsigned int decimate); + + private: + unsigned int d_ntaps; + float *d_taps; + float **d_aligned_taps; + short *d_output; + int d_align; + int d_naligned; + }; + } /* namespace kernel */ } /* namespace filter */ } /* namespace gr */ |