diff options
Diffstat (limited to 'gnuradio-core/src/lib/general')
-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-- | gnuradio-core/src/lib/general/gr_squash_ff.cc | 93 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_squash_ff.h | 68 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_squash_ff.i | 34 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wavelet_ff.cc | 107 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wavelet_ff.h | 71 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wavelet_ff.i | 31 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wvps_ff.cc | 98 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wvps_ff.h | 58 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/gr_wvps_ff.i | 29 |
11 files changed, 0 insertions, 598 deletions
diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index ee6e4c4e6..1d1da247c 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 fcf60c927..bf8bc163f 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/gnuradio-core/src/lib/general/gr_squash_ff.cc b/gnuradio-core/src/lib/general/gr_squash_ff.cc deleted file mode 100644 index 479204fdb..000000000 --- a/gnuradio-core/src/lib/general/gr_squash_ff.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2010 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 <stdexcept> -#include <gr_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) -{ - return gnuradio::get_initial_sptr(new gr_squash_ff(igrid, ogrid)); -} - -gr_squash_ff::gr_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())) -{ - d_inum = igrid.size(); - d_onum = ogrid.size(); - d_igrid = (double *) malloc(d_inum * sizeof(double)); - d_iwork = (double *) malloc(d_inum * sizeof(double)); - d_ogrid = (double *) malloc(d_onum * sizeof(double)); - for (unsigned int i = 0; i < d_inum; i++) - d_igrid[i] = igrid[i]; - for (unsigned int i = 0; i < d_onum; i++) - d_ogrid[i] = ogrid[i]; - - d_accel = gsl_interp_accel_alloc(); - d_spline = gsl_spline_alloc(gsl_interp_cspline, d_inum); // FIXME check w/ Frank -} - -gr_squash_ff::~gr_squash_ff() -{ - free((char *) d_igrid); - free((char *) d_iwork); - free((char *) d_ogrid); - gsl_interp_accel_free(d_accel); - gsl_spline_free(d_spline); -} - -int -gr_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]; - - for (int count = 0; count < noutput_items; count++) { - - for (unsigned int i = 0; i < d_inum; i++) - d_iwork[i] = in[i]; - - gsl_spline_init(d_spline, d_igrid, d_iwork, d_inum); - - for (unsigned int i = 0; i < d_onum; i++) - out[i] = gsl_spline_eval(d_spline, d_ogrid[i], d_accel); - - in += d_inum; - out += d_onum; - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.h b/gnuradio-core/src/lib/general/gr_squash_ff.h deleted file mode 100644 index f7fea1648..000000000 --- a/gnuradio-core/src/lib/general/gr_squash_ff.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 INCLUDED_GR_SQUASH_FF_H_ -# define INCLUDED_GR_SQUASH_FF_H_ - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gsl/gsl_errno.h> -#include <gsl/gsl_interp.h> -#include <gsl/gsl_spline.h> -/*! - * \brief implements cheap resampling of spectrum directly from - * spectral points, using gsl interpolation - * \ingroup misc - */ - -class gr_squash_ff; -typedef boost::shared_ptr<gr_squash_ff> gr_squash_ff_sptr; - -GR_CORE_API gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); - -class GR_CORE_API gr_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); - - size_t d_inum; - size_t d_onum; - double *d_igrid; - double *d_iwork; - double *d_ogrid; - - gsl_interp_accel *d_accel; - gsl_spline *d_spline; - - gr_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); - - public: - ~gr_squash_ff(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_squash_ff.i b/gnuradio-core/src/lib/general/gr_squash_ff.i deleted file mode 100644 index c89b1c28d..000000000 --- a/gnuradio-core/src/lib/general/gr_squash_ff.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 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,squash_ff); - -gr_squash_ff_sptr gr_make_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); - -class gr_squash_ff : public gr_sync_block -{ -private: - gr_squash_ff(const std::vector<float> &igrid, - const std::vector<float> &ogrid); - -}; - diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc b/gnuradio-core/src/lib/general/gr_wavelet_ff.cc deleted file mode 100644 index f77c96e99..000000000 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2010 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 tewavelet 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 <stdexcept> -#include <gr_wavelet_ff.h> -#include <gr_io_signature.h> - -#include <stdio.h> - -// 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) -{ - return gnuradio::get_initial_sptr(new gr_wavelet_ff(size, - order, - forward)); -} - -gr_wavelet_ff::gr_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))), - d_size(size), - d_order(order), - d_forward(forward) -{ - d_wavelet = gsl_wavelet_alloc(gsl_wavelet_daubechies, d_order); - if (d_wavelet == NULL) - throw std::runtime_error("can't allocate wavelet"); - d_workspace = gsl_wavelet_workspace_alloc(d_size); - if (d_workspace == NULL) - throw std::runtime_error("can't allocate wavelet workspace"); - d_temp = (double *) malloc(d_size*sizeof(double)); - if (d_workspace == NULL) - throw std::runtime_error("can't allocate wavelet double conversion temp"); -} - -gr_wavelet_ff::~gr_wavelet_ff() -{ - gsl_wavelet_free(d_wavelet); - gsl_wavelet_workspace_free(d_workspace); - free((char *) d_temp); -} - -int -gr_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]; - - for (int count = 0; count < noutput_items; count++) { - for (int i = 0; i < d_size; i++) - d_temp[i] = in[i]; - - if (d_forward) - gsl_wavelet_transform_forward(d_wavelet, - d_temp, - 1, - d_size, - d_workspace); - else - gsl_wavelet_transform_inverse(d_wavelet, - d_temp, - 1, - d_size, - d_workspace); - - for (int i = 0; i < d_size; i++) - out[i] = d_temp[i]; - - in += d_size; - out += d_size; - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.h b/gnuradio-core/src/lib/general/gr_wavelet_ff.h deleted file mode 100644 index 107a50fe2..000000000 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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_GR_WAVELET_FF_H -#define INCLUDED_GR_WAVELET_FF_H - -#include <gr_core_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; - -GR_CORE_API gr_wavelet_ff_sptr -gr_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 -{ - int d_size; - int d_order; - bool d_forward; - gsl_wavelet *d_wavelet; - 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); - - gr_wavelet_ff(int size, - int order, - bool forward); - -public: - ~gr_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 */ diff --git a/gnuradio-core/src/lib/general/gr_wavelet_ff.i b/gnuradio-core/src/lib/general/gr_wavelet_ff.i deleted file mode 100644 index 9d4264170..000000000 --- a/gnuradio-core/src/lib/general/gr_wavelet_ff.i +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 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,wavelet_ff); - -gr_wavelet_ff_sptr gr_make_wavelet_ff(int size, int order, bool forward); - -class gr_wavelet_ff : public gr_sync_block -{ -private: - gr_wavelet_ff(int size, int order, bool forward); -}; - diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.cc b/gnuradio-core/src/lib/general/gr_wvps_ff.cc deleted file mode 100644 index 8a8dc56ac..000000000 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.cc +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 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 <gr_wvps_ff.h> -#include <gr_io_signature.h> -#include <string.h> - -static int -ceil_log2(int k) -{ - int m = 0; - for (int n = k-1; n > 0; n >>= 1) m++; - return m; -} - -gr_wvps_ff_sptr -gr_make_wvps_ff(int ilen) -{ - return gnuradio::get_initial_sptr(new gr_wvps_ff(ilen)); -} - -gr_wvps_ff::gr_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))), - d_ilen(ilen), d_olen(ceil_log2(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) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int count = 0; count < noutput_items; count++) { - - // any power? - - if (in[0] == 0.0) { - for (int i = 0; i < d_olen; i++) - out[i] = 0.0; - - } else { - - // get power normalization from 0-th wavelet coefficient - - float scl = 1.0/(in[0]*in[0]); - int k = 1; - - // sum powers over sequences of bins, - // sequence lengths in increasing powers of 2 - - for (int e = 0; e < d_olen; e++) { - int m = 01<<e; - float sum = 0.0; - - for (int l = 0; l < m; l++) - sum += (in[k+l]*in[k+l]); - - out[e] = scl*sum; - k += m; - } - } - - in += d_ilen; - out += d_olen; - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.h b/gnuradio-core/src/lib/general/gr_wvps_ff.h deleted file mode 100644 index 7c8f26066..000000000 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 INCLUDED_GR_WVPS_FF_H -#define INCLUDED_GR_WVPS_FF_H - -#include <gr_core_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); - - -/*! - * \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 -{ - friend GR_CORE_API gr_wvps_ff_sptr - gr_make_wvps_ff(int ilen); - - int d_ilen; - int d_olen; - - protected: - gr_wvps_ff(int ilen); - - public: - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - -}; - -#endif /* INCLUDED_GR_WVPS_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_wvps_ff.i b/gnuradio-core/src/lib/general/gr_wvps_ff.i deleted file mode 100644 index 877126fb2..000000000 --- a/gnuradio-core/src/lib/general/gr_wvps_ff.i +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 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_wvps_ff_sptr gr_make_wvps_ff(int ilen); - -class gr_wvps_ff : public gr_sync_block -{ -private: - gr_wvps_ff(int ilen); -}; |