summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gri_fft.cc18
-rw-r--r--gnuradio-core/src/lib/general/gri_fft.h13
2 files changed, 31 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gri_fft.cc b/gnuradio-core/src/lib/general/gri_fft.cc
index 63e307776..2edb5f5aa 100644
--- a/gnuradio-core/src/lib/general/gri_fft.cc
+++ b/gnuradio-core/src/lib/general/gri_fft.cc
@@ -47,6 +47,24 @@ static int my_fftw_read_char(void *f) { return fgetc((FILE *) f); }
#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);
+}
+
+void
+gri_fft_free(void *b)
+{
+ fftwf_free(b);
+}
+
boost::mutex &
gri_fft_planner::mutex()
{
diff --git a/gnuradio-core/src/lib/general/gri_fft.h b/gnuradio-core/src/lib/general/gri_fft.h
index ed80badf1..f77a18e52 100644
--- a/gnuradio-core/src/lib/general/gri_fft.h
+++ b/gnuradio-core/src/lib/general/gri_fft.h
@@ -30,6 +30,19 @@
#include <gr_complex.h>
#include <boost/thread.hpp>
+/*! \brief Helper function for allocating complex fft buffers
+ */
+gr_complex* gri_fft_malloc_complex(int size);
+
+/*! \brief Helper function for allocating float fft buffers
+ */
+float* gri_fft_malloc_float(int size);
+
+/*! \brief Helper function for freeing fft buffers
+ */
+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.