[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10138 - in gnuradio/branches/developers/n4hy/pfb_fbs:
From: |
n4hy |
Subject: |
[Commit-gnuradio] r10138 - in gnuradio/branches/developers/n4hy/pfb_fbs: . config gnuradio-examples/c++/dial_tone gnuradio-examples/python gnuradio-examples/python/digital gnuradio-examples/python/usrp2 gr-audio-alsa gr-audio-alsa/src gr-trellis/src/examples/fsm_files gr-trellis/src/lib gr-usrp/src gr-usrp2/src gr-utils/src/python gr-wxgui/src/python gruel/src/include/gruel usrp/host/lib/inband |
Date: |
Fri, 19 Dec 2008 19:40:38 -0700 (MST) |
Author: n4hy
Date: 2008-12-19 19:40:37 -0700 (Fri, 19 Dec 2008)
New Revision: 10138
Added:
gnuradio/branches/developers/n4hy/pfb_fbs/config/acx_cblas.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_check_memalign.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwtplot3d.m4
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/gr-audio-alsa.pc.in
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_16_16.fsm
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_4_16.fsm
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_c.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_f.py
Removed:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/config/
gnuradio/branches/developers/n4hy/pfb_fbs/config/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_python.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwt.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_core.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_examples.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_audio_alsa.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_comedi.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_msdd6000.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_qtgui.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_wxgui.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_grc.m4
gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_usrp.m4
gnuradio/branches/developers/n4hy/pfb_fbs/configure.ac
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/c++/dial_tone/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/receive_path.py
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/transmit_path.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/src/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/rep5.fsm
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/simple.fsm
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.h
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.i
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.cc.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.h.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.i.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.i.t
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_tv_rx.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_xcvr2450.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2.i
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.h
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_16sc.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_32fc.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.h
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.cc
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.h
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/Makefile.am
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_const.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_c.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_f.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_fft.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_rx_cfile.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_siggen.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_fft.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_siggen.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/common.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/fft_window.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/number_window.py
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/waterfall_window.py
gnuradio/branches/developers/n4hy/pfb_fbs/gruel/src/include/gruel/realtime.h
gnuradio/branches/developers/n4hy/pfb_fbs/usrp/host/lib/inband/Makefile.am
Log:
Having more fun bringing my branch merged with trunk up to date.
Property changes on: gnuradio/branches/developers/n4hy/pfb_fbs/config
___________________________________________________________________
Name: svn:ignore
- *.cache
*.la
*.lo
*.pc
.deps
.la
.libs
.lo
Makefile
Makefile.in
+ *.cache
*.la
*.lo
*.pc
.deps
.la
.libs
.lo
Makefile
Makefile.in
libtool.m4
lt~obsolete.m4
ltsugar.m4
ltversion.m4
ltoptions.m4
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -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 \
Copied: gnuradio/branches/developers/n4hy/pfb_fbs/config/acx_cblas.m4 (from rev
10133, gnuradio/trunk/config/acx_cblas.m4)
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/acx_cblas.m4
(rev 0)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/acx_cblas.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -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
Copied: gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_check_memalign.m4
(from rev 10133, gnuradio/trunk/config/gr_check_memalign.m4)
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_check_memalign.m4
(rev 0)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_check_memalign.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,42 @@
+# Copyright 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, 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Boston, MA
+# 02110-1301, USA.
+
+AC_DEFUN([GR_CHECK_MEMALIGN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ # Check for allocing memory alignment functions
+ # If 'posix_memalign' is available, use it solely.
+ AC_CHECK_FUNCS([posix_memalign],,[
+ # Otherwise, check for valloc and the
+ # (a-priori known) alignment of 'malloc'
+ AC_CHECK_FUNCS([valloc])
+ aligned_malloc=0
+ # 'malloc' is 16-byte aligned on (at least) Darwin 8 and 9
+ case "$host_os" in
+ darwin8*) aligned_malloc=16 ;;
+ darwin9*) aligned_malloc=16 ;;
+ *) ;;
+ esac
+ if test $aligned_malloc = 0; then
+ AC_MSG_RESULT([malloc has unknown alignment.])
+ else
+ AC_MSG_RESULT([malloc is $aligned_malloc-byte aligned.])
+ fi
+ AC_DEFINE_UNQUOTED([ALIGNED_MALLOC],[$aligned_malloc],[Define as the
alignment of malloc if known; otherwise 0.])
+ ])
+])
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_python.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_python.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_python.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -126,3 +126,29 @@
AC_SUBST(PYTHON_LDFLAGS)
fi
])
+
+# PYTHON_CHECK_MODULE
+#
+# Determines if a particular Python module can be imported
+#
+# $1 - module name
+# $2 - module description
+# $3 - action if found
+# $4 - action if not found
+
+AC_DEFUN([PYTHON_CHECK_MODULE],[
+ AC_MSG_CHECKING([for $2])
+ python_cmd='import sys
+try:
+ import $1
+except:
+ sys.exit(1)'
+
+ if ! $PYTHON -c "$python_cmd" ; then
+ AC_MSG_RESULT([no])
+ $4
+ else
+ AC_MSG_RESULT([yes])
+ $3
+ fi
+])
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwt.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwt.m4 2008-12-20
02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwt.m4 2008-12-20
02:40:37 UTC (rev 10138)
@@ -1,5 +1,5 @@
dnl
-dnl Copyright 2007 Free Software Foundation, Inc.
+dnl Copyright 2007,2008 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -29,12 +29,17 @@
AC_DEFUN([GR_QWT],
[
+ dnl QWT Library Version
+ QWT_LIBRARY1=-lqwt-qt4
+ QWT_LIBRARY2=-lqwt
+
dnl Save the environment
AC_LANG_PUSH(C++)
qwt_save_CPPFLAGS="$CPPFLAGS"
qwt_save_LIBS="$LIBS"
libqwt_ok=yes
+ dnl QWT Info
dnl Allow user to specify where QWT files are
AC_ARG_WITH([qwt-libdir],
[ --with-qwt-libdir=path Prefix where QWT library is
installed (optional)],
@@ -43,42 +48,90 @@
AC_ARG_WITH([qwt-incdir],
[ --with-qwt-incdir=path Prefix where QWT include files are
(optional)],
[qwt_incdir="$withval"], [qwt_incdir=""])
+ AC_ARG_WITH([qwt-lib],
+ [ --with-qwt-lib=library QWT library name (optional)],
+ [qwt_lib="$withval"], [qwt_lib=""])
- dnl Create QWT_CFLAGS based on user input
- AC_MSG_CHECKING(QWT_CFLAGS)
- if test "$qwt_incdir" != "" ; then
+ dnl Check for presence of header files
+ dnl if not user-specified, try the first include dir (Ubuntu), then
+ dnl try the second include dir (Fedora)
+ CPPFLAGS="$CPPFLAGS $QTCORE_CFLAGS"
+
+ dnl if not set by user
+ if test "$qwt_incdir" = "" ; then
+ dnl check qwt/qwt.h (as in Fedora)
+ AC_CHECK_HEADER(
+ [qwt/qwt.h],
+ [qwt_qwt_h=yes],
+ [qwt_qwt_h=no]
+ )
+ dnl If it was found, set the flags and move on
+ if test "$qwt_qwt_h" = "yes" ; then
+ QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt"
+ else
+ dnl otherwise, check qwt-qt4/qwt.h (as in Ubuntu)
+ AC_CHECK_HEADER(
+ [qwt-qt4/qwt.h],
+ [qwt_qt4_qwt_h=yes],
+ [qwt_qt4_qwt_h=no]
+ )
+ dnl if it was found, set the flags and move on
+ if test "$qwt_qt4_qwt_h" = "yes" ; then
+ QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt-qt4"
+ else
+ dnl otherwise, qwt.h wasn't found, so set the flag to no
+ libqwt_ok=no
+ fi
+ fi
+ else
+ dnl Using the user-specified include directory
QWT_CFLAGS="$QWT_CFLAGS -I$qwt_incdir"
+ AC_CHECK_HEADER(
+ [$qwt_incdir/qwt.h],
+ [],
+ [libqwt_ok=no])
fi
- AC_MSG_RESULT($QWT_CFLAGS)
-
- dnl Set CPPFLAGS so C++ tests can operate
- CPPFLAGS="$CPPFLAGS $QT_CFLAGS $QWT_CFLAGS"
- dnl Check for presence of header files
- AC_CHECK_HEADERS([qwt.h],
- [],
- [libqwt_ok=no;AC_MSG_RESULT([cannot find usable qwt
headers])]
- )
+ dnl Don't bother going on if we can't find the headers
+ if test "$libqwt_ok" = "yes" ; then
- dnl Set QWT_LIBS based on user input
- AC_MSG_CHECKING(QWT_LIBS)
- QWT_LIBS="$QWT_LIBS -lqwt"
- if test "$qwt_libdir" != "" ; then
- QWT_LIBS="-L$qwt_libdir $QWT_LIBS"
- fi
- AC_MSG_RESULT($QWT_LIBS)
+ dnl Check for QWT library (qwt or qwt-qt4)
- dnl Set LIBS so C++ link test can operate
- LIBS="$QWT_LIBS $QT_LIBS $LIBS"
+ dnl User-defined QWT library path
+ if test "$qwt_libdir" != "" ; then
+ QWT_LIBS="-L$qwt_libdir $QWT_LIBS"
+ fi
- dnl Check that library files can be linked in
- dnl This references an arbitrary static class method
- AC_TRY_LINK([#include <qwt_text.h>],
- [QwtTextEngine const *te =
QwtText::textEngine(QwtText::AutoText)],
- [],
- [libqwt_ok=no;AC_MSG_RESULT([unable to link QWT library])]
- )
+ dnl temporarily set these so the AC_CHECK_LIB works
+ CPPFLAGS="$CPPFLAGS $QWT_CFLAGS"
+ LIBS="$qwt_save_LIBS $QT_LIBS $QWT_LIBS -lqwt"
+ dnl If the user specified a qwt library name, use it here
+ if test "$qwt_lib" != "" ; then
+ AC_CHECK_LIB([$qwt_lib], [main], [libqwt_ok=yes], [libqwt_ok=no])
+
+ else
+ dnl Check for 'main' in libqwt (Fedora)
+ AC_CHECK_LIB([qwt], [main], [libqwt_ok=yes], [libqwt_ok=no])
+
+ dnl If library found properly, set the flag and move on
+ if test "$libqwt_ok" = "yes" ; then
+ QWT_LIBS="$QWT_LIBS -lqwt"
+ else
+ dnl Otherwise, check for 'main' in libqwt-qt4 (Ubuntu)
+ LIBS="$qwt_save_LIBS $QT_LIBS $QWT_LIBS -lqwt-qt4"
+ AC_CHECK_LIB([qwt-qt4], [main], [libqwt_ok=yes],
[libqwt_ok=no])
+ if test "$libqwt_ok" = "yes" ; then
+ QWT_LIBS="$QWT_LIBS -lqwt-qt4"
+ else
+ AC_MSG_RESULT([Could not link to libqwt.so])
+ fi
+ fi
+ fi
+ else
+ AC_MSG_RESULT([Could not find qwt headers])
+ fi
+
dnl Restore saved variables
LIBS="$qwt_save_LIBS"
CPPFLAGS="$qwt_save_CPPFLAGS"
Copied: gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwtplot3d.m4 (from
rev 10133, gnuradio/trunk/config/gr_qwtplot3d.m4)
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwtplot3d.m4
(rev 0)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/gr_qwtplot3d.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,151 @@
+dnl
+dnl Copyright 2008 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl
+
+dnl Configure paths for library qwtplot3d.
+dnl
+dnl GR_QWTPLOT3D([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+dnl Test for library qwtplot3d, set QWTPLOT3D_CFLAGS and QWTPLOT3D_LIBS if
found. Assumes
+dnl QT_CFLAGS and QT_LIBS have already been correctly set.
+dnl
+
+AC_DEFUN([GR_QWTPLOT3D],
+[
+ dnl QWTPLOT3D Library Version
+
+ dnl Save the environment
+ AC_LANG_PUSH(C++)
+ qwtplot3d_save_CPPFLAGS="$CPPFLAGS"
+ qwtplot3d_save_LIBS="$LIBS"
+ libqwtplot3d_ok=yes
+
+ dnl Allow user to specify where QWTPLOT3D files are
+ AC_ARG_WITH([qwtplot3d-libdir],
+ [ --with-qwtplot3d-libdir=path Prefix where QWTPLOT3D library
is installed (optional)],
+ [qwtplot3d_libdir="$withval"], [qwtplot3d_libdir=""])
+
+ AC_ARG_WITH([qwtplot3d-incdir],
+ [ --with-qwtplot3d-incdir=path Prefix where QWTPLOT3D include
files are (optional)],
+ [qwtplot3d_incdir="$withval"], [qwtplot3d_incdir=""])
+
+ AC_ARG_WITH([qwtplot3d-lib],
+ [ --with-qwtplot3d-lib=library QWT Plot3D library name
(optional)],
+ [qwtplot3d_lib="$withval"], [qwtplot3d_lib=""])
+
+
+ dnl Check for presence of header files
+ dnl if not user-specified, try the first include dir (Ubuntu), then
+ dnl try the second include dir (Fedora)
+ CPPFLAGS="$CPPFLAGS $QTCORE_CFLAGS $QTGUI_CFLAGS $QWT_CFLAGS"
+
+ dnl if not set by user
+ if test "$qwtplot3d_incdir" = "" ; then
+ dnl check qwtplot3d/qwtplot3d.h (as in Fedora)
+ AC_CHECK_HEADER(
+ [qwtplot3d/qwt3d_plot.h],
+ [qwtplot3d_qwtplot3d_h=yes],
+ [qwtplot3d_qwtplot3d_h=no]
+ )
+ dnl If it was found, set the flags and move on
+ if test "$qwtplot3d_qwtplot3d_h" = "yes" ; then
+ QWTPLOT3D_CFLAGS="$QWTPLOT3D_CFLAGS -I/usr/include/qwtplot3d"
+ else
+ dnl otherwise, check qwtplot3d-qt4/qwtplot3d.h (as in Ubuntu)
+ AC_CHECK_HEADER(
+ [qwtplot3d-qt4/qwt3d_plot.h],
+ [qwtplot3d_qt4_qwtplot3d_h=yes],
+ [qwtplot3d_qt4_qwtplot3d_h=no]
+ )
+ dnl if it was found, set the flags and move on
+ if test "$qwtplot3d_qt4_qwtplot3d_h" = "yes" ; then
+ QWTPLOT3D_CFLAGS="$QWTPLOT3D_CFLAGS
-I/usr/include/qwtplot3d-qt4"
+ else
+ dnl otherwise, qwtplot3d.h wasn't found, so set the flag to no
+ libqwtplot3d_ok=no
+ fi
+ fi
+ else
+ dnl Using the user-specified include directory
+ QWTPLOT3D_CFLAGS="$QWTPLOT3D_CFLAGS -I$qwtplot3d_incdir"
+ AC_CHECK_HEADER(
+ [$qwtplot3d_incdir/qwt3d_plot.h],
+ [],
+ [libqwtplot3d_ok=no])
+ fi
+
+ dnl Don't bother going on if we can't find the headers
+ if test "$libqwtplot3d_ok" = "yes" ; then
+
+ dnl Check for QWTPLOT3D library (qwtplot3d or qwtplot3d-qt4)
+
+ dnl User-defined QWTPLOT3D library path
+ if test "$qwtplot3d_libdir" != "" ; then
+ QWTPLOT3D_LIBS="-L$qwtplot3d_libdir $QWTPLOT3D_LIBS"
+ fi
+
+ dnl temporarily set these so the AC_CHECK_LIB works
+ CPPFLAGS="$CPPFLAGS $QWTPLOT3D_CFLAGS"
+ LIBS="$qwtplot3d_save_LIBS $QT_LIBS $QWTPLOT3D_LIBS -lqwtplot3d-qt4"
+
+ dnl If the user specified a qwtplot3d library name, use it here
+ if test "$qwtplot3d_lib" != "" ; then
+ AC_CHECK_LIB([$qwtplot3d_lib], [main], [libqwtplot3d_ok=yes],
[libqwtplot3d_ok=no])
+
+ else
+ dnl Check for 'main' in libqwtplot3d-qt4
+ AC_CHECK_LIB([qwtplot3d-qt4], [main], [libqwtplot3d_ok=yes],
[libqwtplot3d_ok=no])
+
+ dnl If library found properly, set the flag and move on
+ if test "$libqwtplot3d_ok" = "yes" ; then
+ QWTPLOT3D_LIBS="$QWTPLOT3D_LIBS -lqwtplot3d-qt4"
+ else
+ dnl Otherwise, check for 'main' in libqwtplot3d
+ LIBS="$qwtplot3d_save_LIBS $QT_LIBS $QWTPLOT3D_LIBS
-lqwtplot3d"
+ AC_CHECK_LIB([qwtplot3d], [main], [libqwtplot3d_ok=yes],
[libqwtplot3d_ok=no])
+ if test "$libqwtplot3d_ok" = "yes" ; then
+ QWTPLOT3D_LIBS="$QWTPLOT3D_LIBS -lqwtplot3d"
+ else
+ AC_MSG_RESULT([Could not link to libqwtplot3d.so])
+ fi
+ fi
+ fi
+ else
+ AC_MSG_RESULT([Could not find qwtplot3d headers])
+ fi
+
+ dnl Restore saved variables
+ LIBS="$qwtplot3d_save_LIBS"
+ CPPFLAGS="$qwtplot3d_save_CPPFLAGS"
+ AC_LANG_POP
+
+ dnl Execute user actions
+ if test "x$libqwtplot3d_ok" = "xyes" ; then
+ ifelse([$1], , :, [$1])
+ else
+ QWTPLOT3D_CFLAGS=""
+ QWTPLOT3D_LIBDIRS=""
+ ifelse([$2], , :, [$2])
+ fi
+
+ dnl Export our variables
+ AC_SUBST(QWTPLOT3D_CFLAGS)
+ AC_SUBST(QWTPLOT3D_LIBS)
+])
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_core.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_core.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_core.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -36,6 +36,15 @@
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, but don't complain if not found
+ ACX_CBLAS([],[])
+ dnl check for GSL
+ PKG_CHECK_MODULES(GSL, gsl >= 1.10,
+ [], dnl FIXME remove -lgslcblas from GSL_LIBS if we found a better
CBLAS_LIBS above
+ [passed=no;AC_MSG_RESULT([gnuradio-core requires package gsl, not
found.])])
+ fi
+
if test $passed != with; then
dnl how and where to find INCLUDES and LA and such
gnuradio_core_INCLUDES="\
@@ -46,13 +55,15 @@
-I\${abs_top_builddir}/gnuradio-core/src/lib/gengen \
-I\${abs_top_srcdir}/gnuradio-core/src/lib/filter \
-I\${abs_top_builddir}/gnuradio-core/src/lib/filter \
+-I\${abs_top_srcdir}/gnuradio-core/src/lib/missing \
-I\${abs_top_srcdir}/gnuradio-core/src/lib/reed-solomon \
-I\${abs_top_srcdir}/gnuradio-core/src/lib/viterbi \
-I\${abs_top_srcdir}/gnuradio-core/src/lib/io \
-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/n4hy/pfb_fbs/config/grc_gnuradio_examples.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_examples.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gnuradio_examples.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -41,6 +41,7 @@
gnuradio-examples/python/network/Makefile \
gnuradio-examples/python/ofdm/Makefile \
gnuradio-examples/python/usrp/Makefile \
+ gnuradio-examples/python/usrp2/Makefile \
])
GRC_BUILD_CONDITIONAL(gnuradio-examples)
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_audio_alsa.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_audio_alsa.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_audio_alsa.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -35,6 +35,7 @@
AC_CONFIG_FILES([ \
gr-audio-alsa/Makefile \
+ gr-audio-alsa/gr-audio-alsa.pc \
gr-audio-alsa/src/Makefile \
gr-audio-alsa/src/run_tests \
])
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_comedi.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_comedi.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_comedi.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -29,7 +29,7 @@
dnl no : otherwise
if test $passed = yes; then
dnl Don't do gr-comedi if the 'comedi' library is unavailable.
- PKG_CHECK_MODULES(COMEDI, comedilib >= 0.7,[],
+ PKG_CHECK_MODULES(COMEDI, comedilib < 0.8,[],
[passed=no;AC_MSG_RESULT([gr-comedi requires comedilib, not
found.])])
fi
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_msdd6000.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_msdd6000.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_msdd6000.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -32,6 +32,6 @@
GRC_BUILD_CONDITIONAL([gr-msdd6000],[
dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_msdd6000], [chmod +x
gr-msdd6000/src/run_tests])
+ dnl AC_CONFIG_COMMANDS([run_tests_msdd6000], [chmod +x
gr-msdd6000/src/run_tests])
])
])
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_qtgui.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_qtgui.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_qtgui.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -27,20 +27,68 @@
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
+
+
+# Check for:
+# QtOpenGL
+# QtGui
+# QtCore
+# qwt
+# qwtplot3d
+# qt4
+
+# qt4-core, qt4-gui, qwt5-qt4, qwt5-qt4-dev, libqwtplot3d-qt4,
libqwtplot3d-qt4-dev, qt4-dev-tools
+
if test $passed = yes; then
- dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
- PKG_CHECK_MODULES(QT, qt >= 3.3, [], [
- PKG_CHECK_MODULES(QT, qt-mt >= 3.3, [],
- [passed=no;AC_MSG_RESULT([gr-qtgui requires libqt or libqt-mt,
neither found.])])])
-
+ dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
+ PKG_CHECK_MODULES(QTCORE, QtCore >= 4.3.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore.])])
+ PKG_CHECK_MODULES(QTGUI, QtGui >= 4.3.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui.])])
+ PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.3.4, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL.])])
+
dnl Fetch QWT variables
GR_QWT([], [passed=no])
+
+ dnl Process QWT Plot3D only if QWT passed
+ if test "$passed" = "yes"; then
+ GR_QWTPLOT3D([], [passed=no])
+ fi
+
+ dnl Export the include dirs and libraries (note: QTOPENGL_LIBS includes
links
+ dnl to QtCore and QtGui libraries)
+ QT_INCLUDES="$QWT_CFLAGS $QWTPLOT3D_CFLAGS $QTCORE_CFLAGS $QTGUI_CFLAGS"
+ QT_LIBS="$QWT_LIBS $QWTPLOT3D_LIBS $QTOPENGL_LIBS"
+
+ dnl Build an includes variable specifically for running qmake by
extracting
+ dnl all includes from the QWT and QWTPLOT3D, without the -I;
+ dnl qmake appends the -I when processing the project file INCLUDEPATH
+ for i in $QWT_CFLAGS $QWTPLOT3D_CFLAGS; do
+ QMAKE_INCLUDES="$QMAKE_INCLUDES ${i##-I}"
+ done
+
+ QT_MOC_EXEC=`pkg-config --variable=moc_location QtCore`
+ QT_UIC_EXEC=`pkg-config --variable=uic_location QtCore`
+
+ AC_SUBST(QMAKE_INCLUDES)
+ AC_SUBST(QT_INCLUDES)
+ AC_SUBST(QT_LIBS)
+ AC_SUBST(QT_MOC_EXEC)
+ AC_SUBST(QT_UIC_EXEC)
fi
+ if test "$passed" = "no"; then
+ AM_CONDITIONAL(BUILD_QT, false)
+ else
+ AM_CONDITIONAL(BUILD_QT, true)
+ fi
+
AC_CONFIG_FILES([ \
gr-qtgui/Makefile \
gr-qtgui/src/Makefile \
gr-qtgui/src/lib/Makefile \
+ gr-qtgui/src/python/Makefile \
])
GRC_BUILD_CONDITIONAL(gr-qtgui)
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_wxgui.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_wxgui.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_gr_wxgui.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -29,14 +29,8 @@
dnl yes : if the --enable code passed muster and all dependencies are
met
dnl no : otherwise
if test $passed = yes; then
- if ! ${PYTHON} -c 'import wx'; then
- AC_MSG_RESULT([gr-wxgui requires wxPython, not found.])
- passed=no
- fi
- if ! ${PYTHON} -c 'import numpy'; then
- AC_MSG_RESULT([gr-wxgui requires numpy (Numeric Python), not
found.])
- passed=no
- fi
+ PYTHON_CHECK_MODULE([wx],[Python wxWidgets wrappers],[],[passed=no])
+ PYTHON_CHECK_MODULE([numpy],[Numeric Python extensions],[],[passed=no])
fi
AC_CONFIG_FILES([ \
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_grc.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_grc.m4 2008-12-20
02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_grc.m4 2008-12-20
02:40:37 UTC (rev 10138)
@@ -26,24 +26,37 @@
AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS)
dnl ########################################
+ dnl # test python version
+ dnl ########################################
+ AC_MSG_CHECKING([for Python version 2.5])
+ if test `${PYTHON} -c "import sys; print sys.version.split()[[0]] >=
'2.5'"` = 'True'; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ passed=no
+ fi
+
+ dnl ########################################
dnl # test python dependencies
dnl ########################################
if test $passed = yes; then
- if ! ${PYTHON} -c 'import Cheetah'; then
- AC_MSG_RESULT([grc requires the Python Cheetah templates
installed, not found.])
- passed=no
- fi
- if ! ${PYTHON} -c 'import pygtk'; then
- AC_MSG_RESULT([grc requires Python GTK wrappers installed, not
found.])
- passed=no
- fi
- if ! ${PYTHON} -c 'import lxml'; then
- AC_MSG_RESULT([grc requires libxml2 and libxslt wrappers (lxml),
not found.])
- passed=no
- fi
+ PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah
templates],[],[passed=no])
+ PYTHON_CHECK_MODULE([pygtk],[Python GTK wrappers],[],[passed=no])
+ PYTHON_CHECK_MODULE([lxml],[Python XML wrappers],[],[passed=no])
fi
dnl ########################################
+ dnl # test gtk version
+ dnl ########################################
+ AC_MSG_CHECKING([for GTK version >= 2.10.0])
+ if test `${PYTHON} -c "import gtk; print gtk.pygtk_version >= (2, 10, 0)"`
= 'True'; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ passed=no
+ fi
+
+ dnl ########################################
dnl # platform dependency pythonw
dnl ########################################
dnl FIXME: move this test to Python config m4
@@ -72,6 +85,7 @@
grc/examples/usrp/Makefile \
grc/examples/audio/Makefile \
grc/examples/simple/Makefile \
+ grc/examples/trellis/Makefile \
grc/Makefile \
grc/data/Makefile \
grc/data/platforms/Makefile \
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_usrp.m4
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_usrp.m4
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/config/grc_usrp.m4
2008-12-20 02:40:37 UTC (rev 10138)
@@ -61,7 +61,7 @@
-I\${abs_top_srcdir}/usrp/firmware/include"
usrp_LA="\${abs_top_builddir}/usrp/host/lib/legacy/libusrp.la"
usrp_inband_INCLUDES="-I\${abs_top_srcdir}/usrp/host/lib/inband"
-
usrp_inband_LA="\${abs_top_builddir}/usrp/host/lib/inband/libusrp_inband.la"
+
usrp_inband_LA="\${abs_top_builddir}/usrp/host/lib/inband/libusrp-inband.la"
fi
dnl Include the usrp-inband INCLUDES and LA
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/configure.ac
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/configure.ac 2008-12-20
02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/configure.ac 2008-12-20
02:40:37 UTC (rev 10138)
@@ -141,6 +141,7 @@
dnl Checks for library functions.
AC_FUNC_ALLOCA
+GR_CHECK_MEMALIGN
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([mmap select socket strcspn strerror strspn getpagesize
sysconf])
@@ -294,6 +295,7 @@
GRC_GR_TRELLIS
GRC_GR_VIDEO_SDL
GRC_GR_WXGUI
+GRC_GR_QTGUI
GRC_GR_SOUNDER dnl this must come after GRC_USRP
GRC_GR_UTILS dnl this must come after GRC_GR_WXGUI
GRC_GNURADIO_EXAMPLES dnl must come after all GRC_GR_*
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/c++/dial_tone/Makefile.am
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/c++/dial_tone/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/c++/dial_tone/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -26,7 +26,7 @@
-I$(top_srcdir)/gr-audio-alsa/src \
$(WITH_INCLUDES)
-GR_AUDIO_ALSA_LA=$(top_builddir)/gr-audio-alsa/src/libgr_audio_alsa.la
+GR_AUDIO_ALSA_LA=$(top_builddir)/gr-audio-alsa/src/libgnuradio-audio-alsa.la
# For compiling outside the tree, these will get fished out by pkgconfig
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/Makefile.am
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -33,7 +33,8 @@
multi_usrp \
network \
ofdm \
- usrp
+ usrp \
+ usrp2
# Make example scripts with #! executable
install-data-local:
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/receive_path.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/receive_path.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/receive_path.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -42,6 +42,7 @@
options = copy.copy(options) # make a copy so we can destructively
modify
+ self._which = options.which # the USRP board
attached
self._verbose = options.verbose
self._rx_freq = options.rx_freq # receiver's center
frequency
self._rx_gain = options.rx_gain # receiver's gain
@@ -124,7 +125,8 @@
self.connect(self.u, self.chan_filt, self.packet_receiver)
def _setup_usrp_source(self):
- self.u = usrp.source_c (fusb_block_size=self._fusb_block_size,
+ self.u = usrp.source_c (self._which,
+ fusb_block_size=self._fusb_block_size,
fusb_nblocks=self._fusb_nblocks)
adc_rate = self.u.adc_rate()
@@ -213,6 +215,8 @@
if not normal.has_option("--bitrate"):
normal.add_option("-r", "--bitrate", type="eng_float",
default=None,
help="specify bitrate. samples-per-symbol and
interp/decim will be derived.")
+ normal.add_option("-w", "--which", type="int", default=0,
+ help="select USRP board [default=%default]")
normal.add_option("-R", "--rx-subdev-spec", type="subdev",
default=None,
help="select USRP Rx side A or B")
normal.add_option("", "--rx-gain", type="eng_float", default=None,
metavar="GAIN",
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/transmit_path.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/transmit_path.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/digital/transmit_path.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -44,6 +44,7 @@
options = copy.copy(options) # make a copy so we can destructively
modify
+ self._which = options.which # the USRP board
attached
self._verbose = options.verbose
self._tx_freq = options.tx_freq # tranmitter's
center frequency
self._tx_amplitude = options.tx_amplitude # digital amplitude
sent to USRP
@@ -109,7 +110,8 @@
Creates a USRP sink, determines the settings for best bitrate,
and attaches to the transmitter's subdevice.
"""
- self.u = usrp.sink_c(fusb_block_size=self._fusb_block_size,
+ self.u = usrp.sink_c(self._which,
+ fusb_block_size=self._fusb_block_size,
fusb_nblocks=self._fusb_nblocks)
dac_rate = self.u.dac_rate();
@@ -189,6 +191,8 @@
if not normal.has_option('--bitrate'):
normal.add_option("-r", "--bitrate", type="eng_float",
default=None,
help="specify bitrate. samples-per-symbol and
interp/decim will be derived.")
+ normal.add_option("-w", "--which", type="int", default=0,
+ help="select USRP board [default=%default]")
normal.add_option("-T", "--tx-subdev-spec", type="subdev",
default=None,
help="select USRP Tx side A or B")
normal.add_option("", "--tx-amplitude", type="eng_float",
default=12000, metavar="AMPL",
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2 (from
rev 10133, gnuradio/trunk/gnuradio-examples/python/usrp2)
Property changes on:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2
___________________________________________________________________
Name: svn:ignore
+ Makefile
Makefile.in
Deleted:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
(from rev 10133, gnuradio/trunk/gnuradio-examples/python/usrp2/Makefile.am)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,28 @@
+#
+# Copyright 2004,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.
+#
+
+include $(top_srcdir)/Makefile.common
+
+EXTRA_DIST = \
+ usrp2_wfm_rcv.py
+
+ourdatadir = $(exampledir)/usrp2
+ourdata_DATA = $(EXTRA_DIST)
Deleted:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
(from rev 10133,
gnuradio/trunk/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,275 @@
+#!/usr/bin/env python
+#
+# Copyright 2005,2006,2007,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.
+#
+
+from gnuradio import gr, gru, eng_notation, optfir
+from gnuradio import audio
+from gnuradio import usrp2
+from gnuradio import blks2
+from gnuradio.eng_option import eng_option
+from gnuradio.wxgui import slider, powermate
+from gnuradio.wxgui import stdgui2, fftsink2, form
+from optparse import OptionParser
+import sys
+import math
+import wx
+
+class wfm_rx_block (stdgui2.std_top_block):
+ def __init__(self,frame,panel,vbox,argv):
+ stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
+
+ parser = OptionParser(option_class=eng_option)
+ parser.add_option("-e", "--interface", type="string", default="eth0",
+ help="select Ethernet interface, default is eth0")
+ parser.add_option("-m", "--mac-addr", type="string", default="",
+ help="select USRP by MAC address, default is
auto-select")
+ #parser.add_option("-A", "--antenna", default=None,
+ # help="select Rx Antenna (only on RFX-series
boards)")
+ parser.add_option("-f", "--freq", type="eng_float", default=100.1,
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
+ parser.add_option("-V", "--volume", type="eng_float", default=None,
+ help="set volume (default is midpoint)")
+ parser.add_option("-O", "--audio-output", type="string", default="",
+ help="pcm device name. E.g., hw:0,0 or surround51
or /dev/dsp")
+
+ (options, args) = parser.parse_args()
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ self.frame = frame
+ self.panel = panel
+
+ self.vol = 0
+ self.state = "FREQ"
+ self.freq = 0
+
+ # build graph
+
+ self.u = usrp2.source_32fc(options.interface, options.mac_addr)
+
+ adc_rate = self.u.adc_rate() # 100 MS/s
+ usrp_decim = 312
+ self.u.set_decim(usrp_decim)
+ usrp_rate = adc_rate / usrp_decim # ~320 kS/s
+ chanfilt_decim = 1
+ demod_rate = usrp_rate / chanfilt_decim
+ audio_decimation = 10
+ audio_rate = demod_rate / audio_decimation # ~32 kHz
+
+ print "Using RX d'board 0x%04X" % (self.u.daughterboard_id(),)
+
+ chan_filt_coeffs = optfir.low_pass (1, # gain
+ usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ #print len(chan_filt_coeffs)
+ chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+
+ self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
+
+ self.volume_control = gr.multiply_const_ff(self.vol)
+
+ # sound card as final sink
+ audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
+
+ # now wire it all together
+ self.connect (self.u, chan_filt, self.guts, self.volume_control,
audio_sink)
+
+ self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
+
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.gain_range()
+ options.gain = float(g[0]+g[1])/2
+
+ if options.volume is None:
+ g = self.volume_range()
+ options.volume = float(g[0]+g[1])/2
+
+ if abs(options.freq) < 1e6:
+ options.freq *= 1e6
+
+ # set initial values
+
+ self.set_gain(options.gain)
+ self.set_vol(options.volume)
+ if not(self.set_freq(options.freq)):
+ self._set_status_msg("Failed to set initial frequency")
+
+
+ def _set_status_msg(self, msg, which=0):
+ self.frame.GetStatusBar().SetStatusText(msg, which)
+
+
+ def _build_gui(self, vbox, usrp_rate, demod_rate, audio_rate):
+
+ def _form_set_freq(kv):
+ return self.set_freq(kv['freq'])
+
+
+ if 1:
+ self.src_fft = fftsink2.fft_sink_c(self.panel, title="Data from
USRP2",
+ fft_size=512,
sample_rate=usrp_rate,
+ ref_scale=1.0, ref_level=0,
y_divs=12)
+ self.connect (self.u, self.src_fft)
+ vbox.Add (self.src_fft.win, 4, wx.EXPAND)
+
+ if 1:
+ post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post
Demod",
+ fft_size=1024,
sample_rate=usrp_rate,
+ y_per_div=10, ref_level=0)
+ self.connect (self.guts.fm_demod, post_filt_fft)
+ vbox.Add (post_filt_fft.win, 4, wx.EXPAND)
+
+ if 0:
+ post_deemph_fft = fftsink2.fft_sink_f(self.panel, title="Post
Deemph",
+ fft_size=512,
sample_rate=audio_rate,
+ y_per_div=10, ref_level=-20)
+ self.connect (self.guts.deemph, post_deemph_fft)
+ vbox.Add (post_deemph_fft.win, 4, wx.EXPAND)
+
+
+ # control area form at bottom
+ self.myform = myform = form.form()
+
+ hbox = wx.BoxSizer(wx.HORIZONTAL)
+ hbox.Add((5,0), 0)
+ myform['freq'] = form.float_field(
+ parent=self.panel, sizer=hbox, label="Freq", weight=1,
+ callback=myform.check_input_and_call(_form_set_freq,
self._set_status_msg))
+
+ hbox.Add((5,0), 0)
+ myform['freq_slider'] = \
+ form.quantized_slider_field(parent=self.panel, sizer=hbox,
weight=3,
+ range=(87.9e6, 108.1e6, 0.1e6),
+ callback=self.set_freq)
+ hbox.Add((5,0), 0)
+ vbox.Add(hbox, 0, wx.EXPAND)
+
+ hbox = wx.BoxSizer(wx.HORIZONTAL)
+ hbox.Add((5,0), 0)
+
+ myform['volume'] = \
+ form.quantized_slider_field(parent=self.panel, sizer=hbox,
label="Volume",
+ weight=3, range=self.volume_range(),
+ callback=self.set_vol)
+ hbox.Add((5,0), 1)
+
+ myform['gain'] = \
+ form.quantized_slider_field(parent=self.panel, sizer=hbox,
label="Gain",
+ weight=3, range=self.u.gain_range(),
+ callback=self.set_gain)
+ hbox.Add((5,0), 0)
+ vbox.Add(hbox, 0, wx.EXPAND)
+
+ try:
+ self.knob = powermate.powermate(self.frame)
+ self.rot = 0
+ powermate.EVT_POWERMATE_ROTATE (self.frame, self.on_rotate)
+ powermate.EVT_POWERMATE_BUTTON (self.frame, self.on_button)
+ except:
+ pass
+ #print "FYI: No Powermate or Contour Knob found"
+
+
+ def on_rotate (self, event):
+ self.rot += event.delta
+ if (self.state == "FREQ"):
+ if self.rot >= 3:
+ self.set_freq(self.freq + .1e6)
+ self.rot -= 3
+ elif self.rot <=-3:
+ self.set_freq(self.freq - .1e6)
+ self.rot += 3
+ else:
+ step = self.volume_range()[2]
+ if self.rot >= 3:
+ self.set_vol(self.vol + step)
+ self.rot -= 3
+ elif self.rot <=-3:
+ self.set_vol(self.vol - step)
+ self.rot += 3
+
+ def on_button (self, event):
+ if event.value == 0: # button up
+ return
+ self.rot = 0
+ if self.state == "FREQ":
+ self.state = "VOL"
+ else:
+ self.state = "FREQ"
+ self.update_status_bar ()
+
+
+ def set_vol (self, vol):
+ g = self.volume_range()
+ self.vol = max(g[0], min(g[1], vol))
+ self.volume_control.set_k(10**(self.vol/10))
+ self.myform['volume'].set_value(self.vol)
+ self.update_status_bar ()
+
+ def set_freq(self, target_freq):
+ """
+ Set the center frequency we're interested in.
+
+ @param target_freq: frequency in Hz
+ @rypte: bool
+
+ Tuning is a two step process. First we ask the front-end to
+ tune as close to the desired frequency as it can. Then we use
+ the result of that operation and our target_frequency to
+ determine the value for the digital down converter.
+ """
+ r = self.u.set_center_freq(target_freq)
+ if r:
+ self.freq = target_freq
+ self.myform['freq'].set_value(target_freq) # update
displayed value
+ self.myform['freq_slider'].set_value(target_freq) # update
displayed value
+ self.update_status_bar()
+ self._set_status_msg("OK", 0)
+ return True
+
+ self._set_status_msg("Failed", 0)
+ return False
+
+ def set_gain(self, gain):
+ self.myform['gain'].set_value(gain) # update displayed value
+ self.u.set_gain(gain)
+
+ def update_status_bar (self):
+ msg = "Volume:%r Setting:%s" % (self.vol, self.state)
+ self._set_status_msg(msg, 1)
+ self.src_fft.set_baseband_freq(self.freq)
+
+ def volume_range(self):
+ return (-20.0, 0.0, 0.5)
+
+
+if __name__ == '__main__':
+ app = stdgui2.stdapp (wfm_rx_block, "USRP2 WFM RX")
+ app.MainLoop ()
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -21,12 +21,14 @@
include $(top_srcdir)/Makefile.common
-EXTRA_DIST = gr-audio-alsa.conf
+EXTRA_DIST = \
+ gr-audio-alsa.conf \
+ gr-audio-alsa.pc.in
SUBDIRS = src
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA =
+pkgconfig_DATA = gr-audio-alsa.pc
etcdir = $(sysconfdir)/gnuradio/conf.d
etc_DATA = gr-audio-alsa.conf
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/gr-audio-alsa.pc.in
(from rev 10133, gnuradio/trunk/gr-audio-alsa/gr-audio-alsa.pc.in)
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/gr-audio-alsa.pc.in
(rev 0)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/gr-audio-alsa.pc.in
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,11 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: gnuradio-audio-alsa
+Description: The GNU Radio block for the ALSA sound system
+Requires: gnuradio-core
+Version: @VERSION@
+Libs: -L${libdir} -lgnuradio-audio-alsa
+Cflags: -I${includedir}
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/src/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/src/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-audio-alsa/src/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -56,12 +56,12 @@
ourlib_LTLIBRARIES = _audio_alsa.la
-lib_LTLIBRARIES = libgr_audio_alsa.la
+lib_LTLIBRARIES = libgnuradio-audio-alsa.la
_audio_alsa_la_SOURCES = \
audio_alsa.cc
-libgr_audio_alsa_la_SOURCES = \
+libgnuradio_audio_alsa_la_SOURCES = \
audio_alsa_sink.cc \
audio_alsa_source.cc \
gri_alsa.cc
@@ -80,15 +80,15 @@
$(PYTHON_LDFLAGS) \
$(GNURADIO_CORE_LA) \
$(ALSA_LIBS) \
- libgr_audio_alsa.la \
+ libgnuradio-audio-alsa.la \
-lstdc++
-libgr_audio_alsa_la_LIBADD = \
+libgnuradio_audio_alsa_la_LIBADD = \
$(ALSA_LIBS)
_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-libgr_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED)
+libgnuradio_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED)
_audio_alsa_la_CXXFLAGS = @swig_CXXFLAGS@
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_16_16.fsm
(from rev 10133,
gnuradio/trunk/gr-trellis/src/examples/fsm_files/joint_16_16.fsm)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_16_16.fsm
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_16_16.fsm
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,523 @@
+4 256 16
+
+0 8 128 136
+0 8 128 136
+1 9 129 137
+1 9 129 137
+2 10 130 138
+2 10 130 138
+3 11 131 139
+3 11 131 139
+4 12 132 140
+4 12 132 140
+5 13 133 141
+5 13 133 141
+6 14 134 142
+6 14 134 142
+7 15 135 143
+7 15 135 143
+0 8 128 136
+0 8 128 136
+1 9 129 137
+1 9 129 137
+2 10 130 138
+2 10 130 138
+3 11 131 139
+3 11 131 139
+4 12 132 140
+4 12 132 140
+5 13 133 141
+5 13 133 141
+6 14 134 142
+6 14 134 142
+7 15 135 143
+7 15 135 143
+16 24 144 152
+16 24 144 152
+17 25 145 153
+17 25 145 153
+18 26 146 154
+18 26 146 154
+19 27 147 155
+19 27 147 155
+20 28 148 156
+20 28 148 156
+21 29 149 157
+21 29 149 157
+22 30 150 158
+22 30 150 158
+23 31 151 159
+23 31 151 159
+16 24 144 152
+16 24 144 152
+17 25 145 153
+17 25 145 153
+18 26 146 154
+18 26 146 154
+19 27 147 155
+19 27 147 155
+20 28 148 156
+20 28 148 156
+21 29 149 157
+21 29 149 157
+22 30 150 158
+22 30 150 158
+23 31 151 159
+23 31 151 159
+32 40 160 168
+32 40 160 168
+33 41 161 169
+33 41 161 169
+34 42 162 170
+34 42 162 170
+35 43 163 171
+35 43 163 171
+36 44 164 172
+36 44 164 172
+37 45 165 173
+37 45 165 173
+38 46 166 174
+38 46 166 174
+39 47 167 175
+39 47 167 175
+32 40 160 168
+32 40 160 168
+33 41 161 169
+33 41 161 169
+34 42 162 170
+34 42 162 170
+35 43 163 171
+35 43 163 171
+36 44 164 172
+36 44 164 172
+37 45 165 173
+37 45 165 173
+38 46 166 174
+38 46 166 174
+39 47 167 175
+39 47 167 175
+48 56 176 184
+48 56 176 184
+49 57 177 185
+49 57 177 185
+50 58 178 186
+50 58 178 186
+51 59 179 187
+51 59 179 187
+52 60 180 188
+52 60 180 188
+53 61 181 189
+53 61 181 189
+54 62 182 190
+54 62 182 190
+55 63 183 191
+55 63 183 191
+48 56 176 184
+48 56 176 184
+49 57 177 185
+49 57 177 185
+50 58 178 186
+50 58 178 186
+51 59 179 187
+51 59 179 187
+52 60 180 188
+52 60 180 188
+53 61 181 189
+53 61 181 189
+54 62 182 190
+54 62 182 190
+55 63 183 191
+55 63 183 191
+64 72 192 200
+64 72 192 200
+65 73 193 201
+65 73 193 201
+66 74 194 202
+66 74 194 202
+67 75 195 203
+67 75 195 203
+68 76 196 204
+68 76 196 204
+69 77 197 205
+69 77 197 205
+70 78 198 206
+70 78 198 206
+71 79 199 207
+71 79 199 207
+64 72 192 200
+64 72 192 200
+65 73 193 201
+65 73 193 201
+66 74 194 202
+66 74 194 202
+67 75 195 203
+67 75 195 203
+68 76 196 204
+68 76 196 204
+69 77 197 205
+69 77 197 205
+70 78 198 206
+70 78 198 206
+71 79 199 207
+71 79 199 207
+80 88 208 216
+80 88 208 216
+81 89 209 217
+81 89 209 217
+82 90 210 218
+82 90 210 218
+83 91 211 219
+83 91 211 219
+84 92 212 220
+84 92 212 220
+85 93 213 221
+85 93 213 221
+86 94 214 222
+86 94 214 222
+87 95 215 223
+87 95 215 223
+80 88 208 216
+80 88 208 216
+81 89 209 217
+81 89 209 217
+82 90 210 218
+82 90 210 218
+83 91 211 219
+83 91 211 219
+84 92 212 220
+84 92 212 220
+85 93 213 221
+85 93 213 221
+86 94 214 222
+86 94 214 222
+87 95 215 223
+87 95 215 223
+96 104 224 232
+96 104 224 232
+97 105 225 233
+97 105 225 233
+98 106 226 234
+98 106 226 234
+99 107 227 235
+99 107 227 235
+100 108 228 236
+100 108 228 236
+101 109 229 237
+101 109 229 237
+102 110 230 238
+102 110 230 238
+103 111 231 239
+103 111 231 239
+96 104 224 232
+96 104 224 232
+97 105 225 233
+97 105 225 233
+98 106 226 234
+98 106 226 234
+99 107 227 235
+99 107 227 235
+100 108 228 236
+100 108 228 236
+101 109 229 237
+101 109 229 237
+102 110 230 238
+102 110 230 238
+103 111 231 239
+103 111 231 239
+112 120 240 248
+112 120 240 248
+113 121 241 249
+113 121 241 249
+114 122 242 250
+114 122 242 250
+115 123 243 251
+115 123 243 251
+116 124 244 252
+116 124 244 252
+117 125 245 253
+117 125 245 253
+118 126 246 254
+118 126 246 254
+119 127 247 255
+119 127 247 255
+112 120 240 248
+112 120 240 248
+113 121 241 249
+113 121 241 249
+114 122 242 250
+114 122 242 250
+115 123 243 251
+115 123 243 251
+116 124 244 252
+116 124 244 252
+117 125 245 253
+117 125 245 253
+118 126 246 254
+118 126 246 254
+119 127 247 255
+119 127 247 255
+
+0 3 12 15
+3 0 15 12
+1 2 13 14
+2 1 14 13
+1 2 13 14
+2 1 14 13
+0 3 12 15
+3 0 15 12
+2 1 14 13
+1 2 13 14
+3 0 15 12
+0 3 12 15
+3 0 15 12
+0 3 12 15
+2 1 14 13
+1 2 13 14
+12 15 0 3
+15 12 3 0
+13 14 1 2
+14 13 2 1
+13 14 1 2
+14 13 2 1
+12 15 0 3
+15 12 3 0
+14 13 2 1
+13 14 1 2
+15 12 3 0
+12 15 0 3
+15 12 3 0
+12 15 0 3
+14 13 2 1
+13 14 1 2
+4 7 8 11
+7 4 11 8
+5 6 9 10
+6 5 10 9
+5 6 9 10
+6 5 10 9
+4 7 8 11
+7 4 11 8
+6 5 10 9
+5 6 9 10
+7 4 11 8
+4 7 8 11
+7 4 11 8
+4 7 8 11
+6 5 10 9
+5 6 9 10
+8 11 4 7
+11 8 7 4
+9 10 5 6
+10 9 6 5
+9 10 5 6
+10 9 6 5
+8 11 4 7
+11 8 7 4
+10 9 6 5
+9 10 5 6
+11 8 7 4
+8 11 4 7
+11 8 7 4
+8 11 4 7
+10 9 6 5
+9 10 5 6
+4 7 8 11
+7 4 11 8
+5 6 9 10
+6 5 10 9
+5 6 9 10
+6 5 10 9
+4 7 8 11
+7 4 11 8
+6 5 10 9
+5 6 9 10
+7 4 11 8
+4 7 8 11
+7 4 11 8
+4 7 8 11
+6 5 10 9
+5 6 9 10
+8 11 4 7
+11 8 7 4
+9 10 5 6
+10 9 6 5
+9 10 5 6
+10 9 6 5
+8 11 4 7
+11 8 7 4
+10 9 6 5
+9 10 5 6
+11 8 7 4
+8 11 4 7
+11 8 7 4
+8 11 4 7
+10 9 6 5
+9 10 5 6
+0 3 12 15
+3 0 15 12
+1 2 13 14
+2 1 14 13
+1 2 13 14
+2 1 14 13
+0 3 12 15
+3 0 15 12
+2 1 14 13
+1 2 13 14
+3 0 15 12
+0 3 12 15
+3 0 15 12
+0 3 12 15
+2 1 14 13
+1 2 13 14
+12 15 0 3
+15 12 3 0
+13 14 1 2
+14 13 2 1
+13 14 1 2
+14 13 2 1
+12 15 0 3
+15 12 3 0
+14 13 2 1
+13 14 1 2
+15 12 3 0
+12 15 0 3
+15 12 3 0
+12 15 0 3
+14 13 2 1
+13 14 1 2
+8 11 4 7
+11 8 7 4
+9 10 5 6
+10 9 6 5
+9 10 5 6
+10 9 6 5
+8 11 4 7
+11 8 7 4
+10 9 6 5
+9 10 5 6
+11 8 7 4
+8 11 4 7
+11 8 7 4
+8 11 4 7
+10 9 6 5
+9 10 5 6
+4 7 8 11
+7 4 11 8
+5 6 9 10
+6 5 10 9
+5 6 9 10
+6 5 10 9
+4 7 8 11
+7 4 11 8
+6 5 10 9
+5 6 9 10
+7 4 11 8
+4 7 8 11
+7 4 11 8
+4 7 8 11
+6 5 10 9
+5 6 9 10
+12 15 0 3
+15 12 3 0
+13 14 1 2
+14 13 2 1
+13 14 1 2
+14 13 2 1
+12 15 0 3
+15 12 3 0
+14 13 2 1
+13 14 1 2
+15 12 3 0
+12 15 0 3
+15 12 3 0
+12 15 0 3
+14 13 2 1
+13 14 1 2
+0 3 12 15
+3 0 15 12
+1 2 13 14
+2 1 14 13
+1 2 13 14
+2 1 14 13
+0 3 12 15
+3 0 15 12
+2 1 14 13
+1 2 13 14
+3 0 15 12
+0 3 12 15
+3 0 15 12
+0 3 12 15
+2 1 14 13
+1 2 13 14
+12 15 0 3
+15 12 3 0
+13 14 1 2
+14 13 2 1
+13 14 1 2
+14 13 2 1
+12 15 0 3
+15 12 3 0
+14 13 2 1
+13 14 1 2
+15 12 3 0
+12 15 0 3
+15 12 3 0
+12 15 0 3
+14 13 2 1
+13 14 1 2
+0 3 12 15
+3 0 15 12
+1 2 13 14
+2 1 14 13
+1 2 13 14
+2 1 14 13
+0 3 12 15
+3 0 15 12
+2 1 14 13
+1 2 13 14
+3 0 15 12
+0 3 12 15
+3 0 15 12
+0 3 12 15
+2 1 14 13
+1 2 13 14
+8 11 4 7
+11 8 7 4
+9 10 5 6
+10 9 6 5
+9 10 5 6
+10 9 6 5
+8 11 4 7
+11 8 7 4
+10 9 6 5
+9 10 5 6
+11 8 7 4
+8 11 4 7
+11 8 7 4
+8 11 4 7
+10 9 6 5
+9 10 5 6
+4 7 8 11
+7 4 11 8
+5 6 9 10
+6 5 10 9
+5 6 9 10
+6 5 10 9
+4 7 8 11
+7 4 11 8
+6 5 10 9
+5 6 9 10
+7 4 11 8
+4 7 8 11
+7 4 11 8
+4 7 8 11
+6 5 10 9
+5 6 9 10
+
+This is the joint trellis of two trellises described in awgn1o2_16.fsm
+It is useful for application of joint decoding...
+It can be generated in python as follows:
+> import trellis
+> f1=trellis.fsm('awgn1o2_16.fsm')
+> f=trellis.fsm(f1,f1)
+> f.write_fsm_txt('joint_16_16.fsm')
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_4_16.fsm
(from rev 10133,
gnuradio/trunk/gr-trellis/src/examples/fsm_files/joint_4_16.fsm)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_4_16.fsm
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/joint_4_16.fsm
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,141 @@
+4 64 16
+
+0 8 32 40
+0 8 32 40
+1 9 33 41
+1 9 33 41
+2 10 34 42
+2 10 34 42
+3 11 35 43
+3 11 35 43
+4 12 36 44
+4 12 36 44
+5 13 37 45
+5 13 37 45
+6 14 38 46
+6 14 38 46
+7 15 39 47
+7 15 39 47
+0 8 32 40
+0 8 32 40
+1 9 33 41
+1 9 33 41
+2 10 34 42
+2 10 34 42
+3 11 35 43
+3 11 35 43
+4 12 36 44
+4 12 36 44
+5 13 37 45
+5 13 37 45
+6 14 38 46
+6 14 38 46
+7 15 39 47
+7 15 39 47
+16 24 48 56
+16 24 48 56
+17 25 49 57
+17 25 49 57
+18 26 50 58
+18 26 50 58
+19 27 51 59
+19 27 51 59
+20 28 52 60
+20 28 52 60
+21 29 53 61
+21 29 53 61
+22 30 54 62
+22 30 54 62
+23 31 55 63
+23 31 55 63
+16 24 48 56
+16 24 48 56
+17 25 49 57
+17 25 49 57
+18 26 50 58
+18 26 50 58
+19 27 51 59
+19 27 51 59
+20 28 52 60
+20 28 52 60
+21 29 53 61
+21 29 53 61
+22 30 54 62
+22 30 54 62
+23 31 55 63
+23 31 55 63
+
+0 3 12 15
+3 0 15 12
+1 2 13 14
+2 1 14 13
+1 2 13 14
+2 1 14 13
+0 3 12 15
+3 0 15 12
+2 1 14 13
+1 2 13 14
+3 0 15 12
+0 3 12 15
+3 0 15 12
+0 3 12 15
+2 1 14 13
+1 2 13 14
+12 15 0 3
+15 12 3 0
+13 14 1 2
+14 13 2 1
+13 14 1 2
+14 13 2 1
+12 15 0 3
+15 12 3 0
+14 13 2 1
+13 14 1 2
+15 12 3 0
+12 15 0 3
+15 12 3 0
+12 15 0 3
+14 13 2 1
+13 14 1 2
+4 7 8 11
+7 4 11 8
+5 6 9 10
+6 5 10 9
+5 6 9 10
+6 5 10 9
+4 7 8 11
+7 4 11 8
+6 5 10 9
+5 6 9 10
+7 4 11 8
+4 7 8 11
+7 4 11 8
+4 7 8 11
+6 5 10 9
+5 6 9 10
+8 11 4 7
+11 8 7 4
+9 10 5 6
+10 9 6 5
+9 10 5 6
+10 9 6 5
+8 11 4 7
+11 8 7 4
+10 9 6 5
+9 10 5 6
+11 8 7 4
+8 11 4 7
+11 8 7 4
+8 11 4 7
+10 9 6 5
+9 10 5 6
+
+This is the joint trellis of two trellises described in awgn1o2_4.fsm and
awgn1o2_16.fsm
+It is useful for application of joint decoding...
+It can be generated in python as follows:
+> import trellis
+> f1=trellis.fsm('awgn1o2_4.fsm')
+> f2=trellis.fsm('awgn1o2_16.fsm')
+> f=trellis.fsm(f1,f2)
+> f.write_fsm_txt('joint_4_16.fsm')
+
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/rep5.fsm
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/rep5.fsm
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/rep5.fsm
2008-12-20 02:40:37 UTC (rev 10138)
@@ -1,7 +1,7 @@
-2 1 8
+2 1 32
0 0
-0 7
+0 31
-1/3 repetiotion code
+1/5 repetition code
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/simple.fsm
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/simple.fsm
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/examples/fsm_files/simple.fsm
2008-12-20 02:40:37 UTC (rev 10138)
@@ -10,4 +10,4 @@
0
0
-essentially this fsm has no inputs and no outputs; it ijust cycles through all
4 states.
+essentially this fsm has no inputs and no outputs; it just cycles through all
4 states.
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -240,6 +240,35 @@
//######################################################################
+//# Automatically generate an FSM specification describing the
+//# the joint trellis of fsm1 and fsm2
+//######################################################################
+fsm::fsm(const fsm &FSM1, const fsm &FSM2)
+{
+ d_I=FSM1.I()*FSM2.I();
+ d_S=FSM1.S()*FSM2.S();
+ d_O=FSM1.O()*FSM2.O();
+
+ d_NS.resize(d_I*d_S);
+ d_OS.resize(d_I*d_S);
+
+ for(int s=0;s<d_S;s++) {
+ for(int i=0;i<d_I;i++) {
+ int s1=s/FSM2.S();
+ int s2=s%FSM2.S();
+ int i1=i/FSM2.I();
+ int i2=i%FSM2.I();
+ d_NS[s*d_I+i] = FSM1.NS()[s1 * FSM1.I() + i1] * FSM2.S() + FSM2.NS()[s2
* FSM2.I() + i2];
+ d_OS[s*d_I+i] = FSM1.OS()[s1 * FSM1.I() + i1] * FSM2.O() + FSM2.OS()[s2
* FSM2.I() + i2];
+ }
+ }
+
+ generate_PS_PI();
+ generate_TM();
+}
+
+
+//######################################################################
//# generate the PS and PI tables for later use
//######################################################################
void fsm::generate_PS_PI()
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.h
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.h
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.h
2008-12-20 02:40:37 UTC (rev 10138)
@@ -50,6 +50,7 @@
fsm(const char *name);
fsm(int k, int n, const std::vector<int> &G);
fsm(int mod_size, int ch_length);
+ fsm(const fsm &FSM1, const fsm &FSM2);
int I () const { return d_I; }
int S () const { return d_S; }
int O () const { return d_O; }
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.i
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.i
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/fsm.i
2008-12-20 02:40:37 UTC (rev 10138)
@@ -40,6 +40,7 @@
fsm(const char *name);
fsm(int k, int n, const std::vector<int> &G);
fsm(int mod_size, int ch_length);
+ fsm(const fsm &FSM1, const fsm &FSM2);
int I () const { return d_I; }
int S () const { return d_S; }
int O () const { return d_O; }
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.cc.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.cc.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.cc.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -54,9 +54,12 @@
set_output_multiple ((int)d_O);
}
+void @NAME@::set_TABLE (const std::vector<@I_TYPE@> &table)
+{
+ d_TABLE = table;
+}
-
void
@NAME@::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.h.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.h.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.h.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -53,6 +53,7 @@
int D () const { return d_D; }
trellis_metric_type_t TYPE () const { return d_TYPE; }
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
+ void set_TABLE (const std::vector<@I_TYPE@> &table);
void forecast (int noutput_items,
gr_vector_int &ninput_items_required);
int general_work (int noutput_items,
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.i.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.i.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_metrics_X.i.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -35,5 +35,6 @@
int O () const { return d_O; }
int D () const { return d_D; }
trellis_metric_type_t TYPE () const { return d_TYPE; }
+ void set_TABLE (const std::vector<@I_TYPE@> &table);
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
};
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.cc.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -71,6 +71,11 @@
}
+void @NAME@::set_TABLE(const std::vector<@I_TYPE@> &table)
+{
+ d_TABLE = table;
+}
+
void
@NAME@::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.h.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -82,6 +82,7 @@
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
trellis_metric_type_t TYPE () const { return d_TYPE; }
//std::vector<int> trace () const { return d_trace; }
+ void set_TABLE (const std::vector<@I_TYPE@> &table);
void forecast (int noutput_items,
gr_vector_int &ninput_items_required);
int general_work (int noutput_items,
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.i.t
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.i.t
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-trellis/src/lib/trellis_viterbi_combined_XX.i.t
2008-12-20 02:40:37 UTC (rev 10138)
@@ -55,4 +55,5 @@
std::vector<@I_TYPE@> TABLE () const { return d_TABLE; }
trellis_metric_type_t TYPE () const { return d_TYPE; }
//std::vector<short> trace () const { return d_trace; }
+ void set_TABLE (const std::vector<@I_TYPE@> &table);
};
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_tv_rx.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_tv_rx.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_tv_rx.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -60,7 +60,7 @@
return c
class db_tv_rx(db_base.db_base):
- def __init__(self, usrp, which, first_IF, second_IF):
+ def __init__(self, usrp, which, first_IF, second_IF, inverted):
"""
Control Microtune 4937 based USRP daughterboard.
@@ -77,10 +77,10 @@
self._second_IF = second_IF
self._reference_divisor = 640
self._fast_tuning = False
- self._inverted = False # FIXME get rid of this
+ self._inverted = inverted
- g = self.gain_range() # initialize gain
- self.set_gain(float(g[0]+g[1]) / 2)
+ g = self.gain_range()
+ self.set_gain(float(g[0]+g[1]) / 2) # default gain is halfscale
self.bypass_adc_buffers(False)
@@ -187,12 +187,12 @@
# With MT4937DI5-3x7702 with second downconversion
db_instantiator.add(usrp_dbid.TV_RX,
- lambda usrp, which : (db_tv_rx(usrp, which, 43.75e6,
5.75e6),))
+ lambda usrp, which : (db_tv_rx(usrp, which, 43.75e6,
5.75e6, False),))
# With MT4937DI5-3x8680, and 3x8769 without second downconversion
db_instantiator.add(usrp_dbid.TV_RX_REV_2,
- lambda usrp, which : (db_tv_rx(usrp, which, 44e6, 20e6),))
+ lambda usrp, which : (db_tv_rx(usrp, which, 44e6, 44e6,
True),))
# With MT4937DI5-3x7901 without second downconversion, basically the same as
tvrx2
db_instantiator.add(usrp_dbid.TV_RX_REV_3,
- lambda usrp, which : (db_tv_rx(usrp, which, 44e6, 20e6),))
+ lambda usrp, which : (db_tv_rx(usrp, which, 44e6, 44e6,
True),))
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_xcvr2450.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_xcvr2450.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp/src/db_xcvr2450.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -274,7 +274,7 @@
chr((v >> 8) & 0xff),
chr(v & 0xff)))
self.u._write_spi(0, self.spi_enable, self.spi_format, s)
- print "xcvr2450: Setting reg %d to %06X" % ((v&15), v)
+ #print "xcvr2450: Setting reg %d to %06X" % ((v&15), v)
# --------------------------------------------------------------------
# These methods control the GPIO bus. Since the board has to access
@@ -356,8 +356,8 @@
self.tx_set_atr_rxval(io_tx_while_rx)
self.tx_set_atr_txval(io_tx_while_tx)
- print "GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X" % (
- io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx)
+ #print "GPIO: RXRX=%04X RXTX=%04X TXRX=%04X TXTX=%04X" % (
+ #io_rx_while_rx, io_rx_while_tx, io_tx_while_rx, io_tx_while_tx)
# --------------------------------------------------------------------
# These methods set control the high-level operating parameters.
@@ -374,15 +374,13 @@
self.ad9515_div = 3
scaler = 4.0/3.0;
- if target_freq > 5.25e9:
+ if target_freq > 5.275e9:
self.highband = 1
else:
self.highband = 0
vco_freq = target_freq*scaler;
- #ref_clk = self.u.fpga_master_clock_freq() # Assumes AD9515 is
bypassed
- sys_clk = 64e6
- #sys_clk = 75e6
+ sys_clk = self.u.fpga_master_clock_freq() # Usually 64e6
ref_clk = sys_clk / self.ad9515_div
phdet_freq = ref_clk/self.ref_div
@@ -391,9 +389,9 @@
self.frac_div = int((div-self.int_div)*65536.0)
actual_freq = phdet_freq*(self.int_div+(self.frac_div/65536.0))/scaler
- print "RF=%s VCO=%s R=%d PHD=%s DIV=%3.5f I=%3d F=%5d ACT=%s" % (
- n2s(target_freq), n2s(vco_freq), self.ref_div, n2s(phdet_freq),
- div, self.int_div, self.frac_div, n2s(actual_freq))
+ #print "RF=%s VCO=%s R=%d PHD=%s DIV=%3.5f I=%3d F=%5d ACT=%s" % (
+ # n2s(target_freq), n2s(vco_freq), self.ref_div, n2s(phdet_freq),
+ # div, self.int_div, self.frac_div, n2s(actual_freq))
self.set_gpio()
self.set_reg_int_divider()
@@ -401,10 +399,25 @@
self.set_reg_bandselpll()
ok = self.lock_detect()
- print "lock detect:", ok
#if(not ok):
# ok = self.lock_detect()
- # print "lock detect:", ok
+ # if ok:
+ # print "lock detect on 2nd try %f" % (target_freq,)
+
+ if(not ok):
+ if (target_freq > 5.275e9) and (target_freq <= 5.35e9):
+ self.highband = 0
+ self.set_reg_bandselpll()
+ ok = self.lock_detect()
+ print "swap to 0 at %f, ok %d" % (target_freq,ok)
+ if (target_freq >= 5.25e9) and (target_freq <= 5.275e9):
+ self.highband = 1
+ self.set_reg_bandselpll()
+ ok = self.lock_detect()
+ print "swap to 1 at %f, ok %d" % (target_freq,ok)
+
+ if(not ok):
+ print "Fail %f" % (target_freq,)
return (ok, actual_freq)
def lock_detect(self):
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2.i
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2.i
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2.i
2008-12-20 02:40:37 UTC (rev 10138)
@@ -46,6 +46,9 @@
~usrp2_base();
std::string mac_addr() const;
+ %rename(_real_fpga_master_clock_freq) fpga_master_clock_freq;
+ bool fpga_master_clock_freq(long *freq);
+ bool sync_to_pps();
};
// ----------------------------------------------------------------
@@ -62,6 +65,19 @@
%rename(_real_set_center_freq) set_center_freq;
bool set_center_freq(double frequency, usrp2::tune_result *r);
bool set_decim(int decimation_factor);
+ bool set_scale_iq(int scale_i, int scale_q);
+ int decim();
+ %rename(_real_adc_rate) adc_rate;
+ bool adc_rate(long *rate);
+ double gain_min();
+ double gain_max();
+ double gain_db_per_step();
+ double freq_min();
+ double freq_max();
+ %rename(_real_daughterboard_id) daughterboard_id;
+ bool daughterboard_id(int *dbid);
+ unsigned int overruns();
+ unsigned int missing();
};
// ----------------------------------------------------------------
@@ -114,6 +130,17 @@
%rename(_real_set_center_freq) set_center_freq;
bool set_center_freq(double frequency, usrp2::tune_result *r);
bool set_interp(int interp_factor);
+ bool set_scale_iq(int scale_i, int scale_q);
+ int interp();
+ %rename(_real_dac_rate) dac_rate;
+ bool dac_rate(long *rate);
+ double gain_min();
+ double gain_max();
+ double gain_db_per_step();
+ double freq_min();
+ double freq_max();
+ %rename(_real_daughterboard_id) daughterboard_id;
+ bool daughterboard_id(int *dbid);
};
// ----------------------------------------------------------------
@@ -154,6 +181,23 @@
// ----------------------------------------------------------------
+// some utility functions to allow Python to deal with pointers
+%{
+ long *make_long_ptr() { return (long *)malloc(sizeof(long)); }
+ long deref_long_ptr(long *l) { return *l; }
+ void free_long_ptr(long *l) { free(l); }
+ int *make_int_ptr() { return (int *)malloc(sizeof(int)); }
+ int deref_int_ptr(int *l) { return *l; }
+ void free_int_ptr(int *l) { free(l); }
+%}
+
+long *make_long_ptr();
+long deref_long_ptr(long *l);
+void free_long_ptr(long *l);
+int *make_int_ptr();
+int deref_int_ptr(int *l);
+void free_int_ptr(int *l);
+
// create a more pythonic interface
%pythoncode %{
@@ -165,8 +209,86 @@
else:
return None
+def __fpga_master_clock_freq(self):
+ f = make_long_ptr();
+ r = self._real_fpga_master_clock_freq(f)
+ if r:
+ result = deref_long_ptr(f)
+ else:
+ result = None
+ free_long_ptr(f)
+ return result
+
+def __adc_rate(self):
+ rate = make_long_ptr();
+ r = self._real_adc_rate(rate)
+ if r:
+ result = deref_long_ptr(rate)
+ else:
+ result = None
+ free_long_ptr(rate)
+ return result
+
+def __dac_rate(self):
+ rate = make_long_ptr();
+ r = self._real_dac_rate(rate)
+ if r:
+ result = deref_long_ptr(rate)
+ else:
+ result = None
+ free_long_ptr(rate)
+ return result
+
+def __gain_range(self):
+ return [self.gain_min(),
+ self.gain_max(),
+ self.gain_db_per_step()]
+
+# NOTE: USRP1 uses a length three tuple here (3rd value is 'freq step'),
+# but it's not really useful. We let an index error happen here
+# to identify code using it.
+def __freq_range(self):
+ return [self.freq_min(),
+ self.freq_max()]
+
+def __daughterboard_id(self):
+ dbid = make_int_ptr();
+ r = self._real_daughterboard_id(dbid)
+ if r:
+ result = deref_int_ptr(dbid)
+ else:
+ result = None
+ free_int_ptr(dbid)
+ return result
+
usrp2_source_32fc_sptr.set_center_freq = __set_center_freq
usrp2_source_16sc_sptr.set_center_freq = __set_center_freq
usrp2_sink_32fc_sptr.set_center_freq = __set_center_freq
usrp2_sink_16sc_sptr.set_center_freq = __set_center_freq
+
+usrp2_source_32fc_sptr.fpga_master_clock_freq = __fpga_master_clock_freq
+usrp2_source_16sc_sptr.fpga_master_clock_freq = __fpga_master_clock_freq
+usrp2_sink_32fc_sptr.fpga_master_clock_freq = __fpga_master_clock_freq
+usrp2_sink_16sc_sptr.fpga_master_clock_freq = __fpga_master_clock_freq
+
+usrp2_source_32fc_sptr.adc_rate = __adc_rate
+usrp2_source_16sc_sptr.adc_rate = __adc_rate
+usrp2_sink_32fc_sptr.dac_rate = __dac_rate
+usrp2_sink_16sc_sptr.dac_rate = __dac_rate
+
+usrp2_source_32fc_sptr.gain_range = __gain_range
+usrp2_source_16sc_sptr.gain_range = __gain_range
+usrp2_sink_32fc_sptr.gain_range = __gain_range
+usrp2_sink_16sc_sptr.gain_range = __gain_range
+
+usrp2_source_32fc_sptr.freq_range = __freq_range
+usrp2_source_16sc_sptr.freq_range = __freq_range
+usrp2_sink_32fc_sptr.freq_range = __freq_range
+usrp2_sink_16sc_sptr.freq_range = __freq_range
+
+usrp2_source_32fc_sptr.daughterboard_id = __daughterboard_id
+usrp2_source_16sc_sptr.daughterboard_id = __daughterboard_id
+usrp2_sink_32fc_sptr.daughterboard_id = __daughterboard_id
+usrp2_sink_16sc_sptr.daughterboard_id = __daughterboard_id
+
%}
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -56,6 +56,18 @@
}
bool
+usrp2_base::fpga_master_clock_freq(long *freq) const
+{
+ return d_u2->fpga_master_clock_freq(freq);
+}
+
+bool
+usrp2_base::sync_to_pps()
+{
+ return d_u2->sync_to_pps();
+}
+
+bool
usrp2_base::start()
{
// Default implementation is NOP
Modified: gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.h
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.h
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_base.h
2008-12-20 02:40:37 UTC (rev 10138)
@@ -54,6 +54,16 @@
std::string mac_addr() const;
/*!
+ * \brief Get USRP2 master clock rate
+ */
+ bool fpga_master_clock_freq(long *freq) const;
+
+ /*!
+ * \brief Set master time to 0 at next PPS rising edge
+ */
+ bool sync_to_pps();
+
+ /*!
* \brief Called by scheduler when starting flowgraph
*/
virtual bool start();
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_16sc.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_16sc.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_16sc.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -62,7 +62,7 @@
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_16sc(0, // FIXME: use channel number instead of 0
+ bool ok = d_u2->tx_16sc(0, // FIXME: someday, streams will have channel
numbers
in, noutput_items, &metadata);
if (!ok){
std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_32fc.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_32fc.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_32fc.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -62,7 +62,7 @@
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_32fc(0, // FIXME: use channel number instead of 0
+ bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel
numbers
in, noutput_items, &metadata);
if (!ok){
std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -63,3 +63,57 @@
{
return d_u2->set_tx_interp(interp_factor);
}
+
+bool
+usrp2_sink_base::set_scale_iq(int scale_i, int scale_q)
+{
+ return d_u2->set_tx_scale_iq(scale_i, scale_q);
+}
+
+int
+usrp2_sink_base::interp()
+{
+ return d_u2->tx_interp();
+}
+
+bool
+usrp2_sink_base::dac_rate(long *rate)
+{
+ return d_u2->dac_rate(rate);
+}
+
+double
+usrp2_sink_base::gain_min()
+{
+ return d_u2->tx_gain_min();
+}
+
+double
+usrp2_sink_base::gain_max()
+{
+ return d_u2->tx_gain_max();
+}
+
+double
+usrp2_sink_base::gain_db_per_step()
+{
+ return d_u2->tx_gain_db_per_step();
+}
+
+double
+usrp2_sink_base::freq_min()
+{
+ return d_u2->tx_freq_min();
+}
+
+double
+usrp2_sink_base::freq_max()
+{
+ return d_u2->tx_freq_max();
+}
+
+bool
+usrp2_sink_base::daughterboard_id(int *dbid)
+{
+ return d_u2->tx_daughterboard_id(dbid);
+}
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.h
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.h
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_sink_base.h
2008-12-20 02:40:37 UTC (rev 10138)
@@ -54,6 +54,56 @@
* \brief Set transmit interpolation rate
*/
bool set_interp(int interp_factor);
+
+ /*!
+ * \brief Set transmit IQ scale factors
+ */
+ bool set_scale_iq(int scale_i, int scale_q);
+
+ /*!
+ * \brief Get transmit interpolation rate
+ */
+ int interp();
+
+ /*!
+ * \brief Get DAC sample rate in Hz
+ */
+ bool dac_rate(long *rate);
+
+ /*!
+ * \brief Returns minimum Tx gain
+ */
+ double gain_min();
+
+ /*!
+ * \brief Returns maximum Tx gain
+ */
+ double gain_max();
+
+ /*!
+ * \brief Returns Tx gain db_per_step
+ */
+ double gain_db_per_step();
+
+ /*!
+ * \brief Returns minimum Tx center frequency
+ */
+ double freq_min();
+
+ /*!
+ * \brief Returns maximum Tx center frequency
+ */
+ double freq_max();
+
+ /*!
+ * \brief Get Tx daughterboard ID
+ *
+ * \param[out] dbid returns the daughterboard id.
+ *
+ * daughterboard id >= 0 if successful, -1 if no daugherboard installed,
+ * -2 if invalid EEPROM on daughterboard.
+ */
+ bool daughterboard_id(int *dbid);
};
#endif /* INCLUDED_USRP2_SINK_BASE_H */
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.cc
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.cc
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.cc
2008-12-20 02:40:37 UTC (rev 10138)
@@ -64,7 +64,73 @@
return d_u2->set_rx_decim(decimation_factor);
}
+bool
+usrp2_source_base::set_scale_iq(int scale_i, int scale_q)
+{
+ return d_u2->set_rx_scale_iq(scale_i, scale_q);
+}
+
+int
+usrp2_source_base::decim()
+{
+ return d_u2->rx_decim();
+}
+
bool
+usrp2_source_base::adc_rate(long *rate)
+{
+ return d_u2->adc_rate(rate);
+}
+
+double
+usrp2_source_base::gain_min()
+{
+ return d_u2->rx_gain_min();
+}
+
+double
+usrp2_source_base::gain_max()
+{
+ return d_u2->rx_gain_max();
+}
+
+double
+usrp2_source_base::gain_db_per_step()
+{
+ return d_u2->rx_gain_db_per_step();
+}
+
+double
+usrp2_source_base::freq_min()
+{
+ return d_u2->rx_freq_min();
+}
+
+double
+usrp2_source_base::freq_max()
+{
+ return d_u2->rx_freq_max();
+}
+
+bool
+usrp2_source_base::daughterboard_id(int *dbid)
+{
+ return d_u2->rx_daughterboard_id(dbid);
+}
+
+unsigned int
+usrp2_source_base::overruns()
+{
+ return d_u2->rx_overruns();
+}
+
+unsigned int
+usrp2_source_base::missing()
+{
+ return d_u2->rx_missing();
+}
+
+bool
usrp2_source_base::start()
{
return d_u2->start_rx_streaming(0); // FIXME: someday sources will have
channel #s
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.h
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.h
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-usrp2/src/usrp2_source_base.h
2008-12-20 02:40:37 UTC (rev 10138)
@@ -56,6 +56,66 @@
bool set_decim(int decimation_factor);
/*!
+ * \brief Set receive IQ scale factors
+ */
+ bool set_scale_iq(int scale_i, int scale_q);
+
+ /*!
+ * \brief Get receive decimation rate
+ */
+ int decim();
+
+ /*!
+ * \brief Get the ADC sample rate
+ */
+ bool adc_rate(long *rate);
+
+ /*!
+ * \brief Returns minimum Rx gain
+ */
+ double gain_min();
+
+ /*!
+ * \brief Returns maximum Rx gain
+ */
+ double gain_max();
+
+ /*!
+ * \brief Returns Rx gain db_per_step
+ */
+ double gain_db_per_step();
+
+ /*!
+ * \brief Returns minimum Rx center frequency
+ */
+ double freq_min();
+
+ /*!
+ * \brief Returns maximum Rx center frequency
+ */
+ double freq_max();
+
+ /*!
+ * \brief Get Rx daughterboard ID
+ *
+ * \param[out] dbid returns the daughterboard id.
+ *
+ * daughterboard id >= 0 if successful, -1 if no daugherboard installed,
+ * -2 if invalid EEPROM on daughterboard.
+ */
+ bool daughterboard_id(int *dbid);
+
+ /*!
+ * \brief Returns number of receiver overruns
+ */
+ unsigned int overruns();
+
+ /*!
+ * \brief Returns number of missing sequence numbers
+ */
+ unsigned int missing();
+
+ /*!
* \brief Called by scheduler when starting flowgraph
*/
virtual bool start();
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -33,8 +33,12 @@
bin_SCRIPTS = \
gr_plot_char.py \
gr_plot_const.py \
+ gr_plot_fft.py \
gr_plot_fft_c.py \
gr_plot_fft_f.py \
+ gr_plot_psd.py \
+ gr_plot_psd_c.py \
+ gr_plot_psd_f.py \
gr_plot_float.py \
gr_plot_int.py \
gr_plot_iq.py \
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_const.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_const.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_const.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -140,7 +140,7 @@
def zoom(self, event):
newxlim = self.sp_iq.get_xlim()
- if(newxlim != self.xlim):
+ if(newxlim.all() != self.xlim.all()):
self.xlim = newxlim
r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
i = self.imags[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft.py
(from rev 10133, gnuradio/trunk/gr-utils/src/python/gr_plot_fft.py)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,252 @@
+#!/usr/bin/env python
+#
+# Copyright 2007,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.
+#
+
+try:
+ import matplotlib
+ matplotlib.use('TkAgg')
+ matplotlib.interactive(True)
+except ImportError:
+ print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
+ raise SystemExit, 1
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Please install SciPy to run this script (http://www.scipy.org/)"
+ raise SystemExit, 1
+
+try:
+ from pylab import *
+except ImportError:
+ print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
+ raise SystemExit, 1
+
+from optparse import OptionParser
+
+class gr_plot_fft:
+ def __init__(self, datatype, filename, options):
+ self.hfile = open(filename, "r")
+ self.block_length = options.block
+ self.start = options.start
+ self.sample_rate = options.sample_rate
+
+ self.datatype = getattr(scipy, datatype)
+ self.sizeof_data = self.datatype().nbytes # number of bytes per
sample in file
+
+ self.axis_font_size = 16
+ self.label_font_size = 18
+ self.title_font_size = 20
+ self.text_size = 22
+
+ # Setup PLOT
+ self.fig = figure(1, figsize=(16, 12), facecolor='w')
+ rcParams['xtick.labelsize'] = self.axis_font_size
+ rcParams['ytick.labelsize'] = self.axis_font_size
+
+ self.text_file = figtext(0.10, 0.94, ("File: %s" % filename),
weight="heavy", size=self.text_size)
+ self.text_file_pos = figtext(0.10, 0.88, "File Position: ",
weight="heavy", size=self.text_size)
+ self.text_block = figtext(0.35, 0.88, ("Block Size: %d" %
self.block_length),
+ weight="heavy", size=self.text_size)
+ self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" %
self.sample_rate),
+ weight="heavy", size=self.text_size)
+ self.make_plots()
+
+ self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05],
frameon=True)
+ self.button_left = Button(self.button_left_axes, "<")
+ self.button_left_callback =
self.button_left.on_clicked(self.button_left_click)
+
+ self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05],
frameon=True)
+ self.button_right = Button(self.button_right_axes, ">")
+ self.button_right_callback =
self.button_right.on_clicked(self.button_right_click)
+
+ self.xlim = self.sp_iq.get_xlim()
+
+ self.manager = get_current_fig_manager()
+ connect('draw_event', self.zoom)
+ connect('key_press_event', self.click)
+ show()
+
+ def get_data(self):
+ self.position = self.hfile.tell()/self.sizeof_data
+ self.text_file_pos.set_text("File Position: %d" % (self.position))
+ self.iq = scipy.fromfile(self.hfile, dtype=self.datatype,
count=self.block_length)
+ #print "Read in %d items" % len(self.iq)
+ if(len(self.iq) == 0):
+ print "End of File"
+ else:
+ self.iq_fft = self.dofft(self.iq)
+
+ tstep = 1.0 / self.sample_rate
+ self.time = [tstep*(self.position + i) for i in
xrange(len(self.iq))]
+
+ self.freq = self.calc_freq(self.time, self.sample_rate)
+
+ def dofft(self, iq):
+ N = len(iq)
+ iq_fft = fftpack.fftshift(scipy.fft(iq)) # fft and shift axis
+ iq_fft = 20*scipy.log10(abs((iq_fft+1e-15)/N)) # convert to decibels,
adjust power
+ # adding 1e-15 (-300 dB) to protect against value errors if an item in
iq_fft is 0
+ return iq_fft
+
+ def calc_freq(self, time, sample_rate):
+ N = len(time)
+ Fs = 1.0 / (max(time) - min(time))
+ Fn = 0.5 * sample_rate
+ freq = [-Fn + i*Fs for i in xrange(N)]
+ return freq
+
+ def make_plots(self):
+ # if specified on the command-line, set file pointer
+ self.hfile.seek(self.sizeof_data*self.start, 1)
+
+ # Subplot for real and imaginary parts of signal
+ self.sp_iq = self.fig.add_subplot(2,2,1, position=[0.075, 0.2, 0.4,
0.6])
+ self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size,
fontweight="bold")
+ self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size,
fontweight="bold")
+ self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size,
fontweight="bold")
+
+ # Subplot for FFT plot
+ self.sp_fft = self.fig.add_subplot(2,2,2, position=[0.575, 0.2, 0.4,
0.6])
+ self.sp_fft.set_title(("FFT"), fontsize=self.title_font_size,
fontweight="bold")
+ self.sp_fft.set_xlabel("Frequency (Hz)",
fontsize=self.label_font_size, fontweight="bold")
+ self.sp_fft.set_ylabel("Power Spectrum (dBm)",
fontsize=self.label_font_size, fontweight="bold")
+
+ self.get_data()
+
+ self.plot_iq = self.sp_iq.plot([], 'bo-') # make plot for reals
+ self.plot_iq += self.sp_iq.plot([], 'ro-') # make plot for imags
+ self.draw_time() # draw the plot
+
+ self.plot_fft = self.sp_fft.plot([], 'bo-') # make plot for FFT
+ self.draw_fft() # draw the plot
+
+ draw()
+
+ def draw_time(self):
+ reals = self.iq.real
+ imags = self.iq.imag
+ self.plot_iq[0].set_data([self.time, reals])
+ self.plot_iq[1].set_data([self.time, imags])
+ self.sp_iq.set_xlim(min(self.time), max(self.time))
+ self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]),
+ 1.5*max([max(reals), max(imags)])])
+
+ def draw_fft(self):
+ self.plot_fft[0].set_data([self.freq, self.iq_fft])
+ self.sp_fft.set_xlim(min(self.freq), max(self.freq))
+ self.sp_fft.set_ylim([min(self.iq_fft)-10, max(self.iq_fft)+10])
+
+ def update_plots(self):
+ self.draw_time()
+ self.draw_fft()
+
+ self.xlim = self.sp_iq.get_xlim()
+ draw()
+
+ def zoom(self, event):
+ newxlim = self.sp_iq.get_xlim()
+ if(newxlim.all() != self.xlim.all()):
+ self.xlim = newxlim
+ xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] -
self.position))))
+ xmax = min(int(ceil(self.sample_rate*(self.xlim[1] -
self.position))), len(self.iq))
+
+ iq = self.iq[xmin : xmax]
+ time = self.time[xmin : xmax]
+
+ iq_fft = self.dofft(iq)
+ freq = self.calc_freq(time, self.sample_rate)
+
+ self.plot_fft[0].set_data(freq, iq_fft)
+ self.sp_fft.axis([min(freq), max(freq),
+ min(iq_fft)-10, max(iq_fft)+10])
+
+ draw()
+
+ def click(self, event):
+ forward_valid_keys = [" ", "down", "right"]
+ backward_valid_keys = ["up", "left"]
+
+ if(find(event.key, forward_valid_keys)):
+ self.step_forward()
+
+ elif(find(event.key, backward_valid_keys)):
+ self.step_backward()
+
+ def button_left_click(self, event):
+ self.step_backward()
+
+ def button_right_click(self, event):
+ self.step_forward()
+
+ def step_forward(self):
+ self.get_data()
+ self.update_plots()
+
+ def step_backward(self):
+ # Step back in file position
+ if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ):
+ self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
+ else:
+ self.hfile.seek(-self.hfile.tell(),1)
+ self.get_data()
+ self.update_plots()
+
+def find(item_in, list_search):
+ try:
+ return list_search.index(item_in) != None
+ except ValueError:
+ return False
+
+def setup_options():
+ usage="%prog: [options] input_filename"
+ description = "Takes a GNU Radio complex binary file and displays the I&Q
data versus time as well as the frequency domain (FFT) plot. The y-axis values
are plotted assuming volts as the amplitude of the I&Q streams and converted
into dBm in the frequency domain (the 1/N power adjustment out of the FFT is
performed internally). The script plots a certain block of data at a time,
specified on the command line as -B or --block. This value defaults to 1000.
The start position in the file can be set by specifying -s or --start and
defaults to 0 (the start of the file). By default, the system assumes a sample
rate of 1, so in time, each sample is plotted versus the sample number. To set
a true time and frequency axis, set the sample rate (-R or --sample-rate) to
the sample rate used when capturing the samples."
+
+ parser = OptionParser(conflict_handler="resolve", usage=usage,
description=description)
+ parser.add_option("-d", "--data-type", type="string", default="complex64",
+ help="Specify the data type (complex64, float32,
(u)int32, (u)int16, (u)int8) [default=%default]")
+ parser.add_option("-B", "--block", type="int", default=1000,
+ help="Specify the block size [default=%default]")
+ parser.add_option("-s", "--start", type="int", default=0,
+ help="Specify where to start in the file
[default=%default]")
+ parser.add_option("-R", "--sample-rate", type="float", default=1.0,
+ help="Set the sampler rate of the data
[default=%default]")
+ return parser
+
+def main():
+ parser = setup_options()
+ (options, args) = parser.parse_args ()
+ if len(args) != 1:
+ parser.print_help()
+ raise SystemExit, 1
+ filename = args[0]
+
+ dc = gr_plot_fft(options.data_type, filename, options)
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
+
+
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_c.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_c.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_c.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -20,198 +20,11 @@
# Boston, MA 02110-1301, USA.
#
-try:
- import scipy
- from scipy import fftpack
-except ImportError:
- print "Please install SciPy to run this script (http://www.scipy.org/)"
- raise SystemExit, 1
+import gr_plot_fft
-try:
- from pylab import *
-except ImportError:
- print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
- raise SystemExit, 1
-
-from optparse import OptionParser
-from math import log10
-
-matplotlib.interactive(True)
-matplotlib.use('TkAgg')
-
-class draw_fft_c:
- def __init__(self, filename, options):
- self.hfile = open(filename, "r")
- self.block_length = options.block
- self.start = options.start
- self.sample_rate = options.sample_rate
-
- self.datatype = scipy.complex64
- self.sizeof_data = self.datatype().nbytes # number of bytes per
sample in file
-
- self.axis_font_size = 16
- self.label_font_size = 18
- self.title_font_size = 20
- self.text_size = 22
-
- # Setup PLOT
- self.fig = figure(1, figsize=(16, 9), facecolor='w')
- rcParams['xtick.labelsize'] = self.axis_font_size
- rcParams['ytick.labelsize'] = self.axis_font_size
-
- self.text_file = figtext(0.10, 0.94, ("File: %s" % filename),
weight="heavy", size=self.text_size)
- self.text_file_pos = figtext(0.10, 0.88, "File Position: ",
weight="heavy", size=self.text_size)
- self.text_block = figtext(0.40, 0.88, ("Block Size: %d" %
self.block_length),
- weight="heavy", size=self.text_size)
- self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" %
self.sample_rate),
- weight="heavy", size=self.text_size)
- self.make_plots()
-
- self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05],
frameon=True)
- self.button_left = Button(self.button_left_axes, "<")
- self.button_left_callback =
self.button_left.on_clicked(self.button_left_click)
-
- self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05],
frameon=True)
- self.button_right = Button(self.button_right_axes, ">")
- self.button_right_callback =
self.button_right.on_clicked(self.button_right_click)
-
- self.xlim = self.sp_iq.get_xlim()
-
- self.manager = get_current_fig_manager()
- connect('draw_event', self.zoom)
- connect('key_press_event', self.click)
- show()
-
- def get_data(self):
- self.text_file_pos.set_text("File Position: %d" %
(self.hfile.tell()//self.sizeof_data))
- self.iq = scipy.fromfile(self.hfile, dtype=self.datatype,
count=self.block_length)
- #print "Read in %d items" % len(self.iq)
- if(len(self.iq) == 0):
- print "End of File"
- else:
- self.reals = [r.real for r in self.iq]
- self.imags = [i.imag for i in self.iq]
-
- self.iq_fft = self.dofft(self.iq)
-
- self.time = [i*(1/self.sample_rate) for i in
range(len(self.reals))]
- self.freq = self.calc_freq(self.time, self.sample_rate)
-
-
- def dofft(self, iq):
- N = len(iq)
- iq_fft = fftpack.fftshift(scipy.fft(iq)) # fft and shift axis
- iq_fft = [20*log10(abs(i/N)) for i in iq_fft] # convert to decibels,
adjust power
- return iq_fft
-
- def calc_freq(self, time, sample_rate):
- N = len(time)
- Fs = 1.0 / (max(time) - min(time))
- Fn = 0.5 * sample_rate
- freq = [-Fn + i*Fs for i in range(N)]
- return freq
-
- def make_plots(self):
- # if specified on the command-line, set file pointer
- self.hfile.seek(self.sizeof_data*self.start, 1)
-
- self.get_data()
-
- # Subplot for real and imaginary parts of signal
- self.sp_iq = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.4,
0.6])
- self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size,
fontweight="bold")
- self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size,
fontweight="bold")
- self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size,
fontweight="bold")
- self.plot_iq = plot(self.time, self.reals, 'bo-', self.time,
self.imags, 'ro-')
- self.sp_iq.set_ylim([1.5*min([min(self.reals), min(self.imags)]),
- 1.5*max([max(self.reals), max(self.imags)])])
-
- # Subplot for constellation plot
- self.sp_fft = self.fig.add_subplot(2,2,1, position=[0.575, 0.2, 0.4,
0.6])
- self.sp_fft.set_title(("FFT"), fontsize=self.title_font_size,
fontweight="bold")
- self.sp_fft.set_xlabel("Frequency (Hz)",
fontsize=self.label_font_size, fontweight="bold")
- self.sp_fft.set_ylabel("Power (dBm)", fontsize=self.label_font_size,
fontweight="bold")
- self.plot_fft = plot(self.freq, self.iq_fft, '-bo')
- self.sp_fft.set_ylim([min(self.iq_fft)-10, max(self.iq_fft)+10])
-
- draw()
-
- def update_plots(self):
- self.plot_iq[0].set_data([self.time, self.reals])
- self.plot_iq[1].set_data([self.time, self.imags])
- self.sp_iq.set_ylim([1.5*min([min(self.reals), min(self.imags)]),
- 1.5*max([max(self.reals), max(self.imags)])])
-
- self.plot_fft[0].set_data([self.freq, self.iq_fft])
- self.sp_fft.set_ylim([min(self.iq_fft)-10, max(self.iq_fft)+10])
-
- draw()
-
- def zoom(self, event):
- newxlim = self.sp_iq.get_xlim()
- if(newxlim != self.xlim):
- self.xlim = newxlim
- xmin = max(0, int(ceil(self.sample_rate*self.xlim[0])))
- xmax = min(int(ceil(self.sample_rate*self.xlim[1])), len(self.iq))
-
- iq = self.iq[xmin : xmax]
- time = self.time[xmin : xmax]
-
- iq_fft = self.dofft(iq)
- freq = self.calc_freq(time, self.sample_rate)
-
- self.plot_fft[0].set_data(freq, iq_fft)
- self.sp_fft.axis([min(freq), max(freq),
- min(iq_fft)-10, max(iq_fft)+10])
-
- draw()
-
- def click(self, event):
- forward_valid_keys = [" ", "down", "right"]
- backward_valid_keys = ["up", "left"]
-
- if(find(event.key, forward_valid_keys)):
- self.step_forward()
-
- elif(find(event.key, backward_valid_keys)):
- self.step_backward()
-
- def button_left_click(self, event):
- self.step_backward()
-
- def button_right_click(self, event):
- self.step_forward()
-
- def step_forward(self):
- self.get_data()
- self.update_plots()
-
- def step_backward(self):
- # Step back in file position
- if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ):
- self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
- else:
- self.hfile.seek(-self.hfile.tell(),1)
- self.get_data()
- self.update_plots()
-
-def find(item_in, list_search):
- try:
- return list_search.index(item_in) != None
- except ValueError:
- return False
-
def main():
- usage="%prog: [options] input_filename"
- description = "Takes a GNU Radio complex binary file and displays the I&Q
data versus time as well as the frequency domain (FFT) plot. The y-axis values
are plotted assuming volts as the amplitude of the I&Q streams and converted
into dBm in the frequency domain (the 1/N power adjustment out of the FFT is
performed internally). The script plots a certain block of data at a time,
specified on the command line as -B or --block. This value defaults to 1000.
The start position in the file can be set by specifying -s or --start and
defaults to 0 (the start of the file). By default, the system assumes a sample
rate of 1, so in time, each sample is plotted versus the sample number. To set
a true time and frequency axis, set the sample rate (-R or --sample-rate) to
the sample rate used when capturing the samples."
-
- parser = OptionParser(conflict_handler="resolve", usage=usage,
description=description)
- parser.add_option("-B", "--block", type="int", default=1000,
- help="Specify the block size [default=%default]")
- parser.add_option("-s", "--start", type="int", default=0,
- help="Specify where to start in the file
[default=%default]")
- parser.add_option("-R", "--sample-rate", type="float", default=1.0,
- help="Set the sampler rate of the data
[default=%default]")
+ parser = gr_plot_fft.setup_options()
+ parser.remove_option("--data-type")
(options, args) = parser.parse_args ()
if len(args) != 1:
@@ -219,7 +32,7 @@
raise SystemExit, 1
filename = args[0]
- dc = draw_fft_c(filename, options)
+ dc = gr_plot_fft.gr_plot_fft("complex64", filename, options)
if __name__ == "__main__":
try:
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_f.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_f.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_fft_f.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -20,201 +20,11 @@
# Boston, MA 02110-1301, USA.
#
-try:
- import scipy
- from scipy import fftpack
-except ImportError:
- print "Please install SciPy to run this script (http://www.scipy.org/)"
- raise SystemExit, 1
+import gr_plot_fft
-try:
- from pylab import *
-except ImportError:
- print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
- raise SystemExit, 1
-
-from optparse import OptionParser
-from math import log10
-
-matplotlib.interactive(True)
-matplotlib.use('TkAgg')
-
-class draw_fft_f:
- def __init__(self, filename, options):
- self.hfile = open(filename, "r")
- self.block_length = options.block
- self.start = options.start
- self.sample_rate = options.sample_rate
-
- self.datatype = scipy.float32
- self.sizeof_data = self.datatype().nbytes # number of bytes per
sample in file
-
- self.axis_font_size = 16
- self.label_font_size = 18
- self.title_font_size = 20
- self.text_size = 22
-
- # Setup PLOT
- self.fig = figure(1, figsize=(16, 9), facecolor='w')
- rcParams['xtick.labelsize'] = self.axis_font_size
- rcParams['ytick.labelsize'] = self.axis_font_size
-
- self.text_file = figtext(0.10, 0.94, ("File: %s" % filename),
weight="heavy", size=self.text_size)
- self.text_file_pos = figtext(0.10, 0.88, "File Position: ",
weight="heavy", size=self.text_size)
- self.text_block = figtext(0.40, 0.88, ("Block Size: %d" %
self.block_length),
- weight="heavy", size=self.text_size)
- self.text_sr = figtext(0.60, 0.88, ("Sample Rate: %.2f" %
self.sample_rate),
- weight="heavy", size=self.text_size)
- self.make_plots()
-
- self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05],
frameon=True)
- self.button_left = Button(self.button_left_axes, "<")
- self.button_left_callback =
self.button_left.on_clicked(self.button_left_click)
-
- self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05],
frameon=True)
- self.button_right = Button(self.button_right_axes, ">")
- self.button_right_callback =
self.button_right.on_clicked(self.button_right_click)
-
- self.xlim = self.sp_f.get_xlim()
-
- self.manager = get_current_fig_manager()
- connect('draw_event', self.zoom)
- connect('key_press_event', self.click)
- show()
-
- def get_data(self):
- self.text_file_pos.set_text("File Position: %d" %
(self.hfile.tell()//self.sizeof_data))
- self.floats = scipy.fromfile(self.hfile, dtype=self.datatype,
count=self.block_length)
- #print "Read in %d items" % len(self.floats)
- if(len(self.floats) == 0):
- print "End of File"
- else:
- self.f_fft = self.dofft(self.floats)
-
- self.time = [i*(1/self.sample_rate) for i in
range(len(self.floats))]
- self.freq = self.calc_freq(self.time, self.sample_rate)
-
- def dofft(self, f):
- N = len(f)
- f_fft = fftpack.fftshift(scipy.fft(f)) # fft and shift axis
- f_dB = list()
- for f in f_fft:
- try:
- f_dB.append(20*log10(abs(f/N))) # convert to decibels, adjust
power
- except OverflowError: # protect against taking
log(0)
- f = 1e-14 # not sure if this is the
best way to do this
- f_dB.append(20*log10(abs(f/N)))
-
- return f_dB
-
- def calc_freq(self, time, sample_rate):
- N = len(time)
- Fs = 1.0 / (max(time) - min(time))
- Fn = 0.5 * sample_rate
- freq = [-Fn + i*Fs for i in range(N)]
- return freq
-
- def make_plots(self):
- # if specified on the command-line, set file pointer
- self.hfile.seek(self.sizeof_data*self.start, 1)
-
- self.get_data()
-
- # Subplot for real and imaginary parts of signal
- self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.4,
0.6])
- self.sp_f.set_title(("Amplitude"), fontsize=self.title_font_size,
fontweight="bold")
- self.sp_f.set_xlabel("Time (s)", fontsize=self.label_font_size,
fontweight="bold")
- self.sp_f.set_ylabel("Amplitude (V)", fontsize=self.label_font_size,
fontweight="bold")
- self.plot_f = plot(self.time, self.floats, 'bo-')
- self.sp_f.set_ylim([1.5*min(self.floats),
- 1.5*max(self.floats)])
-
- # Subplot for constellation plot
- self.sp_fft = self.fig.add_subplot(2,2,1, position=[0.575, 0.2, 0.4,
0.6])
- self.sp_fft.set_title(("FFT"), fontsize=self.title_font_size,
fontweight="bold")
- self.sp_fft.set_xlabel("Frequency (Hz)",
fontsize=self.label_font_size, fontweight="bold")
- self.sp_fft.set_ylabel("Power (dBm)", fontsize=self.label_font_size,
fontweight="bold")
- self.plot_fft = plot(self.freq, self.f_fft, '-bo')
- self.sp_fft.set_ylim([min(self.f_fft)-10, max(self.f_fft)+10])
-
- draw()
-
- def update_plots(self):
- self.plot_f[0].set_data([self.time, self.floats])
- self.sp_f.set_ylim([1.5*min(self.floats),
- 1.5*max(self.floats)])
-
- self.plot_fft[0].set_data([self.freq, self.f_fft])
- self.sp_fft.set_ylim([min(self.f_fft)-10, max(self.f_fft)+10])
-
- draw()
-
- def zoom(self, event):
- newxlim = self.sp_f.get_xlim()
- if(newxlim != self.xlim):
- self.xlim = newxlim
- xmin = max(0, int(ceil(self.sample_rate*self.xlim[0])))
- xmax = min(int(ceil(self.sample_rate*self.xlim[1])),
len(self.floats))
-
- f = self.floats[xmin : xmax]
- time = self.time[xmin : xmax]
-
- f_fft = self.dofft(f)
- freq = self.calc_freq(time, self.sample_rate)
-
- self.plot_fft[0].set_data(freq, f_fft)
- self.sp_fft.axis([min(freq), max(freq),
- min(f_fft)-10, max(f_fft)+10])
-
- draw()
-
- def click(self, event):
- forward_valid_keys = [" ", "down", "right"]
- backward_valid_keys = ["up", "left"]
-
- if(find(event.key, forward_valid_keys)):
- self.step_forward()
-
- elif(find(event.key, backward_valid_keys)):
- self.step_backward()
-
- def button_left_click(self, event):
- self.step_backward()
-
- def button_right_click(self, event):
- self.step_forward()
-
- def step_forward(self):
- self.get_data()
- self.update_plots()
-
- def step_backward(self):
- # Step back in file position
- if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ):
- self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
- else:
- self.hfile.seek(-self.hfile.tell(),1)
- self.get_data()
- self.update_plots()
-
-
-def find(item_in, list_search):
- try:
- return list_search.index(item_in) != None
- except ValueError:
- return False
-
def main():
- usage="%prog: [options] input_filename"
- description = "Takes a GNU Radio floating point binary file and displays
the sample data versus time as well as the frequency domain (FFT) plot. The
y-axis values are plotted assuming volts as the amplitude of the I&Q streams
and converted into dBm in the frequency domain (the 1/N power adjustment out of
the FFT is performed internally). The script plots a certain block of data at a
time, specified on the command line as -B or --block. This value defaults to
1000. The start position in the file can be set by specifying -s or --start and
defaults to 0 (the start of the file). By default, the system assumes a sample
rate of 1, so in time, each sample is plotted versus the sample number. To set
a true time and frequency axis, set the sample rate (-R or --sample-rate) to
the sample rate used when capturing the samples."
-
- parser = OptionParser(conflict_handler="resolve", usage=usage,
description=description)
- parser.add_option("-B", "--block", type="int", default=1000,
- help="Specify the block size [default=%default]")
- parser.add_option("-s", "--start", type="int", default=0,
- help="Specify where to start in the file
[default=%default]")
- parser.add_option("-R", "--sample-rate", type="float", default=1.0,
- help="Set the sampler rate of the data
[default=%default]")
+ parser = gr_plot_fft.setup_options()
+ parser.remove_option("--data-type")
(options, args) = parser.parse_args ()
if len(args) != 1:
@@ -222,7 +32,7 @@
raise SystemExit, 1
filename = args[0]
- dc = draw_fft_f(filename, options)
+ dc = gr_plot_fft.gr_plot_fft("float32", filename, options)
if __name__ == "__main__":
try:
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd.py
(from rev 10133, gnuradio/trunk/gr-utils/src/python/gr_plot_psd.py)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,281 @@
+#!/usr/bin/env python
+#
+# Copyright 2007,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.
+#
+
+try:
+ import matplotlib
+ matplotlib.use('TkAgg')
+ matplotlib.interactive(True)
+except ImportError:
+ print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
+ raise SystemExit, 1
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Please install SciPy to run this script (http://www.scipy.org/)"
+ raise SystemExit, 1
+
+try:
+ from pylab import *
+except ImportError:
+ print "Please install Matplotlib to run this script
(http://matplotlib.sourceforge.net/)"
+ raise SystemExit, 1
+
+from optparse import OptionParser
+from scipy import log10
+
+class gr_plot_psd:
+ def __init__(self, datatype, filename, options):
+ self.hfile = open(filename, "r")
+ self.block_length = options.block
+ self.start = options.start
+ self.sample_rate = options.sample_rate
+ self.psdfftsize = options.psd_size
+ self.specfftsize = options.spec_size
+
+ self.dospec = options.enable_spec # if we want to plot the spectrogram
+
+ self.datatype = getattr(scipy, datatype) #scipy.complex64
+ self.sizeof_data = self.datatype().nbytes # number of bytes per
sample in file
+
+ self.axis_font_size = 16
+ self.label_font_size = 18
+ self.title_font_size = 20
+ self.text_size = 22
+
+ # Setup PLOT
+ self.fig = figure(1, figsize=(16, 12), facecolor='w')
+ rcParams['xtick.labelsize'] = self.axis_font_size
+ rcParams['ytick.labelsize'] = self.axis_font_size
+
+ self.text_file = figtext(0.10, 0.95, ("File: %s" % filename),
weight="heavy", size=self.text_size)
+ self.text_file_pos = figtext(0.10, 0.92, "File Position: ",
weight="heavy", size=self.text_size)
+ self.text_block = figtext(0.35, 0.92, ("Block Size: %d" %
self.block_length),
+ weight="heavy", size=self.text_size)
+ self.text_sr = figtext(0.60, 0.915, ("Sample Rate: %.2f" %
self.sample_rate),
+ weight="heavy", size=self.text_size)
+ self.make_plots()
+
+ self.button_left_axes = self.fig.add_axes([0.45, 0.01, 0.05, 0.05],
frameon=True)
+ self.button_left = Button(self.button_left_axes, "<")
+ self.button_left_callback =
self.button_left.on_clicked(self.button_left_click)
+
+ self.button_right_axes = self.fig.add_axes([0.50, 0.01, 0.05, 0.05],
frameon=True)
+ self.button_right = Button(self.button_right_axes, ">")
+ self.button_right_callback =
self.button_right.on_clicked(self.button_right_click)
+
+ self.xlim = self.sp_iq.get_xlim()
+
+ self.manager = get_current_fig_manager()
+ connect('draw_event', self.zoom)
+ connect('key_press_event', self.click)
+ show()
+
+ def get_data(self):
+ self.position = self.hfile.tell()/self.sizeof_data
+ self.text_file_pos.set_text("File Position: %d" % self.position)
+ self.iq = scipy.fromfile(self.hfile, dtype=self.datatype,
count=self.block_length)
+ #print "Read in %d items" % len(self.iq)
+ if(len(self.iq) == 0):
+ print "End of File"
+ else:
+ tstep = 1.0 / self.sample_rate
+ self.time = [tstep*(self.position + i) for i in
xrange(len(self.iq))]
+
+ self.iq_psd, self.freq = self.dopsd(self.iq)
+
+ def dopsd(self, iq):
+ ''' Need to do this here and plot later so we can do the fftshift '''
+ overlap = self.psdfftsize/4
+ winfunc = scipy.blackman
+ psd,freq = self.sp_psd.psd(iq, self.psdfftsize, self.sample_rate,
+ window = lambda d:
d*winfunc(self.psdfftsize),
+ noverlap = overlap, visible=False)
+ psd = 10.0*log10(abs(fftpack.fftshift(psd)))
+ return (psd, freq)
+
+ def make_plots(self):
+ # if specified on the command-line, set file pointer
+ self.hfile.seek(self.sizeof_data*self.start, 1)
+
+ iqdims = [[0.075, 0.2, 0.4, 0.6], [0.075, 0.55, 0.4, 0.3]]
+ psddims = [[0.575, 0.2, 0.4, 0.6], [0.575, 0.55, 0.4, 0.3]]
+ specdims = [0.2, 0.125, 0.6, 0.3]
+
+ # Subplot for real and imaginary parts of signal
+ self.sp_iq = self.fig.add_subplot(2,2,1, position=iqdims[self.dospec])
+ self.sp_iq.set_title(("I&Q"), fontsize=self.title_font_size,
fontweight="bold")
+ self.sp_iq.set_xlabel("Time (s)", fontsize=self.label_font_size,
fontweight="bold")
+ self.sp_iq.set_ylabel("Amplitude (V)", fontsize=self.label_font_size,
fontweight="bold")
+
+ # Subplot for PSD plot
+ self.sp_psd = self.fig.add_subplot(2,2,2,
position=psddims[self.dospec])
+ self.sp_psd.set_title(("PSD"), fontsize=self.title_font_size,
fontweight="bold")
+ self.sp_psd.set_xlabel("Frequency (Hz)",
fontsize=self.label_font_size, fontweight="bold")
+ self.sp_psd.set_ylabel("Power Spectrum (dBm)",
fontsize=self.label_font_size, fontweight="bold")
+
+ self.get_data()
+
+ self.plot_iq = self.sp_iq.plot([], 'bo-') # make plot for reals
+ self.plot_iq += self.sp_iq.plot([], 'ro-') # make plot for imags
+ self.draw_time() # draw the plot
+
+ self.plot_psd = self.sp_psd.plot([], 'b') # make plot for PSD
+ self.draw_psd() # draw the plot
+
+
+ if self.dospec:
+ # Subplot for spectrogram plot
+ self.sp_spec = self.fig.add_subplot(2,2,3, position=specdims)
+ self.sp_spec.set_title(("Spectrogram"),
fontsize=self.title_font_size, fontweight="bold")
+ self.sp_spec.set_xlabel("Time (s)", fontsize=self.label_font_size,
fontweight="bold")
+ self.sp_spec.set_ylabel("Frequency (Hz)",
fontsize=self.label_font_size, fontweight="bold")
+
+ self.draw_spec()
+
+ draw()
+
+ def draw_time(self):
+ reals = self.iq.real
+ imags = self.iq.imag
+ self.plot_iq[0].set_data([self.time, reals])
+ self.plot_iq[1].set_data([self.time, imags])
+ self.sp_iq.set_xlim(min(self.time), max(self.time))
+ self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]),
+ 1.5*max([max(reals), max(imags)])])
+
+ def draw_psd(self):
+ self.plot_psd[0].set_data([self.freq, self.iq_psd])
+ self.sp_psd.set_ylim([min(self.iq_psd)-10, max(self.iq_psd)+10])
+
+ def draw_spec(self):
+ overlap = self.specfftsize/4
+ winfunc = scipy.blackman
+ self.sp_spec.clear()
+ self.sp_spec.specgram(self.iq, self.specfftsize, self.sample_rate,
+ window = lambda d: d*winfunc(self.specfftsize),
+ noverlap = overlap, xextent=[min(self.time),
max(self.time)])
+
+ def update_plots(self):
+ self.draw_time()
+ self.draw_psd()
+
+ if self.dospec:
+ self.draw_spec()
+
+ self.xlim = self.sp_iq.get_xlim() # so zoom doesn't get called
+ draw()
+
+ def zoom(self, event):
+ newxlim = self.sp_iq.get_xlim()
+ if(newxlim.all() != self.xlim.all()):
+ self.xlim = newxlim
+ xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] -
self.position))))
+ xmax = min(int(ceil(self.sample_rate*(self.xlim[1] -
self.position))), len(self.iq))
+
+ iq = self.iq[xmin : xmax]
+ time = self.time[xmin : xmax]
+
+ iq_psd, freq = self.dopsd(iq)
+
+ self.plot_psd[0].set_data(freq, iq_psd)
+ self.sp_psd.axis([min(freq), max(freq),
+ min(iq_psd)-10, max(iq_psd)+10])
+
+ draw()
+
+ def click(self, event):
+ forward_valid_keys = [" ", "down", "right"]
+ backward_valid_keys = ["up", "left"]
+
+ if(find(event.key, forward_valid_keys)):
+ self.step_forward()
+
+ elif(find(event.key, backward_valid_keys)):
+ self.step_backward()
+
+ def button_left_click(self, event):
+ self.step_backward()
+
+ def button_right_click(self, event):
+ self.step_forward()
+
+ def step_forward(self):
+ self.get_data()
+ self.update_plots()
+
+ def step_backward(self):
+ # Step back in file position
+ if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ):
+ self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
+ else:
+ self.hfile.seek(-self.hfile.tell(),1)
+ self.get_data()
+ self.update_plots()
+
+def find(item_in, list_search):
+ try:
+ return list_search.index(item_in) != None
+ except ValueError:
+ return False
+
+def setup_options():
+ usage="%prog: [options] input_filename"
+ description = "Takes a GNU Radio binary file (with specified data type
using --data-type) and displays the I&Q data versus time as well as the power
spectral density (PSD) plot. The y-axis values are plotted assuming volts as
the amplitude of the I&Q streams and converted into dBm in the frequency domain
(the 1/N power adjustment out of the FFT is performed internally). The script
plots a certain block of data at a time, specified on the command line as -B or
--block. The start position in the file can be set by specifying -s or --start
and defaults to 0 (the start of the file). By default, the system assumes a
sample rate of 1, so in time, each sample is plotted versus the sample number.
To set a true time and frequency axis, set the sample rate (-R or
--sample-rate) to the sample rate used when capturing the samples. Finally, the
size of the FFT to use for the PSD and spectrogram plots can be set
independently with --psd-size and --spec-size, respectively. The spectrogram
plot does not display by default and is turned on with -S or --enable-spec."
+
+ parser = OptionParser(conflict_handler="resolve", usage=usage,
description=description)
+ parser.add_option("-d", "--data-type", type="string", default="complex64",
+ help="Specify the data type (complex64, float32,
(u)int32, (u)int16, (u)int8) [default=%default]")
+ parser.add_option("-B", "--block", type="int", default=8192,
+ help="Specify the block size [default=%default]")
+ parser.add_option("-s", "--start", type="int", default=0,
+ help="Specify where to start in the file
[default=%default]")
+ parser.add_option("-R", "--sample-rate", type="float", default=1.0,
+ help="Set the sampler rate of the data
[default=%default]")
+ parser.add_option("", "--psd-size", type="int", default=1024,
+ help="Set the size of the PSD FFT [default=%default]")
+ parser.add_option("", "--spec-size", type="int", default=256,
+ help="Set the size of the spectrogram FFT
[default=%default]")
+ parser.add_option("-S", "--enable-spec", action="store_true",
default=False,
+ help="Turn on plotting the spectrogram
[default=%default]")
+
+ return parser
+
+def main():
+ parser = setup_options()
+ (options, args) = parser.parse_args ()
+ if len(args) != 1:
+ parser.print_help()
+ raise SystemExit, 1
+ filename = args[0]
+
+ dc = gr_plot_psd(options.data_type, filename, options)
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
+
+
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_c.py
(from rev 10133, gnuradio/trunk/gr-utils/src/python/gr_plot_psd_c.py)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_c.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_c.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+from optparse import OptionParser
+import gr_plot_psd
+
+# This is a wrapper program for gr_plot_psd specifically for complex data
+
+def main():
+ parser = gr_plot_psd.setup_options()
+ parser.remove_option("--data-type")
+
+ (options, args) = parser.parse_args ()
+ if len(args) != 1:
+ parser.print_help()
+ raise SystemExit, 1
+ filename = args[0]
+
+ dc = gr_plot_psd.gr_plot_psd("complex64", filename, options)
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
+
+
Copied:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_f.py
(from rev 10133, gnuradio/trunk/gr-utils/src/python/gr_plot_psd_f.py)
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_f.py
(rev 0)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/gr_plot_psd_f.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# 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.
+#
+
+from optparse import OptionParser
+import gr_plot_psd
+
+# This is a wrapper program for gr_plot_psd specifically for floating point
data
+
+def main():
+ parser = gr_plot_psd.setup_options()
+ parser.remove_option("--data-type")
+
+ (options, args) = parser.parse_args ()
+ if len(args) != 1:
+ parser.print_help()
+ raise SystemExit, 1
+ filename = args[0]
+
+ dc = gr_plot_psd.gr_plot_psd("float32", filename, options)
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
+
+
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_fft.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_fft.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_fft.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -68,8 +68,7 @@
self.u = usrp2.source_32fc(options.interface, options.mac_addr)
self.u.set_decim(options.decim)
- #input_rate = self.u.adc_freq() / self.u.decim_rate()
- input_rate = 100e6/options.decim
+ input_rate = self.u.adc_rate() / self.u.decim()
if options.waterfall:
self.scope = \
@@ -90,15 +89,13 @@
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- #g = self.subdev.gain_range()
- #options.gain = float(g[0]+g[1])/2
- options.gain = 0
+ g = self.u.gain_range()
+ options.gain = float(g[0]+g[1])/2
if options.freq is None:
# if no freq was specified, use the mid-point
- #r = self.subdev.freq_range()
- #options.freq = float(r[0]+r[1])/2
- options.freq = 0
+ r = self.u.freq_range()
+ options.freq = float(r[0]+r[1])/2
self.set_gain(options.gain)
@@ -107,13 +104,13 @@
# self.subdev.select_rx_antenna(options.antenna)
if self.show_debug_info:
- self.myform['decim'].set_value(options.decim)
- self.myform['address@hidden'].set_value(100e6/options.decim)
#self.u.adc_freq() / self.u.decim_rate())
- #self.myform['dbname'].set_value(self.subdev.name())
+ self.myform['decim'].set_value(self.u.decim())
+ self.myform['address@hidden'].set_value(input_rate)
+ self.myform['dbname'].set_value("0x%04X" %
(self.u.daughterboard_id(),)) # FIXME: add text name
self.myform['baseband'].set_value(0)
self.myform['ddc'].set_value(0)
- if not(self.u.set_center_freq(options.freq)):
+ if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
def _set_status_msg(self, msg):
@@ -135,9 +132,11 @@
callback=myform.check_input_and_call(_form_set_freq,
self._set_status_msg))
hbox.Add((5,0), 0, 0)
- #g = self.subdev.gain_range()
- g = [0, 100, 1] #FIXME
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox,
label="Gain",
+ g = self.u.gain_range()
+
+ # some configurations don't have gain control
+ if g[1] > g[0]:
+ myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox,
label="Gain",
weight=3,
min=int(g[0]), max=int(g[1]),
callback=self.set_gain)
@@ -174,8 +173,8 @@
callback=myform.check_input_and_call(_form_set_decim,
self._set_status_msg))
hbox.Add((5,0), 1)
- myform['address@hidden'] = form.static_float_field(
- parent=panel, sizer=hbox, label="address@hidden")
+ myform['address@hidden'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="address@hidden")
hbox.Add((5,0), 1)
myform['dbname'] = form.static_text_field(
@@ -219,19 +218,19 @@
return False
def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
+ if self.myform.has_key('gain'):
+ self.myform['gain'].set_value(gain) # update displayed value
self.u.set_gain(gain)
def set_decim(self, decim):
ok = self.u.set_decim(decim)
if not ok:
print "set_decim failed"
- #input_rate = self.u.adc_freq() / self.u.decim_rate()
- input_rate = 100e6/decim # FIXME
+ input_rate = self.u.adc_rate() / self.u.decim()
self.scope.set_sample_rate(input_rate)
if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(decim) #self.u.decim_rate())
- self.myform['address@hidden'].set_value(input_rate)
#self.u.adc_freq() / self.u.decim_rate())
+ self.myform['decim'].set_value(self.u.decim())
+ self.myform['address@hidden'].set_value(input_rate)
return ok
def _setup_events(self):
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_rx_cfile.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_rx_cfile.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_rx_cfile.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -22,8 +22,8 @@
"""
Read samples from the USRP2 and write to file formatted as binary
-outputs single precision complex float values or complex short values
(interleaved 16 bit signed short integers).
-
+outputs single precision complex float values or complex short values
+(interleaved 16 bit signed short integers).
"""
from gnuradio import gr, eng_notation
@@ -52,9 +52,9 @@
# Set receive daughterboard gain
if options.gain is None:
- #g = self._u.gain_range()
- #options.gain = float(g[0]+g[1])/2
- options.gain = 0 # Until gain range is implemented
+ g = self._u.gain_range()
+ options.gain = float(g[0]+g[1])/2
+ print "Using mid-point gain of", options.gain, "(", g[0], "-",
g[1], ")"
self._u.set_gain(options.gain)
# Set receive frequency
@@ -63,7 +63,7 @@
sys.stderr.write('Failed to set center frequency\n')
raise SystemExit, 1
- # Create head block if needed wire it up
+ # Create head block if needed and wire it up
if options.nsamples is None:
self.connect(self._u, self._sink)
else:
@@ -74,13 +74,12 @@
self.connect(self._u, self._head, self._sink)
- #input_rate = self.u.adc_freq() / self.u.decim_rate()
- input_rate = 100e6/options.decim
+ input_rate = self._u.adc_rate()/self._u.decim()
if options.verbose:
print "Network interface:", options.interface
print "USRP2 address:", self._u.mac_addr()
- #print "Using RX d'board %s" % (self._u.rx_name(),)
+ print "Using RX d'board id 0x%04X" % (self._u.daughterboard_id(),)
print "Rx gain:", options.gain
print "Rx baseband frequency:", n2s(tr.baseband_freq)
print "Rx DDC frequency:", n2s(tr.dxc_freq)
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_siggen.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_siggen.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp2_siggen.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -25,6 +25,7 @@
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
+import math
n2s = eng_notation.num_to_str
@@ -38,9 +39,8 @@
# Set the Tx daughterboard gain as requested
if options.gain is None:
- #g = self._u.gain_range()
- #options.gain = float(g[0]+g[1])/2
- options.gain = 0 # Until gain range is implemented
+ g = self._u.gain_range()
+ options.gain = float(g[0]+g[1])/2
self._u.set_gain(options.gain)
# Tune the USRP2 FPGA and daughterboard to the requested center
frequency
@@ -49,8 +49,7 @@
sys.stderr.write('Failed to set center frequency\n')
raise SystemExit, 1
- #eth_rate = self._u.dac_rate()/self._u.interp_rate()
- eth_rate = 100e6/options.interp # FIXME
+ eth_rate = self._u.dac_rate()/self._u.interp()
# Create a source for the requested waveform type
if options.type == gr.GR_SIN_WAVE or options.type == gr.GR_CONST_WAVE:
@@ -62,6 +61,37 @@
elif options.type == gr.GR_GAUSSIAN or options.type == gr.GR_UNIFORM:
self._src = gr.noise_source_c(options.type, options.amplitude)
+ elif options.type == "2tone":
+ self._src1 = gr.sig_source_c(eth_rate,
+ gr.GR_SIN_WAVE,
+ options.waveform_freq,
+ options.amplitude,
+ 0)
+ if(options.waveform2_freq is None):
+ w2freq = -options.waveform_freq
+ else:
+ w2freq = options.waveform2_freq
+ self._src2 = gr.sig_source_c(eth_rate,
+ gr.GR_SIN_WAVE,
+ w2freq,
+ options.amplitude,
+ 0)
+ self._src = gr.add_cc()
+ self.connect(self._src1,(self._src,0))
+ self.connect(self._src2,(self._src,1))
+ elif options.type == "sweep":
+ # rf freq is center frequency
+ # waveform_freq is total swept width
+ # waveform2_freq is sweep rate
+ # will sweep from (rf_freq-waveform_freq/2) to
(rf_freq+waveform_freq/2)
+ self._src1 = gr.sig_source_f(eth_rate,
+ gr.GR_TRI_WAVE,
+ options.waveform2_freq,
+ 1.0, # options.waveform_freq,
+ -0.5)
+ self._src2 =
gr.frequency_modulator_fc(options.waveform_freq*2*math.pi/eth_rate)
+ self._src = gr.multiply_const_cc(options.amplitude)
+ self.connect(self._src1,self._src2,self._src)
else:
sys.stderr.write('Unknown waveform type\n')
raise SystemExit, 1
@@ -105,8 +135,10 @@
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-v", "--verbose", action="store_true", default=False,
help="verbose output")
- parser.add_option("-w", "--waveform-freq", type="eng_float", default=100e3,
+ parser.add_option("-w", "--waveform-freq", type="eng_float", default=0,
help="set waveform frequency to FREQ [default=%default]")
+ parser.add_option("-x", "--waveform2-freq", type="eng_float", default=None,
+ help="set waveform frequency to FREQ [default=%default]")
parser.add_option("-a", "--amplitude", type="eng_float", default=0.5,
help="set waveform amplitude to AMPLITUDE (0-1.0)
[default=%default]", metavar="AMPL")
parser.add_option("--offset", type="eng_float", default=0,
@@ -119,7 +151,11 @@
help="generate Gaussian random output")
parser.add_option("--uniform", dest="type", action="store_const",
const=gr.GR_UNIFORM,
help="generate Uniform random output")
-
+ parser.add_option("--2tone", dest="type", action="store_const",
const="2tone",
+ help="generate Two Tone signal for IMD testing")
+ parser.add_option("--sweep", dest="type", action="store_const",
const="sweep",
+ help="generate a swept sine wave")
+
(options, args) = parser.parse_args ()
if len(args) != 0:
parser.print_help()
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_fft.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_fft.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_fft.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -64,7 +64,7 @@
parser.add_option("-f", "--freq", type="eng_float", default=None,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
+ help="set gain in dB [default is midpoint]")
parser.add_option("-W", "--waterfall", action="store_true",
default=False,
help="Enable waterfall display")
parser.add_option("-8", "--width-8", action="store_true",
default=False,
@@ -74,9 +74,12 @@
parser.add_option("-S", "--oscilloscope", action="store_true",
default=False,
help="Enable oscilloscope display")
parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
- help="Set fftsink averaging factor,
default=[%default]")
+ help="Set fftsink averaging factor,
[default=%default]")
parser.add_option("", "--ref-scale", type="eng_float", default=13490.0,
- help="Set dBFS=0dB input value, default=[%default]")
+ help="Set dBFS=0dB input value, [default=%default]")
+ parser.add_option("", "--fft-size", type="int", default=1024,
+ help="Set FFT frame size, [default=%default]");
+
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -115,11 +118,11 @@
if options.waterfall:
self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024,
sample_rate=input_rate)
+ waterfallsink2.waterfall_sink_c (panel,
fft_size=options.fft_size, sample_rate=input_rate)
elif options.oscilloscope:
self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
else:
- self.scope = fftsink2.fft_sink_c (panel, fft_size=1024,
sample_rate=input_rate,
+ self.scope = fftsink2.fft_sink_c (panel,
fft_size=options.fft_size, sample_rate=input_rate,
ref_scale=options.ref_scale,
ref_level=0.0, y_divs = 10,
avg_alpha=options.avg_alpha)
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_siggen.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_siggen.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-utils/src/python/usrp_siggen.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -148,7 +148,7 @@
parser.add_option ("--uniform", dest="type", action="store_const",
const=gr.GR_UNIFORM,
help="generate Uniform random output")
- parser.add_option ("-w", "--waveform-freq", type="eng_float",
default=100e3,
+ parser.add_option ("-w", "--waveform-freq", type="eng_float", default=0,
help="set waveform frequency to FREQ
[default=%default]")
parser.add_option ("-a", "--amplitude", type="eng_float", default=16e3,
help="set waveform amplitude to AMPLITUDE
[default=%default]", metavar="AMPL")
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/common.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/common.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/common.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -31,6 +31,15 @@
setattr(self, 'set_%s'%control_key, set_method)
##################################################
+# Custom Data Event
+##################################################
+EVT_DATA = wx.PyEventBinder(wx.NewEventType())
+class DataEvent(wx.PyEvent):
+ def __init__(self, data):
+ wx.PyEvent.__init__(self, wx.NewId(), EVT_DATA.typeId)
+ self.data = data
+
+##################################################
# Input Watcher Thread
##################################################
class input_watcher(threading.Thread):
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/fft_window.py
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/fft_window.py
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/fft_window.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -149,6 +149,7 @@
#ensure y_per_div
if y_per_div not in DIV_LEVELS: y_per_div = DIV_LEVELS[0]
#setup
+ self.samples = list()
self.ext_controller = controller
self.real = real
self.fft_size = fft_size
@@ -197,6 +198,7 @@
Autoscale the fft plot to the last frame.
Set the dynamic range and reference level.
"""
+ if not len(self.samples): return
#get the peak level (max of the samples)
peak_level = numpy.max(self.samples)
#get the noise floor (averge the smallest samples)
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/number_window.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/number_window.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/number_window.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -135,6 +135,7 @@
self._register_set_prop(self, RUNNING_KEY, True)
#register events
self.ext_controller.subscribe(msg_key, self.handle_msg)
+ self.Bind(common.EVT_DATA, self.update)
def show_gauges(self, show_gauge):
"""
@@ -149,11 +150,19 @@
def handle_msg(self, msg):
"""
+ Post this message into a data event.
+ Allow wx to handle the event to avoid threading issues.
+ @param msg the incoming numbersink data
+ """
+ wx.PostEvent(self, common.DataEvent(msg))
+
+ def update(self, event):
+ """
Handle a message from the message queue.
Convert the string based message into a float or complex.
If more than one number was read, only take the last number.
Perform peak hold operations, set the gauges and display.
- @param msg the number sample as a character array
+ @param event event.data is the number sample as a character
array
"""
if not self[RUNNING_KEY]: return
#set gauge
@@ -164,12 +173,12 @@
gauge.SetValue(gauge_val)
format_string = "%%.%df"%self.decimal_places
if self.real:
- sample = numpy.fromstring(msg, numpy.float32)[-1]
+ sample = numpy.fromstring(event.data, numpy.float32)[-1]
if self[PEAK_HOLD_KEY]: sample = self.peak_val_real =
max(self.peak_val_real, sample)
label_text = "%s %s"%(format_string%sample, self.units)
set_gauge_value(self.gauge_real, sample)
else:
- sample = numpy.fromstring(msg, numpy.complex64)[-1]
+ sample = numpy.fromstring(event.data,
numpy.complex64)[-1]
if self[PEAK_HOLD_KEY]:
self.peak_val_real = max(self.peak_val_real,
sample.real)
self.peak_val_imag = max(self.peak_val_imag,
sample.imag)
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/waterfall_window.py
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/waterfall_window.py
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gr-wxgui/src/python/waterfall_window.py
2008-12-20 02:40:37 UTC (rev 10138)
@@ -168,6 +168,7 @@
):
pubsub.pubsub.__init__(self)
#setup
+ self.samples = list()
self.ext_controller = controller
self.real = real
self.fft_size = fft_size
@@ -220,6 +221,7 @@
Set the dynamic range and reference level.
Does not affect the current data in the waterfall.
"""
+ if not len(self.samples): return
#get the peak level (max of the samples)
peak_level = numpy.max(self.samples)
#get the noise floor (averge the smallest samples)
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/gruel/src/include/gruel/realtime.h
===================================================================
---
gnuradio/branches/developers/n4hy/pfb_fbs/gruel/src/include/gruel/realtime.h
2008-12-20 02:37:07 UTC (rev 10137)
+++
gnuradio/branches/developers/n4hy/pfb_fbs/gruel/src/include/gruel/realtime.h
2008-12-20 02:40:37 UTC (rev 10138)
@@ -84,6 +84,9 @@
* an non-blocking infinite loop and you enable realtime scheduling,
* it's possible to hang the system.
*/
+
+ // NOTE: If you change this, you need to change the code in
+ // gnuradio-core/src/lib/runtime/gr_realtime.i, see note there.
rt_status_t
enable_realtime_scheduling(rt_sched_param = rt_sched_param());
Modified:
gnuradio/branches/developers/n4hy/pfb_fbs/usrp/host/lib/inband/Makefile.am
===================================================================
--- gnuradio/branches/developers/n4hy/pfb_fbs/usrp/host/lib/inband/Makefile.am
2008-12-20 02:37:07 UTC (rev 10137)
+++ gnuradio/branches/developers/n4hy/pfb_fbs/usrp/host/lib/inband/Makefile.am
2008-12-20 02:40:37 UTC (rev 10138)
@@ -32,8 +32,8 @@
usrp_interface.mbh
lib_LTLIBRARIES = \
- libusrp_inband.la \
- libusrp_inband-qa.la
+ libusrp-inband.la \
+ libusrp-inband-qa.la
# ------------------------------------------------------------------------
# Build the inband library
@@ -100,7 +100,7 @@
libusrp_inband_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid-version
libusrp_inband_qa_la_LIBADD = \
- libusrp_inband.la \
+ libusrp-inband.la \
$(PMT_LA) \
$(CPPUNIT_LIBS) \
-lstdc++
@@ -111,7 +111,7 @@
test_inband
test_inband_SOURCES = test_inband.cc
-test_inband_LDADD = libusrp_inband-qa.la
+test_inband_LDADD = libusrp-inband-qa.la
MOSTLYCLEANFILES = \
$(BUILT_SOURCES) *~ *.pyc
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10138 - in gnuradio/branches/developers/n4hy/pfb_fbs: . config gnuradio-examples/c++/dial_tone gnuradio-examples/python gnuradio-examples/python/digital gnuradio-examples/python/usrp2 gr-audio-alsa gr-audio-alsa/src gr-trellis/src/examples/fsm_files gr-trellis/src/lib gr-usrp/src gr-usrp2/src gr-utils/src/python gr-wxgui/src/python gruel/src/include/gruel usrp/host/lib/inband,
n4hy <=