diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | gnuradio-core/CMakeLists.txt | 3 | ||||
-rw-r--r-- | gnuradio-core/gnuradio-core.pc.in | 2 | ||||
-rw-r--r-- | gnuradio-core/src/lib/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/CMakeLists.txt | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 6 | ||||
-rw-r--r-- | gr-wavelet/CMakeLists.txt | 109 | ||||
-rw-r--r-- | gr-wavelet/gnuradio-wavelet.pc.in | 11 | ||||
-rw-r--r-- | gr-wavelet/include/wavelet/CMakeLists.txt | 31 | ||||
-rw-r--r-- | gr-wavelet/include/wavelet/wavelet_api.h | 33 | ||||
-rw-r--r-- | gr-wavelet/include/wavelet/wavelet_squash_ff.h (renamed from gnuradio-core/src/lib/general/gr_squash_ff.h) | 28 | ||||
-rw-r--r-- | gr-wavelet/include/wavelet/wavelet_wavelet_ff.h (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.h) | 40 | ||||
-rw-r--r-- | gr-wavelet/include/wavelet/wavelet_wvps_ff.h (renamed from gnuradio-core/src/lib/general/gr_wvps_ff.h) | 27 | ||||
-rw-r--r-- | gr-wavelet/lib/CMakeLists.txt | 53 | ||||
-rw-r--r-- | gr-wavelet/lib/wavelet_squash_ff.cc (renamed from gnuradio-core/src/lib/general/gr_squash_ff.cc) | 24 | ||||
-rw-r--r-- | gr-wavelet/lib/wavelet_wavelet_ff.cc (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.cc) | 28 | ||||
-rw-r--r-- | gr-wavelet/lib/wavelet_wvps_ff.cc (renamed from gnuradio-core/src/lib/general/gr_wvps_ff.cc) | 18 | ||||
-rw-r--r-- | gr-wavelet/python/CMakeLists.txt | 47 | ||||
-rw-r--r-- | gr-wavelet/python/__init__.py | 28 | ||||
-rwxr-xr-x | gr-wavelet/python/qa_classify.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_classify.py) | 8 | ||||
-rw-r--r-- | gr-wavelet/swig/CMakeLists.txt | 50 | ||||
-rw-r--r-- | gr-wavelet/swig/wavelet_squash_ff.i (renamed from gnuradio-core/src/lib/general/gr_squash_ff.i) | 15 | ||||
-rw-r--r-- | gr-wavelet/swig/wavelet_swig.i | 36 | ||||
-rw-r--r-- | gr-wavelet/swig/wavelet_wavelet_ff.i (renamed from gnuradio-core/src/lib/general/gr_wavelet_ff.i) | 8 | ||||
-rw-r--r-- | gr-wavelet/swig/wavelet_wvps_ff.i (renamed from gnuradio-core/src/lib/general/gr_wvps_ff.i) | 8 |
26 files changed, 500 insertions, 124 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..b25c15b81f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4979e34983..583d24b914 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,6 +230,7 @@ add_subdirectory(gr-utils) add_subdirectory(gr-video-sdl) add_subdirectory(gr-vocoder) add_subdirectory(gr-fcd) +add_subdirectory(gr-wavelet) add_subdirectory(gr-wxgui) add_subdirectory(gnuradio-examples/grc) add_subdirectory(gnuradio-examples/python) diff --git a/gnuradio-core/CMakeLists.txt b/gnuradio-core/CMakeLists.txt index 101f4c3a33..6991044997 100644 --- a/gnuradio-core/CMakeLists.txt +++ b/gnuradio-core/CMakeLists.txt @@ -22,8 +22,6 @@ ######################################################################## include(GrBoost) -find_package(GSL) - find_package(FFTW3f) include(GrPython) #used for code generation @@ -41,7 +39,6 @@ GR_REGISTER_COMPONENT("gnuradio-core" ENABLE_GR_CORE ENABLE_GRUEL ENABLE_VOLK Boost_FOUND - GSL_FOUND FFTW3F_FOUND PYTHONINTERP_FOUND ) diff --git a/gnuradio-core/gnuradio-core.pc.in b/gnuradio-core/gnuradio-core.pc.in index 40c26a129d..46e4dc379a 100644 --- a/gnuradio-core/gnuradio-core.pc.in +++ b/gnuradio-core/gnuradio-core.pc.in @@ -6,7 +6,7 @@ guile_load_path=@prefix@/share/guile/site Name: gnuradio-core Description: GNU Software Radio toolkit -Requires: gruel fftw3f gsl +Requires: gruel fftw3f Version: @LIBVER@ Libs.private: @BOOST_LDFLAGS@ @BOOST_THREAD_LIB@ @BOOST_DATE_TIME_LIB@ Libs: -L${libdir} -lgnuradio-core diff --git a/gnuradio-core/src/lib/CMakeLists.txt b/gnuradio-core/src/lib/CMakeLists.txt index 86f88242ca..73002ec7bf 100644 --- a/gnuradio-core/src/lib/CMakeLists.txt +++ b/gnuradio-core/src/lib/CMakeLists.txt @@ -47,10 +47,6 @@ include_directories(${VOLK_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) -add_definitions(${GSL_DEFINITIONS}) -include_directories(${GSL_INCLUDE_DIRS}) -link_directories(${GSL_LIBRARY_DIRS}) - include_directories(${FFTW3F_INCLUDE_DIRS}) link_directories(${FFTW3F_LIBRARY_DIRS}) @@ -60,7 +56,6 @@ link_directories(${FFTW3F_LIBRARY_DIRS}) list(APPEND gnuradio_core_libs gruel ${Boost_LIBRARIES} - ${GSL_LIBRARIES} ${FFTW3F_LIBRARIES} ) @@ -80,7 +75,6 @@ list(APPEND gnuradio_core_libs volk) add_library(gnuradio-core SHARED ${gnuradio_core_sources}) target_link_libraries(gnuradio-core ${gnuradio_core_libs}) GR_LIBRARY_FOO(gnuradio-core RUNTIME_COMPONENT "core_runtime" DEVEL_COMPONENT "core_devel") -#avoid fftw and gsl link in dependent libraries: set_target_properties(gnuradio-core PROPERTIES LINK_INTERFACE_LIBRARIES "gruel") ######################################################################## diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index ee6e4c4e6b..1d1da247c8 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -267,7 +267,6 @@ set(gr_core_general_triple_threats gr_simple_framer gr_simple_squelch_cc gr_skiphead - gr_squash_ff gr_squelch_base_cc gr_squelch_base_ff gr_stream_mux @@ -285,8 +284,6 @@ set(gr_core_general_triple_threats gr_vector_to_stream gr_vector_to_streams gr_unpack_k_bits_bb - gr_wavelet_ff - gr_wvps_ff gr_descrambler_bb gr_scrambler_bb gr_probe_mpsk_snr_c diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index fcf60c9271..bf8bc163fa 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -128,10 +128,7 @@ #include <gr_probe_mpsk_snr_c.h> #include <gr_probe_density_b.h> #include <gr_rail_ff.h> -#include <gr_squash_ff.h> #include <gr_stretch_ff.h> -#include <gr_wavelet_ff.h> -#include <gr_wvps_ff.h> #include <gr_copy.h> #include <gr_additive_scrambler_bb.h> #include <complex_vec_test.h> @@ -249,10 +246,7 @@ %include "gr_probe_mpsk_snr_c.i" %include "gr_probe_density_b.i" %include "gr_rail_ff.i" -%include "gr_squash_ff.i" %include "gr_stretch_ff.i" -%include "gr_wavelet_ff.i" -%include "gr_wvps_ff.i" %include "gr_copy.i" %include "gr_additive_scrambler_bb.i" %include "complex_vec_test.i" diff --git a/gr-wavelet/CMakeLists.txt b/gr-wavelet/CMakeLists.txt new file mode 100644 index 0000000000..c37e552822 --- /dev/null +++ b/gr-wavelet/CMakeLists.txt @@ -0,0 +1,109 @@ +# Copyright 2012 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. + +######################################################################## +# Setup dependencies +######################################################################## +include(GrBoost) + +find_package(GSL) + +######################################################################## +# Register component +######################################################################## +include(GrComponent) + +GR_REGISTER_COMPONENT("gr-wavelet" ENABLE_GR_WAVELET + Boost_FOUND + ENABLE_GR_CORE + GSL_FOUND +) + +GR_SET_GLOBAL(GR_WAVELET_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/lib + ${CMAKE_CURRENT_SOURCE_DIR}/include/wavelet +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_WAVELET) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_WAVELET_DESCRIPTION "GNU Radio Wavelet Blocks") + +CPACK_COMPONENT("wavelet_runtime" + GROUP "WAVELET" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("wavelet_devel" + GROUP "WAVELET" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("wavelet_python" + GROUP "WAVELET" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;wavelet_runtime" +) + +CPACK_COMPONENT("wavelet_swig" + GROUP "WAVELET" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;wavelet_python;wavelet_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(include/wavelet) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) +# add_subdirectory(grc) +endif(ENABLE_PYTHON) +#add_subdirectory(examples) +#add_subdirectory(doc) + +######################################################################## +# Create Pkg Config File +######################################################################## +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-wavelet.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-wavelet.pc +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-wavelet.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "wavelet_devel" +) + +endif(ENABLE_GR_WAVELET) diff --git a/gr-wavelet/gnuradio-wavelet.pc.in b/gr-wavelet/gnuradio-wavelet.pc.in new file mode 100644 index 0000000000..998ae90564 --- /dev/null +++ b/gr-wavelet/gnuradio-wavelet.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gnuradio-wavelet +Description: Wavelet signal processing blocks for GNU Radio +Requires: gnuradio-core +Version: @LIBVER@ +Libs: -L${libdir} -lgnuradio-wavelet +Cflags: -I${includedir} diff --git a/gr-wavelet/include/wavelet/CMakeLists.txt b/gr-wavelet/include/wavelet/CMakeLists.txt new file mode 100644 index 0000000000..a37a3b0cd8 --- /dev/null +++ b/gr-wavelet/include/wavelet/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright 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. + +######################################################################## +# Install header files +######################################################################## +install(FILES + wavelet_api.h + wavelet_squash_ff.h + wavelet_wavelet_ff.h + wavelet_wvps_ff.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "wavelet_devel" +) + diff --git a/gr-wavelet/include/wavelet/wavelet_api.h b/gr-wavelet/include/wavelet/wavelet_api.h new file mode 100644 index 0000000000..68b2c04d78 --- /dev/null +++ b/gr-wavelet/include/wavelet/wavelet_api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 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_WAVELET_API_H +#define INCLUDED_WAVELET_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_wavelet_EXPORTS +# define WAVELET_API __GR_ATTR_EXPORT +#else +# define WAVELET_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_WAVELET_API_H */ diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.h b/gr-wavelet/include/wavelet/wavelet_squash_ff.h index f7fea16481..99ecf93ca8 100644 --- a/gnuradio-core/src/lib/general/gr_squash_ff.h +++ b/gr-wavelet/include/wavelet/wavelet_squash_ff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,10 +20,10 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_SQUASH_FF_H_ -# define INCLUDED_GR_SQUASH_FF_H_ +#ifndef INCLUDED_WAVELET_SQUASH_FF_H_ +# define INCLUDED_WAVELET_SQUASH_FF_H_ -#include <gr_core_api.h> +#include <wavelet_api.h> #include <gr_sync_block.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_interp.h> @@ -34,16 +34,16 @@ * \ingroup misc */ -class gr_squash_ff; -typedef boost::shared_ptr<gr_squash_ff> gr_squash_ff_sptr; +class wavelet_squash_ff; +typedef boost::shared_ptr<wavelet_squash_ff> wavelet_squash_ff_sptr; -GR_CORE_API gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); +WAVELET_API wavelet_squash_ff_sptr wavelet_make_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid); -class GR_CORE_API gr_squash_ff : public gr_sync_block +class WAVELET_API wavelet_squash_ff : public gr_sync_block { - friend GR_CORE_API gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); + friend WAVELET_API wavelet_squash_ff_sptr wavelet_make_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid); size_t d_inum; size_t d_onum; @@ -54,11 +54,11 @@ class GR_CORE_API gr_squash_ff : public gr_sync_block gsl_interp_accel *d_accel; gsl_spline *d_spline; - gr_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); + wavelet_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid); public: - ~gr_squash_ff(); + ~wavelet_squash_ff(); int work(int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.h b/gr-wavelet/include/wavelet/wavelet_wavelet_ff.h index 107a50fe27..9b1f3fe0ec 100644 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.h +++ b/gr-wavelet/include/wavelet/wavelet_wavelet_ff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,30 +19,30 @@ * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_WAVELET_FF_H -#define INCLUDED_GR_WAVELET_FF_H +#ifndef INCLUDED_WAVELET_WAVELET_FF_H +#define INCLUDED_WAVELET_WAVELET_FF_H -#include <gr_core_api.h> +#include <wavelet_api.h> #include <iostream> #include <gr_sync_block.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_wavelet.h> -class gr_wavelet_ff; -typedef boost::shared_ptr<gr_wavelet_ff> gr_wavelet_ff_sptr; +class wavelet_wavelet_ff; +typedef boost::shared_ptr<wavelet_wavelet_ff> wavelet_wavelet_ff_sptr; -GR_CORE_API gr_wavelet_ff_sptr -gr_make_wavelet_ff(int size = 1024, - int order = 20, - bool forward = true); +WAVELET_API wavelet_wavelet_ff_sptr +wavelet_make_wavelet_ff(int size = 1024, + int order = 20, + bool forward = true); /*! * \brief compute wavelet transform using gsl routines * \ingroup wavelet_blk */ -class GR_CORE_API gr_wavelet_ff : public gr_sync_block +class WAVELET_API wavelet_wavelet_ff : public gr_sync_block { int d_size; int d_order; @@ -51,21 +51,21 @@ class GR_CORE_API gr_wavelet_ff : public gr_sync_block gsl_wavelet_workspace *d_workspace; double *d_temp; - friend GR_CORE_API gr_wavelet_ff_sptr - gr_make_wavelet_ff(int size, - int order, - bool forward); + friend WAVELET_API wavelet_wavelet_ff_sptr + wavelet_make_wavelet_ff(int size, + int order, + bool forward); - gr_wavelet_ff(int size, - int order, - bool forward); + wavelet_wavelet_ff(int size, + int order, + bool forward); public: - ~gr_wavelet_ff(); + ~wavelet_wavelet_ff(); int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; -#endif /* INCLUDED_GR_WAVELET_FF_H */ +#endif /* INCLUDED_WAVELET_WAVELET_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.h b/gr-wavelet/include/wavelet/wavelet_wvps_ff.h index 7c8f260665..ec6ed0c340 100644 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.h +++ b/gr-wavelet/include/wavelet/wavelet_wvps_ff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,33 +20,32 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_WVPS_FF_H -#define INCLUDED_GR_WVPS_FF_H +#ifndef INCLUDED_WAVELET_WVPS_FF_H +#define INCLUDED_WAVELET_WVPS_FF_H -#include <gr_core_api.h> +#include <wavelet_api.h> #include <gr_sync_decimator.h> -class gr_wvps_ff; -typedef boost::shared_ptr<gr_wvps_ff> gr_wvps_ff_sptr; - -GR_CORE_API gr_wvps_ff_sptr -gr_make_wvps_ff(int ilen); +class wavelet_wvps_ff; +typedef boost::shared_ptr<wavelet_wvps_ff> wavelet_wvps_ff_sptr; +WAVELET_API wavelet_wvps_ff_sptr +wavelet_make_wvps_ff(int ilen); /*! * \brief computes the Wavelet Power Spectrum from a set of wavelet coefficients * \ingroup wavelet_blk */ -class GR_CORE_API gr_wvps_ff : public gr_sync_block +class WAVELET_API wavelet_wvps_ff : public gr_sync_block { - friend GR_CORE_API gr_wvps_ff_sptr - gr_make_wvps_ff(int ilen); + friend WAVELET_API wavelet_wvps_ff_sptr + wavelet_make_wvps_ff(int ilen); int d_ilen; int d_olen; protected: - gr_wvps_ff(int ilen); + wavelet_wvps_ff(int ilen); public: int work(int noutput_items, @@ -55,4 +54,4 @@ class GR_CORE_API gr_wvps_ff : public gr_sync_block }; -#endif /* INCLUDED_GR_WVPS_FF_H */ +#endif /* INCLUDED_WAVELET_WVPS_FF_H */ diff --git a/gr-wavelet/lib/CMakeLists.txt b/gr-wavelet/lib/CMakeLists.txt new file mode 100644 index 0000000000..51a5d39899 --- /dev/null +++ b/gr-wavelet/lib/CMakeLists.txt @@ -0,0 +1,53 @@ +# Copyright 2012 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. + +######################################################################## +# Setup the include and linker paths +######################################################################## +include_directories( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_WAVELET_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} +) + +include_directories(${WAVELET_INCLUDE_DIRS}) +link_directories(${WAVELET_LIBRARY_DIRS}) + +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +list(APPEND gr_wavelet_sources + wavelet_squash_ff.cc + wavelet_wavelet_ff.cc + wavelet_wvps_ff.cc +) + +list(APPEND wavelet_libs + gnuradio-core + ${Boost_LIBRARIES} + ${WAVELET_LIBRARIES} + ${GSL_LIBRARIES} +) + +add_library(gnuradio-wavelet SHARED ${gr_wavelet_sources}) +target_link_libraries(gnuradio-wavelet ${wavelet_libs}) +GR_LIBRARY_FOO(gnuradio-wavelet RUNTIME_COMPONENT "wavelet_runtime" DEVEL_COMPONENT "wavelet_devel") diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.cc b/gr-wavelet/lib/wavelet_squash_ff.cc index 479204fdbf..9316d34fee 100644 --- a/gnuradio-core/src/lib/general/gr_squash_ff.cc +++ b/gr-wavelet/lib/wavelet_squash_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2010 Free Software Foundation, Inc. + * Copyright 2008,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -25,21 +25,21 @@ #endif #include <stdexcept> -#include <gr_squash_ff.h> +#include <wavelet_squash_ff.h> #include <gr_io_signature.h> // expect input vector of igrid.size y-values, // produce output vector of ogrid.size y-values -gr_squash_ff_sptr -gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid) +wavelet_squash_ff_sptr +wavelet_make_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid) { - return gnuradio::get_initial_sptr(new gr_squash_ff(igrid, ogrid)); + return gnuradio::get_initial_sptr(new wavelet_squash_ff(igrid, ogrid)); } -gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid) +wavelet_squash_ff::wavelet_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid) : gr_sync_block("squash_ff", gr_make_io_signature(1, 1, sizeof(float) * igrid.size()), gr_make_io_signature(1, 1, sizeof(float) * ogrid.size())) @@ -58,7 +58,7 @@ gr_squash_ff::gr_squash_ff(const std::vector<float> &igrid, d_spline = gsl_spline_alloc(gsl_interp_cspline, d_inum); // FIXME check w/ Frank } -gr_squash_ff::~gr_squash_ff() +wavelet_squash_ff::~wavelet_squash_ff() { free((char *) d_igrid); free((char *) d_iwork); @@ -68,9 +68,9 @@ gr_squash_ff::~gr_squash_ff() } int -gr_squash_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +wavelet_squash_ff::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const float *in = (const float *) input_items[0]; float *out = (float *) output_items[0]; diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc b/gr-wavelet/lib/wavelet_wavelet_ff.cc index f77c96e993..3f4354f313 100644 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc +++ b/gr-wavelet/lib/wavelet_wavelet_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2010 Free Software Foundation, Inc. + * Copyright 2008,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -25,7 +25,7 @@ #endif #include <stdexcept> -#include <gr_wavelet_ff.h> +#include <wavelet_wavelet_ff.h> #include <gr_io_signature.h> #include <stdio.h> @@ -33,19 +33,15 @@ // NB in this version, only Daubechies wavelets // order is wavelet length, even, 2...20 -gr_wavelet_ff_sptr -gr_make_wavelet_ff(int size, - int order, - bool forward) +wavelet_wavelet_ff_sptr +wavelet_make_wavelet_ff(int size, + int order, + bool forward) { - return gnuradio::get_initial_sptr(new gr_wavelet_ff(size, - order, - forward)); + return gnuradio::get_initial_sptr(new wavelet_wavelet_ff(size, order, forward)); } -gr_wavelet_ff::gr_wavelet_ff(int size, - int order, - bool forward) +wavelet_wavelet_ff::wavelet_wavelet_ff(int size, int order, bool forward) : gr_sync_block("wavelet_ff", gr_make_io_signature(1, 1, size * sizeof(float)), gr_make_io_signature(1, 1, size * sizeof(float))), @@ -64,7 +60,7 @@ gr_wavelet_ff::gr_wavelet_ff(int size, throw std::runtime_error("can't allocate wavelet double conversion temp"); } -gr_wavelet_ff::~gr_wavelet_ff() +wavelet_wavelet_ff::~wavelet_wavelet_ff() { gsl_wavelet_free(d_wavelet); gsl_wavelet_workspace_free(d_workspace); @@ -72,9 +68,9 @@ gr_wavelet_ff::~gr_wavelet_ff() } int -gr_wavelet_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +wavelet_wavelet_ff::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const float *in = (const float *) input_items[0]; float *out = (float *) output_items[0]; diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.cc b/gr-wavelet/lib/wavelet_wvps_ff.cc index 8a8dc56acd..5edc43496d 100644 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.cc +++ b/gr-wavelet/lib/wavelet_wvps_ff.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,7 +24,7 @@ #include "config.h" #endif -#include <gr_wvps_ff.h> +#include <wavelet_wvps_ff.h> #include <gr_io_signature.h> #include <string.h> @@ -36,13 +36,13 @@ ceil_log2(int k) return m; } -gr_wvps_ff_sptr -gr_make_wvps_ff(int ilen) +wavelet_wvps_ff_sptr +wavelet_make_wvps_ff(int ilen) { - return gnuradio::get_initial_sptr(new gr_wvps_ff(ilen)); + return gnuradio::get_initial_sptr(new wavelet_wvps_ff(ilen)); } -gr_wvps_ff::gr_wvps_ff(int ilen) +wavelet_wvps_ff::wavelet_wvps_ff(int ilen) : gr_sync_block("wvps_ff", gr_make_io_signature(1, 1, sizeof(float) * ilen), gr_make_io_signature(1, 1, sizeof(float) * ceil_log2(ilen))), @@ -53,9 +53,9 @@ gr_wvps_ff::gr_wvps_ff(int ilen) // input vector assumed to be output from gsl wavelet computation int -gr_wvps_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +wavelet_wvps_ff::work(int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const float *in = (const float *) input_items[0]; float *out = (float *) output_items[0]; diff --git a/gr-wavelet/python/CMakeLists.txt b/gr-wavelet/python/CMakeLists.txt new file mode 100644 index 0000000000..9ddcb7ea9c --- /dev/null +++ b/gr-wavelet/python/CMakeLists.txt @@ -0,0 +1,47 @@ +# Copyright 2012 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(GrPython) + +GR_PYTHON_INSTALL( + FILES + __init__.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/wavelet + COMPONENT "wavelet_python" +) + +######################################################################## +# Handle the unit tests +######################################################################## +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-wavelet/python + ${CMAKE_BINARY_DIR}/gr-wavelet/swig + ) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-wavelet) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-wavelet/python/__init__.py b/gr-wavelet/python/__init__.py new file mode 100644 index 0000000000..ce63ed37c1 --- /dev/null +++ b/gr-wavelet/python/__init__.py @@ -0,0 +1,28 @@ +# +# Copyright 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. +# + +''' +This is the gr-wavelet package. This package provides GNU Radio +processing blocks for wavelet transforms. +''' + +from wavelet_swig import * + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py b/gr-wavelet/python/qa_classify.py index ac5b53b577..157d6b8c66 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py +++ b/gr-wavelet/python/qa_classify.py @@ -25,7 +25,7 @@ from gnuradio import gr, gr_unittest import copy #import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config import math - +import wavelet_swig def sqr(x): return x*x @@ -106,7 +106,7 @@ class test_classify(gr_unittest.TestCase): src_data = (0.0, 1.0, 0.0, 1.0, 0.0) src = gr.vector_source_f(src_data, False, len(src_grid)) - sq = gr.squash_ff(src_grid, trg_grid) + sq = wavelet_swig.squash_ff(src_grid, trg_grid) dst = gr.vector_sink_f(len(trg_grid)) self.tb.connect(src, sq) self.tb.connect(sq, dst) @@ -132,7 +132,7 @@ class test_classify(gr_unittest.TestCase): # d = w.transform_inverse(c, ws) # # src = gr.vector_source_f(b, False, n) -# wv = gr.wavelet_ff(n, o, True) +# wv = wavelet_swig.wavelet_ff(n, o, True) # # dst = gr.vector_sink_f(n) # self.tb.connect(src, wv) @@ -161,7 +161,7 @@ class test_classify(gr_unittest.TestCase): k += 01<<e src = gr.vector_source_f(src_data, False, len(src_data)) - kon = gr.wvps_ff(len(src_data)) + kon = wavelet_swig.wvps_ff(len(src_data)) dst = gr.vector_sink_f(int(math.ceil(math.log(len(src_data), 2)))) self.tb.connect(src, kon) diff --git a/gr-wavelet/swig/CMakeLists.txt b/gr-wavelet/swig/CMakeLists.txt new file mode 100644 index 0000000000..e91915d86f --- /dev/null +++ b/gr-wavelet/swig/CMakeLists.txt @@ -0,0 +1,50 @@ +# Copyright 2012 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. + +######################################################################## +# Setup swig generation +######################################################################## +include(GrPython) +include(GrSwig) + +set(GR_SWIG_INCLUDE_DIRS + ${GR_WAVELET_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) + +set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/wavelet_swig_doc.i) +set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib) + +set(GR_SWIG_LIBRARIES gnuradio-wavelet) + +GR_SWIG_MAKE(wavelet_swig wavelet_swig.i) + +GR_SWIG_INSTALL( + TARGETS wavelet_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/wavelet + COMPONENT "wavelet_python" +) + +install( + FILES + wavelet_swig.i + ${CMAKE_CURRENT_BINARY_DIR}/wavelet_swig_doc.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "wavelet_swig" +) diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.i b/gr-wavelet/swig/wavelet_squash_ff.i index c89b1c28d7..298399d4b0 100644 --- a/gnuradio-core/src/lib/general/gr_squash_ff.i +++ b/gr-wavelet/swig/wavelet_squash_ff.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,16 +19,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -GR_SWIG_BLOCK_MAGIC(gr,squash_ff); +GR_SWIG_BLOCK_MAGIC(wavelet,squash_ff); -gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); +wavelet_squash_ff_sptr wavelet_make_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid); -class gr_squash_ff : public gr_sync_block +class wavelet_squash_ff : public gr_sync_block { private: - gr_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); + wavelet_squash_ff(const std::vector<float> &igrid, + const std::vector<float> &ogrid); }; - diff --git a/gr-wavelet/swig/wavelet_swig.i b/gr-wavelet/swig/wavelet_swig.i new file mode 100644 index 0000000000..dbf5f15d94 --- /dev/null +++ b/gr-wavelet/swig/wavelet_swig.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012 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 "gnuradio.i" + +//load generated python docstrings +%include "wavelet_swig_doc.i" + +%{ +#include "wavelet_squash_ff.h" +#include "wavelet_wavelet_ff.h" +#include "wavelet_wvps_ff.h" +%} + +%include "wavelet_squash_ff.i" +%include "wavelet_wavelet_ff.i" +%include "wavelet_wvps_ff.i" diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.i b/gr-wavelet/swig/wavelet_wavelet_ff.i index 9d42641708..de6ef1113d 100644 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.i +++ b/gr-wavelet/swig/wavelet_wavelet_ff.i @@ -19,13 +19,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -GR_SWIG_BLOCK_MAGIC(gr,wavelet_ff); +GR_SWIG_BLOCK_MAGIC(wavelet,wavelet_ff); -gr_wavelet_ff_sptr gr_make_wavelet_ff(int size, int order, bool forward); +wavelet_wavelet_ff_sptr wavelet_make_wavelet_ff(int size, int order, bool forward); -class gr_wavelet_ff : public gr_sync_block +class wavelet_wavelet_ff : public gr_sync_block { private: - gr_wavelet_ff(int size, int order, bool forward); + wavelet_wavelet_ff(int size, int order, bool forward); }; diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.i b/gr-wavelet/swig/wavelet_wvps_ff.i index 877126fb23..30e394d041 100644 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.i +++ b/gr-wavelet/swig/wavelet_wvps_ff.i @@ -18,12 +18,12 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -GR_SWIG_BLOCK_MAGIC(gr,wvps_ff); +GR_SWIG_BLOCK_MAGIC(wavelet,wvps_ff); -gr_wvps_ff_sptr gr_make_wvps_ff(int ilen); +wavelet_wvps_ff_sptr wavelet_make_wvps_ff(int ilen); -class gr_wvps_ff : public gr_sync_block +class wavelet_wvps_ff : public gr_sync_block { private: - gr_wvps_ff(int ilen); + wavelet_wvps_ff(int ilen); }; |