summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-06 14:59:56 -0500
committerTom Rondeau <trondeau@vt.edu>2013-03-06 14:59:56 -0500
commit4865f080c419349274d945e046b2e46920edc682 (patch)
tree1b071e87444c9cfde9279c391cb2c8751c7e445b /gnuradio-core/src
parenta770feec38cd8a188a4c4c88f34d513155b4b539 (diff)
core: removing goertzel and fft implementations from core; see gr-fft.
Also cleaning up some other leftovers.
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/filter/CMakeLists.txt2
-rw-r--r--gnuradio-core/src/lib/filter/gri_goertzel.cc75
-rw-r--r--gnuradio-core/src/lib/filter/gri_goertzel.h57
-rw-r--r--gnuradio-core/src/lib/general/CMakeLists.txt1
-rw-r--r--gnuradio-core/src/lib/general/gri_fft.cc336
-rw-r--r--gnuradio-core/src/lib/general/gri_fft.h189
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/benchmark_filters.py75
7 files changed, 0 insertions, 735 deletions
diff --git a/gnuradio-core/src/lib/filter/CMakeLists.txt b/gnuradio-core/src/lib/filter/CMakeLists.txt
index 703580213e..a185b06bd5 100644
--- a/gnuradio-core/src/lib/filter/CMakeLists.txt
+++ b/gnuradio-core/src/lib/filter/CMakeLists.txt
@@ -26,7 +26,6 @@
########################################################################
list(APPEND gnuradio_core_sources
${CMAKE_CURRENT_SOURCE_DIR}/gr_sincos.c
- ${CMAKE_CURRENT_SOURCE_DIR}/gri_goertzel.cc
)
########################################################################
@@ -35,7 +34,6 @@ list(APPEND gnuradio_core_sources
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/gr_rotator.h
${CMAKE_CURRENT_SOURCE_DIR}/gr_sincos.h
- ${CMAKE_CURRENT_SOURCE_DIR}/gri_goertzel.h
DESTINATION ${GR_INCLUDE_DIR}/gnuradio
COMPONENT "core_devel"
)
diff --git a/gnuradio-core/src/lib/filter/gri_goertzel.cc b/gnuradio-core/src/lib/filter/gri_goertzel.cc
deleted file mode 100644
index 2fbdd3b137..0000000000
--- a/gnuradio-core/src/lib/filter/gri_goertzel.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2002,2011 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <cmath>
-
-#include <gri_goertzel.h>
-
-gri_goertzel::gri_goertzel(int rate, int len, float freq)
-{
- gri_setparms(rate, len, freq);
-}
-
-void
-gri_goertzel::gri_setparms(int rate, int len, float freq)
-{
- d_d1 = 0.0;
- d_d2 = 0.0;
-
- float w = 2.0*M_PI*freq/rate;
- d_wr = 2.0*std::cos(w);
- d_wi = std::sin(w);
- d_len = len;
- d_processed = 0;
-
-}
-
-gr_complex gri_goertzel::batch(float *in)
-{
- d_d1 = 0.0;
- d_d2 = 0.0;
-
- for(int i = 0; i < d_len; i++)
- input(in[i]);
-
- return output();
-}
-
-void gri_goertzel::input(const float &input)
-{
- float y = input + d_wr*d_d1 - d_d2;
- d_d2 = d_d1;
- d_d1 = y;
- d_processed++;
-}
-
-gr_complex gri_goertzel::output()
-{
- gr_complex out((0.5*d_wr*d_d1-d_d2)/d_len, (d_wi*d_d1)/d_len);
- d_d1 = 0.0;
- d_d2 = 0.0;
- d_processed = 0;
- return out;
-}
diff --git a/gnuradio-core/src/lib/filter/gri_goertzel.h b/gnuradio-core/src/lib/filter/gri_goertzel.h
deleted file mode 100644
index e28cb21a88..0000000000
--- a/gnuradio-core/src/lib/filter/gri_goertzel.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,2011 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef INCLUDED_GRI_GOERTZEL_H
-#define INCLUDED_GRI_GOERTZEL_H
-
-#include <gr_core_api.h>
-#include <gr_types.h>
-
-/*!
- * \brief Implements Goertzel single-bin DFT calculation
- * \ingroup misc
- */
-class GR_CORE_API gri_goertzel
-{
-public:
- gri_goertzel() {}
- gri_goertzel(int rate, int len, float freq);
- void gri_setparms(int rate, int len, float freq);
-
- // Process a input array
- gr_complex batch(float *in);
-
- // Process sample by sample
- void input(const float &in);
- gr_complex output();
- bool ready() const { return d_processed == d_len; }
-
-private:
- float d_d1;
- float d_d2;
- float d_wr;
- float d_wi;
- int d_len;
- int d_processed;
-};
-
-#endif /* INCLUDED_GRI_GOERTZEL_H */
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt
index de1ad59092..599d0f2a0d 100644
--- a/gnuradio-core/src/lib/general/CMakeLists.txt
+++ b/gnuradio-core/src/lib/general/CMakeLists.txt
@@ -77,7 +77,6 @@ list(APPEND gnuradio_core_sources
${CMAKE_CURRENT_SOURCE_DIR}/gri_add_const_ss_generic.cc
${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.cc
${CMAKE_CURRENT_SOURCE_DIR}/gri_debugger_hook.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/gri_fft.cc
${CMAKE_CURRENT_SOURCE_DIR}/malloc16.c
)
diff --git a/gnuradio-core/src/lib/general/gri_fft.cc b/gnuradio-core/src/lib/general/gri_fft.cc
deleted file mode 100644
index 78446ad39b..0000000000
--- a/gnuradio-core/src/lib/general/gri_fft.cc
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003,2008,2011 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-#include <gri_fft.h>
-#include <gr_sys_paths.h>
-#include <fftw3.h>
-
-#ifdef _MSC_VER //http://www.fftw.org/install/windows.html#DLLwisdom
-static void my_fftw_write_char(char c, void *f) { fputc(c, (FILE *) f); }
-#define fftw_export_wisdom_to_file(f) fftw_export_wisdom(my_fftw_write_char, (void*) (f))
-#define fftwf_export_wisdom_to_file(f) fftwf_export_wisdom(my_fftw_write_char, (void*) (f))
-#define fftwl_export_wisdom_to_file(f) fftwl_export_wisdom(my_fftw_write_char, (void*) (f))
-
-static int my_fftw_read_char(void *f) { return fgetc((FILE *) f); }
-#define fftw_import_wisdom_from_file(f) fftw_import_wisdom(my_fftw_read_char, (void*) (f))
-#define fftwf_import_wisdom_from_file(f) fftwf_import_wisdom(my_fftw_read_char, (void*) (f))
-#define fftwl_import_wisdom_from_file(f) fftwl_import_wisdom(my_fftw_read_char, (void*) (f))
-#endif //_MSC_VER
-
-#include <gr_complex.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <cassert>
-#include <stdexcept>
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-namespace fs = boost::filesystem;
-
-gr_complex *
-gri_fft_malloc_complex(int size)
-{
- return (gr_complex*)fftwf_malloc(sizeof(gr_complex)*size);
-}
-
-float *
-gri_fft_malloc_float(int size)
-{
- return (float*)fftwf_malloc(sizeof(float)*size);
-}
-
-double *
-gri_fft_malloc_double(int size)
-{
- return (double*)fftwf_malloc(sizeof(double)*size);
-}
-
-void
-gri_fft_free(void *b)
-{
- fftwf_free(b);
-}
-
-boost::mutex &
-gri_fft_planner::mutex()
-{
- static boost::mutex s_planning_mutex;
-
- return s_planning_mutex;
-}
-
-static const char *
-wisdom_filename ()
-{
- static fs::path path;
- path = fs::path(gr_appdata_path()) / ".gr_fftw_wisdom";
- return path.string().c_str();
-}
-
-static void
-gri_fftw_import_wisdom ()
-{
- const char *filename = wisdom_filename ();
- FILE *fp = fopen (filename, "r");
- if (fp != 0){
- int r = fftwf_import_wisdom_from_file (fp);
- fclose (fp);
- if (!r){
- fprintf (stderr, "gri_fftw: can't import wisdom from %s\n", filename);
- }
- }
-}
-
-static void
-gri_fftw_config_threading (int nthreads)
-{
- static int fftw_threads_inited = 0;
-
-#ifdef FFTW3F_THREADS
- if (fftw_threads_inited == 0)
- {
- fftw_threads_inited = 1;
- fftwf_init_threads();
- }
-
- fftwf_plan_with_nthreads(nthreads);
-#endif
-}
-
-static void
-gri_fftw_export_wisdom ()
-{
- const char *filename = wisdom_filename ();
- FILE *fp = fopen (filename, "w");
- if (fp != 0){
- fftwf_export_wisdom_to_file (fp);
- fclose (fp);
- }
- else {
- fprintf (stderr, "gri_fftw: ");
- perror (filename);
- }
-}
-
-// ----------------------------------------------------------------
-
-gri_fft_complex::gri_fft_complex (int fft_size, bool forward, int nthreads)
-{
- // Hold global mutex during plan construction and destruction.
- gri_fft_planner::scoped_lock lock(gri_fft_planner::mutex());
-
- assert (sizeof (fftwf_complex) == sizeof (gr_complex));
-
- if (fft_size <= 0)
- throw std::out_of_range ("gri_fftw: invalid fft_size");
-
- d_fft_size = fft_size;
- d_inbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * inbuf_length ());
- if (d_inbuf == 0)
- throw std::runtime_error ("fftwf_malloc");
-
- d_outbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * outbuf_length ());
- if (d_outbuf == 0){
- fftwf_free (d_inbuf);
- throw std::runtime_error ("fftwf_malloc");
- }
-
- d_nthreads = nthreads;
- gri_fftw_config_threading (nthreads);
- gri_fftw_import_wisdom (); // load prior wisdom from disk
-
- d_plan = fftwf_plan_dft_1d (fft_size,
- reinterpret_cast<fftwf_complex *>(d_inbuf),
- reinterpret_cast<fftwf_complex *>(d_outbuf),
- forward ? FFTW_FORWARD : FFTW_BACKWARD,
- FFTW_MEASURE);
-
- if (d_plan == NULL) {
- fprintf(stderr, "gri_fft_complex: error creating plan\n");
- throw std::runtime_error ("fftwf_plan_dft_1d failed");
- }
- gri_fftw_export_wisdom (); // store new wisdom to disk
-}
-
-gri_fft_complex::~gri_fft_complex ()
-{
- // Hold global mutex during plan construction and destruction.
- gri_fft_planner::scoped_lock lock(gri_fft_planner::mutex());
-
- fftwf_destroy_plan ((fftwf_plan) d_plan);
- fftwf_free (d_inbuf);
- fftwf_free (d_outbuf);
-}
-
-void
-gri_fft_complex::set_nthreads(int n)
-{
- if (n <= 0)
- throw std::out_of_range ("gri_fftw: invalid number of threads");
- d_nthreads = n;
-
-#ifdef FFTW3F_THREADS
- fftwf_plan_with_nthreads(d_nthreads);
-#endif
-}
-
-void
-gri_fft_complex::execute ()
-{
- fftwf_execute ((fftwf_plan) d_plan);
-}
-
-// ----------------------------------------------------------------
-
-gri_fft_real_fwd::gri_fft_real_fwd (int fft_size, int nthreads)
-{
- // Hold global mutex during plan construction and destruction.
- gri_fft_planner::scoped_lock lock(gri_fft_planner::mutex());
-
- assert (sizeof (fftwf_complex) == sizeof (gr_complex));
-
- if (fft_size <= 0)
- throw std::out_of_range ("gri_fftw: invalid fft_size");
-
- d_fft_size = fft_size;
- d_inbuf = (float *) fftwf_malloc (sizeof (float) * inbuf_length ());
- if (d_inbuf == 0)
- throw std::runtime_error ("fftwf_malloc");
-
- d_outbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * outbuf_length ());
- if (d_outbuf == 0){
- fftwf_free (d_inbuf);
- throw std::runtime_error ("fftwf_malloc");
- }
-
- d_nthreads = nthreads;
- gri_fftw_config_threading (nthreads);
- gri_fftw_import_wisdom (); // load prior wisdom from disk
-
- d_plan = fftwf_plan_dft_r2c_1d (fft_size,
- d_inbuf,
- reinterpret_cast<fftwf_complex *>(d_outbuf),
- FFTW_MEASURE);
-
- if (d_plan == NULL) {
- fprintf(stderr, "gri_fft_real_fwd: error creating plan\n");
- throw std::runtime_error ("fftwf_plan_dft_r2c_1d failed");
- }
- gri_fftw_export_wisdom (); // store new wisdom to disk
-}
-
-gri_fft_real_fwd::~gri_fft_real_fwd ()
-{
- // Hold global mutex during plan construction and destruction.
- gri_fft_planner::scoped_lock lock(gri_fft_planner::mutex());
-
- fftwf_destroy_plan ((fftwf_plan) d_plan);
- fftwf_free (d_inbuf);
- fftwf_free (d_outbuf);
-}
-
-void
-gri_fft_real_fwd::set_nthreads(int n)
-{
- if (n <= 0)
- throw std::out_of_range ("gri_fftw: invalid number of threads");
- d_nthreads = n;
-
-#ifdef FFTW3F_THREADS
- fftwf_plan_with_nthreads(d_nthreads);
-#endif
-}
-
-void
-gri_fft_real_fwd::execute ()
-{
- fftwf_execute ((fftwf_plan) d_plan);
-}
-
-// ----------------------------------------------------------------
-
-gri_fft_real_rev::gri_fft_real_rev (int fft_size, int nthreads)
-{
- // Hold global mutex during plan construction and destruction.
- gri_fft_planner::scoped_lock lock(gri_fft_planner::mutex());
-
- assert (sizeof (fftwf_complex) == sizeof (gr_complex));
-
- if (fft_size <= 0)
- throw std::out_of_range ("gri_fftw: invalid fft_size");
-
- d_fft_size = fft_size;
- d_inbuf = (gr_complex *) fftwf_malloc (sizeof (gr_complex) * inbuf_length ());
- if (d_inbuf == 0)
- throw std::runtime_error ("fftwf_malloc");
-
- d_outbuf = (float *) fftwf_malloc (sizeof (float) * outbuf_length ());
- if (d_outbuf == 0){
- fftwf_free (d_inbuf);
- throw std::runtime_error ("fftwf_malloc");
- }
-
- d_nthreads = nthreads;
- gri_fftw_config_threading (nthreads);
- gri_fftw_import_wisdom (); // load prior wisdom from disk
-
- // FIXME If there's ever a chance that the planning functions
- // will be called in multiple threads, we've got to ensure single
- // threaded access. They are not thread-safe.
- d_plan = fftwf_plan_dft_c2r_1d (fft_size,
- reinterpret_cast<fftwf_complex *>(d_inbuf),
- d_outbuf,
- FFTW_MEASURE);
-
- if (d_plan == NULL) {
- fprintf(stderr, "gri_fft_real_rev: error creating plan\n");
- throw std::runtime_error ("fftwf_plan_dft_c2r_1d failed");
- }
- gri_fftw_export_wisdom (); // store new wisdom to disk
-}
-
-gri_fft_real_rev::~gri_fft_real_rev ()
-{
- fftwf_destroy_plan ((fftwf_plan) d_plan);
- fftwf_free (d_inbuf);
- fftwf_free (d_outbuf);
-}
-
-void
-gri_fft_real_rev::set_nthreads(int n)
-{
- if (n <= 0)
- throw std::out_of_range ("gri_fftw: invalid number of threads");
- d_nthreads = n;
-
-#ifdef FFTW3F_THREADS
- fftwf_plan_with_nthreads(d_nthreads);
-#endif
-}
-
-void
-gri_fft_real_rev::execute ()
-{
- fftwf_execute ((fftwf_plan) d_plan);
-}
-
diff --git a/gnuradio-core/src/lib/general/gri_fft.h b/gnuradio-core/src/lib/general/gri_fft.h
deleted file mode 100644
index c6fbd4f43f..0000000000
--- a/gnuradio-core/src/lib/general/gri_fft.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003,2008 Free Software Foundation, Inc.
- *
- * This file is part of GNU Radio
- *
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- *
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-#ifndef _GRI_FFT_H_
-#define _GRI_FFT_H_
-
-/*
- * Wrappers for FFTW single precision 1d dft
- */
-
-#include <gr_core_api.h>
-#include <gr_complex.h>
-#include <boost/thread.hpp>
-
-/*! \brief Helper function for allocating complex* buffers
- */
-GR_CORE_API gr_complex* gri_fft_malloc_complex(int size);
-
-/*! \brief Helper function for allocating float* buffers
- */
-GR_CORE_API float* gri_fft_malloc_float(int size);
-
-/*! \brief Helper function for allocating double* buffers
- */
-GR_CORE_API double* gri_fft_malloc_double(int size);
-
-/*! \brief Helper function for freeing fft buffers
- */
-GR_CORE_API void gri_fft_free(void *b);
-
-
-/*!
- * \brief Export reference to planner mutex for those apps that
- * want to use FFTW w/o using the gri_fftw* classes.
- */
-class GR_CORE_API gri_fft_planner {
-public:
- typedef boost::mutex::scoped_lock scoped_lock;
- /*!
- * Return reference to planner mutex
- */
- static boost::mutex &mutex();
-};
-
-/*!
- * \brief FFT: complex in, complex out
- * \ingroup misc
- */
-class GR_CORE_API gri_fft_complex {
- int d_fft_size;
- int d_nthreads;
- gr_complex *d_inbuf;
- gr_complex *d_outbuf;
- void *d_plan;
-
-public:
- gri_fft_complex (int fft_size, bool forward = true, int nthreads=1);
- virtual ~gri_fft_complex ();
-
- /*
- * These return pointers to buffers owned by gri_fft_complex into which
- * input and output take place. It's done this way in order to
- * ensure optimal alignment for SIMD instructions.
- */
- gr_complex *get_inbuf () const { return d_inbuf; }
- gr_complex *get_outbuf () const { return d_outbuf; }
-
- int inbuf_length () const { return d_fft_size; }
- int outbuf_length () const { return d_fft_size; }
-
- /*!
- * Set the number of threads to use for caclulation.
- */
- void set_nthreads(int n);
-
- /*!
- * Get the number of threads being used by FFTW
- */
- int nthreads() const { return d_nthreads; }
-
- /*!
- * compute FFT. The input comes from inbuf, the output is placed in outbuf.
- */
- void execute ();
-};
-
-/*!
- * \brief FFT: real in, complex out
- * \ingroup misc
- */
-class GR_CORE_API gri_fft_real_fwd {
- int d_fft_size;
- int d_nthreads;
- float *d_inbuf;
- gr_complex *d_outbuf;
- void *d_plan;
-
-public:
- gri_fft_real_fwd (int fft_size, int nthreads=1);
- virtual ~gri_fft_real_fwd ();
-
- /*
- * These return pointers to buffers owned by gri_fft_real_fwd into
- * which input and output take place. It's done this way in order
- * to ensure optimal alignment for SIMD instructions.
- */
- float *get_inbuf () const { return d_inbuf; }
- gr_complex *get_outbuf () const { return d_outbuf; }
-
- int inbuf_length () const { return d_fft_size; }
- int outbuf_length () const { return d_fft_size / 2 + 1; }
-
- /*!
- * Set the number of threads to use for caclulation.
- */
- void set_nthreads(int n);
-
- /*!
- * Get the number of threads being used by FFTW
- */
- int nthreads() const { return d_nthreads; }
-
- /*!
- * compute FFT. The input comes from inbuf, the output is placed in outbuf.
- */
- void execute ();
-};
-
-/*!
- * \brief FFT: complex in, float out
- * \ingroup misc
- */
-class GR_CORE_API gri_fft_real_rev {
- int d_fft_size;
- int d_nthreads;
- gr_complex *d_inbuf;
- float *d_outbuf;
- void *d_plan;
-
-public:
- gri_fft_real_rev (int fft_size, int nthreads=1);
- virtual ~gri_fft_real_rev ();
-
- /*
- * These return pointers to buffers owned by gri_fft_real_rev into
- * which input and output take place. It's done this way in order
- * to ensure optimal alignment for SIMD instructions.
- */
- gr_complex *get_inbuf () const { return d_inbuf; }
- float *get_outbuf () const { return d_outbuf; }
-
- int inbuf_length () const { return d_fft_size / 2 + 1; }
- int outbuf_length () const { return d_fft_size; }
-
- /*!
- * Set the number of threads to use for caclulation.
- */
- void set_nthreads(int n);
-
- /*!
- * Get the number of threads being used by FFTW
- */
- int nthreads() const { return d_nthreads; }
-
- /*!
- * compute FFT. The input comes from inbuf, the output is placed in outbuf.
- */
- void execute ();
-};
-
-#endif
diff --git a/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py b/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py
deleted file mode 100755
index 4fc10b7210..0000000000
--- a/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-import time
-import random
-from optparse import OptionParser
-from gnuradio import gr
-from gnuradio.eng_option import eng_option
-
-def make_random_complex_tuple(L):
- result = []
- for x in range(L):
- result.append(complex(random.uniform(-1000,1000),
- random.uniform(-1000,1000)))
- return tuple(result)
-
-def benchmark(name, creator, dec, ntaps, total_test_size, block_size):
- block_size = 32768
-
- tb = gr.top_block()
- taps = make_random_complex_tuple(ntaps)
- src = gr.vector_source_c(make_random_complex_tuple(block_size), True)
- head = gr.head(gr.sizeof_gr_complex, int(total_test_size))
- op = creator(dec, taps)
- dst = gr.null_sink(gr.sizeof_gr_complex)
- tb.connect(src, head, op, dst)
- start = time.time()
- tb.run()
- stop = time.time()
- delta = stop - start
- print "%16s: taps: %4d input: %4g, time: %6.3f taps/sec: %10.4g" % (
- name, ntaps, total_test_size, delta, ntaps*total_test_size/delta)
-
-def main():
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-n", "--ntaps", type="int", default=256)
- parser.add_option("-t", "--total-input-size", type="eng_float", default=40e6)
- parser.add_option("-b", "--block-size", type="intx", default=50000)
- parser.add_option("-d", "--decimation", type="int", default=1)
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- ntaps = options.ntaps
- total_input_size = options.total_input_size
- block_size = options.block_size
- dec = options.decimation
-
- benchmark("gr.fir_filter_ccc", gr.fir_filter_ccc,
- dec, ntaps, total_input_size, block_size)
- benchmark("gr.fft_filter_ccc", gr.fft_filter_ccc,
- dec, ntaps, total_input_size, block_size)
-
-if __name__ == '__main__':
- main()