commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9628 - in gnuradio/branches/developers/eb/frank: conf


From: eb
Subject: [Commit-gnuradio] r9628 - in gnuradio/branches/developers/eb/frank: config gnuradio-core/src/lib gnuradio-core/src/lib/general gnuradio-core/src/python/gnuradio/gr
Date: Sat, 20 Sep 2008 18:24:24 -0600 (MDT)

Author: eb
Date: 2008-09-20 18:24:24 -0600 (Sat, 20 Sep 2008)
New Revision: 9628

Added:
   gnuradio/branches/developers/eb/frank/config/acx_cblas.m4
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.h
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.h
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.h
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.h
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.h
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
Modified:
   gnuradio/branches/developers/eb/frank/config/Makefile.am
   gnuradio/branches/developers/eb/frank/config/grc_gnuradio_core.m4
   gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/Makefile.am
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/Makefile.am
   gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/general.i
   
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/Makefile.am
Log:
Import of classifier blocks from Frank.  Builds, but core dumps in
~gr_squash_ff during make check.


Modified: gnuradio/branches/developers/eb/frank/config/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/frank/config/Makefile.am    2008-09-20 
23:19:29 UTC (rev 9627)
+++ gnuradio/branches/developers/eb/frank/config/Makefile.am    2008-09-21 
00:24:24 UTC (rev 9628)
@@ -26,6 +26,7 @@
 
 # List your m4 macros here
 m4macros = \
+       acx_cblas.m4 \
        acx_pthread.m4 \
        ax_boost_base.m4 \
        ax_boost_date_time.m4 \

Added: gnuradio/branches/developers/eb/frank/config/acx_cblas.m4
===================================================================
--- gnuradio/branches/developers/eb/frank/config/acx_cblas.m4                   
        (rev 0)
+++ gnuradio/branches/developers/eb/frank/config/acx_cblas.m4   2008-09-21 
00:24:24 UTC (rev 9628)
@@ -0,0 +1,227 @@
+# ===========================================================================
+#                http://autoconf-archive.cryp.to/acx_blas.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   ACX_CBLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro looks for a library that implements the CBLAS linear-algebra
+#   interface (see http://www.netlib.org/blas/). On success, it sets the
+#   CBLAS_LIBS output variable to hold the requisite library linkages.
+#
+#   To link with BLAS, you should link with:
+#
+#      $CBLAS_LIBS $LIBS
+#
+#   Many libraries are searched for, from ATLAS to CXML to ESSL. The user
+#   may also use --with-blas=<lib> in order to use some specific CBLAS
+#   library <lib>. In order to link successfully, however, be aware that you
+#   will probably need to use the same Fortran compiler (which can be set
+#   via the F77 env. var.) as was used to compile the BLAS library.
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a CBLAS library is
+#   found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
+#   not found. If ACTION-IF-FOUND is not specified, the default action will
+#   define HAVE_CBLAS.
+#
+#   This macro requires autoconf 2.50 or later.
+#
+# LAST MODIFICATION
+#
+#   2008-04-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2008 Steven G. Johnson <address@hidden>
+#   Copyright (c) 2008 Free Software Foundation, Inc.
+#
+#   This program 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 of the License, or (at your
+#   option) any later version.
+#
+#   This program 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, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Macro Archive. When you make and
+#   distribute a modified version of the Autoconf Macro, you may extend this
+#   special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_CBLAS], [
+AC_PREREQ(2.50)
+dnl AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
+AC_REQUIRE([AC_CANONICAL_HOST])
+acx_cblas_ok=no
+
+AC_ARG_WITH(cblas,
+       [AC_HELP_STRING([--with-cblas=<lib>], [use CBLAS library <lib>])])
+case $with_cblas in
+       yes | "") ;;
+       no) acx_cblas_ok=disable ;;
+       -* | */* | *.a | *.so | *.so.* | *.o) CBLAS_LIBS="$with_cblas" ;;
+       *) CBLAS_LIBS="-l$with_cblas" ;;
+esac
+
+
+acx_cblas_save_LIBS="$LIBS"
+LIBS="$LIBS $FLIBS"
+
+# First, check CBLAS_LIBS environment variable
+if test $acx_cblas_ok = no; then
+if test "x$CBLAS_LIBS" != x; then
+       save_LIBS="$LIBS"; LIBS="$CBLAS_LIBS $LIBS"
+       AC_MSG_CHECKING([for cblas_sgemm in $CBLAS_LIBS])
+       AC_TRY_LINK_FUNC(cblas_sgemm, [acx_cblas_ok=yes], [CBLAS_LIBS=""])
+       AC_MSG_RESULT($acx_cblas_ok)
+       LIBS="$save_LIBS"
+fi
+fi
+
+# CBLAS linked to by default?  (happens on some supercomputers)
+if test $acx_cblas_ok = no; then
+       save_LIBS="$LIBS"; LIBS="$LIBS"
+       AC_CHECK_FUNC(cblas_sgemm, [acx_cblas_ok=yes])
+       LIBS="$save_LIBS"
+fi
+
+# CBLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(atlas, ATL_xerbla,
+           [AC_CHECK_LIB(cblas, cblas_dgemm,
+               [acx_cblas_ok=yes
+                CBLAS_LIBS="-lcblas -latlas"],
+                [], [-latlas])],
+           [], [-latlas])
+fi
+
+# CBLAS in ATLAS library in /usr/lib64/atlas (if not cross-compiling)
+if test $acx_cblas_ok = no && test "$cross_compiling" = no; then
+       unset ac_cv_lib_atlas_ATL_xerbla
+       unset ac_cv_lib_cblas_cblas_dgemm
+       AC_CHECK_LIB(atlas, ATL_xerbla,
+           [AC_CHECK_LIB(cblas, cblas_dgemm,
+               [acx_cblas_ok=yes
+                CBLAS_LIBS="-L/usr/lib64/atlas -lcblas -latlas"],
+                [], [-L/usr/lib64/atlas -latlas])],
+           [], [-L/usr/lib64/atlas -latlas])
+fi
+
+# CBLAS in ATLAS library in /usr/lib/atlas (if not cross-compiling)
+if test $acx_cblas_ok = no && test "$cross_compiling" = no; then
+       unset ac_cv_lib_atlas_ATL_xerbla
+       unset ac_cv_lib_cblas_cblas_dgemm
+       AC_CHECK_LIB(atlas, ATL_xerbla,
+           [AC_CHECK_LIB(cblas, cblas_dgemm,
+               [acx_cblas_ok=yes
+                CBLAS_LIBS="-L/usr/lib/atlas -lcblas -latlas"],
+                [], [-L/usr/lib/atlas -latlas])],
+           [], [-L/usr/lib/atlas -latlas])
+fi
+
+
+# CBLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(cblas, cblas_sgemm,
+               [AC_CHECK_LIB(dgemm, cblas_dgemm,
+               [AC_CHECK_LIB(sgemm, cblas_sgemm,
+                       [acx_cblas_ok=yes; CBLAS_LIBS="-lsgemm -ldgemm -lblas"],
+                       [], [-lblas])],
+                       [], [-lblas])])
+fi
+
+# BLAS in Intel MKL library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(mkl, cblas_sgemm, [acx_cblas_ok=yes;CBLAS_LIBS="-lmkl"])
+fi
+
+# CBLAS in Apple vecLib library?
+if test $acx_cblas_ok = no; then
+       save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
+       AC_CHECK_FUNC(cblas_sgemm, [acx_cblas_ok=yes;CBLAS_LIBS="-framework 
vecLib"])
+       LIBS="$save_LIBS"
+fi
+
+# CBLAS in Alpha CXML library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(cxml, cblas_sgemm, [acx_cblas_ok=yes;CBLAS_LIBS="-lcxml"])
+fi
+
+# CBLAS in Alpha DXML library? (now called CXML, see above)
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(dxml, cblas_sgemm, [acx_cblas_ok=yes;CBLAS_LIBS="-ldxml"])
+fi
+
+# CBLAS in Sun Performance library?
+if test $acx_cblas_ok = no; then
+       if test "x$GCC" != xyes; then # only works with Sun CC
+               AC_CHECK_LIB(sunmath, acosp,
+                       [AC_CHECK_LIB(sunperf, cblas_sgemm,
+                               [CBLAS_LIBS="-xlic_lib=sunperf -lsunmath"
+                                 acx_cblas_ok=yes],[],[-lsunmath])])
+       fi
+fi
+
+# CBLAS in SCSL library?  (SGI/Cray Scientific Library)
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(scs, cblas_sgemm, [acx_cblas_ok=yes; CBLAS_LIBS="-lscs"])
+fi
+
+# CBLAS in SGIMATH library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(complib.sgimath, cblas_sgemm,
+                    [acx_cblas_ok=yes; CBLAS_LIBS="-lcomplib.sgimath"])
+fi
+
+# CBLAS in IBM ESSL library? (requires generic CBLAS lib, too)
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(cblas, cblas_sgemm,
+               [AC_CHECK_LIB(essl, cblas_sgemm,
+                       [acx_cblas_ok=yes; CBLAS_LIBS="-lessl -lblas"],
+                       [], [-lblas $FLIBS])])
+fi
+
+# Generic CBLAS library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(cblas, cblas_sgemm, [acx_cblas_ok=yes; 
CBLAS_LIBS="-lcblas"])
+fi
+
+# Generic BLAS library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(blas, cblas_sgemm, [acx_cblas_ok=yes; CBLAS_LIBS="-lblas"])
+fi
+
+# GSL generic CBLAS library?
+if test $acx_cblas_ok = no; then
+       AC_CHECK_LIB(gslcblas, cblas_sgemm, [acx_cblas_ok=yes; 
CBLAS_LIBS="-lgslcblas"])
+fi
+
+AC_SUBST(CBLAS_LIBS)
+
+LIBS="$acx_cblas_save_LIBS"
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_cblas_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_CBLAS,1,[Define if you have a CBLAS 
library.]),[$1])
+        :
+else
+        acx_cblas_ok=no
+        $2
+fi
+])dnl ACX_CBLAS


Property changes on: gnuradio/branches/developers/eb/frank/config/acx_cblas.m4
___________________________________________________________________
Name: svn:eol-style
   + LF

Modified: gnuradio/branches/developers/eb/frank/config/grc_gnuradio_core.m4
===================================================================
--- gnuradio/branches/developers/eb/frank/config/grc_gnuradio_core.m4   
2008-09-20 23:19:29 UTC (rev 9627)
+++ gnuradio/branches/developers/eb/frank/config/grc_gnuradio_core.m4   
2008-09-21 00:24:24 UTC (rev 9628)
@@ -36,6 +36,17 @@
     dnl   with : if the --with code didn't error out
     dnl   yes  : if the --enable code passed muster and all dependencies are 
met
     dnl   no   : otherwise
+    if test $passed = yes; then        
+       dnl look for fast CBLAS for GSL
+       ACX_CBLAS([],[passed=no; AC_MSG_RESULT([gnuradio-core requires a CBLAS 
library, not found.])])
+       if test $passed = yes; then
+            dnl check for GSL
+           PKG_CHECK_MODULES(GSL, gsl >= 1.10,
+               [], dnl FIXME remove -lgslcblas from GSL_LIBS
+               [passed=no;AC_MSG_RESULT([gnuradio-core requires package gsl, 
not found.])])
+        fi
+    fi
+
     if test $passed != with; then
        dnl how and where to find INCLUDES and LA and such
         gnuradio_core_INCLUDES="\
@@ -52,7 +63,8 @@
 -I\${abs_top_srcdir}/gnuradio-core/src/lib/g72x \
 -I\${abs_top_srcdir}/gnuradio-core/src/lib/swig \
 -I\${abs_top_builddir}/gnuradio-core/src/lib/swig \
-\$(FFTW3F_CFLAGS)"
+\$(FFTW3F_CFLAGS) \
+\$(GSL_CFLAGS)"
         
gnuradio_core_LA="\${abs_top_builddir}/gnuradio-core/src/lib/libgnuradio-core.la"
        
gnuradio_core_I="\${abs_top_srcdir}/gnuradio-core/src/lib/swig/gnuradio.i"
        
gnuradio_core_LIBDIRPATH="\${abs_top_builddir}/gnuradio-core/src/lib:\${abs_top_builddir}/gnuradio-core/src/lib/.libs"

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/Makefile.am     
2008-09-20 23:19:29 UTC (rev 9627)
+++ gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/Makefile.am     
2008-09-21 00:24:24 UTC (rev 9628)
@@ -50,7 +50,9 @@
        runtime/libruntime.la           \
        $(OMNITHREAD_LA)                \
        $(GRUEL_LA)                     \
-       $(FFTW3F_LIBS)
+       $(FFTW3F_LIBS)                  \
+       $(GSL_LIBS)                     \
+       $(CBLAS_LIBS)                   
 
 libgnuradio_core_qa_la_LIBADD  =       \
        filter/libfilter-qa.la          \

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/Makefile.am 
    2008-09-20 23:19:29 UTC (rev 9627)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/Makefile.am 
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -125,6 +125,7 @@
        gr_pwr_squelch_cc.cc            \
        gr_pwr_squelch_ff.cc            \
        gr_quadrature_demod_cf.cc       \
+       gr_rail_ff.cc                   \
        gr_random.cc                    \
        gr_regenerate_bb.cc             \
        gr_remez.cc                     \
@@ -137,6 +138,7 @@
        gr_simple_framer.cc             \
        gr_simple_squelch_cc.cc         \
        gr_skiphead.cc                  \
+       gr_squash_ff.cc                 \
        gr_squelch_base_cc.cc           \
        gr_squelch_base_ff.cc           \
        gr_stream_mux.cc                \
@@ -144,6 +146,7 @@
        gr_stream_to_vector.cc          \
        gr_streams_to_stream.cc         \
        gr_streams_to_vector.cc         \
+       gr_stretch_ff.cc                \
         gr_test.cc                      \
        gr_threshold_ff.cc              \
        gr_throttle.cc                  \
@@ -151,6 +154,8 @@
        gr_vco_f.cc                     \
        gr_vector_to_stream.cc          \
        gr_vector_to_streams.cc         \
+       gr_wavelet_ff.cc                \
+       gr_wvps_ff.cc                   \
        gri_add_const_ss_generic.cc     \
        gri_char_to_float.cc            \
        gri_debugger_hook.cc            \
@@ -275,6 +280,7 @@
        gr_pwr_squelch_cc.h             \
        gr_pwr_squelch_ff.h             \
        gr_quadrature_demod_cf.h        \
+       gr_rail_ff.h                    \
        gr_random.h                     \
        gr_regenerate_bb.h              \
        gr_remez.h                      \
@@ -287,6 +293,7 @@
        gr_simple_framer.h              \
        gr_simple_framer_sync.h         \
        gr_simple_squelch_cc.h          \
+       gr_squash_ff.h                  \
        gr_skiphead.h                   \
        gr_squelch_base_cc.h            \
        gr_squelch_base_ff.h            \
@@ -295,6 +302,7 @@
        gr_stream_to_vector.h           \
        gr_streams_to_stream.h          \
        gr_streams_to_vector.h          \
+       gr_stretch_ff.h                 \
         gr_test_types.h                        \
         gr_test.h                      \
        gr_threshold_ff.h               \
@@ -304,6 +312,8 @@
        gr_vco_f.h                      \
        gr_vector_to_stream.h           \
        gr_vector_to_streams.h          \
+       gr_wavelet_ff.h                 \
+       gr_wvps_ff.h                    \
        gri_add_const_ss.h              \
        gri_agc_cc.h                    \
        gri_agc_ff.h                    \

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/general.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/general.i   
    2008-09-20 23:19:29 UTC (rev 9627)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/general.i   
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -133,6 +133,12 @@
 #include <gr_scrambler_bb.h>
 #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_nop.i"
@@ -246,3 +252,8 @@
 %include "gr_scrambler_bb.i"
 %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"

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.cc
                           (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.cc
   2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,62 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_rail_ff.h>
+#include <gr_io_signature.h>
+
+gr_rail_ff_sptr
+gr_make_rail_ff(float lo, float hi)
+{
+  return gr_rail_ff_sptr(new gr_rail_ff(lo, hi));
+}
+
+gr_rail_ff::gr_rail_ff(float lo, float hi)
+  : gr_sync_block("rail_ff",
+                 gr_make_io_signature(1, 1, sizeof(float)),
+                 gr_make_io_signature(1, 1, sizeof(float))),
+    d_lo(lo), d_hi(hi)
+{
+}
+
+int
+gr_rail_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 i = 0; i < noutput_items; i++) {
+    if (in[i] < d_lo)
+      out[i] = d_lo;
+    else if (in[i] > d_hi)
+      out[i] = d_hi;
+    else
+      out[i] = in[i];
+  }
+
+  return noutput_items;
+}


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.h
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.h
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_RAIL_FF_H_
+# define       INCLUDED_GR_RAIL_FF_H_
+
+#include <gr_sync_block.h>
+
+/*!
+ * \brief clips input values to min, max
+ * \ingroup misc
+ */
+
+class gr_rail_ff;
+typedef boost::shared_ptr<gr_rail_ff> gr_rail_ff_sptr;
+
+gr_rail_ff_sptr gr_make_rail_ff(float lo, float hi);
+
+class gr_rail_ff : public gr_sync_block
+{
+  friend gr_rail_ff_sptr gr_make_rail_ff (float lo, float hi);
+
+  float        d_lo, d_hi;             // the constant
+  gr_rail_ff(float lo, float hi);
+
+ public:
+  float lo() const { return d_lo; }
+  void set_lo(float lo) { d_lo = lo; }
+  float hi() const { return d_hi; }
+  void set_hi(float hi) { d_hi = hi; }
+
+  int work(int noutput_items,
+          gr_vector_const_void_star &input_items,
+          gr_vector_void_star &output_items);
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.i
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_rail_ff.i
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,30 @@
+/* -*- 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,rail_ff);
+
+gr_rail_ff_sptr gr_make_rail_ff(float lo, float hi);
+
+class gr_rail_ff : public gr_sync_block
+{
+private:
+  gr_rail_ff(float lo, float hi);
+};

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.cc
                         (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.cc
 2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,90 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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 gr_squash_ff_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 (int i = 0; i < d_inum; i++)
+    d_igrid[i] = igrid[i];
+  for (int i = 0; i < d_onum; i++)
+    d_ogrid[i] = ogrid[i];
+}
+
+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 (int i = 0; i < d_inum; i++)
+      d_iwork[i] = in[i];
+
+    gsl_spline_init(d_spline, d_igrid, d_iwork, d_inum);
+    
+    for (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;
+}


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.h
                          (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.h
  2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_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_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
+{
+  friend 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


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.i
                          (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_squash_ff.i
  2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,34 @@
+/* -*- 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);
+
+};
+

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.cc
                                (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.cc
        2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,74 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_stretch_ff.h>
+#include <gr_io_signature.h>
+
+gr_stretch_ff_sptr
+gr_make_stretch_ff(float lo, size_t vlen)
+{
+  return gr_stretch_ff_sptr(new gr_stretch_ff(lo, vlen));
+}
+
+gr_stretch_ff::gr_stretch_ff(float lo, size_t vlen)
+  : gr_sync_block("stretch_ff",
+                 gr_make_io_signature(1, 1, vlen * sizeof(float)),
+                 gr_make_io_signature(1, 1, vlen * sizeof(float))),
+    d_lo(lo), d_vlen(vlen)
+{
+}
+
+int
+gr_stretch_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++) {
+    float vmax = in[0] - d_lo;
+
+    for (int i = 1; i < d_vlen; i++) {
+      float vtmp = in[i] - d_lo;
+      if (vtmp > vmax)
+       vmax = vtmp;
+    }
+    
+    if (vmax != 0.0)
+      for (int i = 0; i < d_vlen; i++)
+       out[i] = d_lo * (1.0 - (in[i] - d_lo) / vmax);
+    else
+      for (int i = 0; i < d_vlen; i++)
+       out[i] = in[i];
+
+    in  += d_vlen;
+    out += d_vlen;
+  }
+  
+  return noutput_items;
+}
+


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.h
                         (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.h
 2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,60 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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_STRETCH_FF_H_
+# define       INCLUDED_GR_STRETCH_FF_H_
+
+#include <gr_sync_block.h>
+
+/*!
+ * \brief adjust y-range of an input vector by mapping to range
+ * (max-of-input, stipulated-min). Primarily for spectral signature
+ * matching by normalizing spectrum dynamic ranges.
+ * \ingroup misc
+ */
+
+
+class gr_stretch_ff;
+typedef boost::shared_ptr<gr_stretch_ff> gr_stretch_ff_sptr;
+
+gr_stretch_ff_sptr gr_make_stretch_ff(float lo, size_t vlen);
+
+class gr_stretch_ff : public gr_sync_block
+{
+  friend gr_stretch_ff_sptr gr_make_stretch_ff(float lo, size_t vlen);
+
+  float        d_lo;           // the constant
+  size_t d_vlen;
+  gr_stretch_ff(float lo, size_t vlen);
+
+ public:
+  float lo() const { return d_lo; }
+  void set_lo(float lo) { d_lo = lo; }
+  size_t vlen() const { return d_vlen; }
+  void set_vlen(size_t vlen) { d_vlen = vlen; }
+
+  int work(int noutput_items,
+          gr_vector_const_void_star &input_items,
+          gr_vector_void_star &output_items);
+};
+
+#endif


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.i
                         (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_stretch_ff.i
 2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,31 @@
+/* -*- 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,stretch_ff);
+
+gr_stretch_ff_sptr gr_make_stretch_ff(float lo, size_t vlen);
+
+class gr_stretch_ff : public gr_sync_block
+{
+private:
+  gr_stretch_ff(float lo, size_t vlen);
+};
+

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
                                (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
        2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,103 @@
+/* -*- 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 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 gr_wavelet_ff_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::invalid_argument("can't allocate wavelet");
+  d_workspace = gsl_wavelet_workspace_alloc(d_size);
+  d_temp = (double *) malloc(d_size*sizeof(double));
+}
+
+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 < noutput_items; i++)
+      out[i] = d_temp[i];
+
+    in  += d_size;
+    out += d_size;
+  }
+
+  return noutput_items;
+}


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.h
                         (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.h
 2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,70 @@
+/* -*- 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 <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_wavelet_ff_sptr
+gr_make_wavelet_ff(int size = 1024,
+                  int order = 20,
+                  bool forward = true);
+
+/*!
+ * \brief compute wavelet transform using gsl routines
+ * \ingroup math
+ */
+
+class 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_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 */


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.i
                         (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wavelet_ff.i
 2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,31 @@
+/* -*- 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);
+};
+

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
                           (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
   2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,99 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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>
+
+inline int
+np2(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 gr_wvps_ff_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) * np2(ilen))),
+    d_ilen(ilen)
+{
+  d_olen = np2(d_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;
+}


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.h
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.h
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.h
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,57 @@
+/* -*- 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_sync_decimator.h>
+
+class gr_wvps_ff;
+typedef boost::shared_ptr<gr_wvps_ff> gr_wvps_ff_sptr;
+
+gr_wvps_ff_sptr 
+gr_make_wvps_ff(int ilen);
+
+
+/*!
+ * \brief computes the Wavelet Power Spectrum from a set of wavelet 
coefficients
+ * \ingroup misc
+ */
+class gr_wvps_ff : public gr_sync_block
+{
+  friend 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 */


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.i
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.i
                            (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/lib/general/gr_wvps_ff.i
    2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,29 @@
+/* -*- 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);
+};

Modified: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/Makefile.am
      2008-09-20 23:19:29 UTC (rev 9627)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/Makefile.am
      2008-09-21 00:24:24 UTC (rev 9628)
@@ -49,6 +49,7 @@
        qa_agc.py                       \
        qa_argmax.py                    \
        qa_bin_statistics.py            \
+       qa_classify.py                  \
        qa_cma_equalizer.py             \
        qa_complex_to_xxx.py            \
        qa_constellation_decoder_cb.py  \

Added: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
===================================================================
--- 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
                           (rev 0)
+++ 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
   2008-09-21 00:24:24 UTC (rev 9628)
@@ -0,0 +1,158 @@
+#!/usr/bin/env python
+
+import numpy
+from gnuradio import gr, gr_unittest
+import copy
+import pygsl.wavelet as wavelet
+
+def sqr(x):
+    return x*x
+
+class qa_classify(gr_unittest.TestCase):
+
+    def setUp(self):
+        self.tb = gr.top_block()
+
+    def tearDown(self):
+        self.tb = None
+
+    def test_000_(self):
+        src_data = numpy.zeros(10)
+        trg_data = numpy.zeros(10)
+        src = gr.vector_source_f(src_data)
+        dst = gr.vector_sink_f()
+        self.tb.connect(src, dst)
+        self.tb.run()
+        rsl_data = dst.data()
+        sum = 0
+        for (u,v) in zip(trg_data, rsl_data):
+            w = u - v
+            sum += w * w
+        sum /= float(len(trg_data))
+        assert sum < 1e-6
+
+    def test_001_(self):
+        src_data = numpy.array([-1.0, 1.0, -1.0, 1.0])
+        trg_data = src_data * 0.5
+        src = gr.vector_source_f(src_data)
+        dst = gr.vector_sink_f()
+        rail = gr.rail_ff(-0.5, 0.5)
+        self.tb.connect(src, rail)
+        self.tb.connect(rail, dst)
+        self.tb.run()
+        rsl_data = dst.data()
+        sum = 0
+        for (u, v) in zip(trg_data, rsl_data):
+            w = u - v
+            sum += w * w
+        sum /= float(len(trg_data))
+        assert sum < 1e-6
+
+    def test_002_(self):
+        src_data = numpy.array([-1.0,
+                                -1.0/2.0,
+                                -1.0/3.0,
+                                -1.0/4.0,
+                                -1.0/5.0])
+        trg_data = copy.deepcopy(src_data)
+
+        src = gr.vector_source_f(src_data)
+        st = gr.stretch_ff(-1.0/5.0, len(src_data))
+        dst = gr.vector_sink_f()
+        self.tb.connect(src, st)
+        self.tb.connect(st, dst)
+        self.tb.run()
+        rsl_data = dst.data()
+        sum = 0
+        for (u, v) in zip(trg_data, rsl_data):
+            w = u - v
+            sum += w * w
+        sum /= float(len(trg_data))
+        assert sum < 1e-6
+        
+    def test_003_(self):
+        src_grid = numpy.array([0.0, 1.0, 2.0, 3.0, 4.0])
+        trg_grid = copy.deepcopy(src_grid)
+        src_data = numpy.array([0.0, 1.0, 0.0, 1.0, 0.0])
+
+        src = gr.vector_source_f(src_data)
+        sq = gr.squash_ff(src_grid, trg_grid)
+        dst = gr.vector_sink_f()
+        self.tb.connect(src, sq)
+        self.tb.connect(sq, dst)
+        self.tb.run()
+        rsl_data = dst.data()
+        sum = 0
+        for (u, v) in zip(src_data, rsl_data):
+            w = u - v
+            sum += w * w
+        sum /= float(len(src_data))
+        assert sum < 1e-6
+
+    def test_004_(self):
+
+        n = 256
+        o = 4
+        ws = wavelet.workspace(n)
+        w = wavelet.daubechies(o)
+
+        a = numpy.arange(n)
+        b = numpy.sin(a*numpy.pi/16.0)
+        c = w.transform_forward(b, ws)
+        d = w.transform_inverse(c, ws)
+
+        src = gr.vector_source_f(b)
+        wv = gr.wavelet_ff(n, o, True)
+        dst = gr.vector_sink_f()
+        self.tb.connect(src, wv)
+        self.tb.connect(wv, dst)
+        self.tb.run()
+        e = dst.data()
+
+        sum = 0
+        for (u, v) in zip(c, e):
+            w = u - v
+            sum += w * w
+        sum /= float(len(c))
+        assert sum < 1e-6
+
+    def test_005_(self):
+
+        src_data = numpy.array([1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 
7.0]).astype(numpy.float)
+        trg_data = numpy.array([1.0, 3.0, 5.0, 7.0]).astype(numpy.float)
+
+        dwav = src_data
+        print 'dwav = ', dwav
+        wvps = numpy.zeros(3)
+        # wavelet power spectrum
+        scl = 1.0/sqr(dwav[0])
+        k = 1
+        for e in range(len(wvps)):
+            wvps[e] = scl*sqr(dwav[k:k+(01<<e)]).sum()
+            k += 01<<e
+
+        print 'wvps = ', wvps
+
+        print 'src_data = ', src_data
+
+        src = gr.vector_source_f(src_data)
+        kon = gr.wvps_ff(len(src_data))
+        dst = gr.vector_sink_f()
+
+        self.tb.connect(src, kon)
+        self.tb.connect(kon, dst)
+        self.tb.run()
+        snk_data = dst.data()
+
+        print len(snk_data), snk_data
+
+        sum = 0
+        for (u,v) in zip(snk_data, wvps):
+            w = u - v
+            sum += w * w
+        sum /= float(len(snk_data))
+        assert sum < 1e-6
+
+if __name__ == '__main__':
+    gr_unittest.main()
+    


Property changes on: 
gnuradio/branches/developers/eb/frank/gnuradio-core/src/python/gnuradio/gr/qa_classify.py
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native





reply via email to

[Prev in Thread] Current Thread [Next in Thread]