diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-06-10 15:15:16 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-13 16:30:36 +0200 |
commit | 893b74c770b81f2c09094577e2de720155f84b61 (patch) | |
tree | ce430f554cf032c70eab8a95228731afbffc6efd | |
parent | 7ac7cf6246e4d984d36c64df10ba4d2b2f6b2204 (diff) | |
parent | 6fb0ff274a05daf2f2677af14337704fb88081f7 (diff) |
Merge remote-tracking branch 'grcwg/next_grcwg' into gtk3
427 files changed, 1195 insertions, 61170 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3641ab4b5c..3fc1a2ebda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2010-2015 Free Software Foundation, Inc. +# Copyright 2010-2012,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -45,20 +45,47 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") # Set the version information here set(VERSION_INFO_MAJOR_VERSION 3) -set(VERSION_INFO_API_COMPAT 7) -set(VERSION_INFO_MINOR_VERSION 10) -set(VERSION_INFO_MAINT_VERSION git) +set(VERSION_INFO_API_COMPAT 8) +set(VERSION_INFO_MINOR_VERSION git) +set(VERSION_INFO_MAINT_VERSION 0) include(GrVersion) #setup version info -# Append -O2 optimization flag for Debug builds -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2") +# Append -O2 optimization flag for Debug builds (Not on MSVC since conflicts with RTC1 flag) +IF (NOT MSVC) + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2") +ENDIF() + +# Set C/C++ standard for all targets +# NOTE: Starting with cmake v3.1 this should be used: +# set(CMAKE_C_STANDARD 90) +# set(CMAKE_CXX_STANDARD 98) + +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") +ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") +ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") +ELSE() + message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.") +ENDIF() + +IF(CMAKE_C_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") +ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") +ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") +ELSE() + message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.") +ENDIF() ######################################################################## # Environment setup ######################################################################## IF(NOT DEFINED BOOST_ROOT) - SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) + SET(BOOST_ROOT "${CMAKE_INSTALL_PREFIX}") ENDIF() ######################################################################## @@ -120,6 +147,9 @@ IF(MSVC) ELSE(MSVC12) #Visual Studio 12 SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0") SET(cmake_cxx_compiler_version "Microsoft Visual Studio 12.0") + ELSE(MSVC14) #Visual Studio 14 + SET(cmake_c_compiler_version "Microsoft Visual Studio 14.0") + SET(cmake_cxx_compiler_version "Microsoft Visual Studio 14.0") ENDIF() ELSE() execute_process(COMMAND ${CMAKE_C_COMPILER} --version @@ -158,7 +188,7 @@ set(GR_THEMES_DIR ${GR_PKG_DATA_DIR}/themes CACHE PATH "Path to install QTG # Set location of config/prefs files in /etc # Special exception if prefix is /usr so we don't make a /usr/etc. set(GR_CONF_DIR etc CACHE PATH "Path to install config files") -string(COMPARE EQUAL ${CMAKE_INSTALL_PREFIX} "/usr" isusr) +string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "/usr" isusr) if(isusr) set(SYSCONFDIR "/${GR_CONF_DIR}" CACHE PATH "System configuration directory") else(isusr) @@ -323,6 +353,9 @@ if(NOT VOLK_FOUND) set(VOLK_LIBRARIES volk) + set(VOLK_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_PREFIX}/lib) + set(VOLK_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include) + if(ENABLE_VOLK) include(GrPackage) @@ -344,6 +377,9 @@ if(NOT VOLK_FOUND) else() message(STATUS " An external VOLK has been found and will be used for build.") set(ENABLE_VOLK TRUE) + + get_filename_component(VOLK_INSTALL_LIBRARY_DIR "${VOLK_LIBRARIES}" DIRECTORY) + set(VOLK_INSTALL_INCLUDE_DIR ${VOLK_INCLUDE_DIRS}) endif(NOT VOLK_FOUND) message(STATUS " Override with -DENABLE_INTERNAL_VOLK=ON/OFF") @@ -389,11 +425,9 @@ add_subdirectory(gr-filter) add_subdirectory(gr-analog) add_subdirectory(gr-digital) add_subdirectory(gr-dtv) -add_subdirectory(gr-atsc) add_subdirectory(gr-audio) add_subdirectory(gr-comedi) add_subdirectory(gr-channels) -add_subdirectory(gr-noaa) add_subdirectory(gr-pager) add_subdirectory(gr-qtgui) add_subdirectory(gr-trellis) @@ -401,7 +435,6 @@ add_subdirectory(gr-uhd) add_subdirectory(gr-utils) add_subdirectory(gr-video-sdl) add_subdirectory(gr-vocoder) -add_subdirectory(gr-fcd) add_subdirectory(gr-wavelet) add_subdirectory(gr-wxgui) add_subdirectory(gr-zeromq) @@ -425,12 +458,17 @@ endif(ENABLE_GR_CTRLPORT) # http://www.cmake.org/Wiki/CMake/Tutorials/Packaging configure_file( + ${CMAKE_SOURCE_DIR}/cmake/Modules/GnuradioConfig.cmake.in + ${CMAKE_BINARY_DIR}/cmake/Modules/GnuradioConfig.cmake +@ONLY) + +configure_file( ${CMAKE_SOURCE_DIR}/cmake/Modules/GnuradioConfigVersion.cmake.in ${CMAKE_BINARY_DIR}/cmake/Modules/GnuradioConfigVersion.cmake @ONLY) SET(cmake_configs - ${CMAKE_SOURCE_DIR}/cmake/Modules/GnuradioConfig.cmake + ${CMAKE_BINARY_DIR}/cmake/Modules/GnuradioConfig.cmake ${CMAKE_BINARY_DIR}/cmake/Modules/GnuradioConfigVersion.cmake ) diff --git a/cmake/Modules/FindGSL.cmake b/cmake/Modules/FindGSL.cmake index b36a1e9c2a..7b8c6cdb64 100644 --- a/cmake/Modules/FindGSL.cmake +++ b/cmake/Modules/FindGSL.cmake @@ -44,7 +44,7 @@ if( WIN32 AND NOT CYGWIN AND NOT MSYS ) # look for gsl cblas library find_library( GSL_CBLAS_LIBRARY - NAMES gslcblas + NAMES gslcblas cblas ) if( GSL_CBLAS_LIBRARY ) set( GSL_CBLAS_FOUND ON ) diff --git a/cmake/Modules/FindGnuradio.cmake b/cmake/Modules/FindGnuradio.cmake index 6410dfa22b..716e6f98b4 100644 --- a/cmake/Modules/FindGnuradio.cmake +++ b/cmake/Modules/FindGnuradio.cmake @@ -103,16 +103,13 @@ endfunction() GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) -GR_MODULE(ATSC gnuradio-atsc gnuradio/atsc/api.h gnuradio-atsc) GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) GR_MODULE(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) -GR_MODULE(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) GR_MODULE(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) GR_MODULE(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) GR_MODULE(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) -GR_MODULE(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) GR_MODULE(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) GR_MODULE(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) GR_MODULE(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake index 3ce49aa04b..da8bbe9049 100644 --- a/cmake/Modules/FindQwt.cmake +++ b/cmake/Modules/FindQwt.cmake @@ -9,6 +9,7 @@ find_path(QWT_INCLUDE_DIRS NAMES qwt_global.h HINTS ${CMAKE_INSTALL_PREFIX}/include/qwt + ${CMAKE_PREFIX_PATH}/include/qwt PATHS /usr/local/include/qwt-qt4 /usr/local/include/qwt @@ -22,10 +23,11 @@ find_path(QWT_INCLUDE_DIRS ) find_library (QWT_LIBRARIES - NAMES qwt6 qwt6-qt4 qwt qwt-qt4 + NAMES qwt6 qwt6-qt4 qwt qwt-qt4 qwt5 qwtd5 HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64 + ${CMAKE_PREFIX_PATH}/lib PATHS /usr/local/lib /usr/lib diff --git a/cmake/Modules/GnuradioConfig.cmake b/cmake/Modules/GnuradioConfig.cmake.in index 31532c605c..d9ca22dd7a 100644 --- a/cmake/Modules/GnuradioConfig.cmake +++ b/cmake/Modules/GnuradioConfig.cmake.in @@ -72,6 +72,8 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) ${CMAKE_INSTALL_PREFIX}/include PATHS /usr/local/include /usr/include + "@CMAKE_INSTALL_PREFIX@/include" + "@VOLK_INSTALL_INCLUDE_DIR@" ) # look for libs @@ -87,6 +89,8 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) /usr/local/lib64 /usr/lib /usr/lib64 + "@CMAKE_INSTALL_PREFIX@/lib" + "@VOLK_INSTALL_LIBRARY_DIR@" ) list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) endforeach(libname) @@ -116,7 +120,6 @@ endfunction() GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) -GR_MODULE(ATSC gnuradio-atsc gnuradio/atsc/api.h gnuradio-atsc) GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake index ecf58a9367..6e036a5bdc 100644 --- a/cmake/Modules/GrBoost.cmake +++ b/cmake/Modules/GrBoost.cmake @@ -31,10 +31,15 @@ set(BOOST_REQUIRED_COMPONENTS program_options filesystem system - thread regex ) +if (MINGW) + set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread_win32) +else(MINGW) + set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread) +endif(MINGW) + if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") diff --git a/cmake/Packaging/Fedora-15.cmake b/cmake/Packaging/Fedora-15.cmake index c86dbedbd8..4e648486e1 100644 --- a/cmake/Packaging/Fedora-15.cmake +++ b/cmake/Packaging/Fedora-15.cmake @@ -1,7 +1,8 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4") -SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah") +SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah" "python-mako") SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy") SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL") SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd") diff --git a/cmake/Packaging/Fedora-16.cmake b/cmake/Packaging/Fedora-16.cmake index c86dbedbd8..4e648486e1 100644 --- a/cmake/Packaging/Fedora-16.cmake +++ b/cmake/Packaging/Fedora-16.cmake @@ -1,7 +1,8 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4") -SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah") +SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah" "python-mako") SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy") SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL") SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd") diff --git a/cmake/Packaging/Fedora-17.cmake b/cmake/Packaging/Fedora-17.cmake index ee5460702c..4e7ff51f9f 100644 --- a/cmake/Packaging/Fedora-17.cmake +++ b/cmake/Packaging/Fedora-17.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4") SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Fedora-18.cmake b/cmake/Packaging/Fedora-18.cmake index ee5460702c..4e7ff51f9f 100644 --- a/cmake/Packaging/Fedora-18.cmake +++ b/cmake/Packaging/Fedora-18.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4") SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-10.04.cmake b/cmake/Packaging/Ubuntu-10.04.cmake index c297a50a4c..7f0fe82211 100644 --- a/cmake/Packaging/Ubuntu-10.04.cmake +++ b/cmake/Packaging/Ubuntu-10.04.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-10.10.cmake b/cmake/Packaging/Ubuntu-10.10.cmake index c297a50a4c..7f0fe82211 100644 --- a/cmake/Packaging/Ubuntu-10.10.cmake +++ b/cmake/Packaging/Ubuntu-10.10.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-11.04.cmake b/cmake/Packaging/Ubuntu-11.04.cmake index d08ae1d2c5..b72ff46e70 100644 --- a/cmake/Packaging/Ubuntu-11.04.cmake +++ b/cmake/Packaging/Ubuntu-11.04.cmake @@ -1,5 +1,6 @@ #set the debian package dependencies (parsed by our deb component maker) SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt5-qt4") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-11.10.cmake b/cmake/Packaging/Ubuntu-11.10.cmake index d27cdae532..952eeb6026 100644 --- a/cmake/Packaging/Ubuntu-11.10.cmake +++ b/cmake/Packaging/Ubuntu-11.10.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-12.04.cmake b/cmake/Packaging/Ubuntu-12.04.cmake index f5ead83182..8d4b8d18d1 100644 --- a/cmake/Packaging/Ubuntu-12.04.cmake +++ b/cmake/Packaging/Ubuntu-12.04.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-12.10.cmake b/cmake/Packaging/Ubuntu-12.10.cmake index f5ead83182..8d4b8d18d1 100644 --- a/cmake/Packaging/Ubuntu-12.10.cmake +++ b/cmake/Packaging/Ubuntu-12.10.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6") SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") diff --git a/cmake/Packaging/Ubuntu-13.04.cmake b/cmake/Packaging/Ubuntu-13.04.cmake index 40f748fdff..ed14b1ab22 100644 --- a/cmake/Packaging/Ubuntu-13.04.cmake +++ b/cmake/Packaging/Ubuntu-13.04.cmake @@ -1,4 +1,5 @@ SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6") +SET(PACKAGE_DEPENDS_UTILS "python-mako") SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy") SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6") diff --git a/cmake/Packaging/Ubuntu-15.10.cmake b/cmake/Packaging/Ubuntu-15.10.cmake new file mode 100644 index 0000000000..ed14b1ab22 --- /dev/null +++ b/cmake/Packaging/Ubuntu-15.10.cmake @@ -0,0 +1,13 @@ +SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "libboost-all-dev" "libc6") +SET(PACKAGE_DEPENDS_UTILS "python-mako") +SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python" "python-numpy") +SET(PACKAGE_DEPENDS_CORE_RUNTIME "libfftw3-3") +SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "libqtcore4" "libqwt6") +SET(PACKAGE_DEPENDS_QTGUI_PYTHON "python-qt4" "python-qwt5-qt4") +SET(PACKAGE_DEPENDS_GRC "python" "python-numpy" "python-gtk2" "python-lxml" "python-cheetah") +SET(PACKAGE_DEPENDS_WXGUI "python-wxgtk2.8" "python-opengl") +SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "libsdl1.2debian") +SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd") +SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "libpulse0" "alsa-base" "libjack0") +SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "libgsl0ldbl") +SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "python-numpy") diff --git a/cmake/msvc/config.h b/cmake/msvc/config.h index 43792c7837..50515104db 100644 --- a/cmake/msvc/config.h +++ b/cmake/msvc/config.h @@ -21,19 +21,25 @@ typedef ptrdiff_t ssize_t; //////////////////////////////////////////////////////////////////////// // rint functions //////////////////////////////////////////////////////////////////////// +#define _USE_MATH_DEFINES #include <math.h> +#if _MSC_VER < 1800 static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);} static inline long lrintf(float x){return (long)(x > 0.0f ? x + 0.5f : x - 0.5f);} static inline long long llrint(double x){return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);} static inline long long llrintf(float x){return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);} static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 0.5);} static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x - 0.5f);} +#endif //////////////////////////////////////////////////////////////////////// // math constants //////////////////////////////////////////////////////////////////////// +#ifndef INFINITY #define INFINITY HUGE_VAL +#endif +#ifndef _MATH_DEFINES_DEFINED # define M_E 2.7182818284590452354 /* e */ # define M_LOG2E 1.4426950408889634074 /* log_2 e */ # define M_LOG10E 0.43429448190325182765 /* log_10 e */ @@ -47,6 +53,7 @@ static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif //////////////////////////////////////////////////////////////////////// // random and srandom diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in index 97e67610cc..c5795dfa1f 100644 --- a/docs/doxygen/Doxyfile.in +++ b/docs/doxygen/Doxyfile.in @@ -145,8 +145,6 @@ STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/gnuradio-runtime/include \ @CMAKE_BINARY_DIR@/gnuradio-runtime/include \ @CMAKE_SOURCE_DIR@/gr-analog/include \ @CMAKE_BINARY_DIR@/gr-analog/include \ - @CMAKE_SOURCE_DIR@/gr-atsc/include \ - @CMAKE_BINARY_DIR@/gr-atsc/include \ @CMAKE_SOURCE_DIR@/gr-audio/include \ @CMAKE_BINARY_DIR@/gr-audio/include \ @CMAKE_SOURCE_DIR@/gr-blocks/include \ @@ -752,9 +750,6 @@ EXCLUDE = @abs_top_srcdir@/volk \ @abs_top_builddir@/gnuradio-runtime/python/gnuradio/gr/gr_threading.py \ @abs_top_builddir@/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py \ @abs_top_builddir@/gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py \ - @abs_top_builddir@/gr-atsc/swig/atsc_swig.py \ - @abs_top_builddir@/gr-atsc/lib/gen_encoder.py \ - @abs_top_builddir@/gr-atsc/python \ @abs_top_builddir@/gr-pager/swig/pager_swig.py \ @abs_top_builddir@/gr-trellis/doc \ @abs_top_builddir@/gr-trellis/swig/trellis_swig.py \ @@ -770,8 +765,6 @@ EXCLUDE = @abs_top_srcdir@/volk \ @abs_top_builddir@/gnuradio-runtime/lib \ @abs_top_srcdir@/gr-analog/lib \ @abs_top_builddir@/gr-analog/lib \ - @abs_top_srcdir@/gr-atsc/lib \ - @abs_top_builddir@/gr-atsc/lib \ @abs_top_srcdir@/gr-audio/lib \ @abs_top_builddir@/gr-audio/lib \ @abs_top_srcdir@/gr-blocks/lib \ @@ -845,7 +838,6 @@ EXCLUDE_PATTERNS = */.deps/* \ */.svn/* \ */CVS/* \ */__init__.py \ - */gr-atsc/src/lib/Gr* \ */moc_*.cc \ */qa_*.cc \ */qa_*.h \ diff --git a/docs/doxygen/other/build_guide.dox b/docs/doxygen/other/build_guide.dox index 8fc3f911fb..87e5a456f3 100644 --- a/docs/doxygen/other/build_guide.dox +++ b/docs/doxygen/other/build_guide.dox @@ -29,6 +29,7 @@ first. Most recent systems have these packages available. \li boost (>= 1.35) http://www.boost.org/users/download/ \li cppunit (>= 1.9.14) http://freedesktop.org/wiki/Software/cppunit/ \li fftw3f (>= 3.0.1) http://www.fftw.org/download.html +\li mako (>= 0.4.2) http://www.makotemplates.org/download.html \subsection dep_python Python Wrappers \li python (>= 2.5) http://www.python.org/download/ diff --git a/docs/doxygen/other/group_defs.dox b/docs/doxygen/other/group_defs.dox index 428ac9a8f3..1cb3ff9f97 100644 --- a/docs/doxygen/other/group_defs.dox +++ b/docs/doxygen/other/group_defs.dox @@ -69,11 +69,6 @@ */ /*! - * \defgroup atsc ATSC - * ATSC Applications... - */ - -/*! * \defgroup pager Pager * Pager Applications */ diff --git a/docs/sphinx/source/fcd_blocks.rst b/docs/sphinx/source/fcd_blocks.rst deleted file mode 100644 index 8aed544c97..0000000000 --- a/docs/sphinx/source/fcd_blocks.rst +++ /dev/null @@ -1,6 +0,0 @@ -gnuradio.fcd -============ - -.. automodule:: gnuradio.fcd - -.. autoblock:: gnuradio.fcd.source_c diff --git a/docs/sphinx/source/noaa_blocks.rst b/docs/sphinx/source/noaa_blocks.rst deleted file mode 100644 index 711ce42785..0000000000 --- a/docs/sphinx/source/noaa_blocks.rst +++ /dev/null @@ -1,8 +0,0 @@ -gnuradio.noaa -============= - -.. automodule:: gnuradio.noaa - -.. autoblock:: gnuradio.noaa.hrpt_decoder -.. autoblock:: gnuradio.noaa.hrpt_deframer -.. autoblock:: gnuradio.noaa.hrpt_pll_cf diff --git a/dtools/bin/install-tbb b/dtools/bin/install-tbb deleted file mode 100755 index 8ff216da4c..0000000000 --- a/dtools/bin/install-tbb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -""" -Install the release and debug libs and includes under --prefix -""" - -from optparse import OptionParser -import os -import os.path -import glob - -default_prefix="/usr/local" - -pkgconfig_filename = "tbb.pc" -pkgconfig_file_contents = """\ -prefix=%s -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: tbb -Description: Intel Threading Building Blocks -Requires: -Version: 2.0 -Libs: -L${libdir} -ltbb -ltbbmalloc -Cflags: -I${includedir} -""" - -debug_pkgconfig_filename = "tbb_debug.pc" -debug_pkgconfig_file_contents = """\ -prefix=%s -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: tbb -Description: Intel Threading Building Blocks -Requires: -Version: 2.0 -Libs: -L${libdir} -ltbb_debug -ltbbmalloc_debug -Cflags: -I${includedir} -""" - -def main(): - parser = OptionParser() - parser.add_option('','--prefix', default=default_prefix, - help="install architecture-independent files in PREFIX [default=%default]") - (options, args) = parser.parse_args() - if len(args) != 0: - parser.print_help() - raise SystemExit, 1 - - prefix = options.prefix - - # are we installing 64-bit libs? - - is_64bit = False - files = glob.glob('build/*_em64t_*_release') - # print "files: ", files - if len(files) != 0: - is_64bit = True - - # FIXME add 32 and 64-bit PPC support - - if is_64bit: - lib = 'lib64' - else: - lib = 'lib' - - os.system('install -d ' + os.path.join(prefix, 'include/tbb')) - os.system('install -d ' + os.path.join(prefix, 'include/tbb/machine')) - os.system('install -d ' + os.path.join(prefix, lib)) - os.system('install -d ' + os.path.join(prefix, lib, 'pkgconfig')) - os.system('install -t ' + os.path.join(prefix, lib) + ' build/linux*release/*.so*') - os.system('install -t ' + os.path.join(prefix, lib) + ' build/linux*debug/*.so*') - os.system('install -t ' + os.path.join(prefix, 'include/tbb') + ' include/tbb/*.h') - os.system('install -t ' + os.path.join(prefix, 'include/tbb/machine') + ' include/tbb/machine/*.h') - - f = open(os.path.join(prefix, lib, 'pkgconfig', pkgconfig_filename), 'w') - f.write(pkgconfig_file_contents % (prefix,)) - f.close() - - f = open(os.path.join(prefix, lib, 'pkgconfig', debug_pkgconfig_filename), 'w') - f.write(debug_pkgconfig_file_contents % (prefix,)) - f.close() - -if __name__ == "__main__": - main() diff --git a/gnuradio-runtime/examples/mp-sched/affinity_set.py b/gnuradio-runtime/examples/mp-sched/affinity_set.py index 15d2233b6a..e6637b44bf 100755 --- a/gnuradio-runtime/examples/mp-sched/affinity_set.py +++ b/gnuradio-runtime/examples/mp-sched/affinity_set.py @@ -8,9 +8,9 @@ from gnuradio import eng_notation from gnuradio import gr from gnuradio import blocks from gnuradio import filter -from gnuradio.eng_option import eng_option +from gnuradio.eng_arg import eng_arg from gnuradio.filter import firdes -from optparse import OptionParser +from argparse import ArgumentParser import sys class affinity_set(gr.top_block): @@ -51,8 +51,8 @@ class affinity_set(gr.top_block): self.samp_rate = samp_rate if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() + parser = ArgumentParser() + args = parser.parse_args() tb = affinity_set() tb.start() diff --git a/gnuradio-runtime/examples/mp-sched/plot_flops.py b/gnuradio-runtime/examples/mp-sched/plot_flops.py index d9d810ae2f..c80820b8a3 100755 --- a/gnuradio-runtime/examples/mp-sched/plot_flops.py +++ b/gnuradio-runtime/examples/mp-sched/plot_flops.py @@ -28,7 +28,7 @@ import re import sys import os import tempfile -from optparse import OptionParser +from argparse import ArgumentParser def parse_file(input_filename, output): @@ -84,14 +84,11 @@ def handle_file(input_filename): def main(): - usage = "usage: %prog [options] file.dat" - parser = OptionParser(usage=usage) - (options, args) = parser.parse_args() - if len(args) != 1: - parser.print_help() - raise SystemExit, 1 - - handle_file(args[0]) + parser = ArgumentParser() + parser.add_argument('file', help='Input file', nargs=1) + args = parser.parse_args() + + handle_file(args.file[0]) if __name__ == '__main__': diff --git a/gnuradio-runtime/examples/mp-sched/run_synthetic.py b/gnuradio-runtime/examples/mp-sched/run_synthetic.py index 4896bca462..802fb9fd34 100755 --- a/gnuradio-runtime/examples/mp-sched/run_synthetic.py +++ b/gnuradio-runtime/examples/mp-sched/run_synthetic.py @@ -27,7 +27,7 @@ import re import sys import os import tempfile -from optparse import OptionParser +from argparse import ArgumentParser def write_shell_script(f, data_filename, description, ncores, gflops, max_pipes_and_stages): @@ -70,31 +70,26 @@ total runtime of about 43 minutes, assuming that your values for -n and -f are r For x86 machines, assume 3 FLOPS per processor Hz. E.g., 3 GHz machine -> 9 GFLOPS. plot_flops.py will make pretty graphs from the output data generated by %prog. """ - usage = "usage: %prog [options] output.dat" - parser = OptionParser(usage=usage, description=description) - parser.add_option("-d", "--description", metavar="DESC", - help="machine description, e.g., \"Dual quad-core Xeon 3 GHz\"", default=None) - parser.add_option("-n", "--ncores", type="int", default=1, - help="number of processor cores [default=%default]") - parser.add_option("-g", "--gflops", metavar="GFLOPS", type="float", default=3.0, - help="estimated GFLOPS per core [default=%default]") - parser.add_option("-m", "--max-pipes-and-stages", metavar="MAX", type="int", default=16, - help="maximum number of pipes and stages to use [default=%default]") - (options, args) = parser.parse_args() - if len(args) != 1: - parser.print_help() - raise SystemExit, 1 - - output_filename = args[0] + parser = ArgumentParser(description=description) + parser.add_argument("-d", "--description", metavar="DESC", + help="machine description, e.g., \"Dual quad-core Xeon 3 GHz\"") + parser.add_argument("-n", "--ncores", type=int, default=1, + help="number of processor cores [default=%(default)s]") + parser.add_argument("-g", "--gflops", metavar="GFLOPS", type=float, default=3.0, + help="estimated GFLOPS per core [default=%(default)s]") + parser.add_argument("-m", "--max-pipes-and-stages", metavar="MAX", type=int, default=16, + help="maximum number of pipes and stages to use [default=%(default)s]") + parser.add_argument("output_file_name", metavar="FILE", help="output file name") + args = parser.parse_args() shell = os.popen("/bin/sh", "w") write_shell_script(shell, - output_filename, - options.description, - options.ncores, - options.gflops, - options.max_pipes_and_stages) + args.output_file_name, + args.description, + args.ncores, + args.gflops, + args.max_pipes_and_stages) if __name__ == '__main__': main() diff --git a/gnuradio-runtime/include/gnuradio/attributes.h b/gnuradio-runtime/include/gnuradio/attributes.h index 3d2e764cd5..0102c110c2 100644 --- a/gnuradio-runtime/include/gnuradio/attributes.h +++ b/gnuradio-runtime/include/gnuradio/attributes.h @@ -78,4 +78,15 @@ # pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) #endif +//////////////////////////////////////////////////////////////////////// +// implement cross-compiler VLA macros +//////////////////////////////////////////////////////////////////////// +#ifdef C99 +# define __GR_VLA(TYPE, buf, size) TYPE buf[size] +# define __GR_VLA2D(TYPE, buf, size, size2) TYPE buf[size][size2] +#else +# define __GR_VLA(TYPE, buf, size) TYPE * buf = (TYPE *) alloca(sizeof(TYPE) * (size)) +# define __GR_VLA2D(TYPE, buf, size, size2) TYPE ** buf = (TYPE **) alloca(sizeof(TYPE) * (size) * (size2)) +#endif + #endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */ diff --git a/gnuradio-runtime/include/gnuradio/high_res_timer.h b/gnuradio-runtime/include/gnuradio/high_res_timer.h index ce11cd8ebb..5f6a285a11 100644 --- a/gnuradio-runtime/include/gnuradio/high_res_timer.h +++ b/gnuradio-runtime/include/gnuradio/high_res_timer.h @@ -107,7 +107,7 @@ namespace gr { //////////////////////////////////////////////////////////////////////// #ifdef GNURADIO_HRT_USE_QUERY_PERFORMANCE_COUNTER - #include <Windows.h> + #include <windows.h> inline gr::high_res_timer_type gr::high_res_timer_now(void){ LARGE_INTEGER counts; diff --git a/gnuradio-runtime/include/gnuradio/types.h b/gnuradio-runtime/include/gnuradio/types.h index 6cb0f72834..c91538e60e 100644 --- a/gnuradio-runtime/include/gnuradio/types.h +++ b/gnuradio-runtime/include/gnuradio/types.h @@ -37,29 +37,6 @@ typedef std::vector<double> gr_vector_double; typedef std::vector<void *> gr_vector_void_star; typedef std::vector<const void *> gr_vector_const_void_star; -/* - * #include <config.h> must be placed beforehand - * in the source file including gnuradio/types.h for - * the following to work correctly - */ -#ifdef HAVE_STDINT_H #include <stdint.h> -typedef int16_t gr_int16; -typedef int32_t gr_int32; -typedef int64_t gr_int64; -typedef uint16_t gr_uint16; -typedef uint32_t gr_uint32; -typedef uint64_t gr_uint64; -#else -/* - * Note: these defaults may be wrong on 64-bit systems - */ -typedef short gr_int16; -typedef int gr_int32; -typedef long long gr_int64; -typedef unsigned short gr_uint16; -typedef unsigned int gr_uint32; -typedef unsigned long long gr_uint64; -#endif /* HAVE_STDINT_H */ #endif /* INCLUDED_GR_TYPES_H */ diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt index cc51f97855..3da550d37b 100644 --- a/gnuradio-runtime/lib/CMakeLists.txt +++ b/gnuradio-runtime/lib/CMakeLists.txt @@ -31,9 +31,9 @@ message(STATUS "Loading build date ${BUILD_DATE} into constants...") message(STATUS "Loading version ${VERSION} into constants...") #double escape for windows backslash path separators -string(REPLACE "\\" "\\\\" prefix ${prefix}) -string(REPLACE "\\" "\\\\" SYSCONFDIR ${SYSCONFDIR}) -string(REPLACE "\\" "\\\\" GR_PREFSDIR ${GR_PREFSDIR}) +string(REPLACE "\\" "\\\\" prefix "${prefix}") +string(REPLACE "\\" "\\\\" SYSCONFDIR "${SYSCONFDIR}") +string(REPLACE "\\" "\\\\" GR_PREFSDIR "${GR_PREFSDIR}") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in @@ -149,7 +149,7 @@ CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H) IF(HAVE_WINDOWS_H) ADD_DEFINITIONS(-DHAVE_WINDOWS_H -DUSING_WINSOCK -DWIN32_LEAN_AND_MEAN) MESSAGE(STATUS "Adding windows libs to gnuradio runtime libs...") - LIST(APPEND gnuradio_runtime_libs WS2_32.lib WSock32.lib) + LIST(APPEND gnuradio_runtime_libs ws2_32 wsock32) ENDIF(HAVE_WINDOWS_H) #need to link with librt on ubuntu 11.10 for shm_* diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc index 03e67eb2c2..434a92fb3d 100644 --- a/gnuradio-runtime/lib/flat_flowgraph.cc +++ b/gnuradio-runtime/lib/flat_flowgraph.cc @@ -331,7 +331,7 @@ namespace gr { const int alignment = volk_get_alignment(); for(int i = 0; i < block->detail()->ninputs(); i++) { void *r = (void*)block->detail()->input(i)->read_pointer(); - unsigned long int ri = (unsigned long int)r % alignment; + uintptr_t ri = (uintptr_t)r % alignment; //std::cerr << "reader: " << r << " alignment: " << ri << std::endl; if(ri != 0) { size_t itemsize = block->detail()->input(i)->get_sizeof_item(); @@ -343,7 +343,7 @@ namespace gr { for(int i = 0; i < block->detail()->noutputs(); i++) { void *w = (void*)block->detail()->output(i)->write_pointer(); - unsigned long int wi = (unsigned long int)w % alignment; + uintptr_t wi = (uintptr_t)w % alignment; //std::cerr << "writer: " << w << " alignment: " << wi << std::endl; if(wi != 0) { size_t itemsize = block->detail()->output(i)->get_sizeof_item(); diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc index 5e16c96ea4..35f63076b2 100644 --- a/gnuradio-runtime/lib/math/random.cc +++ b/gnuradio-runtime/lib/math/random.cc @@ -127,7 +127,7 @@ namespace gr { x = 2.0*ran1()-1.0; y = 2.0*ran1()-1.0; s = x*x+y*y; - }while(not(s<1.0)); + }while(s >= 1.0f || s == 0.0f); d_gauss_stored = true; d_gauss_value = x*sqrt(-2.0*log(s)/s); return y*sqrt(-2.0*log(s)/s); diff --git a/gnuradio-runtime/lib/realtime_impl.cc b/gnuradio-runtime/lib/realtime_impl.cc index 54db9d8d70..83afd9568d 100644 --- a/gnuradio-runtime/lib/realtime_impl.cc +++ b/gnuradio-runtime/lib/realtime_impl.cc @@ -65,7 +65,41 @@ namespace gr { #endif -#if defined(HAVE_PTHREAD_SETSCHEDPARAM) +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + +#include <windows.h> + +namespace gr { + namespace impl { + + rt_status_t enable_realtime_scheduling(rt_sched_param p) + { + //set the priority class on the process + int pri_class = (true)? REALTIME_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS; + if(SetPriorityClass(GetCurrentProcess(), pri_class) == 0) + return RT_OTHER_ERROR; + + //scale the priority value to the constants + int priorities[] = { + THREAD_PRIORITY_IDLE, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL, + THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST, THREAD_PRIORITY_TIME_CRITICAL + }; + const double priority = double(p.priority)/(rt_priority_max() - rt_priority_min()); + size_t pri_index = size_t((priority+1.0)*6/2.0); // -1 -> 0, +1 -> 6 + pri_index %= sizeof(priorities)/sizeof(*priorities); //range check + + //set the thread priority on the thread + if(SetThreadPriority(GetCurrentThread(), priorities[pri_index]) == 0) + return RT_OTHER_ERROR; + + //printf("SetPriorityClass + SetThreadPriority\n"); + return RT_OK; + } + + } // namespace impl +} // namespace gr + +#elif defined(HAVE_PTHREAD_SETSCHEDPARAM) namespace gr { namespace impl { @@ -141,40 +175,6 @@ namespace gr { } // namespace impl } // namespace gr -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) - -#include <windows.h> - -namespace gr { - namespace impl { - - rt_status_t enable_realtime_scheduling(rt_sched_param p) - { - //set the priority class on the process - int pri_class = (true)? REALTIME_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS; - if(SetPriorityClass(GetCurrentProcess(), pri_class) == 0) - return RT_OTHER_ERROR; - - //scale the priority value to the constants - int priorities[] = { - THREAD_PRIORITY_IDLE, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL, - THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST, THREAD_PRIORITY_TIME_CRITICAL - }; - const double priority = double(p.priority)/(rt_priority_max() - rt_priority_min()); - size_t pri_index = size_t((priority+1.0)*6/2.0); // -1 -> 0, +1 -> 6 - pri_index %= sizeof(priorities)/sizeof(*priorities); //range check - - //set the thread priority on the thread - if(SetThreadPriority(GetCurrentThread(), priorities[pri_index]) == 0) - return RT_OTHER_ERROR; - - //printf("SetPriorityClass + SetThreadPriority\n"); - return RT_OK; - } - - } // namespace impl -} // namespace gr - #else namespace gr { diff --git a/gnuradio-runtime/lib/scheduler.h b/gnuradio-runtime/lib/scheduler.h index 575862b27d..0924808965 100644 --- a/gnuradio-runtime/lib/scheduler.h +++ b/gnuradio-runtime/lib/scheduler.h @@ -45,7 +45,7 @@ namespace gr { /*! * \brief Construct a scheduler and begin evaluating the graph. * - * The scheduler will continue running until all blocks until they + * The scheduler will continue running until all blocks * report that they are done or the stop method is called. */ scheduler(flat_flowgraph_sptr ffg, int max_noutput_items); diff --git a/gnuradio-runtime/lib/thread/thread.cc b/gnuradio-runtime/lib/thread/thread.cc index 483dfed493..f2606c71ae 100644 --- a/gnuradio-runtime/lib/thread/thread.cc +++ b/gnuradio-runtime/lib/thread/thread.cc @@ -28,7 +28,7 @@ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -#include <Windows.h> +#include <windows.h> namespace gr { namespace thread { @@ -111,6 +111,7 @@ namespace gr { // Not implemented on Windows return -1; } +#ifndef __MINGW32__ #pragma pack(push,8) typedef struct tagTHREADNAME_INFO { @@ -152,6 +153,13 @@ namespace gr { _set_thread_name(thread, name.c_str(), dwThreadId); } +#else + void + set_thread_name(gr_thread_t thread, std::string name) + { + /* Not implemented on mingw-w64 */ + } +#endif /* !__MINGW32__ */ } /* namespace thread */ } /* namespace gr */ diff --git a/gnuradio-runtime/lib/thread/thread_body_wrapper.cc b/gnuradio-runtime/lib/thread/thread_body_wrapper.cc index e23b7d15d0..fffa7e4c44 100644 --- a/gnuradio-runtime/lib/thread/thread_body_wrapper.cc +++ b/gnuradio-runtime/lib/thread/thread_body_wrapper.cc @@ -34,7 +34,7 @@ namespace gr { namespace thread { -#if defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGNAL_H) +#if defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGNAL_H) && !defined(__MINGW32__) void mask_signals() { diff --git a/gnuradio-runtime/lib/tpb_thread_body.cc b/gnuradio-runtime/lib/tpb_thread_body.cc index e0aacb4153..e3f57eef53 100644 --- a/gnuradio-runtime/lib/tpb_thread_body.cc +++ b/gnuradio-runtime/lib/tpb_thread_body.cc @@ -37,8 +37,8 @@ namespace gr { { //std::cerr << "tpb_thread_body: " << block << std::endl; -#ifdef _MSC_VER - #include <Windows.h> +#if defined(_MSC_VER) || defined(__MINGW32__) + #include <windows.h> thread::set_thread_name(GetCurrentThread(), boost::str(boost::format("%s%d") % block->name() % block->unique_id())); #else thread::set_thread_name(pthread_self(), boost::str(boost::format("%s%d") % block->name() % block->unique_id())); diff --git a/gnuradio-runtime/python/gnuradio/__init__.py b/gnuradio-runtime/python/gnuradio/__init__.py index dd7b89650b..263ac28e6e 100644 --- a/gnuradio-runtime/python/gnuradio/__init__.py +++ b/gnuradio-runtime/python/gnuradio/__init__.py @@ -38,12 +38,9 @@ if path.endswith(path_ending): __path__.append(os.path.join(build_path, 'gr-audio', 'python')) __path__.append(os.path.join(build_path, 'gr-qtgui', 'python')) __path__.append(os.path.join(build_path, 'gr-wxgui', 'python')) - __path__.append(os.path.join(build_path, 'gr-atsc', 'python')) - __path__.append(os.path.join(build_path, 'gr-noaa', 'python')) __path__.append(os.path.join(build_path, 'gr-pager', 'python')) __path__.append(os.path.join(build_path, 'gr-video-sdl', 'python')) __path__.append(os.path.join(build_path, 'gr-vocoder', 'python')) - __path__.append(os.path.join(build_path, 'gr-fcd', 'python')) __path__.append(os.path.join(build_path, 'gr-comedi', 'python')) __path__.append(os.path.join(build_path, 'gr-channels', 'python')) __path__.append(os.path.join(build_path, 'gr-fec', 'python')) diff --git a/gnuradio-runtime/python/gnuradio/eng_option.py b/gnuradio-runtime/python/gnuradio/eng_option.py index 5d8660f0f2..ae000fe442 100644 --- a/gnuradio-runtime/python/gnuradio/eng_option.py +++ b/gnuradio-runtime/python/gnuradio/eng_option.py @@ -39,25 +39,9 @@ def check_intx (option, opt, value): raise OptionValueError ( "option %s: invalid integer value: %r" % (opt, value)) -def check_subdev (option, opt, value): - """ - Value has the form: (A|B)(:0|1)? - - Returns: - a 2-tuple (0|1, 0|1) - """ - d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), 'A:2' : (0, 2), - 'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1), 'B:2' : (1, 2) } - try: - return d[value.upper()] - except: - raise OptionValueError( - "option %s: invalid subdev: '%r', must be one of %s" % (opt, value, ', '.join(sorted(d.keys())))) - class eng_option (Option): TYPES = Option.TYPES + ("eng_float", "intx", "subdev") TYPE_CHECKER = copy (Option.TYPE_CHECKER) TYPE_CHECKER["eng_float"] = check_eng_float TYPE_CHECKER["intx"] = check_intx - TYPE_CHECKER["subdev"] = check_subdev diff --git a/gr-analog/grc/analog_block_tree.xml b/gr-analog/grc/analog_block_tree.xml index d08e646663..64ccbdd855 100644 --- a/gr-analog/grc/analog_block_tree.xml +++ b/gr-analog/grc/analog_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Level Controllers</name> <block>analog_agc_xx</block> diff --git a/gr-atsc/CMakeLists.txt b/gr-atsc/CMakeLists.txt deleted file mode 100644 index ffc74a0b4a..0000000000 --- a/gr-atsc/CMakeLists.txt +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright 2011,2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup dependencies -######################################################################## -include(GrBoost) - -######################################################################## -# Register component -######################################################################## -include(GrComponent) -GR_REGISTER_COMPONENT("gr-atsc" ENABLE_GR_ATSC - Boost_FOUND - ENABLE_GNURADIO_RUNTIME - ENABLE_GR_FFT - ENABLE_GR_BLOCKS - ENABLE_GR_FEC - ENABLE_GR_FILTER - ENABLE_GR_ANALOG -) - -GR_SET_GLOBAL(GR_ATSC_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR}/lib -) - -######################################################################## -# Begin conditional configuration -######################################################################## -if(ENABLE_GR_ATSC) - -######################################################################## -# Setup CPack components -######################################################################## -include(GrPackage) -CPACK_SET(CPACK_COMPONENT_GROUP_ATSC_DESCRIPTION "GNU Radio ATSC Blocks") - -CPACK_COMPONENT("atsc_runtime" - GROUP "ATSC" - DISPLAY_NAME "Runtime" - DESCRIPTION "Runtime" - DEPENDS "runtime_runtime" -) - -CPACK_COMPONENT("atsc_devel" - GROUP "ATSC" - DISPLAY_NAME "Development" - DESCRIPTION "C++ headers, package config, import libraries" - DEPENDS "runtime_devel" -) - -CPACK_COMPONENT("atsc_python" - GROUP "ATSC" - DISPLAY_NAME "Python" - DESCRIPTION "Python modules for runtime; GRC xml files" - DEPENDS "runtime_python;atsc_runtime" -) - -CPACK_COMPONENT("atsc_examples" - GROUP "ATSC" - DISPLAY_NAME "Examples" - DESCRIPTION "Python examples for ATSC" - DEPENDS "atsc_python" -) - -CPACK_COMPONENT("atsc_swig" - GROUP "ATSC" - DISPLAY_NAME "SWIG" - DESCRIPTION "SWIG development .i files" - DEPENDS "runtime_swig;atsc_python;atsc_devel" -) - -######################################################################## -# Add subdirectories -######################################################################## -add_subdirectory(lib) -add_subdirectory(include/gnuradio/atsc) -if(ENABLE_PYTHON) - add_subdirectory(swig) - add_subdirectory(python/atsc) -endif(ENABLE_PYTHON) - -######################################################################## -# Create Pkg Config File -######################################################################## -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-atsc.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc -@ONLY) - -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.pc - DESTINATION ${GR_LIBRARY_DIR}/pkgconfig - COMPONENT "atsc_devel" -) - -endif(ENABLE_GR_ATSC) diff --git a/gr-atsc/README b/gr-atsc/README deleted file mode 100644 index aa73910bda..0000000000 --- a/gr-atsc/README +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright 2006 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -This module contains the GNU Radio 2.x code for the -ATSC (HDTV) transmitter and receiver. - -See http://www.atsc.org for specifications. The most relevant ones -are XXX and YYY. - diff --git a/gr-atsc/README.signal_flow b/gr-atsc/README.signal_flow deleted file mode 100644 index eee83a4840..0000000000 --- a/gr-atsc/README.signal_flow +++ /dev/null @@ -1,41 +0,0 @@ -This describes the signal flow through the gnuradio-0.9 ATSC Transmitter -and Receiver programs. - -ATSC Transmitter -================ - -module input output notes --------------------- ---------------- ------------------- -------- -VrFileSource "MPEG transport stream" atsc_mpeg_packet -GrAtscRandomizer atsc_mpeg_packet atsc_mpeg_packet_no_sync whiten data with LFSR -GrAtscRSEncoder atsc_mpeg_packet_no_sync atsc_mpeg_packet_rs_encoded Reed-Soloman encoder -GrAtscInterleaver atsc_mpeg_packet_rs_encoded atsc_mpeg_packet_rs_encoded convolutional interleaver -GrAtscTrellisEncoder atsc_mpeg_packet_rs_encoded atsc_data_segment trellis encoder -GrAtscFieldSyncMux atsc_data_segment atsc_data_segment add in field syncs -GrAtscSymbolMapper atsc_data_segment float map [0,7] to +/- {1,3,5,7} and add pilot -GrWeaverModHead float float,float front half of Weaver VSB modulator -GrFIRfilterFFF (2x) float float low pass root raised cosine (matched filter) -GrWeaverModTail float,float short back half of Weaver VSB modulator -VrFileSink short "16-bit passband data" - - -ATSC Receiver -============= - -module input output notes --------------------- ---------------- ------------------- ------- -VrFileSource "16-bit passband data" short -GrConvertSF short float convert short to float -GrFIRfilterFFF float float band pass root raised cosine centered at IF freq (matched filter) -GrAtscFPLL float float carrier tracking freq and phase lock loop with down converting mixer -GrFIRfilterFFF float float low pass to kill unwanted mixer image -GrRemoveDcFFF float float remove DC offset prior to symbol timing module -GrAtscBitTimingLoop3 float float,syminfo track symbol & segment timing and do fractional interpolation -GrAtscFieldSyncChecker float,syminfo float,syminfo look for field sync patterns -GrAtscEqualizer float,syminfo float,syminfo LMS equalizer -GrAtscFieldSyncDemux float,syminfo atsc_soft_data_segment remove field syncs and pack into data segments -GrAtscViterbiDecoder atsc_soft_data_segment atsc_mpeg_packet_rs_encoded Viterbi decoder (12 seg delay) -GrAtscDeinterleaver atsc_mpeg_packet_rs_encoded atsc_mpeg_packet_rs_encoded convolutional de-interleaver (52 seg delay) -GrAtscRSDecoder atsc_mpeg_packet_rs_encoded atsc_mpeg_packet_no_sync Reed-Solomon decoder -GrAtscDerandomizer atsc_mpeg_packet_no_sync atsc_mpeg_packet de-whiten with LFSR -VrFileSink atsc_mpeg_packet "MPEG transport stream" diff --git a/gr-atsc/gnuradio-atsc.pc.in b/gr-atsc/gnuradio-atsc.pc.in deleted file mode 100644 index c58edcdd22..0000000000 --- a/gr-atsc/gnuradio-atsc.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-atsc -Description: The GNU Radio blocks for ATSC decoding -Requires: gnuradio-runtime -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-atsc -Cflags: -I${includedir} diff --git a/gr-atsc/include/gnuradio/atsc/CMakeLists.txt b/gr-atsc/include/gnuradio/atsc/CMakeLists.txt deleted file mode 100644 index cdf818aab2..0000000000 --- a/gr-atsc/include/gnuradio/atsc/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Install header files -######################################################################## -install(FILES - api.h - basic_trellis_encoder_impl.h - bit_timing_loop.h - CMakeLists.txt - consts.h - convolutional_interleaver.h - create_atsci_equalizer.h - create_atsci_fs_checker.h - create_atsci_fs_correlator.h - data_interleaver_impl.h - deinterleaver.h - depad.h - derandomizer.h - diag_output_impl.h - ds_to_softds.h - equalizer.h - equalizer_impl.h - equalizer_lms2_impl.h - equalizer_lms_impl.h - equalizer_nop_impl.h - exp2_lp_impl.h - fake_single_viterbi_impl.h - field_sync_demux.h - field_sync_mux.h - fpll.h - fs_checker.h - fs_checker_impl.h - fs_checker_naive_impl.h - fs_correlator_impl.h - fs_correlator_naive_impl.h - GrAtscBitTimingLoop2.h - GrAtscBitTimingLoop3.h - GrAtscBitTimingLoop.h - GrAtscConvert2xTo20.h - GrAtscDataSegToSoftDataSeg.h - GrAtscDeinterleaver.h - GrAtscDerandomizer.h - GrAtscEqualizer.h - GrAtscFieldSyncChecker.h - GrAtscFieldSyncCorrelator.h - GrAtscFieldSyncDemux.h - GrAtscFieldSyncMux.h - GrAtscFPLL.h - GrAtscInterleaver.h - GrAtscRandomizer.h - GrAtscRSDecoder.h - GrAtscRSEncoder.h - GrAtscSegSymSync.h - GrAtscSegSymSyncImpl_export.h - GrAtscSegSymSyncImpl.h - GrAtscSymbolMapper.h - GrAtscTrellisEncoder.h - GrAtscViterbiDecoder.h - interleaver_fifo.h - interleaver.h - pad.h - pnXXX_impl.h - randomizer.h - randomizer_impl.h - reed_solomon_impl.h - root_raised_cosine_bandpass_impl.h - root_raised_cosine_impl.h - rs_decoder.h - rs_encoder.h - single_viterbi_impl.h - slicer_agc_impl.h - sliding_correlator_impl.h - sssr_impl.h - syminfo_impl.h - sync_tag_impl.h - trellis_encoder.h - trellis_encoder_impl.h - types.h - viterbi_decoder.h - viterbi_decoder_impl.h - vsbtx_lp_impl.h - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/atsc - COMPONENT "atsc_devel" -) - diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop.h b/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop.h deleted file mode 100644 index e42d37c581..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCBITTIMINGLOOP_H_ -#define _GRATSCBITTIMINGLOOP_H_ - -#include <gnuradio/blocks/nco.h> -#include <VrSigProc.h> -#include <VrHistoryProc.h> -#include <VrDecimatingSigProc.h> -#include <gnuradio/atsc/interleaver_fifo.h> -#include <gnuradio/filter/single_pole_iir.h> -#include <gnuradio/filter/mmse_fir_interpolator.h> -#include <gnuradio/atsc/slicer_agc_impl.h> -#include <stdio.h> -#include <gnuradio/atsc/diag_output_impl.h> - - -/*! - * \brief ATSC BitTimingLoop - * - * This class accepts a single real input and produces a single real output - */ - -class GrAtscBitTimingLoop : public VrDecimatingSigProc<float,float> { - - public: - - GrAtscBitTimingLoop (); - virtual ~GrAtscBitTimingLoop () { }; - - virtual const char *name () { return "GrAtscBitTimingLoop"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - // debug - void set_mu (double a_mu) { mu = a_mu; } - void set_no_update (bool a_no_update) { debug_no_update = a_no_update; } - void set_loop_filter_tap (double tap) { loop.set_taps (tap); } - void set_timing_rate (double rate) { d_timing_rate = rate; } - - protected: - - typedef float iType; - typedef float oType; - - iType produce_sample (const iType *in, unsigned int &index); - double filter_error (double e); - - VrSampleIndex next_input; - gr_mmse_fir_interpolator intr; - double w; // timing control word - double mu; // fractional delay - iType last_right; // last right hand sample - gr_single_pole_iir<double,double,double> loop; - bool debug_no_update;// debug - - double d_loop_filter_tap; - double d_timing_rate; - -#ifdef _BT_DIAG_OUTPUT_ - FILE *fp_loop; - FILE *fp_ps; -#endif -}; - -#endif // _GRATSCBITTIMINGLOOP_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop2.h b/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop2.h deleted file mode 100644 index 7acdbb6140..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop2.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCBITTIMINGLOOP2_H_ -#define _GRATSCBITTIMINGLOOP2_H_ - -#include <gnuradio/blocks/nco.h> -#include <VrSigProc.h> -#include <VrHistoryProc.h> -#include <VrDecimatingSigProc.h> -#include <gnuradio/atsc/interleaver_fifo.h> -#include <filtersingle_pole_iir.h> -#include <gnuradio/filter/mmse_fir_interpolator.h> - -/*! - * \brief ATSC BitTimingLoop - * - * This class accepts a single real input and produces a single real output - */ - -class GrAtscBitTimingLoop2 : public VrDecimatingSigProc<float,float> { - - public: - - GrAtscBitTimingLoop2 (); - virtual ~GrAtscBitTimingLoop2 () { }; - - virtual const char *name () { return "GrAtscBitTimingLoop2"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - // debug - void set_mu (float a_mu) { - assert (0 <= a_mu && a_mu <= 1.9); - use_right_p = a_mu < 1.0; - mu = a_mu - floor (a_mu); - cerr << "BTL2: mu: " << mu << " use_right_p: " << use_right_p << endl; - } - - protected: - - typedef float iType; - typedef float oType; - - iType produce_sample (const iType *in, unsigned int &index); - float filter_error (float e); - - VrSampleIndex next_input; - gr_single_pole_iir<float,float,float> dc; // used to estimate DC component - gr_mmse_fir_interpolator intr; - float mu; // fractional delay - iType last_right; // last right hand sample - - bool use_right_p; // ...else middle -}; - -#endif // _GRATSCBITTIMINGLOOP2_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop3.h b/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop3.h deleted file mode 100644 index cc90e667b6..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscBitTimingLoop3.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCBITTIMINGLOOP3_H_ -#define _GRATSCBITTIMINGLOOP3_H_ - -#include <cstdio> -#include <VrDecimatingSigProc.h> -#include <gnuradio/atsc/diag_output_impl.h> -#include <gnuradio/atsc/sssr_impl.h> -#include <gnuradio/atsc/syminfo_impl.h> - -/*! - * \brief ATSC BitTimingLoop3 - * - * This class accepts a single real input and produces two outputs, - * the raw symbol (float) and the tag (atsc_syminfo) - */ - -class GrAtscBitTimingLoop3 : public VrDecimatingSigProc<float,float> { - - public: - - GrAtscBitTimingLoop3 (double ratio_of_rx_clock_to_symbol_freq); - virtual ~GrAtscBitTimingLoop3 () { }; - - virtual const char *name () { return "GrAtscBitTimingLoop3"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - // debug (NOPs) - void set_mu (double a_mu) { } - void set_no_update (bool a_no_update) { } - void set_loop_filter_tap (double tap) { } - void set_timing_rate (double rate) { } - - protected: - - typedef float iType; - typedef float oDataType; - typedef atsc::syminfo oTagType; - - atsci_sssr d_sssr; - atsci_interpolator d_interp; - VrSampleIndex d_next_input; - double d_rx_clock_to_symbol_freq; -}; - -#endif // _GRATSCBITTIMINGLOOP3_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscConvert2xTo20.h b/gr-atsc/include/gnuradio/atsc/GrAtscConvert2xTo20.h deleted file mode 100644 index 5920832bba..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscConvert2xTo20.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _GRATSCCONVERT2XTO20_H_ -#define _GRATSCCONVERT2XTO20_H_ - -#include <VrDecimatingSigProc.h> -#include <gnuradio/filter/mmse_fir_interpolator.h> - -class GrAtscConvert2xTo20 : public VrDecimatingSigProc<float,float> { - gr_mmse_fir_interpolator d_interp; - double d_frac_part; - VrSampleIndex d_next_input; - -public: - GrAtscConvert2xTo20 (); - ~GrAtscConvert2xTo20 (); - - virtual const char *name () { return "GrAtscConvert2xTo20"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - void pre_initialize (); - int checkOutputSamplingFrequency(float) { return 0; } // bogus, but required - -}; - -#endif /* _GRATSCCONVERT2XTO20_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscDataSegToSoftDataSeg.h b/gr-atsc/include/gnuradio/atsc/GrAtscDataSegToSoftDataSeg.h deleted file mode 100644 index c0f5cf8c33..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscDataSegToSoftDataSeg.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCDATASEGTOSOFTDATASEG_H_ -#define _GRATSCDATASEGTOSOFTDATASEG_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief Debug glue routine (atsc_data_segment --> atsc_soft_data_segment) - */ - -class GrAtscDataSegToSoftDataSeg : public VrHistoryProc<atsc_data_segment, - atsc_soft_data_segment> -{ - -public: - - GrAtscDataSegToSoftDataSeg (); - ~GrAtscDataSegToSoftDataSeg (); - - const char *name () { return "GrAtscDataSegToSoftDataSeg"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: -}; - -#endif /* _GRATSCDATASEGTOSOFTDATASEG_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscDeinterleaver.h b/gr-atsc/include/gnuradio/atsc/GrAtscDeinterleaver.h deleted file mode 100644 index 5cb59c057d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscDeinterleaver.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCDEINTERLEAVER_H_ -#define _GRATSCDEINTERLEAVER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/data_interleaver_impl.h> - -/*! - * \brief Deinterleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_packet_rs_encoded) - */ - -class GrAtscDeinterleaver : public VrHistoryProc<atsc_mpeg_packet_rs_encoded, atsc_mpeg_packet_rs_encoded> -{ - -public: - - GrAtscDeinterleaver (); - ~GrAtscDeinterleaver (); - - const char *name () { return "GrAtscDeinterleaver"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_data_deinterleaver deinterleaver; -}; - -#endif /* _GRATSCDEINTERLEAVER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscDerandomizer.h b/gr-atsc/include/gnuradio/atsc/GrAtscDerandomizer.h deleted file mode 100644 index 2fb6ce3308..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscDerandomizer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCDERANDOMIZER_H_ -#define _GRATSCDERANDOMIZER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/randomizer_impl.h> - -/*! - * \brief Derandomize ATSC data (atsc_mpeg_packet_no_sync --> atsc_mpeg_packet) - */ - -class GrAtscDerandomizer : public VrHistoryProc<atsc_mpeg_packet_no_sync, atsc_mpeg_packet> -{ - -public: - - GrAtscDerandomizer (); - ~GrAtscDerandomizer (); - - const char *name () { return "GrAtscDerandomizer"; } - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_randomizer rand; -}; - -#endif /* _GRATSCDERANDOMIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscEqualizer.h b/gr-atsc/include/gnuradio/atsc/GrAtscEqualizer.h deleted file mode 100644 index ff944deb7d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscEqualizer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCEQUALIZER_H_ -#define _GRATSCEQUALIZER_H_ - -#include <VrHistoryProc.h> - -class atsci_equalizer; - -/*! - * \brief ATSC equalizer (float,syminfo --> float,syminfo) - * - * first inputs are data samples, second inputs are tags. - * first outputs are equalized data samples, second outputs are tags. - * - * tag values are defined in atsci_syminfo.h - */ - -class GrAtscEqualizer : public VrHistoryProc<float,float> -{ - -public: - - GrAtscEqualizer (atsci_equalizer *equalizer); - ~GrAtscEqualizer (); - - const char *name () { return "GrAtscEqualizer"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - // we've got a non-standard forecast routine - int forecast (VrSampleRange output, VrSampleRange inputs[]); - -protected: - atsci_equalizer *d_equalizer; -}; - -#endif /* _GRATSCEQUALIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscFPLL.h b/gr-atsc/include/gnuradio/atsc/GrAtscFPLL.h deleted file mode 100644 index 39d053299b..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscFPLL.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - - -#ifndef _GRATSCFPLL_H_ -#define _GRATSCFPLL_H_ - -#include <gnuradio/blocks/nco.h> -#include <gnuradio/filter/iir.h> -#include <gnuradio/filter/single_pole_iir.h> -#include <gnuradio/analog/agc.h> -#include <VrSigProc.h> -#include <stdio.h> -#include <gnuradio/atsc/diag_output_impl.h> - -/*! - * \brief ATSC FPLL (2nd Version) - * - * Used as follows: - * float float - * A/D --> GrFIRfilterFFF ----> GrAtscFPLL ----> - * - * We use GrFIRfilterFFF to bandpass filter the signal of interest. - * - * This class accepts a single real input and produces a single real output - */ - -class GrAtscFPLL : public VrSigProc { - protected: - - typedef float iType; - typedef float oType; - - public: - - GrAtscFPLL (double a_initial_freq); - virtual ~GrAtscFPLL () {} - - virtual const char *name () { return "GrAtscFPLL"; } - - virtual void initialize (); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - - // diagnostic routines - void set_initial_phase (double phase) { initial_phase = phase; } // radians - void set_no_update (bool a_no_update) { debug_no_update = a_no_update; } - - - protected: - - double initial_freq; - double initial_phase; - bool debug_no_update; - gr_nco<float,float> nco; - gr_agc agc; // automatic gain control - gr_single_pole_iir<float,float,float> afci; - gr_single_pole_iir<float,float,float> afcq; - -#ifdef _FPLL_DIAG_OUTPUT_ - FILE *fp; -#endif - -}; - - -#endif // _GRATSCFPLL_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncChecker.h b/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncChecker.h deleted file mode 100644 index 28458a19b5..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncChecker.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCFIELDSYNCCHECKER_H_ -#define _GRATSCFIELDSYNCCHECKER_H_ - -#include <VrHistoryProc.h> - -class atsci_fs_checker; - -/*! - * \brief ATSC field sync checker (float,syminfo --> float,syminfo) - * - * first output is delayed version of input. - * second output is set of tags, one-for-one with first output. - */ - -class GrAtscFieldSyncChecker : public VrHistoryProc<float,float> -{ - -public: - - GrAtscFieldSyncChecker (); - ~GrAtscFieldSyncChecker (); - - const char *name () { return "GrAtscFieldSyncChecker"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_fs_checker *d_fsc; -}; - -#endif /* _GRATSCFIELDSYNCCHECKER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncCorrelator.h b/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncCorrelator.h deleted file mode 100644 index 1a16048b22..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncCorrelator.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCFIELDSYNCCORRELATOR_H_ -#define _GRATSCFIELDSYNCCORRELATOR_H_ - -#include <VrHistoryProc.h> - -class atsci_fs_correlator; - -/*! - * \brief ATSC field sync correlator (float --> float,float) - * - * first output is delayed version of input. - * second output is set of tags, one-for-one with first output. - * - * tag values are defined in atsci_sync_tag.h - */ - -class GrAtscFieldSyncCorrelator : public VrHistoryProc<float,float> -{ - -public: - - GrAtscFieldSyncCorrelator (); - ~GrAtscFieldSyncCorrelator (); - - const char *name () { return "GrAtscFieldSyncCorrelator"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_fs_correlator *d_fsc; -}; - -#endif /* _GRATSCFIELDSYNCCORRELATOR_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncDemux.h b/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncDemux.h deleted file mode 100644 index ed7eb16215..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncDemux.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCFIELDSYNCDEMUX_H_ -#define _GRATSCFIELDSYNCDEMUX_H_ - -#include <VrDecimatingSigProc.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief ATSC Field Sync Demux - * - * This class accepts 1 stream of floats (data), and 1 stream of tags (syminfo). - * It outputs one stream of atsc_soft_data_segment packets - */ - -class GrAtscFieldSyncDemux : public VrDecimatingSigProc<float,atsc_soft_data_segment> { - - public: - - GrAtscFieldSyncDemux (); - virtual ~GrAtscFieldSyncDemux (); - - virtual const char *name () { return "GrAtscFieldSyncDemux"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - protected: - - bool d_locked; - bool d_in_field2; - int d_segment_number; - VrSampleIndex d_next_input; - VrSampleIndex d_lost_index; // diagnostic fluff -}; - -#endif // _GRATSCFIELDSYNCDEMUX_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncMux.h b/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncMux.h deleted file mode 100644 index 7998d9a8e1..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscFieldSyncMux.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCFIELDSYNCMUX_H_ -#define _GRATSCFIELDSYNCMUX_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief Insert ATSC Field Syncs as required (atsc_data_segment --> atsc_data_segment) - */ - -class GrAtscFieldSyncMux : public VrHistoryProc<atsc_data_segment, atsc_data_segment> -{ - -public: - - GrAtscFieldSyncMux (); - ~GrAtscFieldSyncMux (); - - const char *name () { return "GrAtscFieldSyncMux"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - int forecast (VrSampleRange output, VrSampleRange inputs[]); - - void pre_initialize (); - - static const int N_SAVED_SYMBOLS = 12; - -protected: - VrSampleIndex d_current_index; - bool d_already_output_field_sync; - unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; -}; - -#endif /* _GRATSCFIELDSYNCMUX_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscInterleaver.h b/gr-atsc/include/gnuradio/atsc/GrAtscInterleaver.h deleted file mode 100644 index 158c6a6a17..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscInterleaver.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCINTERLEAVER_H_ -#define _GRATSCINTERLEAVER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/data_interleaver_impl.h> - -/*! - * \brief Interleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_packet_rs_encoded) - */ - -class GrAtscInterleaver : public VrHistoryProc<atsc_mpeg_packet_rs_encoded, atsc_mpeg_packet_rs_encoded> -{ - -public: - - GrAtscInterleaver (); - ~GrAtscInterleaver (); - - const char *name () { return "GrAtscInterleaver"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_data_interleaver interleaver; -}; - -#endif /* _GRATSCINTERLEAVER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscRSDecoder.h b/gr-atsc/include/gnuradio/atsc/GrAtscRSDecoder.h deleted file mode 100644 index 160adc5413..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscRSDecoder.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCRSDECODER_H_ -#define _GRATSCRSDECODER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/reed_solomon_impl.h> - -/*! - * \brief Pass ATSC data Reed-Solomon decoder( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_rs_no_sync) - */ - -class GrAtscRSDecoder : public VrHistoryProc<atsc_mpeg_packet_rs_encoded, atsc_mpeg_packet_no_sync> -{ - -public: - - GrAtscRSDecoder (); - ~GrAtscRSDecoder (); - - const char *name () { return "GrAtscRSDecoder"; } - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_reed_solomon rs_decoder; -}; - -#endif /* _GRATSCRSDECODER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscRSEncoder.h b/gr-atsc/include/gnuradio/atsc/GrAtscRSEncoder.h deleted file mode 100644 index b59e28dcb5..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscRSEncoder.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCRSENCODER_H_ -#define _GRATSCRSENCODER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/reed_solomon_impl.h> - -/*! - * \brief Encode using Reed Solomon ATSC data (atsc_mpeg_packet_no_sync --> atsc_mpeg_packet_rs_encoded) - */ - -class GrAtscRSEncoder : public VrHistoryProc<atsc_mpeg_packet_no_sync, atsc_mpeg_packet_rs_encoded> -{ - -public: - - GrAtscRSEncoder (); - ~GrAtscRSEncoder (); - - const char *name () { return "GrAtscRSEncoder"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_reed_solomon rs_encoder; -}; - -#endif /* _GRATSCRSENCODER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscRandomizer.h b/gr-atsc/include/gnuradio/atsc/GrAtscRandomizer.h deleted file mode 100644 index 44be87349f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscRandomizer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCRANDOMIZER_H_ -#define _GRATSCRANDOMIZER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/randomizer_impl.h> - -/*! - * \brief Randomize ATSC data (atsc_mpeg_packet --> atsc_mpeg_packet_no_sync) - */ - -class GrAtscRandomizer : public VrHistoryProc<atsc_mpeg_packet, atsc_mpeg_packet_no_sync> -{ - -public: - - GrAtscRandomizer (); - ~GrAtscRandomizer (); - - const char *name () { return "GrAtscRandomizer"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_randomizer rand; - - // used to initialize plinfo in output - bool field2; - int segno; -}; - -#endif /* _GRATSCRANDOMIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSync.h b/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSync.h deleted file mode 100644 index 750483f544..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSync.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCSEGSYMSYNC_H_ -#define _GRATSCSEGSYMSYNC_H_ - -#include <VrDecimatingSigProc.h> - -/*! - * \brief ATSC SegSymSync - * - * Abstract class that establishes symbol timing and synchronizes - * with data segment boundaries. - * - * Takes a single stream of floats as the input and - * produces two streams as output. The first stream is the data samples - * and is of type float. The second stream is the tags, and is of type syminfo. - * - * The current GNU Radio interface doesn't currently support different - * types on the input ports (or output ports for that matter), but - * since they are the same size, it works. - */ - -#include <atsci_syminfo.h> - -class GrAtscSegSymSync : public VrDecimatingSigProc<float,float> { - -public: - - GrAtscSegSymSync (); - ~GrAtscSegSymSync (); - - /*! - * \brief reset bit timing loop on channel change - */ - virtual void reset () = 0; - - /*! - * \brief create an instance of GrAtscSegSymSync - */ - static GrAtscSegSymSync *create (double nominal_ratio_of_rx_clock_to_symbol_freq); - -}; - -#endif // _GRATSCSEGSYMSYNC_H_ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl.h b/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl.h deleted file mode 100644 index e7b3a83018..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _GRATSCSEGSYMSYNCIMPL_H_ -#define _GRATSCSEGSYMSYNCIMPL_H_ - -#include <GrAtscSegSymSync.h> -#include <gnuradio/atsc/sssr_impl.h> - - -/*! - * \brief concrete implementation of GrAtscSegSymSync - * - * This class implements data segment sync tracking and symbol timing - * using a variation of the method described in - * "ATSC/VSB Tutorial - Receiver Technology" by Wayne E. Bretl of - * Zenith, pgs 41-45. - */ - -class GrAtscSegSymSyncImpl : public GrAtscSegSymSync { - - atsci_sssr d_sssr; - atsci_interpolator d_interp; - VrSampleIndex d_next_input; - double d_rx_clock_to_symbol_freq; // nominal ratio - -public: - - // the standard methods... - - GrAtscSegSymSyncImpl (double nominal_ratio_of_rx_clock_to_symbol_freq); - virtual ~GrAtscSegSymSyncImpl (); - - virtual const char *name () { return "GrAtscSegSymSyncImpl"; } - - virtual int forecast (VrSampleRange output, - VrSampleRange inputs[]); - - virtual int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - - void pre_initialize (); - - - // reset on channel change - - virtual void reset (); - -}; - -#endif /* _GRATSCSEGSYMSYNCIMPL_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl_export.h b/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl_export.h deleted file mode 100644 index 187f1a0395..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscSegSymSyncImpl_export.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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. - */ - -class GrAtscSegSymSync; - -GrAtscSegSymSync *create_GrAtscSegSymSyncImpl ( - double nominal_ratio_of_rx_clock_to_symbol_freq); diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscSymbolMapper.h b/gr-atsc/include/gnuradio/atsc/GrAtscSymbolMapper.h deleted file mode 100644 index a67b860a45..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscSymbolMapper.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCSYMBOLMAPPER_H_ -#define _GRATSCSYMBOLMAPPER_H_ - - -#include <VrInterpolatingSigProcNoWork.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/blocks/nco.h> - -/*! - * \brief take atsc_data_segments and map them to symbols. - * - * Input is a stream of atsc_data_segments. - * Output is a stream of symbols at 1x the symbol rate - * - * This module performs the signal mapping & pilot addition. - */ - -template<class oType> -class GrAtscSymbolMapper - : public VrInterpolatingSigProcNoWork<atsc_data_segment, oType> { - -public: - GrAtscSymbolMapper () - : VrInterpolatingSigProcNoWork<atsc_data_segment, oType>(1, INTERP_FACTOR) {}; - - ~GrAtscSymbolMapper () {}; - - const char *name () { return "GrAtscSymbolMapper"; } - - int work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]); - -protected: - static const int INTERP_FACTOR = ATSC_DATA_SEGMENT_LENGTH; -}; - - -template<class oType> -int -GrAtscSymbolMapper<oType>::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - atsc_data_segment *in = ((atsc_data_segment **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - assert ((output.size % INTERP_FACTOR) == 0); - - static const float pilot_add = 1.25; - static const float map[8] = { - -7 + pilot_add, - -5 + pilot_add, - -3 + pilot_add, - -1 + pilot_add, - 1 + pilot_add, - 3 + pilot_add, - 5 + pilot_add, - 7 + pilot_add - }; - - unsigned int oo = 0; - unsigned int nsegs = output.size / INTERP_FACTOR; - - for (unsigned int n = 0; n < nsegs; n++){ - unsigned char *symbol = in[n].data; - - for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++){ - out[oo++] = (oType) map[symbol[i] & 0x7]; - } - } - - assert (oo == output.size); - return output.size; -} - -#endif /* _GRATSCSYMBOLMAPPER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscTrellisEncoder.h b/gr-atsc/include/gnuradio/atsc/GrAtscTrellisEncoder.h deleted file mode 100644 index 5e8115e677..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscTrellisEncoder.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCTRELLISENCODER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/trellis_encoder_impl.h> - -/*! - * \brief ATSC 12-way interleaved trellis encoder (atsc_mpeg_packet_rs_encoded --> atsc_data_segment) - */ - -class GrAtscTrellisEncoder : public VrHistoryProc<atsc_mpeg_packet_rs_encoded,atsc_data_segment> -{ - -public: - - GrAtscTrellisEncoder (); - ~GrAtscTrellisEncoder (); - - const char *name () { return "GrAtscTrellisEncoder"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_trellis_encoder encoder; - int last_start; -}; - -#endif diff --git a/gr-atsc/include/gnuradio/atsc/GrAtscViterbiDecoder.h b/gr-atsc/include/gnuradio/atsc/GrAtscViterbiDecoder.h deleted file mode 100644 index e33aba04ce..0000000000 --- a/gr-atsc/include/gnuradio/atsc/GrAtscViterbiDecoder.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRATSCVITERBIDECODER_H_ - -#include <VrHistoryProc.h> -#include <gnuradio/atsc/viterbi_decoder_impl.h> - -/*! - * \brief ATSC 12-way interleaved viterbi decoder (atsc_soft_data_segment --> atsc_mpeg_packet_rs_encoded) - */ - -class GrAtscViterbiDecoder : public VrHistoryProc<atsc_soft_data_segment, - atsc_mpeg_packet_rs_encoded> -{ - -public: - - GrAtscViterbiDecoder (); - ~GrAtscViterbiDecoder (); - - const char *name () { return "GrAtscViterbiDecoder"; } - - int work (VrSampleRange output, void *o[], - VrSampleRange inputs[], void *i[]); - -protected: - atsci_viterbi_decoder decoder; - int last_start; -}; - -#endif diff --git a/gr-atsc/include/gnuradio/atsc/api.h b/gr-atsc/include/gnuradio/atsc/api.h deleted file mode 100644 index 1c1f257059..0000000000 --- a/gr-atsc/include/gnuradio/atsc/api.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_API_H -#define INCLUDED_ATSC_API_H - -#include <gnuradio/attributes.h> - -#ifdef gnuradio_atsc_EXPORTS -# define ATSC_API __GR_ATTR_EXPORT -#else -# define ATSC_API __GR_ATTR_IMPORT -#endif - -#endif /* INCLUDED_ATSC_API_H */ diff --git a/gr-atsc/include/gnuradio/atsc/basic_trellis_encoder_impl.h b/gr-atsc/include/gnuradio/atsc/basic_trellis_encoder_impl.h deleted file mode 100644 index 665a0f9ebf..0000000000 --- a/gr-atsc/include/gnuradio/atsc/basic_trellis_encoder_impl.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_BASIC_TRELLIS_ENCODER_H_ -#define _ATSC_BASIC_TRELLIS_ENCODER_H_ - -#include <gnuradio/atsc/api.h> -#include <assert.h> - -/*! - * \brief ATSC trellis encoder building block. - * - * Note this is NOT the 12x interleaved interface. - * - * This implements a single instance of the ATSC trellis encoder. - * This is a rate 2/3 encoder (really a constraint length 3, rate 1/2 - * encoder with the top bit passed through unencoded. This does not - * implement the "precoding" of the top bit, because the NTSC rejection - * filter is not supported. - */ - -class ATSC_API atsci_basic_trellis_encoder { - -private: - int state; // two bit state; - -public: - atsci_basic_trellis_encoder () : state (0) {} - - /*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ - int encode (unsigned int input); - - //! reset encoder state - void reset () { state = 0; } - - static const unsigned char next_state[32]; - static const unsigned char out_symbol[32]; -}; - -#endif /* _ATSC_BASIC_TRELLIS_ENCODER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/bit_timing_loop.h b/gr-atsc/include/gnuradio/atsc/bit_timing_loop.h deleted file mode 100644 index 9965ade81d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/bit_timing_loop.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_BIT_TIMING_LOOP_H -#define INCLUDED_ATSC_BIT_TIMING_LOOP_H - -#include <gnuradio/atsc/api.h> -#include <cstdio> -#include <gnuradio/block.h> -#include <gnuradio/atsc/diag_output_impl.h> -#include <gnuradio/atsc/sssr_impl.h> -#include <gnuradio/atsc/syminfo_impl.h> - -class atsc_bit_timing_loop; -typedef boost::shared_ptr<atsc_bit_timing_loop> atsc_bit_timing_loop_sptr; - -ATSC_API atsc_bit_timing_loop_sptr atsc_make_bit_timing_loop(); - -/*! - * \brief ATSC BitTimingLoop3 - * \ingroup atsc - * - * This class accepts a single real input and produces two outputs, - * the raw symbol (float) and the tag (atsc_syminfo) - */ -class ATSC_API atsc_bit_timing_loop : public gr::block -{ - friend ATSC_API atsc_bit_timing_loop_sptr atsc_make_bit_timing_loop(); - - atsc_bit_timing_loop(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - - ~atsc_bit_timing_loop () { }; - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - - // debug (NOPs) - void set_mu (double a_mu) { } - void set_no_update (bool a_no_update) { } - void set_loop_filter_tap (double tap) { } - void set_timing_rate (double rate) { } - - - protected: - - atsci_sssr d_sssr; - atsci_interpolator d_interp; - unsigned long long d_next_input; - double d_rx_clock_to_symbol_freq; - int d_si; - - -}; - -#endif /* INCLUDED_ATSC_BIT_TIMING_LOOP_H */ - - - diff --git a/gr-atsc/include/gnuradio/atsc/consts.h b/gr-atsc/include/gnuradio/atsc/consts.h deleted file mode 100644 index bbe2ec69aa..0000000000 --- a/gr-atsc/include/gnuradio/atsc/consts.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_CONSTS_H_ -#define _ATSC_CONSTS_H_ - -static const double ATSC_SYMBOL_RATE = 4.5e6 / 286 * 684; // ~10.76 MHz -static const double ATSC_DATA_SEGMENT_RATE = ATSC_SYMBOL_RATE / 832; // ~12.935 kHz - - -static const int ATSC_MPEG_DATA_LENGTH = 187; -static const int ATSC_MPEG_PKT_LENGTH = 188; // sync + data -static const int ATSC_MPEG_RS_ENCODED_LENGTH = 207; -static const int ATSC_DATA_SEGMENT_LENGTH = 832; // includes 4 sync symbols at beginning -static const int ATSC_DSEGS_PER_FIELD = 312; // regular data segs / field - - -static const int MPEG_SYNC_BYTE = 0x47; - -static const int MPEG_TRANSPORT_ERROR_BIT = 0x80; // top bit of byte after SYNC - - -#endif // _ATSC_CONSTS_H_ diff --git a/gr-atsc/include/gnuradio/atsc/convolutional_interleaver.h b/gr-atsc/include/gnuradio/atsc/convolutional_interleaver.h deleted file mode 100644 index 02c0c4dc44..0000000000 --- a/gr-atsc/include/gnuradio/atsc/convolutional_interleaver.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CONVOLUTIONAL_INTERLEAVER_H_ -#define _CONVOLUTIONAL_INTERLEAVER_H_ - -#include <vector> -#include <gnuradio/atsc/interleaver_fifo.h> -#include <assert.h> - -/*! - * \brief template class for generic convolutional interleaver - */ - -template<class symbol_type> -class convolutional_interleaver { - public: - - convolutional_interleaver (bool interleave_p, int nbanks, int fifo_size_incr); - virtual ~convolutional_interleaver (); - - //! reset interleaver (flushes contents and resets commutator) - void reset (); - - //! sync interleaver (resets commutator, but doesn't flush fifos) - void sync () { m_commutator = 0; } - - //! return end to end delay in symbols (delay through concatenated interleaver / deinterleaver) - int end_to_end_delay (); - - //! transform a single symbol - symbol_type transform (symbol_type input){ - symbol_type retval = m_fifo[m_commutator]->stuff (input); - m_commutator++; - if (m_commutator >= m_nbanks) - m_commutator = 0; - return retval; - } - - //! transform a bunch of symbols - void transform (symbol_type *out, const symbol_type *in, int nsymbols); - -protected: - int m_commutator; - int m_nbanks; - int m_fifo_size_incr; - std::vector<interleaver_fifo<symbol_type> *> m_fifo; -}; - -template<class symbol_type> -convolutional_interleaver<symbol_type>::convolutional_interleaver ( - bool interleave_p, - int nbanks, - int fifo_size_incr) -{ - assert (nbanks >= 1); - assert (fifo_size_incr >= 1); - - m_nbanks = nbanks; - m_fifo_size_incr = fifo_size_incr; - - m_fifo.resize (nbanks); - - if (interleave_p){ // configure as interleaver - for (int i = 0; i < nbanks; i++) - m_fifo[i] = new interleaver_fifo<symbol_type>(i * fifo_size_incr); - } - else { // configure as de-interleaver - for (int i = 0; i < nbanks; i++) - m_fifo[nbanks - 1 - i] = new interleaver_fifo<symbol_type>(i * fifo_size_incr); - } - sync (); -} - -template<class symbol_type> -convolutional_interleaver<symbol_type>::~convolutional_interleaver () -{ - for (int i = 0; i < m_nbanks; i++) - delete m_fifo[i]; -} - -template<class symbol_type> void -convolutional_interleaver<symbol_type>::reset () -{ - sync (); - for (int i = 0; i < m_nbanks; i++) - m_fifo[i]->reset (); -} - -template<class symbol_type> int -convolutional_interleaver<symbol_type>::end_to_end_delay () -{ - int m = m_nbanks * m_fifo_size_incr; - return m * (m_nbanks - 1); -} - -template<class symbol_type> void -convolutional_interleaver<symbol_type>::transform (symbol_type *out, - const symbol_type *in, - int nsymbols) -{ - // we may want to unroll this a couple of times... - for (int i = 0; i < nsymbols; i++) - out[i] = transform (in[i]); -} - -#endif /* _CONVOLUTIONAL_INTERLEAVER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/create_atsci_equalizer.h b/gr-atsc/include/gnuradio/atsc/create_atsci_equalizer.h deleted file mode 100644 index 63773a80bb..0000000000 --- a/gr-atsc/include/gnuradio/atsc/create_atsci_equalizer.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CREATE_ATSC_EQUALIZER_H_ -#define _CREATE_ATSC_EQUALIZER_H_ - -#include <gnuradio/atsc/api.h> - -class atsci_equalizer; - -ATSC_API atsci_equalizer *create_atsci_equalizer_nop (); -ATSC_API atsci_equalizer *create_atsci_equalizer_lms (); -ATSC_API atsci_equalizer *create_atsci_equalizer_lms2 (); - -#endif /* _CREATE_ATSC_EQUALIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/create_atsci_fs_checker.h b/gr-atsc/include/gnuradio/atsc/create_atsci_fs_checker.h deleted file mode 100644 index 73b0c7443f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/create_atsci_fs_checker.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CREATE_ATSC_FS_CHECKER_H_ -#define _CREATE_ATSC_FS_CHECKER_H_ - -#include <gnuradio/atsc/api.h> - -class atsci_fs_checker; - -/*! - * Factory that creates appropriate atsci_fs_checker - */ -ATSC_API atsci_fs_checker *create_atsci_fs_checker (); - - -#endif /* _CREATE_ATSC_FS_CHECKER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/create_atsci_fs_correlator.h b/gr-atsc/include/gnuradio/atsc/create_atsci_fs_correlator.h deleted file mode 100644 index dc6d81499f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/create_atsci_fs_correlator.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _CREATE_ATSC_FS_CORRELATOR_H_ -#define _CREATE_ATSC_FS_CORRELATOR_H_ - -#include <gnuradio/atsc/api.h> - -class atsci_fs_correlator; - -/*! - * Factory that creates appropriate atsci_fs_correlator - */ -ATSC_API atsci_fs_correlator *create_atsci_fs_correlator (); - - -#endif /* _CREATE_ATSC_FS_CORRELATOR_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/data_interleaver_impl.h b/gr-atsc/include/gnuradio/atsc/data_interleaver_impl.h deleted file mode 100644 index e44125864b..0000000000 --- a/gr-atsc/include/gnuradio/atsc/data_interleaver_impl.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_DATA_INTERLEAVER_H_ -#define _ATSC_DATA_INTERLEAVER_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/convolutional_interleaver.h> - -/*! - * \brief atsc convolutional data interleaver - */ -class ATSC_API atsci_data_interleaver : public convolutional_interleaver<unsigned char> { - public: - atsci_data_interleaver () : convolutional_interleaver<unsigned char>(true, 52, 4) {} - - void interleave (atsc_mpeg_packet_rs_encoded &out, - const atsc_mpeg_packet_rs_encoded &in); -}; - -/*! - * \brief atsc convolutional data deinterleaver - */ -class ATSC_API atsci_data_deinterleaver : public convolutional_interleaver<unsigned char> { - public: - atsci_data_deinterleaver () : - convolutional_interleaver<unsigned char>(false, 52, 4), alignment_fifo (156) {} - - void deinterleave (atsc_mpeg_packet_rs_encoded &out, - const atsc_mpeg_packet_rs_encoded &in); - -private: - /*! - * Note: The use of the alignment_fifo keeps the encoder and decoder - * aligned if both are synced to a field boundary. There may be other - * ways to implement this function. This is a best guess as to how - * this should behave, as we have no test vectors for either the - * interleaver or deinterleaver. - */ - interleaver_fifo<unsigned char> alignment_fifo; - - static void remap_pli (plinfo &out, const plinfo &in); -}; - -#endif /* _ATSC_DATA_INTERLEAVER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/deinterleaver.h b/gr-atsc/include/gnuradio/atsc/deinterleaver.h deleted file mode 100644 index 22b5461aaf..0000000000 --- a/gr-atsc/include/gnuradio/atsc/deinterleaver.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_DEINTERLEAVER_H -#define INCLUDED_ATSC_DEINTERLEAVER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/data_interleaver_impl.h> - -class atsc_deinterleaver; -typedef boost::shared_ptr<atsc_deinterleaver> atsc_deinterleaver_sptr; - -ATSC_API atsc_deinterleaver_sptr atsc_make_deinterleaver(); - -/*! - * \brief Deinterleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_packet_rs_encoded) - * \ingroup atsc - * - * input: atsc_mpeg_packet_rs_encoded; output: atsc_mpeg_packet_rs_encoded - */ -class ATSC_API atsc_deinterleaver : public gr::sync_block -{ - friend ATSC_API atsc_deinterleaver_sptr atsc_make_deinterleaver(); - - atsci_data_deinterleaver d_deinterleaver; - - atsc_deinterleaver(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_DEINTERLEAVER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/depad.h b/gr-atsc/include/gnuradio/atsc/depad.h deleted file mode 100644 index 3a638c46fe..0000000000 --- a/gr-atsc/include/gnuradio/atsc/depad.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_ATSC_DEPAD_H -#define INCLUDED_ATSC_DEPAD_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_interpolator.h> - -class atsc_depad; -typedef boost::shared_ptr<atsc_depad> atsc_depad_sptr; - -ATSC_API atsc_depad_sptr atsc_make_depad(); - -/*! - * \brief depad mpeg ts packets from 256 byte atsc_mpeg_packet to 188 byte char - * \ingroup atsc - * - * input: atsc_mpeg_packet; output: unsigned char - */ -class ATSC_API atsc_depad : public gr::sync_interpolator -{ - friend ATSC_API atsc_depad_sptr atsc_make_depad(); - - atsc_depad(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_DEPAD_H */ diff --git a/gr-atsc/include/gnuradio/atsc/derandomizer.h b/gr-atsc/include/gnuradio/atsc/derandomizer.h deleted file mode 100644 index 86eaca427c..0000000000 --- a/gr-atsc/include/gnuradio/atsc/derandomizer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_ATSC_DERANDOMIZER_H -#define INCLUDED_ATSC_DERANDOMIZER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/randomizer_impl.h> - -class atsc_derandomizer; -typedef boost::shared_ptr<atsc_derandomizer> atsc_derandomizer_sptr; - -ATSC_API atsc_derandomizer_sptr atsc_make_derandomizer(); - -/*! - * \brief "dewhiten" incoming mpeg transport stream packets - * \ingroup atsc - * - * input: atsc_mpeg_packet_no_sync; output: atsc_mpeg_packet; - */ -class ATSC_API atsc_derandomizer : public gr::sync_block -{ - friend ATSC_API atsc_derandomizer_sptr atsc_make_derandomizer(); - - atsci_randomizer d_rand; - - atsc_derandomizer(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset(); -}; - - -#endif /* INCLUDED_ATSC_DERANDOMIZER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/diag_output_impl.h b/gr-atsc/include/gnuradio/atsc/diag_output_impl.h deleted file mode 100644 index 09fd763d6a..0000000000 --- a/gr-atsc/include/gnuradio/atsc/diag_output_impl.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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. - */ - -/* - * single place to control all compile time diagnostic output options - */ - -#define _BT_DIAG_OUTPUT_ 0 -#define _FPLL_DIAG_OUTPUT_ 0 -#define _SSSR_DIAG_OUTPUT_ 0 diff --git a/gr-atsc/include/gnuradio/atsc/ds_to_softds.h b/gr-atsc/include/gnuradio/atsc/ds_to_softds.h deleted file mode 100644 index 197aafb7ad..0000000000 --- a/gr-atsc/include/gnuradio/atsc/ds_to_softds.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_DS_TO_SOFTDS_H -#define INCLUDED_ATSC_DS_TO_SOFTDS_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/types.h> - -class atsc_ds_to_softds; -typedef boost::shared_ptr<atsc_ds_to_softds> atsc_ds_to_softds_sptr; - -ATSC_API atsc_ds_to_softds_sptr atsc_make_ds_to_softds(); - -/*! - * \brief Debug glue routine (atsc_data_segment --> atsc_soft_data_segment) - * \ingroup atsc - * - * input: atsc_data_segment; output: atsc_soft_data_segment - */ -class ATSC_API atsc_ds_to_softds : public gr::sync_block -{ - friend ATSC_API atsc_ds_to_softds_sptr atsc_make_ds_to_softds(); - - atsc_ds_to_softds(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void map_to_soft_symbols (atsc_soft_data_segment &out, - const atsc_data_segment &in); - - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_DS_TO_SOFTDS_H */ diff --git a/gr-atsc/include/gnuradio/atsc/equalizer.h b/gr-atsc/include/gnuradio/atsc/equalizer.h deleted file mode 100644 index 4e9103fb12..0000000000 --- a/gr-atsc/include/gnuradio/atsc/equalizer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_EQUALIZER_H -#define INCLUDED_ATSC_EQUALIZER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/equalizer_impl.h> -#include <vector> - -class atsc_equalizer; -typedef boost::shared_ptr<atsc_equalizer> atsc_equalizer_sptr; - -atsc_equalizer_sptr ATSC_API atsc_make_equalizer(); - -/*! - * \brief ATSC equalizer (float,syminfo --> float,syminfo) - * \ingroup atsc - * - * first inputs are data samples, second inputs are tags. - * first outputs are equalized data samples, second outputs are tags. - */ -class ATSC_API atsc_equalizer : public gr::sync_block -{ - friend ATSC_API atsc_equalizer_sptr atsc_make_equalizer(); - - atsc_equalizer(); - -public: - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - std::vector<double> taps() { - return d_equalizer->taps(); - } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - - ~atsc_equalizer (); - - -protected: - atsci_equalizer *d_equalizer; - -}; - - -#endif /* INCLUDED_ATSC_EQUALIZER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/equalizer_impl.h b/gr-atsc/include/gnuradio/atsc/equalizer_impl.h deleted file mode 100644 index a6d849b00f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/equalizer_impl.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_EQUALIZER_H_ -#define _ATSC_EQUALIZER_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/syminfo_impl.h> -#include <vector> - -/*! - * \brief abstract base class for ATSC equalizer - */ -class ATSC_API atsci_equalizer { - -private: - - /* - * have we seen a field sync since the last reset or problem? - */ - bool d_locked_p; - - /* - * sample offset from the beginning of the last field sync we saw - * to the beginning of our current input stream. When we're locked - * this will be in [0, 313*832] i.e., [0, 260416] - */ - int d_offset_from_last_field_sync; - - int d_current_field; // [0,1] - - -public: - - // CREATORS - atsci_equalizer (); - virtual ~atsci_equalizer (); - - virtual std::vector<double> taps () { - return std::vector<double>(); - } - - // MANIPULATORS - - /*! - * \brief reset state (e.g., on channel change) - * - * Note, subclasses must invoke the superclass's method too! - */ - virtual void reset (); - - /*! - * \brief produce \p nsamples of output from given inputs and tags - * - * This is the main entry point. It examines the input_tags - * and local state and invokes the appropriate virtual function - * to handle each sub-segment of the input data. - * - * \p input_samples must have (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] are - * referenced to compute the output values. - * - * \p input_tags must have nsamples valid entries. - * input_tags[0] .. input_tags[nsamples - 1] are referenced to - * compute the output values. - */ - virtual void filter (const float *input_samples, - const atsc::syminfo *input_tags, - float *output_samples, - int nsamples); - - // ACCESSORS - - /*! - * \brief how much history the input data stream requires. - * - * This must return a value >= 1. Think of this as the number - * of samples you need to look at to compute a single output sample. - */ - virtual int ntaps () const = 0; - - /*! - * \brief how many taps are "in the future". - * - * This allows us to handle what the ATSC folks call "pre-ghosts". - * What it really does is allow the caller to jack with the offset - * between the tags and the data so that everything magically works out. - * - * npretaps () must return a value between 0 and ntaps() - 1. - * - * If npretaps () returns 0, this means that the equalizer will only handle - * multipath "in the past." I suspect that a good value would be something - * like 15% - 20% of ntaps (). - */ - virtual int npretaps () const = 0; - - -protected: - - /*! - * Input range is known NOT TO CONTAIN data segment syncs - * or field syncs. This should be the fast path. In the - * non decicion directed case, this just runs the input - * through the filter without adapting it. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ - virtual void filter_normal (const float *input_samples, - float *output_samples, - int nsamples) = 0; - - /*! - * Input range is known to consist of only a data segment sync or a - * portion of a data segment sync. \p nsamples will be in [1,4]. - * \p offset will be in [0,3]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ - virtual void filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset) = 0; - - /*! - * Input range is known to consist of only a field sync segment or a - * portion of a field sync segment. \p nsamples will be in [1,832]. - * \p offset will be in [0,831]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. We consider the - * 4 symbols of the immediately preceding data segment sync to be the - * first symbols of the field sync segment. \p which_field is in [0,1] - * and specifies which field (duh). - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ - virtual void filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field) = 0; -}; - - -#endif /* _ATSC_EQUALIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/equalizer_lms2_impl.h b/gr-atsc/include/gnuradio/atsc/equalizer_lms2_impl.h deleted file mode 100644 index 5f4ab66c96..0000000000 --- a/gr-atsc/include/gnuradio/atsc/equalizer_lms2_impl.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_EQUALIZER_LMS2_H_ -#define _ATSC_EQUALIZER_LMS2_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/equalizer_impl.h> -#include <vector> -#include <stdio.h> - -class ATSC_API atsci_equalizer_lms2 : public atsci_equalizer -{ -public: - atsci_equalizer_lms2 (); - virtual ~atsci_equalizer_lms2 (); - - virtual void reset (); - virtual int ntaps () const; - virtual int npretaps () const; - -protected: - FILE *trainingfile; - virtual void filter_normal (const float *input_samples, - float *output_samples, - int nsamples); - - virtual void filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset); - - virtual void filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field); - -private: - std::vector<double> d_taps_ff; - std::vector<double> d_taps_fb; - std::vector<float> d_old_output; - - int d_output_ptr; - - void filterN (const float *input_samples, - float *output_samples, - int nsamples); - - void adaptN (const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples); - - float filter1 (const float input[]); - float adapt1 (const float input[], float ideal_output); - -}; - - -#endif /* _ATSC_EQUALIZER_LMS2_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/equalizer_lms_impl.h b/gr-atsc/include/gnuradio/atsc/equalizer_lms_impl.h deleted file mode 100644 index 0daa00e67c..0000000000 --- a/gr-atsc/include/gnuradio/atsc/equalizer_lms_impl.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_EQUALIZER_LMS_H_ -#define _ATSC_EQUALIZER_LMS_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/equalizer_impl.h> -#include <vector> -#include <stdio.h> - -class ATSC_API atsci_equalizer_lms : public atsci_equalizer -{ -public: - atsci_equalizer_lms (); - virtual ~atsci_equalizer_lms (); - - virtual void reset (); - virtual int ntaps () const; - virtual int npretaps () const; - std::vector<double> taps () { - return d_taps; - } - -protected: - FILE *trainingfile; - virtual void filter_normal (const float *input_samples, - float *output_samples, - int nsamples); - - virtual void filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset); - - virtual void filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field); - -private: - std::vector<double> d_taps; - - void filterN (const float *input_samples, - float *output_samples, - int nsamples); - - void adaptN (const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples); - - float filter1 (const float input[]); - float adapt1 (const float input[], float ideal_output); - -}; - - -#endif /* _ATSC_EQUALIZER_LMS_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/equalizer_nop_impl.h b/gr-atsc/include/gnuradio/atsc/equalizer_nop_impl.h deleted file mode 100644 index 1c075c5220..0000000000 --- a/gr-atsc/include/gnuradio/atsc/equalizer_nop_impl.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_EQUALIZER_NOP_H_ -#define _ATSC_EQUALIZER_NOP_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/equalizer_impl.h> - -class ATSC_API atsci_equalizer_nop : public atsci_equalizer -{ -private: - float scale (float input) { return input; } - - float scale_and_train (float input); - - -public: - atsci_equalizer_nop (); - virtual ~atsci_equalizer_nop (); - - virtual void reset (); - virtual int ntaps () const; - virtual int npretaps () const; - -protected: - virtual void filter_normal (const float *input_samples, - float *output_samples, - int nsamples); - - virtual void filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset); - - virtual void filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field); -}; - - -#endif /* _ATSC_EQUALIZER_NOP_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/exp2_lp_impl.h b/gr-atsc/include/gnuradio/atsc/exp2_lp_impl.h deleted file mode 100644 index 2d61fc8667..0000000000 --- a/gr-atsc/include/gnuradio/atsc/exp2_lp_impl.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_EXP2_LP_H_ -#define _ATSC_EXP2_LP_H_ - -#include <gnuradio/atsc/api.h> -#include <gr_fir_builder.h> - -class ATSC_API atsci_exp2_lp : public gr_fir_builder -{ -public: - virtual std::vector<float> taps (double sampling_freq); -}; - -#endif /* _ATSC_EXP2_LP_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/fake_single_viterbi_impl.h b/gr-atsc/include/gnuradio/atsc/fake_single_viterbi_impl.h deleted file mode 100644 index ae671832b4..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fake_single_viterbi_impl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSCFAKESINGLEVITERBI_H_ -#define _ATSCFAKESINGLEVITERBI_H_ - -#include <gnuradio/atsc/api.h> - -/*! - * \brief single channel viterbi decoder - */ -class ATSC_API atsci_fake_single_viterbi -{ - -public: - atsci_fake_single_viterbi (); - - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode (float input); - - void reset (); - - //! internal delay of decoder - int delay () { return 0; } - -protected: - int post_coder_state; -}; - -#endif diff --git a/gr-atsc/include/gnuradio/atsc/field_sync_demux.h b/gr-atsc/include/gnuradio/atsc/field_sync_demux.h deleted file mode 100644 index 1c31a5b98f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/field_sync_demux.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_ATSC_FIELD_SYNC_DEMUX_H -#define INCLUDED_ATSC_FIELD_SYNC_DEMUX_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/block.h> -#include <gnuradio/atsc/types.h> - -class atsc_field_sync_demux; -typedef boost::shared_ptr<atsc_field_sync_demux> atsc_field_sync_demux_sptr; - -ATSC_API atsc_field_sync_demux_sptr atsc_make_field_sync_demux(); - -/*! - * \brief ATSC Field Sync Demux - * - * This class accepts 1 stream of floats (data), and 1 stream of tags (syminfo). * It outputs one stream of atsc_soft_data_segment packets - * \ingroup atsc - * - */ -class ATSC_API atsc_field_sync_demux : public gr::block -{ - friend ATSC_API atsc_field_sync_demux_sptr atsc_make_field_sync_demux(); - - atsc_field_sync_demux(); - -public: - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - -protected: - bool d_locked; - bool d_in_field2; - int d_segment_number; - uint64_t d_next_input; - uint64_t d_lost_index; // diagnostic fluff - - unsigned long long d_inputs0_index; // for inputs[0].index - unsigned long d_inputs0_size; // for inputs[0].size - int d_consume; - -}; - - -#endif /* INCLUDED_ATSC_FIELD_SYNC_DEMUX_H */ diff --git a/gr-atsc/include/gnuradio/atsc/field_sync_mux.h b/gr-atsc/include/gnuradio/atsc/field_sync_mux.h deleted file mode 100644 index 2cccb52aec..0000000000 --- a/gr-atsc/include/gnuradio/atsc/field_sync_mux.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_FIELD_SYNC_MUX_H -#define INCLUDED_ATSC_FIELD_SYNC_MUX_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/types.h> - -class atsc_field_sync_mux; -typedef boost::shared_ptr<atsc_field_sync_mux> atsc_field_sync_mux_sptr; - -ATSC_API atsc_field_sync_mux_sptr atsc_make_field_sync_mux(); - -/*! - * \brief Insert ATSC Field Syncs as required (atsc_data_segment --> atsc_data_segment) - * \ingroup atsc - * - * input: atsc_data_segment; output: atsc_data_segment - */ -class ATSC_API atsc_field_sync_mux : public gr::block -{ - friend ATSC_API atsc_field_sync_mux_sptr atsc_make_field_sync_mux(); - - atsc_field_sync_mux(); - -public: - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - - static const int N_SAVED_SYMBOLS = 12; - - void reset() - { - d_already_output_field_sync = false; - } - -protected: - bool d_already_output_field_sync; - unsigned char d_saved_symbols[N_SAVED_SYMBOLS]; -}; - - -#endif /* INCLUDED_ATSC_FIELD_SYNC_MUX_H */ diff --git a/gr-atsc/include/gnuradio/atsc/fpll.h b/gr-atsc/include/gnuradio/atsc/fpll.h deleted file mode 100644 index 9c565ed2eb..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fpll.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_FPLL_H -#define INCLUDED_ATSC_FPLL_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/nco.h> -#include <gnuradio/filter/single_pole_iir.h> -#include <gnuradio/analog/agc.h> -#include <stdio.h> -#include <gnuradio/atsc/diag_output_impl.h> - -using namespace gr; - -class atsc_fpll; -typedef boost::shared_ptr<atsc_fpll> atsc_fpll_sptr; - -ATSC_API atsc_fpll_sptr atsc_make_fpll(); - -/*! - * \brief ATSC FPLL (2nd Version) - * \ingroup atsc - * - * A/D --> GrFIRfilterFFF ----> GrAtscFPLL ----> - * - * We use GrFIRfilterFFF to bandpass filter the signal of interest. - * - * This class accepts a single real input and produces a single real output - */ - -class ATSC_API atsc_fpll : public gr::sync_block -{ - friend ATSC_API atsc_fpll_sptr atsc_make_fpll(); - - atsc_fpll(); - -public: - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - - void initialize () ; - - protected: - - double initial_freq; - double initial_phase; - bool debug_no_update; - gr::nco<float,float> nco; - analog::kernel::agc_ff agc; // automatic gain control - filter::single_pole_iir<float,float,float> afci; - filter::single_pole_iir<float,float,float> afcq; - - -}; - - -#endif /* INCLUDED_ATSC_FPLL_H */ diff --git a/gr-atsc/include/gnuradio/atsc/fs_checker.h b/gr-atsc/include/gnuradio/atsc/fs_checker.h deleted file mode 100644 index 7a7d73852a..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fs_checker.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_FS_CHECKER_H -#define INCLUDED_ATSC_FS_CHECKER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/fs_checker_impl.h> -#include <gnuradio/sync_block.h> - -class atsc_fs_checker; -typedef boost::shared_ptr<atsc_fs_checker> atsc_fs_checker_sptr; - -ATSC_API atsc_fs_checker_sptr atsc_make_fs_checker(); - -/*! - * \brief ATSC field sync checker (float,syminfo --> float,syminfo) - * \ingroup atsc - * - * first output is delayed version of input. - * second output is set of tags, one-for-one with first output. - */ - -class ATSC_API atsc_fs_checker : public gr::sync_block -{ - friend ATSC_API atsc_fs_checker_sptr atsc_make_fs_checker(); - - atsc_fs_checker(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - - ~atsc_fs_checker (); - -protected: - atsci_fs_checker *d_fsc; - -}; - - -#endif /* INCLUDED_ATSC_FS_CHECKER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/fs_checker_impl.h b/gr-atsc/include/gnuradio/atsc/fs_checker_impl.h deleted file mode 100644 index 3ac1b8d913..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fs_checker_impl.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _ATSC_FS_CHECKER_H_ -#define _ATSC_FS_CHECKER_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/syminfo_impl.h> - -/*! - * \brief abstract base class for ATSC field sync checker - * - * Processes input samples one at a time looking for - * an occurence of either the field sync 1 or field sync 2 pattern. - * - * Note that unlike atsci_fs_correlator, this class uses the symbol_num in - * input_tag to avoid having to test each symbol position. - * - * For each sample processed, an output sample and an output tag are produced. - * The output samples are identical to the input samples but are delayed by - * a number of samples given by \p delay(). The output tag associated with - * the the given output sample indicates whether this sample is the beginning - * of one of the field syncs or is an ordinary sample. The tags are defined in - * atsci_sync_tag.h. - * - * For ease of use, the field sync patterns are defined to begin with the - * first symbol of the 4 symbol data segment sync pattern that immediately - * proceeds the actual PN 511 code. This makes it easier for downstream code - * to determine the location of data segment syncs merely by counting. They'll - * occur every 832 samples assuming everything is working. - */ - -class ATSC_API atsci_fs_checker { - -public: - - // CREATORS - atsci_fs_checker (); - virtual ~atsci_fs_checker () = 0; - - // MANIPULATORS - virtual void reset () = 0; - virtual void filter (float input_sample, atsc::syminfo input_tag, - float *output_sample, atsc::syminfo *output_tag) = 0; - - // ACCESSORS - - //! return delay in samples from input to output - virtual int delay () const = 0; -}; - -#endif /* _ATSC_FS_CHECKER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/fs_checker_naive_impl.h b/gr-atsc/include/gnuradio/atsc/fs_checker_naive_impl.h deleted file mode 100644 index 002af5c645..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fs_checker_naive_impl.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_FS_CHECKER_NAIVE_H_ -#define _ATSC_FS_CHECKER_NAIVE_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/fs_checker_impl.h> - -/*! - * \brief Naive concrete implementation of field sync checker - */ -class ATSC_API atsci_fs_checker_naive : public atsci_fs_checker { - - private: - static const int SRSIZE = 1024; // must be power of two - int d_index; // points at oldest sample - float d_sample_sr[SRSIZE]; // sample shift register - atsc::syminfo d_tag_sr[SRSIZE]; // tag shift register - unsigned char d_bit_sr[SRSIZE]; // binary decision shift register - int d_field_num; - int d_segment_num; - - static const int OFFSET_511 = 0; // offset to PN 511 pattern - static const int LENGTH_511 = 511 + 4; // length of PN 511 pattern (+ 4 seg sync) - static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern - static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern - - static unsigned char s_511[LENGTH_511]; // PN 511 pattern - static unsigned char s_63[LENGTH_2ND_63]; // PN 63 pattern - - inline static int wrap (int index){ return index & (SRSIZE - 1); } - inline static int incr (int index){ return wrap (index + 1); } - inline static int decr (int index){ return wrap (index - 1); } - - public: - - // CREATORS - atsci_fs_checker_naive (); - ~atsci_fs_checker_naive (); - - // MANIPULATORS - virtual void reset (); - void filter (float input_sample, atsc::syminfo input_tag, - float *output_sample, atsc::syminfo *output_tag); - - // ACCESSORS - - //! return delay in samples from input to output - int delay () const; - -}; - - -#endif /* _ATSC_FS_CHECKER_NAIVE_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/fs_correlator_impl.h b/gr-atsc/include/gnuradio/atsc/fs_correlator_impl.h deleted file mode 100644 index 2517877666..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fs_correlator_impl.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_FS_CORRELATOR_H_ -#define _ATSC_FS_CORRELATOR_H_ - -#include <gnuradio/atsc/api.h> - -/*! - * \brief abstract base class for ATSC field sync correlator - * - * Processes input samples one at a time looking for - * an occurence of either the field sync 1 or field sync 2 pattern. - * - * For each sample processed, an output sample and an output tag are produced. - * The output samples are identical to the input samples but are delayed by - * a number of samples given by \p delay(). The output tag associated with - * the the given output sample indicates whether this sample is the beginning - * of one of the field syncs or is an ordinary sample. The tags are defined in - * atsci_sync_tag.h. - * - * For ease of use, the field sync patterns are defined to begin with the - * first symbol of the 4 symbol data segment sync pattern that immediately - * proceeds the actual PN 511 code. This makes it easier for downstream code - * to determine the location of data segment syncs merely by counting. They'll - * occur every 832 samples assuming everything is working. - */ - -class ATSC_API atsci_fs_correlator { - -public: - - // CREATORS - atsci_fs_correlator (); - virtual ~atsci_fs_correlator () = 0; - - // MANIPULATORS - virtual void reset () = 0; - virtual void filter (float input_sample, float *output_sample, float *output_tag) = 0; - - // ACCESSORS - - //! return delay in samples from input to output - virtual int delay () const = 0; -}; - -#endif /* _ATSC_FS_CORRELATOR_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/fs_correlator_naive_impl.h b/gr-atsc/include/gnuradio/atsc/fs_correlator_naive_impl.h deleted file mode 100644 index 4f8b5a8d76..0000000000 --- a/gr-atsc/include/gnuradio/atsc/fs_correlator_naive_impl.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_FS_CORRELATOR_NAIVE_H_ -#define _ATSC_FS_CORRELATOR_NAIVE_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/fs_correlator_impl.h> - -/*! - * \brief Naive concrete implementation of field sync correlator - */ -class ATSC_API atsci_fs_correlator_naive : public atsci_fs_correlator { - - private: - static const int SRSIZE = 1024; // must be power of two - int d_index; // points at oldest sample - float d_sample_sr[SRSIZE]; // sample shift register - unsigned char d_bit_sr[SRSIZE]; // binary decision shift register - - static const int OFFSET_511 = 0; // offset to PN 511 pattern - static const int LENGTH_511 = 511 + 4; // length of PN 511 pattern (+ 4 seg sync) - static const int OFFSET_2ND_63 = 578; // offset to second PN 63 pattern - static const int LENGTH_2ND_63 = 63; // length of PN 63 pattern - - static unsigned char s_511[LENGTH_511]; // PN 511 pattern - static unsigned char s_63[LENGTH_2ND_63]; // PN 63 pattern - - inline static int wrap (int index){ return index & (SRSIZE - 1); } - inline static int incr (int index){ return wrap (index + 1); } - inline static int decr (int index){ return wrap (index - 1); } - - public: - - // CREATORS - atsci_fs_correlator_naive (); - ~atsci_fs_correlator_naive (); - - // MANIPULATORS - virtual void reset (); - void filter (float input_sample, float *output_sample, float *output_tag); - - // ACCESSORS - - //! return delay in samples from input to output - int delay () const; - -}; - - -#endif /* _ATSC_FS_CORRELATOR_NAIVE_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/interleaver.h b/gr-atsc/include/gnuradio/atsc/interleaver.h deleted file mode 100644 index 1f245bbbe0..0000000000 --- a/gr-atsc/include/gnuradio/atsc/interleaver.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_INTERLEAVER_H -#define INCLUDED_ATSC_INTERLEAVER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/data_interleaver_impl.h> - -class atsc_interleaver; -typedef boost::shared_ptr<atsc_interleaver> atsc_interleaver_sptr; - -ATSC_API atsc_interleaver_sptr atsc_make_interleaver(); - -/*! \brief Interleave RS encoded ATSC data ( atsc_mpeg_packet_rs_encoded --> atsc_mpeg_packet_rs_encoded)* - * \ingroup atsc - * - * input: atsc_mpeg_packet_rs_encoded; output: atsc_mpeg_packet_rs_encoded - */ -class ATSC_API atsc_interleaver : public gr::sync_block -{ - friend ATSC_API atsc_interleaver_sptr atsc_make_interleaver(); - - atsci_data_interleaver d_interleaver; - - atsc_interleaver(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_INTERLEAVER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/interleaver_fifo.h b/gr-atsc/include/gnuradio/atsc/interleaver_fifo.h deleted file mode 100644 index aee42104e7..0000000000 --- a/gr-atsc/include/gnuradio/atsc/interleaver_fifo.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _INTERLEAVER_FIFO_H_ -#define _INTERLEAVER_FIFO_H_ - - -#include <gnuradio/atsc/interleaver_fifo.h> -#include <string.h> - -/*! - * \brief template class for interleaver fifo - */ - -template<class symbol_type> -class interleaver_fifo { - public: - - interleaver_fifo (unsigned int size); - ~interleaver_fifo (); - - //! reset interleaver (flushes contents and resets commutator) - void reset (); - - //! stuff a symbol into the fifo and return the oldest - symbol_type stuff (symbol_type input){ - if (m_size == 0) - return input; - - symbol_type retval = m_fifo[m_position]; - m_fifo[m_position] = input; - m_position++; - if (m_position >= m_size) - m_position = 0; - - return retval; - } - -protected: - unsigned int m_size; - unsigned int m_position; - symbol_type *m_fifo; -}; - -template<class symbol_type> -interleaver_fifo<symbol_type>::interleaver_fifo (unsigned int size) -{ - m_size = size; - m_position = 0; - m_fifo = new symbol_type[size]; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); -} - -template<class symbol_type> -interleaver_fifo<symbol_type>::~interleaver_fifo () -{ - delete [] m_fifo; -} - -template<class symbol_type> void -interleaver_fifo<symbol_type>::reset () -{ - m_position = 0; - memset (m_fifo, 0, m_size * sizeof (symbol_type)); -} - -#endif /* _INTERLEAVER_FIFO_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/pad.h b/gr-atsc/include/gnuradio/atsc/pad.h deleted file mode 100644 index cbe5b11e5d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/pad.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_PAD_H -#define INCLUDED_ATSC_PAD_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_decimator.h> - -class atsc_pad; -typedef boost::shared_ptr<atsc_pad> atsc_pad_sptr; - -ATSC_API atsc_pad_sptr atsc_make_pad(); - -/*! - * \brief pad mpeg ts packets from 188 byte char to - * to 256 byte atsc_mpeg_packet - * \ingroup atsc - * - * input: unsigned char; output: atsc_mpeg_packet - */ -class ATSC_API atsc_pad : public gr::sync_decimator -{ - friend ATSC_API atsc_pad_sptr atsc_make_pad(); - - atsc_pad(); - -public: - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_PAD_H */ diff --git a/gr-atsc/include/gnuradio/atsc/pnXXX_impl.h b/gr-atsc/include/gnuradio/atsc/pnXXX_impl.h deleted file mode 100644 index b33d82cec6..0000000000 --- a/gr-atsc/include/gnuradio/atsc/pnXXX_impl.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/api.h> - -ATSC_API extern const unsigned char atsc_pn511[]; -ATSC_API extern const unsigned char atsc_pn63[]; diff --git a/gr-atsc/include/gnuradio/atsc/randomizer.h b/gr-atsc/include/gnuradio/atsc/randomizer.h deleted file mode 100644 index dfda95d032..0000000000 --- a/gr-atsc/include/gnuradio/atsc/randomizer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_RANDOMIZER_H -#define INCLUDED_ATSC_RANDOMIZER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/randomizer_impl.h> - -class atsc_randomizer; -typedef boost::shared_ptr<atsc_randomizer> atsc_randomizer_sptr; - -ATSC_API atsc_randomizer_sptr atsc_make_randomizer(); - -/*! - * \brief "Whiten" incoming mpeg transport stream packets - * \ingroup atsc - * - * input: atsc_mpeg_packet; output: atsc_mpeg_packet_no_sync - */ -class ATSC_API atsc_randomizer : public gr::sync_block -{ - friend ATSC_API atsc_randomizer_sptr atsc_make_randomizer(); - - atsci_randomizer d_rand; - bool d_field2; // user to init plinfo in output - int d_segno; // likewise - - atsc_randomizer(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset(); -}; - - -#endif /* INCLUDED_ATSC_RANDOMIZER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/randomizer_impl.h b/gr-atsc/include/gnuradio/atsc/randomizer_impl.h deleted file mode 100644 index d798629de2..0000000000 --- a/gr-atsc/include/gnuradio/atsc/randomizer_impl.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2001 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_RANDOMIZER_H_ -#define _ATSC_RANDOMIZER_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief ATSC data "whitener" - * - * The data randomizer described in ATSC standard A/53B. - * See figure D4 on page 54. - */ - -class ATSC_API atsci_randomizer { - friend class qa_atsci_randomizer; - - public: - atsci_randomizer(); - - /*! \brief reset randomizer LFSR - * - * must be called during the Data Segment Sync interval prior to the - * first data segment. I.e., the LFSR is reset prior to the first - * field of each VSB data frame. - */ - void reset (); - - //! randomize (whiten) mpeg packet and remove leading MPEG-2 sync byte - void randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in); - - //! derandomize (de-whiten) mpeg packet and add leading MPEG-2 sync byte - void derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in); - - unsigned int state() const { return d_state; } - - private: - static void initialize_output_map (); - static unsigned char slow_output_map (int st); - - static unsigned char fast_output_map (int st){ - return s_output_map[(st & 0xb23c) >> 2]; // Magic const with 8 bits set improves cache - // utilization. The bits correspond to the taps - // used in output calculation. Others may be - // safely ignored. - } - - //! return current output value - unsigned char output (){ - return fast_output_map (d_state); - } - - //! clock LFSR; advance to next state. - void clk (){ - if (d_state & 0x1) - d_state = ((d_state ^ MASK) >> 1) | 0x8000; - else - d_state = d_state >> 1; - } - - //! return current output value and advance to next state - unsigned char output_and_clk (){ - unsigned char r = output (); - clk (); - return r; - } - - unsigned int d_state; - - static const unsigned int PRELOAD_VALUE = 0x018f; /* 0xf180 bit reversed */ - static const unsigned int MASK = 0xa638; - static unsigned char s_output_map[1 << 14]; - static bool s_output_map_initialized_p; -}; - -#endif /* _ATSC_RANDOMIZER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/reed_solomon_impl.h b/gr-atsc/include/gnuradio/atsc/reed_solomon_impl.h deleted file mode 100644 index 53584b4dbf..0000000000 --- a/gr-atsc/include/gnuradio/atsc/reed_solomon_impl.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_REED_SOLOMON_H_ -#define _ATSC_REED_SOLOMON_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief ATSC Reed-Solomon encoder / decoder - * - * The t=10 (207,187) code described in ATSC standard A/53B. - * See figure D5 on page 55. - */ - -class ATSC_API atsci_reed_solomon { - - public: - atsci_reed_solomon(); - ~atsci_reed_solomon(); - - /*! - * \brief Add RS error correction encoding - */ - void encode (atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in); - - /*! - * Decode RS encoded packet. - * \returns a count of corrected symbols, or -1 if the block was uncorrectible. - */ - int decode (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in); - - private: - void *d_rs; -}; - -#endif /* _ATSC_REED_SOLOMON_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/root_raised_cosine_bandpass_impl.h b/gr-atsc/include/gnuradio/atsc/root_raised_cosine_bandpass_impl.h deleted file mode 100644 index 318d888712..0000000000 --- a/gr-atsc/include/gnuradio/atsc/root_raised_cosine_bandpass_impl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_RRC_BANDPASS_H_ -#define _ATSC_RRC_BANDPASS_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/root_raised_cosine_impl.h> - -class ATSC_API atsc_root_raised_cosine_bandpass : public atsc_root_raised_cosine -{ -public: - atsc_root_raised_cosine_bandpass (double center_freq) : _center_freq (center_freq) {} - virtual std::vector<float> taps (double sampling_freq); - -protected: - double _center_freq; -}; - - -#endif /* _ATSC_RRC_BANDPASS_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/root_raised_cosine_impl.h b/gr-atsc/include/gnuradio/atsc/root_raised_cosine_impl.h deleted file mode 100644 index 3489a7a908..0000000000 --- a/gr-atsc/include/gnuradio/atsc/root_raised_cosine_impl.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_RRC_H_ -#define _ATSC_RRC_H_ - -#include <gnuradio/atsc/api.h> -#include <gr_fir_builder.h> - -class ATSC_API atsc_root_raised_cosine : public gr_fir_builder -{ -public: - virtual std::vector<float> taps (double sampling_freq); -}; - - -#endif /* _ATSC_RRC_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/rs_decoder.h b/gr-atsc/include/gnuradio/atsc/rs_decoder.h deleted file mode 100644 index 99ab875869..0000000000 --- a/gr-atsc/include/gnuradio/atsc/rs_decoder.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_RS_DECODER_H -#define INCLUDED_ATSC_RS_DECODER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/reed_solomon_impl.h> - -class atsc_rs_decoder; -typedef boost::shared_ptr<atsc_rs_decoder> atsc_rs_decoder_sptr; - -ATSC_API atsc_rs_decoder_sptr atsc_make_rs_decoder(); - -/*! - * \brief Reed-Solomon decoder for ATSC - * \ingroup atsc - * - * input: atsc_mpeg_packet_rs_encoded; output: atsc_mpeg_packet_no_sync - */ -class ATSC_API atsc_rs_decoder : public gr::sync_block -{ - friend ATSC_API atsc_rs_decoder_sptr atsc_make_rs_decoder(); - - atsci_reed_solomon d_rs_decoder; - - atsc_rs_decoder(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_RS_DECODER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/rs_encoder.h b/gr-atsc/include/gnuradio/atsc/rs_encoder.h deleted file mode 100644 index 49f67d2762..0000000000 --- a/gr-atsc/include/gnuradio/atsc/rs_encoder.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_RS_ENCODER_H -#define INCLUDED_ATSC_RS_ENCODER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/reed_solomon_impl.h> - -class atsc_rs_encoder; -typedef boost::shared_ptr<atsc_rs_encoder> atsc_rs_encoder_sptr; - -ATSC_API atsc_rs_encoder_sptr atsc_make_rs_encoder(); - -/*! - * \brief Reed-Solomon encoder for ATSC - * \ingroup atsc - * - * input: atsc_mpeg_packet_no_sync; output: atsc_mpeg_packet_rs_encoded - */ -class ATSC_API atsc_rs_encoder : public gr::sync_block -{ - friend ATSC_API atsc_rs_encoder_sptr atsc_make_rs_encoder(); - - atsci_reed_solomon d_rs_encoder; - - atsc_rs_encoder(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_RS_ENCODER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/single_viterbi_impl.h b/gr-atsc/include/gnuradio/atsc/single_viterbi_impl.h deleted file mode 100644 index d6578ce259..0000000000 --- a/gr-atsc/include/gnuradio/atsc/single_viterbi_impl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSCSINGLEVITERBI_H_ -#define _ATSCSINGLEVITERBI_H_ - -#include <gnuradio/atsc/api.h> - -/*! - * \brief single channel viterbi decoder - */ -class ATSC_API atsci_single_viterbi -{ - -public: - atsci_single_viterbi (); - - static const unsigned int TB_LEN = 32; - - /*! - * \p INPUT ideally takes on the values +/- 1,3,5,7 - * return is decoded dibit in the range [0, 3] - */ - char decode (float input); - - void reset (); - - //! internal delay of decoder - int delay () { return TB_LEN - 1; } - -protected: - static const int transition_table[32]; - static const float was_sent[32]; - float path_metrics [2][8]; - unsigned long long traceback [2][8]; - unsigned char phase; -}; - -#endif diff --git a/gr-atsc/include/gnuradio/atsc/slicer_agc_impl.h b/gr-atsc/include/gnuradio/atsc/slicer_agc_impl.h deleted file mode 100644 index d55e744fea..0000000000 --- a/gr-atsc/include/gnuradio/atsc/slicer_agc_impl.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_SLICER_AGC_H_ -#define _ATSC_SLICER_AGC_H_ - -#include <gnuradio/atsc/api.h> -#include <math.h> -#include <gnuradio/filter/single_pole_iir.h> - -/*! - * \brief Automatic Gain Control class for atsc slicer - * - * Given perfect data, output values will be +/- {7, 5, 3, 1} - */ - -class ATSC_API atsci_slicer_agc { - - public: - atsci_slicer_agc () : _gain(1), dc(0.0025) {}; - - - float gain () { return _gain; } - -#if 1 - float scale (float input){ - float t = input * _gain; - float output = t - REFERENCE; - float error = REFERENCE - dc.filter (t); - _gain += error * RATE; - return output; - } -#else - float scale(float input){ - float avg = dc.filter(input); - if(fabs(avg)<.1)avg=.1; - _gain += _gain*.99 + .01* REFERENCE/avg; - return input*_gain - REFERENCE; - } -#endif - - protected: - - static const float REFERENCE = 1.25; // pilot reference value - static const float RATE = 1.0e-5; // adjustment rate - float _gain; // current gain - gr_single_pole_iir<float,float,float> dc; -}; - -#endif /* _ATSC_SLICER_AGC_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/sliding_correlator_impl.h b/gr-atsc/include/gnuradio/atsc/sliding_correlator_impl.h deleted file mode 100644 index eca63df609..0000000000 --- a/gr-atsc/include/gnuradio/atsc/sliding_correlator_impl.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_SLIDING_CORRELATOR_H_ -#define _ATSC_SLIDING_CORRELATOR_H_ - -#include <gnuradio/atsc/api.h> -#include <string.h> - -#include <gnuradio/atsc/pnXXX_impl.h> -//extern const unsigned char atsc_pn511[511]; -//extern const unsigned char atsc_pn63[63]; - -/*! - * \brief look for the PN 511 field sync pattern - */ -class ATSC_API atsci_sliding_correlator { - public: - - atsci_sliding_correlator (); - ~atsci_sliding_correlator (){}; - - //! input hard decision bit, return correlation (0,511) - // Result is the number of wrong bits. - // E.g., 0 -> perfect match; 511 -> all bits are wrong - - int input_bit (int bit); - - //! input sample, return correlation (0,511) - // Result is the number of wrong bits. - // E.g., 0 -> perfect match; 511 -> all bits are wrong - - int input_int (int sample){ - return input_bit (sample < 0 ? 0 : 1); - } - - //! input sample, return correlation (0,511) - // Result is the number of wrong bits. - // E.g., 0 -> perfect match; 511 -> all bits are wrong - - int input_float (float sample){ - return input_bit (sample < 0 ? 0 : 1); - } - - void reset () { input.reset (); } - - private: - - typedef unsigned long srblock; - static const int bits_per_char = 8; - static const int srblock_bitsize = sizeof (srblock) * bits_per_char; - static const int NSRBLOCKS = (511 + srblock_bitsize - 1) / srblock_bitsize; - - class shift_reg { - public: - shift_reg () { reset (); } - void reset () { memset (d, 0, sizeof (d)); } - void shift_in (int bit); - srblock d[NSRBLOCKS]; - }; - - shift_reg mask; // pattern we're looking for - shift_reg input; // current input window - shift_reg and_mask; // bits to consider -}; - -#endif /* _ATSC_SLIDING_CORRELATOR_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/sssr_impl.h b/gr-atsc/include/gnuradio/atsc/sssr_impl.h deleted file mode 100644 index f61d0f340f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/sssr_impl.h +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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. - */ - -/* - * --- ATSC Segment and Symbol Sync Recovery --- - */ - -#ifndef _ATSC_SSSR_H_ -#define _ATSC_SSSR_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/filter/mmse_fir_interpolator_ff.h> -#include <gnuradio/filter/single_pole_iir.h> -#include <cstdio> - -/* - * --- support classes for atsci_sssr --- - */ - -namespace sssr { - - typedef float sample_t; - - // ---------------------------------------------------------------- - //! digital correlator for 1001 and 0110 patterns - - class ATSC_API digital_correlator { - int d_sr; // 4 bit shift register - - public: - - // Constructor - digital_correlator () { reset (); } - - // Manipulators - - //! called on channel change - void reset () { d_sr = 0; } - - //! clock bit in and return true if we've seen 1001 - - bool update (int bit) { - d_sr = ((bit & 1) << 3) | (d_sr >> 1); - - return (d_sr == 0x9); // 1001 - } - - }; - - - // ---------------------------------------------------------------- - //! segment sync integrator - - class ATSC_API seg_sync_integrator { - signed char d_integrator[ATSC_DATA_SEGMENT_LENGTH]; - - public: - - // Constructor - seg_sync_integrator () { reset (); } - - // Manipulators - - //! called on channel change - void reset (); - - //! update current tap with weight and return integrated correlation value - int update (int weight, int index); - - //! return index of maximum correlation value - int find_max (int *value); - - }; - - // ---------------------------------------------------------------- - //! quad filter (used to compute timing error) - - class ATSC_API quad_filter { - sample_t d_delay[4]; - - public: - // Constructor - quad_filter () { reset (); } - - // Manipulators - - //! called on channel change - void reset () { d_delay[0] = d_delay[1] = d_delay[2] = d_delay[3] = 0; } - - double update (sample_t sample){ - d_delay[3] = d_delay[2]; - d_delay[2] = d_delay[1]; - d_delay[1] = d_delay[0]; - d_delay[0] = sample; - - // the coefficients are -1,-1,+1,+1 - return d_delay[3] + d_delay[2] - d_delay[1] - d_delay[0]; - } - }; -} - -// ---------------------------------------------------------------- - -/*! - * \brief ATSC Segment and Symbol Sync Recovery - * - * This class implements data segment sync tracking and symbol timing - * using the method described in "ATSC/VSB Tutorial - Receiver Technology" - * by Wayne E. Bretl of Zenith, pgs 41-45. - */ - -class ATSC_API atsci_sssr { - sssr::digital_correlator d_correlator; - sssr::seg_sync_integrator d_integrator; - sssr::quad_filter d_quad_filter; - double d_quad_output[ATSC_DATA_SEGMENT_LENGTH]; - double d_timing_adjust; - int d_counter; // free running mod 832 counter - int d_symbol_index; - bool d_seg_locked; - FILE *d_debug_fp; - - - bool incr_counter () { - d_counter++; - if (d_counter >= ATSC_DATA_SEGMENT_LENGTH){ - d_counter = 0; - return true; - } - return false; - } - - void incr_symbol_index () { - d_symbol_index++; - if (d_symbol_index >= ATSC_DATA_SEGMENT_LENGTH) - d_symbol_index = 0; - } - -public: - - // Constructor - atsci_sssr (); - ~atsci_sssr (); - - // Manipulators - - //! call on channel change - void reset (); - - - /*! - * \brief process a single sample at the ATSC symbol rate (~10.76 MSPS) - * - * This block computes an indication of our timing error and keeps - * track of where the segment sync's occur. \p timing_adjust is - * returned to indicate how the interpolator timing needs to be - * adjusted to track the transmitter's symbol timing. If \p seg_locked - * is true, then \p symbol_index is the index of this sample in - * the current segment. The symbols are numbered from 0 to 831, where - * symbols 0, 1, 2 and 3 correspond to the data segment sync pattern, - * nominally +5, -5, -5, +5. - */ - - void update (sssr::sample_t sample_in, // input - bool *seg_locked, // are we seeing segment syncs? - int *symbol_index, // 0..831 - double *timing_adjust); // how much to adjust timing - -}; - -// ---------------------------------------------------------------- - -/*! - * \brief interpolator control for segment and symbol sync recovery - */ - -class ATSC_API atsci_interpolator { - gr::filter::mmse_fir_interpolator_ff d_interp; - gr::filter::single_pole_iir<float,float,float> d_loop; // ``VCO'' loop filter - double d_nominal_ratio_of_rx_clock_to_symbol_freq; // FREQ - double d_w; // ratio of PERIOD of Tx to Rx clocks - double d_mu; // fractional delay [0,1] - int d_incr; // diagnostic only - FILE *d_debug_fp; // diagnostic only - -public: - //! \p nominal_ratio_of_rx_clock_to_symbol_freq must be >= 1.8 - atsci_interpolator (double nominal_ratio_of_rx_clock_to_symbol_freq); - ~atsci_interpolator (); - - // Manipulators - - //! call on channel change - void reset (); - - /*! - * \brief produce next sample referenced to Tx clock - * - * If there aren't enough input_samples left to produce - * an output, return false, else true. - */ - - bool update (const sssr::sample_t input_samples[], // I: vector of samples - int nsamples, // I: total number of samples - int *index, // I/O: current input index - double timing_adjustment, // I: how much to bump timing - sssr::sample_t *output_sample); // O: the output sample - - // Accessors - - // how much history we require on our input - unsigned ntaps () const { return d_interp.ntaps (); } - - // diagnostic accessors - double mu () const { return d_mu; } - double w () const { return d_w; } - int incr () const { return d_incr; } - -}; - -#endif /* _ATSC_SSSR_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/syminfo_impl.h b/gr-atsc/include/gnuradio/atsc/syminfo_impl.h deleted file mode 100644 index 9f25e4902a..0000000000 --- a/gr-atsc/include/gnuradio/atsc/syminfo_impl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _ATSC_SYMINFO_H_ -#define _ATSC_SYMINFO_H_ - -namespace atsc { - - static const unsigned int SI_SEGMENT_NUM_MASK = 0x1ff; - static const unsigned int SI_FIELD_SYNC_SEGMENT_NUM = SI_SEGMENT_NUM_MASK; // conceptually -1 - - struct syminfo { - unsigned int symbol_num : 10; // 0..831 - unsigned int segment_num : 9; // 0..311 and SI_FIELD_SYNC_SEGMENT_NUM - unsigned int field_num : 1; // 0..1 - unsigned int valid : 1; // contents are valid - }; - - - static inline bool - tag_is_start_field_sync (syminfo tag) - { - return tag.symbol_num == 0 && tag.segment_num == SI_FIELD_SYNC_SEGMENT_NUM && tag.valid; - } - - static inline bool - tag_is_start_field_sync_1 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 0; - } - - static inline bool - tag_is_start_field_sync_2 (syminfo tag) - { - return tag_is_start_field_sync (tag) && tag.field_num == 1; - } - -} - -#endif /* _ATSC_SYMINFO_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/sync_tag_impl.h b/gr-atsc/include/gnuradio/atsc/sync_tag_impl.h deleted file mode 100644 index bdb64c5d3d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/sync_tag_impl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _ATSC_SYNC_TAG_H_ -#define _ATSC_SYNC_TAG_H_ - -/* - * Constants used to communicate in the second stream passed between - * GrAtscFSCorrelator, GrAtscEqualizer and GrAtscFieldSyncMux. The - * second stream is sample-for-sample parallel with the streaming - * floating point in the first stream. The second stream provides - * information about alignment boundaries. - * - * These are in floating point because the current implementation - * requires that for a given module, all input streams share the same - * type and all output streams share the same type. We'd use unsigned - * char otherwise. - */ - -namespace atsc_sync_tag { - - // Nothing special - static const float NORMAL = 0.0; - - // The corresponding symbol is the first symbol of the - // data segment sync sequence { +5, -5, -5, +5 } - static const float START_SEG_SYNC = 1.0; - - // The corresponding symbol is the first symbol of the - // field sync 1 PN511 pattern. - static const float START_FIELD_SYNC_1 = 2.0; - - // The corresponding symbol is the first symbol of the - // field sync 2 PN511 pattern. - static const float START_FIELD_SYNC_2 = 3.0; -}; - -#endif /* _ATSC_SYNC_TAG_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/trellis_encoder.h b/gr-atsc/include/gnuradio/atsc/trellis_encoder.h deleted file mode 100644 index 6eb424650f..0000000000 --- a/gr-atsc/include/gnuradio/atsc/trellis_encoder.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_ATSC_TRELLIS_ENCODER_H -#define INCLUDED_ATSC_TRELLIS_ENCODER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/trellis_encoder_impl.h> - -class atsc_trellis_encoder; -typedef boost::shared_ptr<atsc_trellis_encoder> atsc_trellis_encoder_sptr; - -ATSC_API atsc_trellis_encoder_sptr atsc_make_trellis_encoder(); - -/*! - * \brief ATSC 12-way interleaved trellis encoder (atsc_mpeg_packet_rs_encoded --> atsc_data_segment) - * \ingroup atsc - * - * input: atsc_mpeg_packet_rs_encoded; output: atsc_data_segment - */ -class ATSC_API atsc_trellis_encoder : public gr::sync_block -{ - friend ATSC_API atsc_trellis_encoder_sptr atsc_make_trellis_encoder(); - - atsci_trellis_encoder d_trellis_encoder; - - atsc_trellis_encoder(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } -}; - - -#endif /* INCLUDED_ATSC_TRELLIS_ENCODER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/trellis_encoder_impl.h b/gr-atsc/include/gnuradio/atsc/trellis_encoder_impl.h deleted file mode 100644 index 93aab1b190..0000000000 --- a/gr-atsc/include/gnuradio/atsc/trellis_encoder_impl.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_TRELLIS_ENCODER_H_ -#define _ATSC_TRELLIS_ENCODER_H_ - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/basic_trellis_encoder_impl.h> -#include <gnuradio/atsc/types.h> - -/*! - * \brief fancy, schmancy 12-way interleaved trellis encoder for ATSC - */ - -class ATSC_API atsci_trellis_encoder { - public: - static const int NCODERS = 12; - - atsci_trellis_encoder (); - ~atsci_trellis_encoder (); - - //! reset all encoder states - void reset (); - - /*! - * Take 12 RS encoded, convolutionally interleaved segments and - * produce 12 trellis coded data segments. We work in groups of 12 - * because that's the smallest number of segments that composes a - * single full cycle of the encoder mux. - */ - void encode (atsc_data_segment out[NCODERS], - const atsc_mpeg_packet_rs_encoded in[NCODERS]); - - - protected: - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 - static const int INPUT_SIZE = (SEGMENT_SIZE * 12); - static const int OUTPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - - void encode_helper (unsigned char out[OUTPUT_SIZE], - const unsigned char in[INPUT_SIZE]); - - atsci_basic_trellis_encoder enc[NCODERS]; - bool debug; -}; - - -#endif /* _ATSC_TRELLIS_ENCODER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/types.h b/gr-atsc/include/gnuradio/atsc/types.h deleted file mode 100644 index 1d93bb0d6a..0000000000 --- a/gr-atsc/include/gnuradio/atsc/types.h +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2001,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_TYPES_H_ -#define _ATSC_TYPES_H_ - -#include <gnuradio/atsc/consts.h> -#include <cstring> -#include <cassert> - - -/*! - * \brief pipeline info that flows with data - * - * Not all modules need all the info - */ -class plinfo { -public: - plinfo () : _flags (0), _segno (0) { } - - // accessors - - bool field_sync1_p () const { return (_flags & fl_field_sync1) != 0; } - bool field_sync2_p () const { return (_flags & fl_field_sync2) != 0; } - bool field_sync_p () const { return field_sync1_p () || field_sync2_p (); } - - bool regular_seg_p () const { return (_flags & fl_regular_seg) != 0; } - - bool in_field1_p () const { return (_flags & fl_field2) == 0; } - bool in_field2_p () const { return (_flags & fl_field2) != 0; } - - bool first_regular_seg_p () const { return (_flags & fl_first_regular_seg) != 0; } - - bool transport_error_p () const { return (_flags & fl_transport_error) != 0; } - - unsigned int segno () const { return _segno; } - unsigned int flags () const { return _flags; } - - // setters - - void set_field_sync1 () - { - _segno = 0; - _flags = fl_field_sync1; - } - - void set_field_sync2 () - { - _segno = 0; - _flags = fl_field_sync2 | fl_field2; - } - - void set_regular_seg (bool field2, int segno) - { - assert (0 <= segno && segno < ATSC_DSEGS_PER_FIELD); - _segno = segno; - _flags = fl_regular_seg; - if (segno == 0) - _flags |= fl_first_regular_seg; - if (segno >= ATSC_DSEGS_PER_FIELD) - _flags |= fl_transport_error; - if (field2) - _flags |= fl_field2; - } - - void set_transport_error (bool error){ - if (error) - _flags |= fl_transport_error; - else - _flags &= ~fl_transport_error; - } - - // overload equality operator - bool operator== (const plinfo &other) const { - return (_flags == other._flags && _segno == other._segno); - } - - bool operator!= (const plinfo &other) const { - return !(_flags == other._flags && _segno == other._segno); - } - - /*! - * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY - * pipeline delay from \p IN. - */ - static void delay (plinfo &out, const plinfo &in, int nsegs_of_delay); - - /*! - * confirm that \p X is plausible - */ - static void sanity_check (const plinfo &in); - - -protected: - unsigned short _flags; // bitmask - unsigned short _segno; // segment number [0,311] - - // these three are mutually exclusive - // This is a regular data segment. - static const int fl_regular_seg = 0x0001; - // This is a field sync segment, for 1st half of a field. - static const int fl_field_sync1 = 0x0002; - // This is a field sync segment, for 2nd half of a field. - static const int fl_field_sync2 = 0x0004; - - // This bit is on ONLY when fl_regular_seg is set AND when this is - // the first regular data segment AFTER a field sync segment. This - // segment causes various processing modules to reset. - static const int fl_first_regular_seg = 0x0008; - - // which field are we in? - static const int fl_field2 = 0x0010; // else field 1 - - // This bit is set when Reed-Solomon decoding detects an error that it - // can't correct. Note that other error detection (e.g. Viterbi) do not - // set it, since Reed-Solomon will correct many of those. This bit is - // then copied into the final Transport Stream packet so that MPEG - // software can see that the 188-byte data segment has been corrupted. - static const int fl_transport_error = 0x0020; -}; - - - - -class atsc_mpeg_packet { - public: - static const int NPAD = 68; - unsigned char data[ATSC_MPEG_DATA_LENGTH + 1]; // first byte is sync - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - }; - - bool operator!= (const atsc_mpeg_packet &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - }; -}; - -class atsc_mpeg_packet_no_sync { - public: - static const int NPAD = 65; - plinfo pli; - unsigned char data[ATSC_MPEG_DATA_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_no_sync &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_no_sync &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } -}; - -class atsc_mpeg_packet_rs_encoded { - public: - static const int NPAD = 45; - plinfo pli; - unsigned char data[ATSC_MPEG_RS_ENCODED_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (256) - - // overload equality operator - bool operator== (const atsc_mpeg_packet_rs_encoded &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_mpeg_packet_rs_encoded &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } -}; - - -//! contains 832 3 bit symbols. The low 3 bits in the byte hold the symbol. - -class atsc_data_segment { - public: - static const int NPAD = 188; - plinfo pli; - unsigned char data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (1024) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } -}; - -/*! - * Contains 832 bipolar floating point symbols. - * Nominal values are +/- {1, 3, 5, 7}. - * This data type represents the input to the viterbi decoder. - */ - -class atsc_soft_data_segment { - public: - static const int NPAD = 764; - plinfo pli; - float data[ATSC_DATA_SEGMENT_LENGTH]; - unsigned char _pad_[NPAD]; // pad to power of 2 (4096) - - // overload equality operator - bool operator== (const atsc_data_segment &other) const { - return std::memcmp (data, other.data, sizeof (data)) == 0; - } - - bool operator!= (const atsc_data_segment &other) const { - return !(std::memcmp (data, other.data, sizeof (data)) == 0); - } -}; - - -#endif /* _ATSC_TYPES_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/viterbi_decoder.h b/gr-atsc/include/gnuradio/atsc/viterbi_decoder.h deleted file mode 100644 index a529c18d3b..0000000000 --- a/gr-atsc/include/gnuradio/atsc/viterbi_decoder.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_ATSC_VITERBI_DECODER_H -#define INCLUDED_ATSC_VITERBI_DECODER_H - -#include <gnuradio/atsc/api.h> -#include <gnuradio/sync_block.h> -#include <gnuradio/atsc/viterbi_decoder_impl.h> - -class atsc_viterbi_decoder; -typedef boost::shared_ptr<atsc_viterbi_decoder> atsc_viterbi_decoder_sptr; - -ATSC_API atsc_viterbi_decoder_sptr atsc_make_viterbi_decoder(); - -/*! - * \brief ATSC 12-way interleaved viterbi decoder (atsc_soft_data_segment --> atsc_mpeg_packet_rs_encoded) - * \ingroup atsc - * - * input: atsc_soft_data_segment; output: atsc_mpeg_packet_rs_encoded - */ -class ATSC_API atsc_viterbi_decoder : public gr::sync_block -{ - friend ATSC_API atsc_viterbi_decoder_sptr atsc_make_viterbi_decoder(); - - atsci_viterbi_decoder d_viterbi_decoder; - - atsc_viterbi_decoder(); - -public: - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void reset() { /* nop */ } - -protected: - int last_start; - -}; - - -#endif /* INCLUDED_ATSC_VITERBI_DECODER_H */ diff --git a/gr-atsc/include/gnuradio/atsc/viterbi_decoder_impl.h b/gr-atsc/include/gnuradio/atsc/viterbi_decoder_impl.h deleted file mode 100644 index 447d43911d..0000000000 --- a/gr-atsc/include/gnuradio/atsc/viterbi_decoder_impl.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_VITERBI_DECODER_H_ -#define _ATSC_VITERBI_DECODER_H_ - -#define USE_SIMPLE_SLICER 0 - -#include <gnuradio/atsc/api.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/interleaver_fifo.h> - -#if (USE_SIMPLE_SLICER) -#include <gnuradio/atsc/fake_single_viterbi_impl.h> -typedef atsci_fake_single_viterbi single_viterbi_t; -#else -#include <gnuradio/atsc/single_viterbi_impl.h> -typedef atsci_single_viterbi single_viterbi_t; -#endif - -/*! - * \brief fancy, schmancy 12-way interleaved viterbi decoder for ATSC - */ - -class ATSC_API atsci_viterbi_decoder { -public: - static const int NCODERS = 12; - - atsci_viterbi_decoder (); - ~atsci_viterbi_decoder (); - - //! reset all decoder states - void reset (); - - /*! - * Take 12 data segments of soft decisions (floats) and - * produce 12 RS encoded data segments. We work in groups of 12 - * because that's the smallest number of segments that composes a - * single full cycle of the decoder mux. - */ - void decode (atsc_mpeg_packet_rs_encoded out[NCODERS], - const atsc_soft_data_segment in[NCODERS]); - - - - protected: - typedef interleaver_fifo<unsigned char> fifo_t; - - static const int SEGMENT_SIZE = ATSC_MPEG_RS_ENCODED_LENGTH; // 207 - static const int OUTPUT_SIZE = (SEGMENT_SIZE * 12); - static const int INPUT_SIZE = (ATSC_DATA_SEGMENT_LENGTH * 12); - - void decode_helper (unsigned char out[OUTPUT_SIZE], - const float in[INPUT_SIZE]); - - - single_viterbi_t viterbi[NCODERS]; - fifo_t *fifo[NCODERS]; - bool debug; - -}; - - - -#endif /* _ATSC_VITERBI_DECODER_H_ */ diff --git a/gr-atsc/include/gnuradio/atsc/vsbtx_lp_impl.h b/gr-atsc/include/gnuradio/atsc/vsbtx_lp_impl.h deleted file mode 100644 index ce6f8bfefb..0000000000 --- a/gr-atsc/include/gnuradio/atsc/vsbtx_lp_impl.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ATSC_VSBTX_LP_H_ -#define _ATSC_VSBTX_LP_H_ - -#include <gnuradio/atsc/api.h> -#include <gr_fir_builder.h> - -class ATSC_API atsc_vsbtx_lp : public gr_fir_builder -{ -public: - virtual std::vector<float> taps (double sampling_freq); -}; - - - -#endif /* _ATSC_VSBTX_LP_H_ */ diff --git a/gr-atsc/lib/CMakeLists.txt b/gr-atsc/lib/CMakeLists.txt deleted file mode 100644 index d7da2fbde9..0000000000 --- a/gr-atsc/lib/CMakeLists.txt +++ /dev/null @@ -1,185 +0,0 @@ -# Copyright 2011-2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup the include and linker paths -######################################################################## -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${GR_ATSC_INCLUDE_DIRS} - ${GR_FILTER_INCLUDE_DIRS} - ${GR_ANALOG_INCLUDE_DIRS} - ${GR_FEC_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${LOG4CPP_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -link_directories(${Boost_LIBRARY_DIRS}) -link_directories(${LOG4CPP_LIBRARY_DIRS}) - -######################################################################## -# Generate viterbi mux source -# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build -######################################################################## -if(NOT CMAKE_CROSSCOMPILING) - add_executable(atsci_viterbi_gen atsci_viterbi_gen.cc) - export(TARGETS atsci_viterbi_gen APPEND FILE ${EXPORT_FILE}) -endif() - - -set(atsci_viterbi_mux_cc ${CMAKE_CURRENT_BINARY_DIR}/atsci_viterbi_mux.cc) - -add_custom_command( - OUTPUT ${atsci_viterbi_mux_cc} - DEPENDS atsci_viterbi_gen - COMMAND atsci_viterbi_gen -o ${atsci_viterbi_mux_cc} -) - -######################################################################## -# Setup library -######################################################################## -list(APPEND gr_atsc_sources - ${atsci_viterbi_mux_cc} - atsc_derandomizer.cc - atsc_randomizer.cc - atsc_rs_decoder.cc - atsc_rs_encoder.cc - atsc_interleaver.cc - atsc_deinterleaver.cc - atsc_trellis_encoder.cc - atsc_viterbi_decoder.cc - atsc_ds_to_softds.cc - atsc_field_sync_mux.cc - atsc_field_sync_demux.cc - atsc_equalizer.cc - atsc_fs_checker.cc - atsc_bit_timing_loop.cc - atsc_fpll.cc - atsc_depad.cc - atsc_pad.cc - atsci_basic_trellis_encoder.cc - atsci_data_interleaver.cc - atsci_equalizer.cc - atsci_equalizer_lms.cc - atsci_equalizer_lms2.cc - atsci_equalizer_nop.cc - atsci_fake_single_viterbi.cc - atsci_fs_checker.cc - atsci_fs_checker_naive.cc - atsci_fs_correlator.cc - atsci_fs_correlator_naive.cc - atsci_single_viterbi.cc - atsci_sssr.cc - atsci_pnXXX.cc - atsci_randomizer.cc - atsci_reed_solomon.cc - atsci_sliding_correlator.cc - atsci_trellis_encoder.cc - atsci_viterbi_decoder.cc - create_atsci_equalizer.cc - create_atsci_fs_checker.cc - create_atsci_fs_correlator.cc - plinfo.cc -) - -#Add Windows DLL resource file under MSVC -IF(MSVC) - include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-atsc.rc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.rc - @ONLY) - - list(APPEND gr_atsc_sources - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-atsc.rc - ) -ENDIF(MSVC) - -list(APPEND atsc_libs - gnuradio-filter - gnuradio-analog - gnuradio-runtime - gnuradio-fec - ${Boost_LIBRARIES} - ${LOG4CPP_LIBRARIES} -) - -add_library(gnuradio-atsc SHARED ${gr_atsc_sources}) -target_link_libraries(gnuradio-atsc ${atsc_libs}) -GR_LIBRARY_FOO(gnuradio-atsc RUNTIME_COMPONENT "atsc_runtime" DEVEL_COMPONENT "atsc_devel") - -if(ENABLE_STATIC_LIBS) - if(ENABLE_GR_CTRLPORT) - # Remove GR_CTRLPORT set this target's definitions. - # Makes sure we don't try to use ControlPort stuff in source files - GET_DIRECTORY_PROPERTY(STATIC_DEFS COMPILE_DEFINITIONS) - list(REMOVE_ITEM STATIC_DEFS "GR_CTRLPORT") - SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS "${STATIC_DEFS}") - - # readd it to the target since we removed it from the directory-wide list. - SET_PROPERTY(TARGET gnuradio-atsc APPEND PROPERTY COMPILE_DEFINITIONS "GR_CTRLPORT") - endif(ENABLE_GR_CTRLPORT) - - add_library(gnuradio-atsc_static STATIC ${gr_atsc_sources}) - - if(NOT WIN32) - set_target_properties(gnuradio-atsc_static - PROPERTIES OUTPUT_NAME gnuradio-atsc) - endif(NOT WIN32) - - install(TARGETS gnuradio-atsc_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "atsc_devel" # .lib file - ) -endif(ENABLE_STATIC_LIBS) - -######################################################################## -# Build and register unit test -######################################################################## -if(ENABLE_TESTING) - -include_directories(${CPPUNIT_INCLUDE_DIRS}) -link_directories(${CPPUNIT_LIBRARY_DIRS}) - -list(APPEND test_atsci_sources - qa_atsci_basic_trellis_encoder.cc - qa_atsci_data_interleaver.cc - qa_atsci_equalizer_nop.cc - qa_atsci_fake_single_viterbi.cc - qa_atsci_fs_correlator.cc - qa_atsci_single_viterbi.cc - qa_atsci_randomizer.cc - qa_atsci_reed_solomon.cc - qa_atsci_sliding_correlator.cc - qa_atsci_trellis_encoder.cc - qa_atsci_viterbi_decoder.cc - qa_convolutional_interleaver.cc - qa_atsci.cc - qa_interleaver_fifo.cc -) - -include(GrTest) -list(APPEND GR_TEST_TARGET_DEPS gnuradio-atsc gnuradio-fec gnuradio-filter gnuradio-analog gnuradio-fft) -add_executable(test_atsci ${test_atsci_sources} test_atsci.cc) -target_link_libraries(test_atsci gnuradio-atsc gnuradio-runtime ${CPPUNIT_LIBRARIES}) -GR_ADD_TEST(atsci-test test_atsci) - -endif(ENABLE_TESTING) diff --git a/gr-atsc/lib/GrAtscBitTimingLoop.cc b/gr-atsc/lib/GrAtscBitTimingLoop.cc deleted file mode 100644 index 835dc14a91..0000000000 --- a/gr-atsc/lib/GrAtscBitTimingLoop.cc +++ /dev/null @@ -1,223 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cmath> -#include <gnuradio/atsc/GrAtscBitTimingLoop.h> -#include "fpll_btloop_coupling.h" -#include <algorithm> -#include <gnuradio/atsc/consts.h> -#include <stdio.h> -#include <assert.h> - -using std::abs; - -static const int DEC = 2; // nominal decimation factor - -/* - * I strongly suggest that you not mess with these... - */ -static const double DEFAULT_TIMING_RATE = 2.19e-4 / FPLL_BTLOOP_COUPLING_CONST; -static const double DEFAULT_LOOP_TAP = 0.05; - - -GrAtscBitTimingLoop::GrAtscBitTimingLoop () - : VrDecimatingSigProc<float,float> (1, DEC), - next_input(0), w (1.0), mu (0.5), last_right(0), - debug_no_update (false) -{ - d_timing_rate = DEFAULT_TIMING_RATE; - loop.set_taps (DEFAULT_LOOP_TAP); - - history = 1500; // spare input samples in case we need them. - -#ifdef _BT_DIAG_OUTPUT_ - fp_loop = fopen ("loop.out", "w"); - if (fp_loop == 0){ - perror ("loop.out"); - exit (1); - } - - fp_ps = fopen ("ps.out", "w"); - if (fp_ps == 0){ - perror ("ps.out"); - exit (1); - } -#endif -} - -// -// We are nominally a 2x decimator, but our actual rate varies slightly -// depending on the difference between the transmitter and receiver -// sampling clocks. Hence, we need to compute our input ranges -// explictly. - -int -GrAtscBitTimingLoop::forecast(VrSampleRange output, - VrSampleRange inputs[]) { - /* dec:1 ratio with history */ - for(unsigned int i=0;i<numberInputs;i++) { - inputs[i].index=next_input; - inputs[i].size=output.size*decimation + history-1; - } - return 0; -} - -inline double -GrAtscBitTimingLoop::filter_error (double e) -{ - static const double limit = 50 * FPLL_BTLOOP_COUPLING_CONST; - - // first limit - - if (e > limit) - e = limit; - else if (e < -limit) - e = -limit; - - return loop.filter (e); -} - -int -GrAtscBitTimingLoop::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - iType *in = ((iType **)ai)[0]; - oType *out = ((oType **)ao)[0]; - - // Force in-order computation of output stream. - // This is required because of our slightly variable decimation factor - sync (output.index); - - - // We are tasked with producing output.size output samples. - // We will consume approximately 2 * output.size input samples. - - - unsigned int ii = 0; // input index - unsigned int k; // output index - - // We look at a window of 3 samples that we call left (oldest), - // middle, right (newest). Each time through the loop, the previous - // right becomes the new left, and the new samples are middle and - // right. - // - // The basic game plan is to drive the average difference between - // right and left to zero. Given that all transitions are - // equiprobable (the data is white) and that the composite matched - // filter is symmetric (raised cosine) it turns out that in the - // average, if we drive that difference to zero, (implying that the - // average slope at the middle point is zero), we'll be sampling - // middle at the maximum or minimum point in the pulse. - - iType left; - iType middle; - iType right = last_right; - - for (k = 0; k < output.size; k++){ - - left = right; - middle = produce_sample (in, ii); - right = produce_sample (in, ii); - - // assert (ii < inputs[0].size); - if (!(ii < inputs[0].size)){ - fprintf (stderr, "ii < inputs[0].size\n"); - fprintf (stderr, "ii = %d, inputs[0].size = %lu, k = %d, output.size = %lu\n", - ii, inputs[0].size, k, output.size); - assert (0); - } - - - out[k] = middle; // produce our output - - double timing_error = -middle * ((double) right - left); - - // update_timing_control_word - - double filtered_timing_error = filter_error (timing_error); - - if (!debug_no_update){ - mu += filtered_timing_error * d_timing_rate; - } - -#ifdef _BT_DIAG_OUTPUT_ - float iodata[8]; - iodata[0] = left; - iodata[1] = middle; - iodata[2] = right; - iodata[3] = timing_error; - iodata[4] = filtered_timing_error; - iodata[5] = mu; - iodata[6] = w; - iodata[7] = 0; - if (fwrite (iodata, sizeof (iodata), 1, fp_loop) != 1){ - perror ("fwrite: loop"); - exit (1); - } -#endif - - } - - last_right = right; - next_input += ii; // update next_input so forecast can get us what we need - return output.size; -} - -/*! - * Produce samples equally spaced in time that are referenced - * to the transmitter's sample clock, not ours. - * - * See pp 523-527 of "Digital Communication Receivers", Meyr, - * Moeneclaey and Fechtel, Wiley, 1998. - */ - -GrAtscBitTimingLoop::iType -GrAtscBitTimingLoop::produce_sample (const iType *in, unsigned int &index) -{ - // update mu and index as function of control word, w - - double sum = mu + w; - double f = floor (sum); - int incr = (int) f; // mostly 1, rarely 0 or 2 - mu = sum - f; - - assert (0 <= incr && incr <= 2); - assert (0.0 <= mu && mu <= 1.0); - - index += incr; - - iType n = intr.interpolate (&in[index], mu); - -#if defined(_BT_DIAG_OUTPUT_) && 0 - float iodata[4]; - iodata[0] = incr; - iodata[1] = mu; - iodata[2] = w; - iodata[3] = 0; - if (fwrite (iodata, sizeof (iodata), 1, fp_ps) != 1){ - perror ("fwrite: ps"); - exit (1); - } -#endif - - return n; -} diff --git a/gr-atsc/lib/GrAtscBitTimingLoop2.cc b/gr-atsc/lib/GrAtscBitTimingLoop2.cc deleted file mode 100644 index 536ca08720..0000000000 --- a/gr-atsc/lib/GrAtscBitTimingLoop2.cc +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscBitTimingLoop2.h> -#include <algorithm> -#include <gnuradio/atsc/consts.h> -#include <stdio.h> -#include <assert.h> - - -static const int DEC = 2; // nominal decimation factor - -static const unsigned AVG_WINDOW_LEN = 256; -static const float TIMING_RATE_CONST = 1e-5; // FIXME document interaction with AGC - - -GrAtscBitTimingLoop2::GrAtscBitTimingLoop2 () - : VrDecimatingSigProc<float,float> (1, DEC), - next_input(0), dc (0.0002), mu (0.0), last_right(0), use_right_p (true) -{ - history = 100; // spare input samples in case we need them. - -#ifdef _BT_DIAG_OUTPUT_ - fp_loop = fopen ("loop.out", "w"); - if (fp_loop == 0){ - perror ("loop.out"); - exit (1); - } - - fp_ps = fopen ("ps.out", "w"); - if (fp_ps == 0){ - perror ("ps.out"); - exit (1); - } -#endif - -} - -// -// We are nominally a 2x decimator, but our actual rate varies slightly -// depending on the difference between the transmitter and receiver -// sampling clocks. Hence, we need to compute our input ranges -// explictly. - -int -GrAtscBitTimingLoop2::forecast(VrSampleRange output, - VrSampleRange inputs[]) { - /* dec:1 ratio with history */ - for(unsigned int i=0;i<numberInputs;i++) { - inputs[i].index=next_input; - inputs[i].size=output.size*decimation + history-1; - } - return 0; -} - -inline float -GrAtscBitTimingLoop2::filter_error (float e) -{ - return e; // identity function -} - -int -GrAtscBitTimingLoop2::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - iType *in = ((iType **)ai)[0]; - oType *out = ((oType **)ao)[0]; - - // Force in-order computation of output stream. - // This is required because of our slightly variable decimation factor - sync (output.index); - - - // We are tasked with producing output.size output samples. - // We will consume approximately 2 * output.size input samples. - - - unsigned int ii = 0; // input index - unsigned int k; // output index - - // We look at a window of 3 samples that we call left (oldest), - // middle, right (newest). Each time through the loop, the previous - // right becomes the new left, and the new samples are middle and - // right. - // - // The basic game plan is to drive the average difference between - // right and left to zero. Given that all transitions are - // equiprobable (the data is white) and that the composite matched - // filter is symmetric (raised cosine) it turns out that in the - // average, if we drive that difference to zero, (implying that the - // average slope at the middle point is zero), we'll be sampling - // middle at the maximum or minimum point in the pulse. - - iType left; - iType middle; - iType right = last_right; - - for (k = 0; k < output.size; k++){ - - left = right; - - iType middle_raw = produce_sample (in, ii); - iType middle_dc = dc.filter (middle_raw); - middle = middle_raw - middle_dc; - - iType right_raw = produce_sample (in, ii); - iType right_dc = dc.filter (right_raw); - right = right_raw - right_dc; - - if (use_right_p) // produce our output - out[k] = right; - else - out[k] = middle; - } - -#ifdef _BT_DIAG_OUTPUT_ - float iodata[8]; - iodata[0] = 0; - iodata[1] = out[k]; - iodata[2] = 0; - iodata[3] = 0; - iodata[4] = 0; - iodata[5] = mu; - iodata[6] = 0; - iodata[7] = 0; // spare - if (fwrite (iodata, sizeof (iodata), 1, fp_loop) != 1){ - perror ("fwrite: loop"); - exit (1); - } -#endif - - - last_right = right; - next_input += ii; // update next_input so forecast can get us what we need - return output.size; -} - -/*! - * Produce samples equally spaced in time that are referenced - * to the transmitter's sample clock, not ours. - * - * See pp 523-527 of "Digital Communication Receivers", Meyr, - * Moeneclaey and Fechtel, Wiley, 1998. - */ - -GrAtscBitTimingLoop2::iType -GrAtscBitTimingLoop2::produce_sample (const iType *in, unsigned int &index) -{ - iType n = intr.interpolate (&in[index], mu); - - index++; - return n; -} - diff --git a/gr-atsc/lib/GrAtscBitTimingLoop3.cc b/gr-atsc/lib/GrAtscBitTimingLoop3.cc deleted file mode 100644 index 14596900a9..0000000000 --- a/gr-atsc/lib/GrAtscBitTimingLoop3.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscBitTimingLoop3.h> -#include <cmath> -#include <cstdio> -#include <assert.h> - -using std::abs; - - -static const int NOUTPUTS = 2; - -GrAtscBitTimingLoop3::GrAtscBitTimingLoop3 (double ratio_of_rx_clock_to_symbol_freq) - : VrDecimatingSigProc<float,float> (NOUTPUTS, (int) rint (ratio_of_rx_clock_to_symbol_freq)), - d_interp (ratio_of_rx_clock_to_symbol_freq), d_next_input(0), - d_rx_clock_to_symbol_freq (ratio_of_rx_clock_to_symbol_freq) - -{ - assert (ratio_of_rx_clock_to_symbol_freq >= 1.8); // sanity check - - history = 1500; // spare input samples in case we need them. -} - -// -// We are nominally a 2x decimator, but our actual rate varies slightly -// depending on the difference between the transmitter and receiver -// sampling clocks. Hence, we need to compute our input ranges -// explictly. - -int -GrAtscBitTimingLoop3::forecast(VrSampleRange output, - VrSampleRange inputs[]) { - assert (numberInputs == 1); - - /* dec:1 ratio with history */ - inputs[0].index = d_next_input; - inputs[0].size = - ((unsigned long) (output.size * d_rx_clock_to_symbol_freq) + history - 1); - - return 0; -} - - -int -GrAtscBitTimingLoop3::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - iType *in = ((iType **)ai)[0]; - oDataType *out_sample = ((oDataType **)ao)[0]; - oTagType *out_tag = ((oTagType **) ao)[1]; - - // Force in-order computation of output stream. - // This is required because of our slightly variable decimation factor - sync (output.index); - - // We are tasked with producing output.size output samples. - // We will consume approximately 2 * output.size input samples. - - int si = 0; // source index - unsigned int k; // output index - - float interp_sample; - int symbol_index; - double timing_adjustment = 0; - bool seg_locked; - oTagType tag; - - memset (&tag, 0, sizeof (tag)); - - for (k = 0; k < output.size; k++){ - - if (!d_interp.update (in, inputs[0].size, &si, timing_adjustment, &interp_sample)){ - fprintf (stderr, "GrAtscBitTimingLoop3: ran short on data...\n"); - break; - } - - d_sssr.update (interp_sample, &seg_locked, &symbol_index, &timing_adjustment); - out_sample[k] = interp_sample; - tag.valid = seg_locked; - tag.symbol_num = symbol_index; - out_tag[k] = tag; - } - - d_next_input += si; // update next_input so forecast can get us what we need - return k; -} diff --git a/gr-atsc/lib/GrAtscConvert2xTo20.cc b/gr-atsc/lib/GrAtscConvert2xTo20.cc deleted file mode 100644 index 296ae35302..0000000000 --- a/gr-atsc/lib/GrAtscConvert2xTo20.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscConvert2xTo20.h> -#include <gnuradio/atsc/consts.h> -#include <cmath> -#include <cstdio> - -static const int N_OUTPUTS = 1; -static const double DEC_RATIO = (2.0 * ATSC_SYMBOL_RATE) / 20e6; // ~ 1.076 - -GrAtscConvert2xTo20::GrAtscConvert2xTo20 () - : VrDecimatingSigProc<float,float> (N_OUTPUTS, (int) rint (DEC_RATIO)) -{ - d_next_input = 0; - d_frac_part = 0; - history = 2 * d_interp.ntaps (); // some slack -} - -GrAtscConvert2xTo20::~GrAtscConvert2xTo20 () -{ - // Nop -} - -void -GrAtscConvert2xTo20::pre_initialize () -{ - fprintf (stderr, - "GrAtscConvert2xTo20: input freq = %g\n", getInputSamplingFrequencyN(0)); - fprintf (stderr, - "GrAtscConvert2xTo20: DEC_RATIO = %g\n", DEC_RATIO); - fprintf (stderr, - "GrAtscConvert2xTo20: argument to setSamplingFrequency = %g\n", - getInputSamplingFrequencyN(0) / DEC_RATIO); - - int r; - r = setSamplingFrequency (getInputSamplingFrequencyN (0) / DEC_RATIO); - - fprintf (stderr, "GrAtscConvert2xTo20: result = %d\n", r); - - fprintf (stderr, "GrAtscConvert2xTo20: getSamplingFrequency = %g\n", - getSamplingFrequency ()); -} - - -int -GrAtscConvert2xTo20::forecast (VrSampleRange output, - VrSampleRange inputs[]) -{ - assert (numberInputs == 1); // I hate these free references to - // superclass's instance variables... - - inputs[0].index = d_next_input; - inputs[0].size = - ((long unsigned int) (output.size * DEC_RATIO) + history - 1); - - return 0; -} - -int -GrAtscConvert2xTo20::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - float *in = ((float **) ai)[0]; - float *out = ((float **) ao)[0]; - - sync (output.index); - - unsigned long si = 0; // source index - unsigned long oi = 0; // output index - double frac_part = d_frac_part; - - for (oi = 0; oi < output.size; oi++){ - assert (si + d_interp.ntaps () < inputs[0].size); - out[oi] = d_interp.interpolate (&in[si], (1. - frac_part)); - - double s = frac_part + DEC_RATIO; - double float_incr = floor (s); - frac_part = s - float_incr; - int incr = (int) float_incr; - si += incr; - } - - d_next_input += si; - d_frac_part = frac_part; - return output.size; -} diff --git a/gr-atsc/lib/GrAtscDataSegToSoftDataSeg.cc b/gr-atsc/lib/GrAtscDataSegToSoftDataSeg.cc deleted file mode 100644 index a17927bf5b..0000000000 --- a/gr-atsc/lib/GrAtscDataSegToSoftDataSeg.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscDataSegToSoftDataSeg.h> - -// typedefs for fundamental i/o types - -typedef atsc_data_segment iType; -typedef atsc_soft_data_segment oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - -static void -map_to_soft_symbols (atsc_soft_data_segment &out, - const atsc_data_segment &in) -{ - for (unsigned int i = 0; i < NELEM (in.data); i++){ - out.data[i] = in.data[i] * 2 - 7; - } -} - - -GrAtscDataSegToSoftDataSeg::GrAtscDataSegToSoftDataSeg () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscDataSegToSoftDataSeg::~GrAtscDataSegToSoftDataSeg () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscDataSegToSoftDataSeg::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - map_to_soft_symbols (out[i], in[i]); - out[i].pli = in[i].pli; - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscDeinterleaver.cc b/gr-atsc/lib/GrAtscDeinterleaver.cc deleted file mode 100644 index dffa99e809..0000000000 --- a/gr-atsc/lib/GrAtscDeinterleaver.cc +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscDeinterleaver.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_rs_encoded iType; -typedef atsc_mpeg_packet_rs_encoded oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscDeinterleaver::GrAtscDeinterleaver () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscDeinterleaver::~GrAtscDeinterleaver () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscDeinterleaver::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current contents of the LFSR in the randomizer, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - // pipeline info is handled in the primitive - deinterleaver.deinterleave (out[i], in[i]); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscDerandomizer.cc b/gr-atsc/lib/GrAtscDerandomizer.cc deleted file mode 100644 index f6c1203bc9..0000000000 --- a/gr-atsc/lib/GrAtscDerandomizer.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscDerandomizer.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_no_sync iType; -typedef atsc_mpeg_packet oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscDerandomizer::GrAtscDerandomizer () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscDerandomizer::~GrAtscDerandomizer () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscDerandomizer::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current contents of the LFSR in the randomizer, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - - assert (in[i].pli.regular_seg_p ()); - - if (in[i].pli.first_regular_seg_p ()) - rand.reset (); - - rand.derandomize (out[i], in[i]); - - // take a look at the transport error bit in the pipeline info - // and set bit as required - - if (in[i].pli.transport_error_p ()) - out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; - else - out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; - - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscEqualizer.cc b/gr-atsc/lib/GrAtscEqualizer.cc deleted file mode 100644 index 71e6723505..0000000000 --- a/gr-atsc/lib/GrAtscEqualizer.cc +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscEqualizer.h> -#include <gnuradio/atsc/equalizer_impl.h> - -// typedefs for fundamental i/o types - -typedef float dataType; -typedef atsc::syminfo tagType; - -static const int NUMBER_OF_OUTPUTS = 2; // # of output streams - - -GrAtscEqualizer::GrAtscEqualizer (atsci_equalizer *equalizer) - : VrHistoryProc<dataType,dataType> (NUMBER_OF_OUTPUTS) -{ - // due to limitation of runtime, all inputs must be the same size - assert (sizeof (dataType) == sizeof (tagType)); - - d_equalizer = equalizer; - - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // - // Set this to the answer returned by the equalizer primitive we were passed. - history = d_equalizer->ntaps (); -} - -GrAtscEqualizer::~GrAtscEqualizer () -{ - // Anything that isn't automatically cleaned up... - - delete d_equalizer; -} - - -/* - * non-standard forecast routine that handles getting the correct amount of - * history for the data input as well as ensuring correct alignment of - * the data and tags. - */ - -int -GrAtscEqualizer::forecast (VrSampleRange output, - VrSampleRange inputs[]) -{ - assert (numberInputs == 2); - - int ntaps = d_equalizer->ntaps (); - int npretaps = d_equalizer->npretaps (); - - assert (ntaps >= 1); - assert (npretaps >= 0 && npretaps < ntaps); - - inputs[0].index = output.index; // the equalizer data - inputs[0].size = output.size + ntaps - 1; // history on data - - // FIXME if there's a problem, it's probably on the next line... - int offset = ntaps - npretaps - 1; - - assert (offset >= 0 && offset < ntaps); - - inputs[1].index = output.index + offset; // align equalizer tags - inputs[1].size = output.size; // N.B., no extra history on tags - - return 0; -} - -/* - * This is the real work horse. We consume 2 input streams - * and produce 2 output streams. - */ - -int -GrAtscEqualizer::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // assert (numberInputs == 2); - - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, hence we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - dataType *input_samples = ((dataType **) ai)[0]; - tagType *input_tags = ((tagType **) ai)[1]; - dataType *output_samples = ((dataType **) ao)[0]; - tagType *output_tags = ((tagType **) ao)[1]; - - - // peform the actual equalization - - d_equalizer->filter (input_samples, input_tags, - output_samples, output.size); - - // write the output tags - - for (unsigned int i = 0; i < output.size; i++) - output_tags[i] = input_tags[i]; - - // Return the number of units we produced. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscFPLL.cc b/gr-atsc/lib/GrAtscFPLL.cc deleted file mode 100644 index e0919e0181..0000000000 --- a/gr-atsc/lib/GrAtscFPLL.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscFPLL.h> -#include <algorithm> -#include "fpll_btloop_coupling.h" - -/* - * I strongly suggest that you not mess with these... - * - * They are strongly coupled into the symbol timing code and - * their value also sets the level of the symbols going - * into the equalizer and viterbi decoder. - */ -static const float FPLL_AGC_REFERENCE = 2.5 * FPLL_BTLOOP_COUPLING_CONST; -static const float FPLL_AGC_RATE = 0.25e-6; - - -GrAtscFPLL::GrAtscFPLL (double a_initial_freq) - : VrSigProc (1, sizeof (iType), sizeof (oType)), - initial_phase(0), debug_no_update(false) -{ - initial_freq = a_initial_freq; - agc.set_rate (FPLL_AGC_RATE); - agc.set_reference (FPLL_AGC_REFERENCE); - - if (_FPLL_DIAG_OUTPUT_){ - fp = fopen ("fpll.out", "w"); - if (fp == 0){ - perror ("fpll.out"); - exit (1); - } - } - -} - -void -GrAtscFPLL::initialize () -{ - float Fs = getInputSamplingFrequencyN (0); - - float alpha = 1 - exp(-1.0 / Fs / 5e-6); - - afci.set_taps (alpha); - afcq.set_taps (alpha); - - nco.set_freq (initial_freq / Fs * 2 * M_PI); - nco.set_phase (initial_phase); -} - -int -GrAtscFPLL::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - iType *in = ((iType **)ai)[0]; - oType *out = ((oType **)ao)[0]; - - unsigned int k; - - for (k = 0; k < output.size; k++){ - - float a_cos, a_sin; - - float input = agc.scale (in[k]); - - nco.step (); // increment phase - nco.sincos (a_sin, a_cos); // compute cos and sin - - float I = input * a_sin; - float Q = input * a_cos; - - out[k] = I; - - float filtered_I = afci.filter (I); - float filtered_Q = afcq.filter (Q); - - // phase detector - - float x = atan2 (filtered_Q, filtered_I); - - // avoid slamming filter with big transitions - - static const float limit = M_PI / 2; - - if (x > limit) - x = limit; - else if (x < -limit) - x = -limit; - - // static const float alpha = 0.037; // Max value - // static const float alpha = 0.005; // takes about 5k samples to pull in, stddev = 323 - // static const float alpha = 0.002; // takes about 15k samples to pull in, stddev = 69 - // or about 120k samples on noisy data, - static const float alpha = 0.001; - static const float beta = alpha * alpha / 4; - - - if (!debug_no_update){ - nco.adjust_phase (alpha * x); - nco.adjust_freq (beta * x); - } - - if (_FPLL_DIAG_OUTPUT_){ -#if 0 // lots of data... - float iodata[8]; - iodata[0] = nco.get_freq () * getSamplingFrequency () * (1.0 / (2 * M_PI)); - iodata[1] = in[k]; - iodata[2] = input; - iodata[3] = I; - iodata[4] = Q; - iodata[5] = filtered_I; - iodata[6] = filtered_Q; - iodata[7] = x; - if (fwrite (iodata, sizeof (iodata), 1, fp) != 1){ - perror ("fwrite: fpll"); - exit (1); - } -#else // just the frequency - float iodata[1]; - iodata[0] = nco.get_freq () * getSamplingFrequency () * (1.0 / (2 * M_PI)); - if (fwrite (iodata, sizeof (iodata), 1, fp) != 1){ - perror ("fwrite: fpll"); - exit (1); - } -#endif - } - } - - return output.size; -} - diff --git a/gr-atsc/lib/GrAtscFieldSyncChecker.cc b/gr-atsc/lib/GrAtscFieldSyncChecker.cc deleted file mode 100644 index 620962cbcd..0000000000 --- a/gr-atsc/lib/GrAtscFieldSyncChecker.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscFieldSyncChecker.h> -#include <gnuradio/atsc/create_atsci_fs_checker.h> -#include <gnuradio/atsc/fs_checker_impl.h> - -// typedefs for fundamental i/o types - -typedef float iDataType; -typedef atsc::syminfo iTagType; -typedef float oDataType; -typedef atsc::syminfo oTagType; - -static const int NUMBER_OF_OUTPUTS = 2; // # of output streams - - -GrAtscFieldSyncChecker::GrAtscFieldSyncChecker () - : VrHistoryProc<iDataType,oDataType> (NUMBER_OF_OUTPUTS) -{ - // tags and data must be same size due to limitation of runtime - assert (sizeof (iDataType) == sizeof (iTagType)); - assert (sizeof (oDataType) == sizeof (oTagType)); - - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - d_fsc = create_atsci_fs_checker (); -} - -GrAtscFieldSyncChecker::~GrAtscFieldSyncChecker () -{ - // Anything that isn't automatically cleaned up... - - delete d_fsc; -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscFieldSyncChecker::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, hence we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iDataType *sample_in = ((iDataType **) ai)[0]; - iTagType *tag_in = ((iTagType **) ai)[1]; - oDataType *sample_out = ((oDataType **) ao)[0]; - oTagType *tag_out = ((oTagType **) ao)[1]; - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - d_fsc->filter (sample_in[i], tag_in[i], &sample_out[i], &tag_out[i]); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscFieldSyncCorrelator.cc b/gr-atsc/lib/GrAtscFieldSyncCorrelator.cc deleted file mode 100644 index 0abb1799f1..0000000000 --- a/gr-atsc/lib/GrAtscFieldSyncCorrelator.cc +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscFieldSyncCorrelator.h> -#include <gnuradio/atsc/create_atsci_fs_correlator.h> -#include <gnuradio/atsc/fs_correlator_impl.h> - -// typedefs for fundamental i/o types - -typedef float iType; -typedef float oType; - -static const int NUMBER_OF_OUTPUTS = 2; // # of output streams - - -GrAtscFieldSyncCorrelator::GrAtscFieldSyncCorrelator () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - d_fsc = create_atsci_fs_correlator (); -} - -GrAtscFieldSyncCorrelator::~GrAtscFieldSyncCorrelator () -{ - // Anything that isn't automatically cleaned up... - - delete d_fsc; -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscFieldSyncCorrelator::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, hence we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *sample_out = ((oType **) ao)[0]; - oType *tag_out = ((oType **) ao)[1]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - d_fsc->filter (in[i], &sample_out[i], &tag_out[i]); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscFieldSyncDemux.cc b/gr-atsc/lib/GrAtscFieldSyncDemux.cc deleted file mode 100644 index 873b56eaf3..0000000000 --- a/gr-atsc/lib/GrAtscFieldSyncDemux.cc +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cmath> -#include <gnuradio/atsc/GrAtscFieldSyncDemux.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/syminfo_impl.h> -#include <stdio.h> -#include <assert.h> - -using std::abs; - -static const int DEC = ATSC_DATA_SEGMENT_LENGTH; // nominal decimation factor - -GrAtscFieldSyncDemux::GrAtscFieldSyncDemux () - : VrDecimatingSigProc<float,atsc_soft_data_segment> (1, DEC), - d_locked (false), d_in_field2(true), d_segment_number(0), d_next_input(0), - d_lost_index (0) -{ - history = 2 * ATSC_DATA_SEGMENT_LENGTH; // spare input samples in case we need them. -} - -GrAtscFieldSyncDemux::~GrAtscFieldSyncDemux () -{ -} - -int -GrAtscFieldSyncDemux::forecast (VrSampleRange output, - VrSampleRange inputs[]) { - /* dec:1 ratio with history */ - - assert (numberInputs == 2); - - for (unsigned int i = 0; i < numberInputs; i++) { - inputs[i].index = d_next_input; - inputs[i].size = output.size * decimation + history - 1; - } - return 0; -} - -inline static bool -tag_is_seg_sync_or_field_sync (atsc::syminfo tag) -{ - return tag.symbol_num == 0 && tag.valid; -} - -int -GrAtscFieldSyncDemux::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - float *input_samples = (float *) ai[0]; - atsc::syminfo *input_tags = (atsc::syminfo *) ai[1]; - atsc_soft_data_segment *out = ((atsc_soft_data_segment **)ao)[0]; - - sync (output.index); - - unsigned int ii = 0; // input index - - // Are we in sync? - if (!tag_is_seg_sync_or_field_sync (input_tags[0])){ // No ... - - if (d_locked){ - d_locked = false; - d_lost_index = inputs[0].index + ii; - cerr << "GrAtscFieldSyncDemux: lost sync at " - << d_lost_index << endl; - } - - // ... search for beginning of a field sync - - // cerr << "GrAtscFieldSyncDemux: searching for sync at " - // << inputs[0].index + ii << endl; - - for (ii = 1; ii < inputs[0].size; ii++){ - if (atsc::tag_is_start_field_sync (input_tags[ii])){ - // found one - d_locked = true; - - const char *str; - if (atsc::tag_is_start_field_sync_1 (input_tags[ii])) - str = "FIELD-1"; - else if (atsc::tag_is_start_field_sync_2 (input_tags[ii])) - str = "FIELD-2"; - else - str = "SEGMENT"; - - cerr << "GrAtscFieldSyncDemux: synced (" << str << ") at " - << inputs[0].index + ii - << " [delta = " << inputs[0].index + ii - d_lost_index - << "]\n"; - - d_next_input += ii; // update for forecast - return 0; // no work completed so far - } - } - // no non-NORMAL tag found - d_next_input += ii; // update for forecast - return 0; // no work completed so far - } - - // We are in sync. Produce output... - - unsigned int k = 0; // output index - - while (k < output.size){ - - if (inputs[0].size - ii < (unsigned) ATSC_DATA_SEGMENT_LENGTH){ - // We're out of input data. - cerr << "GrAtscFieldSyncDemux: ran out of input data\n"; - d_next_input += ii; // update for forecast - return k; // return amount of work completed so far - } - - if (!tag_is_seg_sync_or_field_sync (input_tags[ii])){ - // lost sync... - // cerr << "GrAtscFieldSyncDemux: lost sync at " - // << inputs[0].index + ii << endl; - - d_next_input += ii; // update for forecast - return k; // return amount of work completed so far - } - - if (atsc::tag_is_start_field_sync_1 (input_tags[ii])){ - d_in_field2 = false; - d_segment_number = 0; - ii += ATSC_DATA_SEGMENT_LENGTH; // skip over field sync - continue; - } - - if (atsc::tag_is_start_field_sync_2 (input_tags[ii])){ - d_in_field2 = true; - d_segment_number = 0; - ii += ATSC_DATA_SEGMENT_LENGTH; // skip over field sync - continue; - } - - if (d_segment_number >= ATSC_DSEGS_PER_FIELD){ - // something's wrong... - cerr << "GrAtscFieldSyncDemux: segment number overflow\n"; - d_segment_number = 0; - } - - out[k].pli.set_regular_seg (d_in_field2, d_segment_number++); - for (int jj = 0; jj < ATSC_DATA_SEGMENT_LENGTH; jj++) - out[k].data[jj] = input_samples[ii + jj]; - ii += ATSC_DATA_SEGMENT_LENGTH; - k++; - } - - d_next_input += ii; // update for forecast - return k; // return amount of work completed -} - diff --git a/gr-atsc/lib/GrAtscFieldSyncMux.cc b/gr-atsc/lib/GrAtscFieldSyncMux.cc deleted file mode 100644 index 4d514fd852..0000000000 --- a/gr-atsc/lib/GrAtscFieldSyncMux.cc +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscFieldSyncMux.h> -#include <gnuradio/atsc/pnXXX_impl.h> - - -// typedefs for fundamental i/o types - -typedef atsc_data_segment iType; -typedef atsc_data_segment oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - -static const int N_SAVED_SYMBOLS = GrAtscFieldSyncMux::N_SAVED_SYMBOLS; - -static void -init_field_sync_common (unsigned char *p, int mask, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) -{ - static const unsigned char bin_map[2] = { 1, 6 }; // map binary values to 1 of 8 levels - - int i = 0; - - p[i++] = bin_map[1]; // data segment sync pulse - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map[atsc_pn511[j]]; - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map[atsc_pn63[j] ^ mask]; - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - - p[i++] = bin_map[0]; // 24 bits of VSB8 mode identifiera - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - - for (int j = 0; j < 92; j++) // 92 more bits - p[i++] = bin_map[atsc_pn63[j % 63]]; - - // now copy the last 12 symbols of the previous segment - - for (int j = 0; j < N_SAVED_SYMBOLS; j++) - p[i++] = saved_symbols[j]; - - assert (i == ATSC_DATA_SEGMENT_LENGTH); -} - -inline static void -init_field_sync_1 (atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) -{ - init_field_sync_common (&s->data[0], 0, saved_symbols); -} - -inline static void -init_field_sync_2 (atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - -{ - init_field_sync_common (&s->data[0], 1, saved_symbols); -} - -static void -save_last_symbols (unsigned char saved_symbols[N_SAVED_SYMBOLS], - const atsc_data_segment &seg) -{ - for (int i = 0; i < N_SAVED_SYMBOLS; i++) - saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS]; -} - - -inline static bool -last_regular_seg_p (const plinfo &pli) -{ - return pli.regular_seg_p () && (pli.segno () == ATSC_DSEGS_PER_FIELD - 1); -} - - -GrAtscFieldSyncMux::GrAtscFieldSyncMux () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS), - d_current_index (0), d_already_output_field_sync (false) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - history = 1; - - // any other init here. -} - -GrAtscFieldSyncMux::~GrAtscFieldSyncMux () -{ - // Anything that isn't automatically cleaned up... -} - -void -GrAtscFieldSyncMux::pre_initialize () -{ - // we jack our output sampling frequency up to account for inserted field syncs - setSamplingFrequency (getInputSamplingFrequencyN (0) * 313./312.); -} - -/* - * we need a non-standard version of forecast because our output isn't - * exactly 1:1 with our input. - */ - -int -GrAtscFieldSyncMux::forecast (VrSampleRange output, VrSampleRange inputs[]) -{ - for(unsigned int i = 0; i < numberInputs; i++) { - inputs[i].index = d_current_index; - inputs[i].size = output.size; - } - return 0; -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ -int -GrAtscFieldSyncMux::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, hence we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - unsigned int index = 0; - for (unsigned int outdex = 0; outdex < output.size; outdex++){ - - assert (in[index].pli.regular_seg_p ()); - - if (!in[index].pli.first_regular_seg_p ()){ - out[outdex] = in[index]; // just copy in to out - - if (last_regular_seg_p (in[index].pli)) - save_last_symbols (d_saved_symbols, in[index]); - - index++; - } - else { // first_regular_seg_p - if (!d_already_output_field_sync){ - // write out field sync... - atsc_data_segment field_sync; - - if (in[index].pli.in_field1_p ()) - init_field_sync_1 (&field_sync, d_saved_symbols); - else - init_field_sync_2 (&field_sync, d_saved_symbols); - - // note that index doesn't advance in this branch - out[outdex] = field_sync; - d_already_output_field_sync = true; - } - else { - // already output field sync, now output first regular segment - out[outdex] = in[index]; - index++; - d_already_output_field_sync = false; - } - } - } - - d_current_index += index; - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscInterleaver.cc b/gr-atsc/lib/GrAtscInterleaver.cc deleted file mode 100644 index f24dcaad15..0000000000 --- a/gr-atsc/lib/GrAtscInterleaver.cc +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscInterleaver.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_rs_encoded iType; -typedef atsc_mpeg_packet_rs_encoded oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscInterleaver::GrAtscInterleaver () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscInterleaver::~GrAtscInterleaver () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscInterleaver::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current contents of the FIFOs, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - -#if 0 - cerr << "@@@ GrAtscInterleaver: output.index = " << output.index - << " output.size = " << output.size - << " sum = " << output.index + output.size - << " \t[out = " << out << "]" - << endl; -#endif - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - // pipeline info is handled in the primitive - interleaver.interleave (out[i], in[i]); - } - - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscRSDecoder.cc b/gr-atsc/lib/GrAtscRSDecoder.cc deleted file mode 100644 index f87edef6ae..0000000000 --- a/gr-atsc/lib/GrAtscRSDecoder.cc +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscRSDecoder.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_rs_encoded iType; -typedef atsc_mpeg_packet_no_sync oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscRSDecoder::GrAtscRSDecoder () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscRSDecoder::~GrAtscRSDecoder () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscRSDecoder::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - assert (in[i].pli.regular_seg_p ()); - out[i].pli = in[i].pli; // copy pipeline info - - int nerrors_not_corrected = rs_decoder.decode (out[i], in[i]); - out[i].pli.set_transport_error (nerrors_not_corrected == -1); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscRSEncoder.cc b/gr-atsc/lib/GrAtscRSEncoder.cc deleted file mode 100644 index deef98f180..0000000000 --- a/gr-atsc/lib/GrAtscRSEncoder.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscRSEncoder.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_no_sync iType; -typedef atsc_mpeg_packet_rs_encoded oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscRSEncoder::GrAtscRSEncoder () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscRSEncoder::~GrAtscRSEncoder () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscRSEncoder::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - - // ensure that on the way in, the error bit is clear - // [assertion is not valid, because the randomizer has already scrambled the bits] - // assert ((in[i].data[0] & MPEG_TRANSPORT_ERROR_BIT) == 0); - - assert (in[i].pli.regular_seg_p ()); - out[i].pli = in[i].pli; // copy pipeline info... - rs_encoder.encode (out[i], in[i]); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscRandomizer.cc b/gr-atsc/lib/GrAtscRandomizer.cc deleted file mode 100644 index bdf5e682ae..0000000000 --- a/gr-atsc/lib/GrAtscRandomizer.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscRandomizer.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet iType; -typedef atsc_mpeg_packet_no_sync oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscRandomizer::GrAtscRandomizer () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS), - field2 (false), segno (0) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // We're one-to-one input-to-output so set it to 1. - history = 1; - - // any other init here. -} - -GrAtscRandomizer::~GrAtscRandomizer () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscRandomizer::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current contents of the LFSR in the randomizer, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i++){ - - // initialize plinfo for downstream - // - // We do this here because the randomizer is effectively - // the head of the tx processing chain - // - out[i].pli.set_regular_seg (field2, segno); - segno++; - if (segno == 312){ - segno = 0; - field2 = !field2; - } - - assert ((in[i].data[1] & MPEG_TRANSPORT_ERROR_BIT) == 0); - - if (out[i].pli.first_regular_seg_p ()) - rand.reset (); - - rand.randomize (out[i], in[i]); - } - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscSegSymSync.cc b/gr-atsc/lib/GrAtscSegSymSync.cc deleted file mode 100644 index 001f8a1bba..0000000000 --- a/gr-atsc/lib/GrAtscSegSymSync.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscSegSymSync.h> -#include <gnuradio/atsc/GrAtscSegSymSyncImpl_export.h> -#include <iostream> -#include <assert.h> - -static const int DECIMATION = 2; // close enough for super class's use -static const int N_OUTPUTS = 2; - -GrAtscSegSymSync::GrAtscSegSymSync () - : VrDecimatingSigProc<float,float> (N_OUTPUTS, DECIMATION) -{ - if (sizeof (float) != sizeof (atsc::syminfo)){ - cerr << "GrAtscSegSymSync: sizeof (float) != sizeof (atsc::syminfo)\n"; - assert (0); - } -} - -GrAtscSegSymSync::~GrAtscSegSymSync () -{ - // Nop -} - - -GrAtscSegSymSync * -GrAtscSegSymSync::create (double nominal_ratio_of_rx_clock_to_symbol_freq) -{ - return create_GrAtscSegSymSyncImpl (nominal_ratio_of_rx_clock_to_symbol_freq); -} diff --git a/gr-atsc/lib/GrAtscSegSymSyncImpl.cc b/gr-atsc/lib/GrAtscSegSymSyncImpl.cc deleted file mode 100644 index bdb15a2b57..0000000000 --- a/gr-atsc/lib/GrAtscSegSymSyncImpl.cc +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscSegSymSyncImpl.h> -#include <gnuradio/atsc/GrAtscSegSymSyncImpl_export.h> -#include <cmath> -#include <assert.h> - -GrAtscSegSymSyncImpl::GrAtscSegSymSyncImpl ( - double nominal_ratio_of_rx_clock_to_symbol_freq) - : d_interp (nominal_ratio_of_rx_clock_to_symbol_freq) -{ - // set approximate decimation rate for superclass's benefit - decimation = (int) rint (nominal_ratio_of_rx_clock_to_symbol_freq); - - history = 1500; // spare input samples in case we need them. - - d_sssr.reset (); - d_interp.reset (); - d_next_input = 0; - d_rx_clock_to_symbol_freq = nominal_ratio_of_rx_clock_to_symbol_freq; -} - -GrAtscSegSymSyncImpl::~GrAtscSegSymSyncImpl () -{ - // Nop -} - -void -GrAtscSegSymSyncImpl::pre_initialize () -{ - setSamplingFrequency ( - getInputSamplingFrequencyN (0) / d_rx_clock_to_symbol_freq); -} - -int -GrAtscSegSymSyncImpl::forecast (VrSampleRange output, - VrSampleRange inputs[]) -{ - assert (numberInputs == 1); // I hate these free references to - // superclass's instance variables... - - inputs[0].index = d_next_input; - inputs[0].size = - ((long unsigned int) (output.size * d_rx_clock_to_symbol_freq) - + history - 1); - - return 0; -} - -int -GrAtscSegSymSyncImpl::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ -#if 0 - float *input_samples = ((float **) ai)[0]; - float *output_samples = ((float **) ao)[0]; - atsc::syminfo *output_info = ((atsc::syminfo **) ao)[1]; - - // FIXME finish... -#endif - assert (0); - - return output.size; -} - -void -GrAtscSegSymSyncImpl::reset () -{ - d_sssr.reset (); - d_interp.reset (); -} - - -/* - * Exported constructor. - * Doesn't expose any of the internals or our compile time dependencies. - */ - -GrAtscSegSymSync * -create_GrAtscSegSymSyncImpl (double nominal_ratio_of_rx_clock_to_symbol_freq) -{ - return new GrAtscSegSymSyncImpl (nominal_ratio_of_rx_clock_to_symbol_freq); -} diff --git a/gr-atsc/lib/GrAtscTrellisEncoder.cc b/gr-atsc/lib/GrAtscTrellisEncoder.cc deleted file mode 100644 index 62f7f75b22..0000000000 --- a/gr-atsc/lib/GrAtscTrellisEncoder.cc +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscTrellisEncoder.h> - -// typedefs for fundamental i/o types - -typedef atsc_mpeg_packet_rs_encoded iType; -typedef atsc_data_segment oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscTrellisEncoder::GrAtscTrellisEncoder () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS), last_start(-1) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // - // We need our input to be aligned on a 12-segment boundary, - // to ensure satisfaction, ask for 11 more - history = 1 + (atsci_trellis_encoder::NCODERS - 1); - - // any other init here. - - // Let the bottom end know we must produce output in multiples of 12 segments. - setOutputSize (atsci_trellis_encoder::NCODERS); -} - -GrAtscTrellisEncoder::~GrAtscTrellisEncoder () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscTrellisEncoder::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current state of the encoders, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - -#if 0 - cerr << "@@@ GrAtscTrellisEncoder: output.index = " << output.index - << " output.size = " << output.size - << " sum = " << output.index + output.size - << " \t[in = " << in << "]" - << endl; -#endif - - assert (output.size % atsci_trellis_encoder::NCODERS == 0); - - - // find the first mod 12 boundary to begin decoding - int start; - for (start = 0; start < atsci_trellis_encoder::NCODERS; start++){ - plinfo::sanity_check (in[start].pli); - assert (in[start].pli.regular_seg_p ()); - if ((in[start].pli.segno () % atsci_trellis_encoder::NCODERS) == 0) - break; - } - - if (start == atsci_trellis_encoder::NCODERS){ - // we didn't find a mod 12 boundary. There's some kind of problem - // upstream of us (not yet sync'd??) - cerr << "!!!GrAtscTrellisEncoder: no mod-12 boundary found\7\n"; - start = 0; - } - else if (start != last_start){ - cerr << "GrAtscTrellisEncoder: new starting offset = " << start - << " output.index = " << output.index << endl; - last_start = start; - } - - - // FIXME paranoid check for problem - for (unsigned int i = 0; i < output.size; i++){ - plinfo::sanity_check (in[i + start].pli); - } - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i += atsci_trellis_encoder::NCODERS){ - // primitive does 12 segments at a time. - // pipeline info is handled in the primitive. - encoder.encode (&out[i], &in[i + start]); - } - -#if 0 - // FIXME paranoid check for problem - for (unsigned int i = 0; i < output.size; i++){ - plinfo::sanity_check (out[i].pli); - assert (out[i].pli.regular_seg_p ()); - } -#endif - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/GrAtscViterbiDecoder.cc b/gr-atsc/lib/GrAtscViterbiDecoder.cc deleted file mode 100644 index 272d457846..0000000000 --- a/gr-atsc/lib/GrAtscViterbiDecoder.cc +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/GrAtscViterbiDecoder.h> -#include <iostream> - -// typedefs for fundamental i/o types - -typedef atsc_soft_data_segment iType; -typedef atsc_mpeg_packet_rs_encoded oType; - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - - -GrAtscViterbiDecoder::GrAtscViterbiDecoder () - : VrHistoryProc<iType,oType> (NUMBER_OF_OUTPUTS), last_start(-1) -{ - // 1 + number of extra input elements at which we look. This is - // used by the superclass's forecast routine to get us the correct - // range on our inputs. - // - // We need our input to be aligned on a 12-segment boundary, - // to ensure satisfaction, ask for 11 more - history = 1 + (atsci_viterbi_decoder::NCODERS - 1); - - // any other init here. - - // Let the bottom end know we must produce output in multiples of 12 segments. - setOutputSize (atsci_viterbi_decoder::NCODERS); -} - -GrAtscViterbiDecoder::~GrAtscViterbiDecoder () -{ - // Anything that isn't automatically cleaned up... -} - -/* - * This is the real work horse. In general this interface can handle - * multiple streams of input and output, but we almost always - * use a single input and output stream. - */ - -int -GrAtscViterbiDecoder::work (VrSampleRange output, void *ao[], - VrSampleRange inputs[], void *ai[]) -{ - // If we have state that persists across invocations (e.g., we have - // instance variables that we modify), we must use the sync method - // to indicate to the scheduler that our output must be computed in - // order. This doesn't keep other things from being run in - // parallel, it just means that at any given time, there is only a - // single thread working this code, and that the scheduler will - // ensure that we are asked to produce output that is contiguous and - // that will be presented to us in order of increasing time. - - // We have state, the current state of the decoder, hence - // we must use sync. - - sync (output.index); - - // construct some nicer i/o pointers to work with. - - iType *in = ((iType **) ai)[0]; - oType *out = ((oType **) ao)[0]; - - - assert (output.size % atsci_viterbi_decoder::NCODERS == 0); - - // find the first mod 12 boundary to begin decoding - int start; - for (start = 0; start < atsci_viterbi_decoder::NCODERS; start++){ - assert (in[start].pli.regular_seg_p ()); - if ((in[start].pli.segno () % atsci_viterbi_decoder::NCODERS) == 0) - break; - } - - if (start == atsci_viterbi_decoder::NCODERS){ - // we didn't find a mod 12 boundary. There's some kind of problem - // upstream of us (not yet sync'd??) - cerr << "!!!GrAtscViterbiDecoder: no mod-12 boundary found\7\n"; - start = 0; - } - else if (start != last_start){ - cerr << "GrAtscViterbiDecoder: new starting offset = " << start - << " output.index = " << output.index << endl; - last_start = start; - } - - // We must produce output.size units of output. - - for (unsigned int i = 0; i < output.size; i += atsci_viterbi_decoder::NCODERS){ - // primitive does 12 segments at a time. - // pipeline info is handled in the primitive. - decoder.decode (&out[i], &in[i + start]); - } - -#if 0 - // FIXME paranoid check... - for (unsigned int i = 0; i < output.size; i++){ - plinfo::sanity_check (out[i].pli); - assert (out[i].pli.regular_seg_p ()); - } -#endif - -#if 0 - cerr << "@@@ GrAtscViterbiDecoder: output.index = " << output.index - << " output.size = " << output.size - << " sum = " << output.index + output.size << endl; -#endif - - // Return the number of units we produced. - // Note that for all intents and purposes, it is an error to - // produce less than you are asked for. - - return output.size; -} diff --git a/gr-atsc/lib/atsc_bit_timing_loop.cc b/gr-atsc/lib/atsc_bit_timing_loop.cc deleted file mode 100644 index 1458c9ed63..0000000000 --- a/gr-atsc/lib/atsc_bit_timing_loop.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/bit_timing_loop.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <string.h> - -// Input rate changed from 20MHz to 19.2 to support usrp at 3 * 6.4MHz -float input_rate = 19.2e6; -double ratio_of_rx_clock_to_symbol_freq = input_rate / ATSC_SYMBOL_RATE; - - -atsc_bit_timing_loop_sptr -atsc_make_bit_timing_loop() -{ - return gnuradio::get_initial_sptr(new atsc_bit_timing_loop()); -} - - -atsc_bit_timing_loop::atsc_bit_timing_loop() - : gr::block("atsc_bit_timing_loop", - gr::io_signature::make(1, 1, sizeof(float)), - gr::io_signature::make3(2, 3, sizeof(float), sizeof(float), sizeof(float))), - d_interp(ratio_of_rx_clock_to_symbol_freq), d_next_input(0), - d_rx_clock_to_symbol_freq (ratio_of_rx_clock_to_symbol_freq), - d_si(0) -{ - reset(); -} - -void -atsc_bit_timing_loop::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = static_cast<int>(noutput_items * d_rx_clock_to_symbol_freq) + 1500 - 1; - -} - -int -atsc_bit_timing_loop::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - int r = work (noutput_items, input_items, output_items); - if (r > 0) - consume_each (d_si); - return r; -} - - -int -atsc_bit_timing_loop::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out_sample = (float *) output_items[0]; - atsc::syminfo *out_tag = (atsc::syminfo *) output_items[1]; - float *out_timing_error = (float *) output_items[2]; - - assert(sizeof(float) == sizeof(atsc::syminfo)); - - // We are tasked with producing output.size output samples. - // We will consume approximately 2 * output.size input samples. - - int k; // output index - - float interp_sample; - int symbol_index; - double timing_adjustment = 0; - bool seg_locked; - atsc::syminfo tag; - // ammount requested in forecast - unsigned long input_size = noutput_items * d_rx_clock_to_symbol_freq + 1500 -1; - - memset (&tag, 0, sizeof (tag)); - - // ammount actually consumed - d_si = 0; - - for (k = 0; k < noutput_items; k++){ - if (!d_interp.update (in, input_size, &d_si, timing_adjustment, &interp_sample)){ - fprintf (stderr, "GrAtscBitTimingLoop3: ran short on data...\n"); - break; - } - - d_sssr.update (interp_sample, &seg_locked, &symbol_index, &timing_adjustment); - if (output_items.size() == 3) { - out_timing_error[k] = timing_adjustment; - } - out_sample[k] = interp_sample; - tag.valid = seg_locked; - tag.symbol_num = symbol_index; - out_tag[k] = tag; - - } - - return k; -} diff --git a/gr-atsc/lib/atsc_deinterleaver.cc b/gr-atsc/lib/atsc_deinterleaver.cc deleted file mode 100644 index 47507e58aa..0000000000 --- a/gr-atsc/lib/atsc_deinterleaver.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/deinterleaver.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_deinterleaver_sptr -atsc_make_deinterleaver() -{ - return gnuradio::get_initial_sptr(new atsc_deinterleaver()); -} - -atsc_deinterleaver::atsc_deinterleaver() - : gr::sync_block("atsc_deinterleaver", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) -{ - reset(); -} - -int -atsc_deinterleaver::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - d_deinterleaver.deinterleave (out[i], in[i]); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_depad.cc b/gr-atsc/lib/atsc_depad.cc deleted file mode 100644 index b4872df2c9..0000000000 --- a/gr-atsc/lib/atsc_depad.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2008,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/depad.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/types.h> - -atsc_depad_sptr -atsc_make_depad() -{ - return gnuradio::get_initial_sptr(new atsc_depad()); -} - -atsc_depad::atsc_depad() - : gr::sync_interpolator("atsc_depad", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - gr::io_signature::make(1, 1, sizeof(unsigned char)), - ATSC_MPEG_PKT_LENGTH) -{ - reset(); -} - -int -atsc_depad::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *) input_items[0]; - unsigned char *out = (unsigned char *) output_items[0]; - - int i; - - for (i = 0; i < noutput_items/ATSC_MPEG_PKT_LENGTH; i++){ - memcpy(&out[i * ATSC_MPEG_PKT_LENGTH], in[i].data, ATSC_MPEG_PKT_LENGTH); - } - - return i * ATSC_MPEG_PKT_LENGTH; -} diff --git a/gr-atsc/lib/atsc_derandomizer.cc b/gr-atsc/lib/atsc_derandomizer.cc deleted file mode 100644 index e619aa6865..0000000000 --- a/gr-atsc/lib/atsc_derandomizer.cc +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/derandomizer.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_derandomizer_sptr -atsc_make_derandomizer() -{ - return gnuradio::get_initial_sptr(new atsc_derandomizer()); -} - -atsc_derandomizer::atsc_derandomizer() - : gr::sync_block("atsc_derandomizer", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet))) -{ - reset(); -} - -void -atsc_derandomizer::reset() -{ - d_rand.reset(); -} - -int -atsc_derandomizer::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - - assert(in[i].pli.regular_seg_p()); - - if (in[i].pli.first_regular_seg_p()) - d_rand.reset(); - - d_rand.derandomize(out[i], in[i]); - - // Check the pipeline info for error status and and set the - // corresponding bit in transport packet header. - - if (in[i].pli.transport_error_p()) - out[i].data[1] |= MPEG_TRANSPORT_ERROR_BIT; - else - out[i].data[1] &= ~MPEG_TRANSPORT_ERROR_BIT; - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_ds_to_softds.cc b/gr-atsc/lib/atsc_ds_to_softds.cc deleted file mode 100644 index d4f79f829e..0000000000 --- a/gr-atsc/lib/atsc_ds_to_softds.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/ds_to_softds.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_ds_to_softds_sptr -atsc_make_ds_to_softds() -{ - return gnuradio::get_initial_sptr(new atsc_ds_to_softds()); -} - -atsc_ds_to_softds::atsc_ds_to_softds() - : gr::sync_block("atsc_ds_to_softds", - gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), - gr::io_signature::make(1, 1, sizeof(atsc_soft_data_segment))) -{ - reset(); -} - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - -void -atsc_ds_to_softds::map_to_soft_symbols (atsc_soft_data_segment &out, - const atsc_data_segment &in) -{ - for (unsigned int i = 0; i < NELEM (in.data); i++){ - out.data[i] = in.data[i] * 2 - 7; - } -} - - -int -atsc_ds_to_softds::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_data_segment *in = (const atsc_data_segment *) input_items[0]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - - out[i].pli = in[i].pli; // copy pipeline info... - map_to_soft_symbols(out[i], in[i]); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_equalizer.cc b/gr-atsc/lib/atsc_equalizer.cc deleted file mode 100644 index 2e00f5f374..0000000000 --- a/gr-atsc/lib/atsc_equalizer.cc +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/equalizer.h> -#include <gnuradio/atsc/create_atsci_equalizer.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/syminfo_impl.h> - - -atsc_equalizer_sptr -atsc_make_equalizer() -{ - return gnuradio::get_initial_sptr(new atsc_equalizer()); -} - -// had atsc_equalizer(atsci_equalizer *equalizer) -atsc_equalizer::atsc_equalizer() - : gr::sync_block("atsc_equalizer", - gr::io_signature::make(2, 2, sizeof(float)), - gr::io_signature::make(2, 2, sizeof(float))) -{ - d_equalizer = create_atsci_equalizer_lms(); -} - -atsc_equalizer::~atsc_equalizer () -{ - // Anything that isn't automatically cleaned up... - - delete d_equalizer; -} - - -void -atsc_equalizer::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - - int ntaps = d_equalizer->ntaps (); - - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = fixed_rate_noutput_to_ninput (noutput_items + ntaps); - - -} - - - -int -atsc_equalizer::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - const atsc::syminfo *in_tags = (const atsc::syminfo *) input_items[1]; - float *out = (float *) output_items[0]; - atsc::syminfo *out_tags = (atsc::syminfo *) output_items[1]; - - assert(sizeof(float) == sizeof(atsc::syminfo)); - - int ntaps = d_equalizer->ntaps (); - int npretaps = d_equalizer->npretaps (); - - assert (ntaps >= 1); - assert (npretaps >= 0 && npretaps < ntaps); - - int offset = ntaps - npretaps - 1; - assert (offset >= 0 && offset < ntaps); - - - // peform the actual equalization - - d_equalizer->filter (in, in_tags + offset, - out, noutput_items); - - // write the output tags - - for (int i = 0; i < noutput_items; i++) - out_tags[i] = in_tags[i + offset]; - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_field_sync_demux.cc b/gr-atsc/lib/atsc_field_sync_demux.cc deleted file mode 100644 index 69830f45ed..0000000000 --- a/gr-atsc/lib/atsc_field_sync_demux.cc +++ /dev/null @@ -1,209 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cmath> -#include <gnuradio/atsc/field_sync_demux.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/types.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/syminfo_impl.h> -#include <stdio.h> -#include <assert.h> -#include <iostream> - -using std::cerr; -using std::endl; - - -static const int DEC = ATSC_DATA_SEGMENT_LENGTH; // nominal decimation factor - - -atsc_field_sync_demux_sptr -atsc_make_field_sync_demux() -{ - return gnuradio::get_initial_sptr(new atsc_field_sync_demux()); -} - -atsc_field_sync_demux::atsc_field_sync_demux() - : gr::block("atsc_field_sync_demux", - gr::io_signature::make(2, 2, sizeof(float)), - gr::io_signature::make(1, 1, sizeof(atsc_soft_data_segment))), - d_locked(false), d_in_field2(true), d_segment_number(0), - d_next_input(0), d_lost_index(0), d_inputs0_index(0), - d_inputs0_size(0), d_consume(0) -{ - reset(); -} - -inline static bool -tag_is_seg_sync_or_field_sync (atsc::syminfo tag) -{ - return tag.symbol_num == 0 && tag.valid; -} - -void -atsc_field_sync_demux::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) { - ninput_items_required[i] = noutput_items * DEC + 2 * DEC ; - - d_inputs0_index = d_next_input; - d_inputs0_size = noutput_items * DEC + 2 * DEC ; - } -} - -int -atsc_field_sync_demux::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - int r = work (noutput_items, input_items, output_items); - consume_each (d_consume); - // printf("Consumed: %d, produced: %d\n",d_consume,r); - // we consume input even if no output is produced - // while looking for sync - return r; -} - - -int -atsc_field_sync_demux::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - float *in = (float *) input_items[0]; - atsc::syminfo *input_tags = (atsc::syminfo *) input_items[1]; - atsc_soft_data_segment *out = (atsc_soft_data_segment *) output_items[0]; - - assert(sizeof(float) == sizeof(atsc::syminfo)); - - unsigned int ii = 0; // input index - - // Are we in sync? - if (!tag_is_seg_sync_or_field_sync (input_tags[0])){ // No ... - - if (d_locked){ - d_locked = false; - d_lost_index = d_inputs0_index + ii; - cerr << "atsc_field_sync_demux: lost sync at " - << d_lost_index << endl; - } - - // ... search for beginning of a field sync - - // cerr << "atsc_field_sync_demux: searching for sync at " - // << d_inputs0_index + ii << endl; - - for (ii = 1; ii < d_inputs0_size; ii++){ - if (atsc::tag_is_start_field_sync (input_tags[ii])){ - // found one - d_locked = true; - - const char *str; - if (atsc::tag_is_start_field_sync_1 (input_tags[ii])) - str = "FIELD-1"; - else if (atsc::tag_is_start_field_sync_2 (input_tags[ii])) - str = "FIELD-2"; - else - str = "SEGMENT"; - - cerr << "atsc_field_sync_demux: synced (" << str << ") at " - << d_inputs0_index + ii - << " [delta = " << d_inputs0_index + ii - d_lost_index - << "]\n"; - - d_next_input += ii; // update for forecast - d_consume = ii; - return 0; // no work completed so far - } - } - // no non-NORMAL tag found - d_next_input += ii; // update for forecast - d_consume = ii; - // printf("ii: %d, d_next_input: %d\n",ii,d_next_input); - return 0; // no work completed so far - } - - // We are in sync. Produce output... - - int k = 0; // output index - - while (k < noutput_items){ - - if (d_inputs0_size - ii < static_cast<unsigned int>(ATSC_DATA_SEGMENT_LENGTH)){ - // We're out of input data. - cerr << "atsc_field_sync_demux: ran out of input data\n"; - d_next_input += ii; // update for forecast - return k; // return amount of work completed so far - } - - if (!tag_is_seg_sync_or_field_sync (input_tags[ii])){ - // lost sync... - cerr << "atsc_field_sync_demux: lost sync at " - << d_inputs0_index + ii << endl; - - d_next_input += ii; // update for forecast - return k; // return amount of work completed so far - } - - if (atsc::tag_is_start_field_sync_1 (input_tags[ii])){ - d_in_field2 = false; - d_segment_number = 0; - ii += ATSC_DATA_SEGMENT_LENGTH; // skip over field sync - continue; - } - - if (atsc::tag_is_start_field_sync_2 (input_tags[ii])){ - d_in_field2 = true; - d_segment_number = 0; - ii += ATSC_DATA_SEGMENT_LENGTH; // skip over field sync - continue; - } - - if (d_segment_number >= ATSC_DSEGS_PER_FIELD){ - // something's wrong... - cerr << "atsc_field_sync_demux: segment number overflow\n"; - d_segment_number = 0; - } - - out[k].pli.set_regular_seg (d_in_field2, d_segment_number++); - for (int jj = 0; jj < ATSC_DATA_SEGMENT_LENGTH; jj++) - out[k].data[jj] = in[ii + jj]; - ii += ATSC_DATA_SEGMENT_LENGTH; - k++; - } - - d_next_input += ii; // update for forecast - d_consume = ii; - return k; // return amount of work completed - -} - - - - diff --git a/gr-atsc/lib/atsc_field_sync_mux.cc b/gr-atsc/lib/atsc_field_sync_mux.cc deleted file mode 100644 index 6b0586dbfc..0000000000 --- a/gr-atsc/lib/atsc_field_sync_mux.cc +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/field_sync_mux.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/pnXXX_impl.h> - - -atsc_field_sync_mux_sptr -atsc_make_field_sync_mux() -{ - return gnuradio::get_initial_sptr(new atsc_field_sync_mux()); -} - -atsc_field_sync_mux::atsc_field_sync_mux() - : gr::block("atsc_field_sync_mux", - gr::io_signature::make(1, 1, sizeof(atsc_data_segment)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) -{ - reset(); -} - -static const int NUMBER_OF_OUTPUTS = 1; // # of output streams (almost always one) - -static const int N_SAVED_SYMBOLS = atsc_field_sync_mux::N_SAVED_SYMBOLS; - -static void -init_field_sync_common (unsigned char *p, int mask, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) -{ - static const unsigned char bin_map[2] = { 1, 6 }; // map binary values to 1 of 8 levels - - int i = 0; - - p[i++] = bin_map[1]; // data segment sync pulse - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map[atsc_pn511[j]]; - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map[atsc_pn63[j] ^ mask]; - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map[atsc_pn63[j]]; - - p[i++] = bin_map[0]; // 24 bits of VSB8 mode identifiera - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - p[i++] = bin_map[1]; - p[i++] = bin_map[0]; - - - for (int j = 0; j < 92; j++) // 92 more bits - p[i++] = bin_map[atsc_pn63[j % 63]]; - - // now copy the last 12 symbols of the previous segment - - for (int j = 0; j < N_SAVED_SYMBOLS; j++) - p[i++] = saved_symbols[j]; - - assert (i == ATSC_DATA_SEGMENT_LENGTH); -} -inline static void -init_field_sync_1 (atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) -{ - init_field_sync_common (&s->data[0], 0, saved_symbols); -} - -inline static void -init_field_sync_2 (atsc_data_segment *s, - const unsigned char saved_symbols[N_SAVED_SYMBOLS]) - -{ - init_field_sync_common (&s->data[0], 1, saved_symbols); -} - -static void -save_last_symbols (unsigned char saved_symbols[N_SAVED_SYMBOLS], - const atsc_data_segment &seg) -{ - for (int i = 0; i < N_SAVED_SYMBOLS; i++) - saved_symbols[i] = seg.data[i + ATSC_DATA_SEGMENT_LENGTH - N_SAVED_SYMBOLS];} - - -inline static bool -last_regular_seg_p (const plinfo &pli) -{ - return pli.regular_seg_p () && (pli.segno () == ATSC_DSEGS_PER_FIELD - 1); -} - -void -atsc_field_sync_mux::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = noutput_items; - -} - - -int -atsc_field_sync_mux::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - int in_length = ninput_items[0]; - const atsc_data_segment *in = (const atsc_data_segment *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; - - int index = 0; - int outdex = 0; - for (outdex = 0; outdex < noutput_items && index < in_length; outdex++){ - - assert (in[index].pli.regular_seg_p ()); - - if (!in[index].pli.first_regular_seg_p ()){ - out[outdex] = in[index]; // just copy in to out - - if (last_regular_seg_p (in[index].pli)) - save_last_symbols (d_saved_symbols, in[index]); - - index++; - } - else { // first_regular_seg_p - if (!d_already_output_field_sync){ - // write out field sync... - atsc_data_segment field_sync; - - if (in[index].pli.in_field1_p ()) - init_field_sync_1 (&field_sync, d_saved_symbols); - else - init_field_sync_2 (&field_sync, d_saved_symbols); - - // note that index doesn't advance in this branch - out[outdex] = field_sync; - d_already_output_field_sync = true; - } - else { - // already output field sync, now output first regular segment - out[outdex] = in[index]; - index++; - d_already_output_field_sync = false; - } - } - } - - this->consume_each(index); - return outdex; -} diff --git a/gr-atsc/lib/atsc_fpll.cc b/gr-atsc/lib/atsc_fpll.cc deleted file mode 100644 index 9a27674c0a..0000000000 --- a/gr-atsc/lib/atsc_fpll.cc +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/fpll.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <algorithm> -#include "fpll_btloop_coupling.h" -#include <gnuradio/math.h> - -atsc_fpll_sptr -atsc_make_fpll() -{ - return gnuradio::get_initial_sptr(new atsc_fpll()); -} - - -/* - * I strongly suggest that you not mess with these... - * - * They are strongly coupled into the symbol timing code and - * their value also sets the level of the symbols going - * into the equalizer and viterbi decoder. - */ -static const float FPLL_AGC_REFERENCE = 2.5 * FPLL_BTLOOP_COUPLING_CONST; -static const float FPLL_AGC_RATE = 0.25e-6; - - - -atsc_fpll::atsc_fpll() - : gr::sync_block("atsc_fpll", - gr::io_signature::make(1, 1, sizeof(float)), - gr::io_signature::make(1, 1, sizeof(float))), - initial_phase(0) -{ - initial_freq = 5.75e6 - 3e6 + 0.31e6 + 5e3; // a_initial_freq; - agc.set_rate (FPLL_AGC_RATE); - agc.set_reference (FPLL_AGC_REFERENCE); - initialize(); -} - - -void -atsc_fpll::initialize () -{ - float Fs = 19.2e6; - - float alpha = 1 - exp(-1.0 / Fs / 5e-6); - - afci.set_taps (alpha); - afcq.set_taps (alpha); - - printf("Setting initial_freq: %f\n",initial_freq); - nco.set_freq (initial_freq / Fs * 2 * M_PI); - nco.set_phase (initial_phase); -} - - -int -atsc_fpll::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int k = 0; k < noutput_items; k++){ - - float a_cos, a_sin; - - float input = agc.scale (in[k]); - - nco.step (); // increment phase - nco.sincos (&a_sin, &a_cos); // compute cos and sin - - float I = input * a_sin; - float Q = input * a_cos; - - out[k] = I; - - float filtered_I = afci.filter (I); - float filtered_Q = afcq.filter (Q); - - // phase detector - - // float x = atan2 (filtered_Q, filtered_I); - float x = gr::fast_atan2f(filtered_Q, filtered_I); - - // avoid slamming filter with big transitions - - static const float limit = M_PI / 2; - - if (x > limit) - x = limit; - else if (x < -limit) - x = -limit; - - // static const float alpha = 0.037; // Max value - // static const float alpha = 0.005; // takes about 5k samples to pull in, stddev = 323 - // static const float alpha = 0.002; // takes about 15k samples to pull in, stddev = 69 - // or about 120k samples on noisy data, - static const float alpha = 0.001; - static const float beta = alpha * alpha / 4; - - nco.adjust_phase (alpha * x); - nco.adjust_freq (beta * x); - - } - - return noutput_items; -} - - - diff --git a/gr-atsc/lib/atsc_fs_checker.cc b/gr-atsc/lib/atsc_fs_checker.cc deleted file mode 100644 index 28e771dfb5..0000000000 --- a/gr-atsc/lib/atsc_fs_checker.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/fs_checker.h> -#include <gnuradio/atsc/create_atsci_fs_checker.h> -#include <gnuradio/atsc/fs_checker_impl.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/syminfo_impl.h> - - -atsc_fs_checker_sptr -atsc_make_fs_checker() -{ - return gnuradio::get_initial_sptr(new atsc_fs_checker()); -} - -atsc_fs_checker::atsc_fs_checker() - : gr::sync_block("atsc_fs_checker", - gr::io_signature::make(2, 2, sizeof(float)), - gr::io_signature::make(2, 2, sizeof(float))) -{ - d_fsc = create_atsci_fs_checker(); -} - - -atsc_fs_checker::~atsc_fs_checker () -{ - // Anything that isn't automatically cleaned up... - - delete d_fsc; -} - - -int -atsc_fs_checker::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - const atsc::syminfo *tag_in = (const atsc::syminfo *) input_items[1]; - float *out = (float *) output_items[0]; - atsc::syminfo *tag_out = (atsc::syminfo *) output_items[1]; - - assert(sizeof(float) == sizeof(atsc::syminfo)); - - - for (int i = 0; i < noutput_items; i++) - d_fsc->filter (in[i], tag_in[i], &out[i], &tag_out[i]); - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_interleaver.cc b/gr-atsc/lib/atsc_interleaver.cc deleted file mode 100644 index ef8820abaf..0000000000 --- a/gr-atsc/lib/atsc_interleaver.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/interleaver.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_interleaver_sptr -atsc_make_interleaver() -{ - return gnuradio::get_initial_sptr(new atsc_interleaver()); -} - -atsc_interleaver::atsc_interleaver() - : gr::sync_block("atsc_interleaver", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) -{ - reset(); -} - -int -atsc_interleaver::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - d_interleaver.interleave (out[i], in[i]); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_pad.cc b/gr-atsc/lib/atsc_pad.cc deleted file mode 100644 index 776eb4ab05..0000000000 --- a/gr-atsc/lib/atsc_pad.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/pad.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/types.h> - -static const int INTR = ATSC_MPEG_PKT_LENGTH; - -atsc_pad_sptr -atsc_make_pad() -{ - return gnuradio::get_initial_sptr(new atsc_pad()); -} - -atsc_pad::atsc_pad() - : gr::sync_decimator("atsc_pad", - gr::io_signature::make(1, 1, sizeof(unsigned char)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - INTR) -{ - reset(); -} - -void -atsc_pad::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - unsigned ninputs = ninput_items_required.size(); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = noutput_items * ATSC_MPEG_PKT_LENGTH; -} - - -int -atsc_pad::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const unsigned char *in = (const unsigned char *) input_items[0]; - atsc_mpeg_packet *out = (atsc_mpeg_packet *) output_items[0]; - - int i; - - for (i = 0; i < noutput_items; i++){ - for (int j = 0; j < ATSC_MPEG_PKT_LENGTH; j++) - out[i].data[j] = in[i * ATSC_MPEG_PKT_LENGTH + j]; - - } - - return noutput_items; -} - - - - diff --git a/gr-atsc/lib/atsc_randomizer.cc b/gr-atsc/lib/atsc_randomizer.cc deleted file mode 100644 index 6ee61a9888..0000000000 --- a/gr-atsc/lib/atsc_randomizer.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/randomizer.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_randomizer_sptr -atsc_make_randomizer() -{ - return gnuradio::get_initial_sptr(new atsc_randomizer()); -} - -atsc_randomizer::atsc_randomizer() - : gr::sync_block("atsc_randomizer", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) -{ - reset(); -} - -void -atsc_randomizer::reset() -{ - d_rand.reset(); - d_field2 = false; - d_segno = 0; -} - -int -atsc_randomizer::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet *in = (const atsc_mpeg_packet *) input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - - // sanity check incoming data. - assert((in[i].data[0] == MPEG_SYNC_BYTE)); - assert((in[i].data[1] & MPEG_TRANSPORT_ERROR_BIT) == 0); - - // initialize plinfo for downstream - // - // We do this here because the randomizer is effectively - // the head of the tx processing chain - // - out[i].pli.set_regular_seg(d_field2, d_segno); - d_segno++; - if (d_segno == 312){ - d_segno = 0; - d_field2 = !d_field2; - } - - if (out[i].pli.first_regular_seg_p()) - d_rand.reset(); - - d_rand.randomize(out[i], in[i]); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_rs_decoder.cc b/gr-atsc/lib/atsc_rs_decoder.cc deleted file mode 100644 index 3891b3874d..0000000000 --- a/gr-atsc/lib/atsc_rs_decoder.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/rs_decoder.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_rs_decoder_sptr -atsc_make_rs_decoder() -{ - return gnuradio::get_initial_sptr(new atsc_rs_decoder()); -} - -atsc_rs_decoder::atsc_rs_decoder() - : gr::sync_block("atsc_rs_decoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync))) -{ - reset(); -} - -int -atsc_rs_decoder::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_mpeg_packet_no_sync *out = (atsc_mpeg_packet_no_sync *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... - - int nerrors_corrrected = d_rs_decoder.decode(out[i], in[i]); - out[i].pli.set_transport_error(nerrors_corrrected == -1); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_rs_encoder.cc b/gr-atsc/lib/atsc_rs_encoder.cc deleted file mode 100644 index b2b8cf7421..0000000000 --- a/gr-atsc/lib/atsc_rs_encoder.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/rs_encoder.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_rs_encoder_sptr -atsc_make_rs_encoder() -{ - return gnuradio::get_initial_sptr(new atsc_rs_encoder()); -} - -atsc_rs_encoder::atsc_rs_encoder() - : gr::sync_block("atsc_rs_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_no_sync)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))) -{ - reset(); -} - -int -atsc_rs_encoder::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_no_sync *in = (const atsc_mpeg_packet_no_sync *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - - assert(in[i].pli.regular_seg_p()); - out[i].pli = in[i].pli; // copy pipeline info... - d_rs_encoder.encode(out[i], in[i]); - } - - return noutput_items; -} diff --git a/gr-atsc/lib/atsc_trellis_encoder.cc b/gr-atsc/lib/atsc_trellis_encoder.cc deleted file mode 100644 index fe8530d6d2..0000000000 --- a/gr-atsc/lib/atsc_trellis_encoder.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/trellis_encoder.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> - - -atsc_trellis_encoder_sptr -atsc_make_trellis_encoder() -{ - return gnuradio::get_initial_sptr(new atsc_trellis_encoder()); -} - -atsc_trellis_encoder::atsc_trellis_encoder() - : gr::sync_block("atsc_trellis_encoder", - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded)), - gr::io_signature::make(1, 1, sizeof(atsc_data_segment))) -{ - set_output_multiple(atsci_trellis_encoder::NCODERS); - reset(); -} - -int -atsc_trellis_encoder::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_mpeg_packet_rs_encoded *in = (const atsc_mpeg_packet_rs_encoded *) input_items[0]; - atsc_data_segment *out = (atsc_data_segment *) output_items[0]; - - for (int i = 0; i < atsci_trellis_encoder::NCODERS; i += atsci_trellis_encoder::NCODERS){ - d_trellis_encoder.encode(&out[i], &in[i]); - } - return atsci_trellis_encoder::NCODERS; -} - diff --git a/gr-atsc/lib/atsc_viterbi_decoder.cc b/gr-atsc/lib/atsc_viterbi_decoder.cc deleted file mode 100644 index 7f74bffc3b..0000000000 --- a/gr-atsc/lib/atsc_viterbi_decoder.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gnuradio/atsc/viterbi_decoder.h> -#include <gnuradio/io_signature.h> -#include <gnuradio/atsc/consts.h> -#include <iostream> - -using std::cerr; -using std::endl; - -atsc_viterbi_decoder_sptr -atsc_make_viterbi_decoder() -{ - return gnuradio::get_initial_sptr(new atsc_viterbi_decoder()); -} - -atsc_viterbi_decoder::atsc_viterbi_decoder() - : gr::sync_block("atsc_viterbi_decoder", - gr::io_signature::make(1, 1, sizeof(atsc_soft_data_segment)), - gr::io_signature::make(1, 1, sizeof(atsc_mpeg_packet_rs_encoded))), - last_start(-1) -{ - set_output_multiple(atsci_viterbi_decoder::NCODERS); - reset(); -} - -int -atsc_viterbi_decoder::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const atsc_soft_data_segment *in = (const atsc_soft_data_segment *) input_items[0]; - atsc_mpeg_packet_rs_encoded *out = (atsc_mpeg_packet_rs_encoded *) output_items[0]; - - assert (noutput_items % atsci_viterbi_decoder::NCODERS == 0); - - // find the first mod 12 boundary to begin decoding - int start; - for (start = 0; start < atsci_viterbi_decoder::NCODERS; start++){ - assert (in[start].pli.regular_seg_p ()); - if ((in[start].pli.segno () % atsci_viterbi_decoder::NCODERS) == 0) - break; - } - - if (start == atsci_viterbi_decoder::NCODERS){ - // we didn't find a mod 12 boundary. There's some kind of problem - // upstream of us (not yet sync'd??) - cerr << "!!!atsc_viterbi_decoder: no mod-12 boundary found\7\n"; - start = 0; - } - else if (start != last_start){ - cerr << "atsc_viterbi_decoder: new starting offset = " << start - << endl; - last_start = start; - } - - for (int i = 0; i < atsci_viterbi_decoder::NCODERS; i += atsci_viterbi_decoder::NCODERS){ - d_viterbi_decoder.decode(&out[i], &in[i + start]); - } - return atsci_viterbi_decoder::NCODERS; -} - diff --git a/gr-atsc/lib/atsci_basic_trellis_encoder.cc b/gr-atsc/lib/atsci_basic_trellis_encoder.cc deleted file mode 100644 index 589958220a..0000000000 --- a/gr-atsc/lib/atsci_basic_trellis_encoder.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/basic_trellis_encoder_impl.h> -#include <assert.h> - -const unsigned char atsci_basic_trellis_encoder::next_state[32] = { - 0,1,4,5, - 2,3,6,7, - 1,0,5,4, - 3,2,7,6, - 4,5,0,1, - 6,7,2,3, - 5,4,1,0, - 7,6,3,2 -}; - -const unsigned char atsci_basic_trellis_encoder::out_symbol[32] = { - 0,2,4,6, - 1,3,5,7, - 0,2,4,6, - 1,3,5,7, - 4,6,0,2, - 5,7,1,3, - 4,6,0,2, - 5,7,1,3 -}; - - -/*! - * Encode two bit INPUT into 3 bit return value. Domain is [0,3], - * Range is [0,7]. The mapping to bipolar levels is not done. - */ - -int -atsci_basic_trellis_encoder::encode (unsigned int input) -{ - assert (input < 4); - int index = (state << 2) + input; - state = next_state[index]; - return out_symbol[index]; -} - diff --git a/gr-atsc/lib/atsci_data_interleaver.cc b/gr-atsc/lib/atsci_data_interleaver.cc deleted file mode 100644 index ec270071ad..0000000000 --- a/gr-atsc/lib/atsci_data_interleaver.cc +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/data_interleaver_impl.h> - -void -atsci_data_interleaver::interleave (atsc_mpeg_packet_rs_encoded &out, - const atsc_mpeg_packet_rs_encoded &in) -{ - assert (in.pli.regular_seg_p ()); - plinfo::sanity_check (in.pli); - - out.pli = in.pli; // copy pipeline info - if (in.pli.first_regular_seg_p ()) // reset commutator if required - sync (); - - transform (out.data, in.data, sizeof (in.data)); -} - - -void -atsci_data_deinterleaver::deinterleave (atsc_mpeg_packet_rs_encoded &out, - const atsc_mpeg_packet_rs_encoded &in) -{ - assert (in.pli.regular_seg_p ()); - plinfo::sanity_check (in.pli); - - // reset commutator if required using INPUT pipeline info - if (in.pli.first_regular_seg_p ()) - sync (); - - // remap OUTPUT pipeline info to reflect 52 data segment end-to-end delay - - plinfo::delay (out.pli, in.pli, 52); - - // now do the actual deinterleaving - - for (unsigned int i = 0; i < sizeof (in.data); i++){ - out.data[i] = alignment_fifo.stuff (transform (in.data[i])); - } -} - diff --git a/gr-atsc/lib/atsci_equalizer.cc b/gr-atsc/lib/atsci_equalizer.cc deleted file mode 100644 index 9e58cddfc2..0000000000 --- a/gr-atsc/lib/atsci_equalizer.cc +++ /dev/null @@ -1,248 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/equalizer_impl.h> -#include <algorithm> -#include <iostream> -#include <gnuradio/atsc/types.h> - -using std::cerr; -using std::endl; -using std::min; - - -// total number of symbols (including field sync) / field -static const int SYMBOLS_PER_FIELD = - (ATSC_DSEGS_PER_FIELD + 1) * ATSC_DATA_SEGMENT_LENGTH; - - -atsci_equalizer::atsci_equalizer () -{ - d_locked_p = false; - d_offset_from_last_field_sync = 0; - d_current_field = 0; -} - -atsci_equalizer::~atsci_equalizer () -{ -} - -void -atsci_equalizer::reset () -{ - d_locked_p = false; - d_offset_from_last_field_sync = 0; - d_current_field = 0; -} - -/* - * Errrr.... Define to 1 if compiler handles tail recursion without pushing - * unnecessary stack frames, else define to 0 for lame compilers. - */ -#define WINNING_COMPILER 0 - - -/* - * divide and conquer... - * - * Note that this could be refactored to take advantage of the - * symbol_num that is contained in the input_tags. Then we wouldn't - * have to be counting here. - * - * Today's strategy: get it working. - */ - -void -atsci_equalizer::filter (const float *input_samples, - const atsc::syminfo *input_tags, - float *output_samples, - int nsamples) -{ - lame_compiler_kludge: - - if (!d_locked_p){ - - // look for a field sync - - int i; - for (i = 0; i < nsamples; i++){ - if (atsc::tag_is_start_field_sync (input_tags[i])) - break; - } - - // whether we found one or not, everything up to it should - // be run through the normal path - - if (i != 0) - filter_normal (input_samples, output_samples, i); - - if (i == nsamples) // no field sync found, still not locked. - return; - - // OK, we've just transitioned to the locked state. - - d_locked_p = true; - d_offset_from_last_field_sync = 0; - - // handle locked case recursively - - if (WINNING_COMPILER) - filter (&input_samples[i], &input_tags[i], - &output_samples[i], nsamples - i); - else { - input_samples += i; - input_tags += i; - output_samples += i; - nsamples -= i; - goto lame_compiler_kludge; - } - - return; - } - - // We're in the locked state. - // - // Figure out where we are with respect to a data segment boundary - // and do the right thing. Note that in the interested of performance, - // we don't scan all the tags looking for trouble. We only check - // them where we expect them to be non-NORMAL. Worst case, it'll take - // us a field to notice that something went wrong... - - if (d_offset_from_last_field_sync % SYMBOLS_PER_FIELD == 0){ // we should be looking - // at a field sync - if (atsc::tag_is_start_field_sync_1 (input_tags[0])) - d_current_field = 0; - - else if (atsc::tag_is_start_field_sync_2 (input_tags[0])) - d_current_field = 1; - - else { // we're lost... no field sync where we expected it - - cerr << "!!! atsci_equalizer: expected field sync, didn't find one\n"; - - d_locked_p = false; - d_offset_from_last_field_sync = 0; - - if (WINNING_COMPILER) - filter (input_samples, input_tags, output_samples, nsamples); - else - goto lame_compiler_kludge; - - return; - } - - // OK, everything's cool. We're looking at a field sync. - - int n = min (ATSC_DATA_SEGMENT_LENGTH, nsamples); - - filter_field_sync (input_samples, output_samples, n, 0, d_current_field); - - d_offset_from_last_field_sync = n; - nsamples -= n; - - if (nsamples > 0){ - if (WINNING_COMPILER) - filter (&input_samples[n], &input_tags[n], - &output_samples[n], nsamples); - else { - input_samples += n; - input_tags += n; - output_samples += n; - goto lame_compiler_kludge; - } - } - return; - } - - if (d_offset_from_last_field_sync < ATSC_DATA_SEGMENT_LENGTH){ // we're in the middle of a field sync - int n = min (ATSC_DATA_SEGMENT_LENGTH - d_offset_from_last_field_sync, nsamples); - - filter_field_sync (input_samples, output_samples, n, - d_offset_from_last_field_sync, d_current_field); - - d_offset_from_last_field_sync += n; - nsamples -= n; - - if (nsamples > 0){ - if (WINNING_COMPILER) - filter (&input_samples[n], &input_tags[n], - &output_samples[n], nsamples); - else { - input_samples += n; - input_tags += n; - output_samples += n; - goto lame_compiler_kludge; - } - } - return; - } - - // OK, we're not in a field sync. We're either in a data segment sync or in the clear... - - int seg_offset = d_offset_from_last_field_sync % ATSC_DATA_SEGMENT_LENGTH; - - assert (seg_offset >= 0); - - if (seg_offset < 4){ // somewhere in a data seg sync. - int n = min (4 - seg_offset, nsamples); - - filter_data_seg_sync (input_samples, output_samples, n, seg_offset); - - d_offset_from_last_field_sync += n; - nsamples -= n; - - if (nsamples > 0){ - if (WINNING_COMPILER) - filter (&input_samples[n], &input_tags[n], - &output_samples[n], nsamples); - else { - input_samples += n; - input_tags += n; - output_samples += n; - goto lame_compiler_kludge; - } - } - return; - } - - // otherwise... we're in the normal zone - - int n = min (ATSC_DATA_SEGMENT_LENGTH - seg_offset, nsamples); - - filter_normal (input_samples, output_samples, n); - - d_offset_from_last_field_sync += n; - nsamples -= n; - - if (nsamples <= 0) - return; - - if (WINNING_COMPILER) - filter (&input_samples[n], &input_tags[n], - &output_samples[n], nsamples); - else { - input_samples += n; - input_tags += n; - output_samples += n; - goto lame_compiler_kludge; - } -} diff --git a/gr-atsc/lib/atsci_equalizer_lms.cc b/gr-atsc/lib/atsci_equalizer_lms.cc deleted file mode 100644 index 5c09893b5b..0000000000 --- a/gr-atsc/lib/atsci_equalizer_lms.cc +++ /dev/null @@ -1,308 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/equalizer_lms_impl.h> -#include <assert.h> -#include <algorithm> -#include <gnuradio/atsc/pnXXX_impl.h> - -#include <stdio.h> - -using std::min; -using std::max; - -static const int NTAPS = 256; -static const int NPRETAPS = (int) (NTAPS * 0.8); // probably should be either .2 or .8 - - -// the length of the field sync pattern that we know unequivocally -static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; - -// static const float *get_data_seg_sync_training_sequence (int offset); -static int get_field_sync_training_sequence_length (int offset); -static const float *get_field_sync_training_sequence (int which_field, int offset); - - -atsci_equalizer_lms::atsci_equalizer_lms () : d_taps (NTAPS) -{ - for (int i = 0; i < NTAPS; i++) { - d_taps[i] = 0.0; - } - trainingfile=fopen("taps.txt","w"); -} - -atsci_equalizer_lms::~atsci_equalizer_lms () -{ - fclose(trainingfile); -} - -void -atsci_equalizer_lms::reset () -{ - atsci_equalizer::reset (); // invoke superclass - - for (int i = 0; i < NTAPS; i++) { - d_taps[i] = 0.0; - } -} - -int -atsci_equalizer_lms::ntaps () const -{ - return NTAPS; -} - -int -atsci_equalizer_lms::npretaps () const -{ - return NPRETAPS; -} - -/*! - * Input range is known NOT TO CONTAIN data segment syncs - * or field syncs. This should be the fast path. In the - * non decicion directed case, this just runs the input - * through the filter without adapting it. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms::filter_normal (const float *input_samples, - float *output_samples, - int nsamples) -{ - // handle data - filterN (input_samples, output_samples, nsamples); -} - - -/*! - * Input range is known to consist of only a data segment sync or a - * portion of a data segment sync. \p nsamples will be in [1,4]. - * \p offset will be in [0,3]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms::filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset) -{ - // handle data - // adaptN (input_samples, get_data_seg_sync_training_sequence (offset), - // output_samples, nsamples); - filterN (input_samples, output_samples, nsamples); - - // cerr << "Seg Sync: offset " << offset << "\tnsamples\t" << nsamples << "\t pre, 5 -5 -5 5\t" << - // output_samples[0] << "\t" << output_samples[1] << "\t" << output_samples[2] << "\t" << output_samples[3] << endl; - -} - - -/*! - * Input range is known to consist of only a field sync segment or a - * portion of a field sync segment. \p nsamples will be in [1,832]. - * \p offset will be in [0,831]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. We consider the - * 4 symbols of the immediately preceding data segment sync to be the - * first symbols of the field sync segment. \p which_field is in [0,1] - * and specifies which field (duh). - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms::filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field) -{ - // Only the first 4 + 511 + 3 * 63 symbols are completely defined. - // Those after that the symbols are bilevel, so we could use decision feedback and use - // that to train, but for now, don't train on them. - - int n = min (nsamples, get_field_sync_training_sequence_length (offset)); - - // handle known training sequence - adaptN (input_samples, get_field_sync_training_sequence (which_field, offset), - output_samples, n); - - // just filter any unknown portion - if (nsamples > n) - filterN (&input_samples[n], &output_samples[n], nsamples - n); - - if (offset == 0 && nsamples > 0){ - for (int i = 0; i < NTAPS; i++) - fprintf(trainingfile,"%f ",d_taps[i]); - - fprintf (trainingfile,"\n"); - } - -} - -// ---------------------------------------------------------------- - -// -// filter a single output -// -float -atsci_equalizer_lms::filter1 (const float input[]) -{ - static const int N_UNROLL = 4; - - float acc0 = 0; - float acc1 = 0; - float acc2 = 0; - float acc3 = 0; - - - unsigned i = 0; - unsigned n = (NTAPS / N_UNROLL) * N_UNROLL; - - for (i = 0; i < n; i += N_UNROLL){ - acc0 += d_taps[i + 0] * input[i + 0]; - acc1 += d_taps[i + 1] * input[i + 1]; - acc2 += d_taps[i + 2] * input[i + 2]; - acc3 += d_taps[i + 3] * input[i + 3]; - } - - for (; i < (unsigned) NTAPS; i++) - acc0 += d_taps[i] * input[i]; - - return (acc0 + acc1 + acc2 + acc3); -} - -// -// filter and adapt a single output -// -float -atsci_equalizer_lms::adapt1 (const float input[], float ideal_output) -{ - static const double BETA = 0.00005; // FIXME figure out what this ought to be - // FIXME add gear-shifting - - double y = filter1 (input); - double e = y - ideal_output; - - // update taps... - for (int i = 0; i < NTAPS; i++){ - d_taps[i] = d_taps[i] - BETA * e * (double)(input[i]); - } - - return y; -} - -void -atsci_equalizer_lms::filterN (const float *input_samples, - float *output_samples, - int nsamples) -{ - for (int i = 0; i < nsamples; i++) - output_samples[i] = filter1 (&input_samples[i]); -} - - -void -atsci_equalizer_lms::adaptN (const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples) -{ - for (int i = 0; i < nsamples; i++) - output_samples[i] = adapt1 (&input_samples[i], training_pattern[i]); -} - -// ---------------------------------------------------------------- - -static float -bin_map (int bit) -{ - return bit ? +5 : -5; -} - -static void -init_field_sync_common (float *p, int mask) - -{ - int i = 0; - - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map (atsc_pn511[j]); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map (atsc_pn63[j] ^ mask); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - assert (i == KNOWN_FIELD_SYNC_LENGTH); -} - -#if 0 -static const float * -get_data_seg_sync_training_sequence (int offset) -{ - static const float training_data[4] = { +5, -5, -5, +5 }; - return &training_data[offset]; -} -#endif - -static int -get_field_sync_training_sequence_length (int offset) -{ - return max (0, KNOWN_FIELD_SYNC_LENGTH - offset); -} - -static const float * -get_field_sync_training_sequence (int which_field, int offset) -{ - static float *field_1 = 0; - static float *field_2 = 0; - - if (field_1 == 0){ - field_1 = new float[KNOWN_FIELD_SYNC_LENGTH]; - field_2 = new float[KNOWN_FIELD_SYNC_LENGTH]; - init_field_sync_common (field_1, 0); - init_field_sync_common (field_2, 1); - } - - if (which_field == 0) - return &field_1[offset]; - else - return &field_2[offset]; -} diff --git a/gr-atsc/lib/atsci_equalizer_lms2.cc b/gr-atsc/lib/atsci_equalizer_lms2.cc deleted file mode 100644 index 73d93e6f60..0000000000 --- a/gr-atsc/lib/atsci_equalizer_lms2.cc +++ /dev/null @@ -1,376 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/equalizer_lms2_impl.h> -#include <assert.h> -#include <algorithm> -#include <gnuradio/atsc/pnXXX_impl.h> -#include <cmath> -#include <stdlib.h> -#include <gnuradio/math.h> -#include <stdio.h> -#include <boost/math/special_functions/fpclassify.hpp> - -using std::min; -using std::max; - -static const int NFFTAPS = 64; -static const int NFBTAPS = 192; - -// the length of the field sync pattern that we know unequivocally -static const int KNOWN_FIELD_SYNC_LENGTH = 4 + 511 + 3 * 63; - -// static const float *get_data_seg_sync_training_sequence (int offset); -static int get_field_sync_training_sequence_length (int offset); -static const float *get_field_sync_training_sequence (int which_field, int offset); - -static inline int -wrap (int d) -{ - assert (d >= 0 && d <= (2 * NFBTAPS)); - - if(d >= NFBTAPS) - return d - NFBTAPS; - return d; -} - -static inline float -slice (float d) -{ - if (boost::math::isnan (d)) - return 0.0; - - if (d >= 0.0){ - if (d >= 4.0){ - if (d >= 6.0) - return 7.0; - else - return 5.0; - } - if (d >= 2.0) - return 3.0; - return 1.0; - } - else - return -slice (-d); -} - -atsci_equalizer_lms2::atsci_equalizer_lms2 () - : d_taps_ff (NFFTAPS), d_taps_fb (NFBTAPS), d_old_output (NFBTAPS) -{ - for (int i = 0; i < NFFTAPS; i++) { - d_taps_ff[i] = 0.0; - } - for (int i = 0; i < NFBTAPS; i++) { - d_taps_fb[i] = 0.0; - d_old_output[i] = 0.0; - } - d_output_ptr = 0; - trainingfile=fopen("taps.txt","w"); -} - -atsci_equalizer_lms2::~atsci_equalizer_lms2 () -{ - fclose(trainingfile); -} - -void -atsci_equalizer_lms2::reset () -{ - atsci_equalizer::reset (); // invoke superclass - for (int i = 0; i < NFFTAPS; i++) { - d_taps_ff[i] = 0.0; - } - for (int i = 0; i < NFBTAPS; i++) { - d_taps_fb[i] = 0.0; - d_old_output[i] = 0.0; - } - d_output_ptr = 0; -} - - -int -atsci_equalizer_lms2::ntaps () const -{ - return NFFTAPS + NFBTAPS; -} - -int -atsci_equalizer_lms2::npretaps () const -{ - return NFFTAPS; -} - -/*! - * Input range is known NOT TO CONTAIN data segment syncs - * or field syncs. This should be the fast path. In the - * non decicion directed case, this just runs the input - * through the filter without adapting it. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms2::filter_normal (const float *input_samples, - float *output_samples, - int nsamples) -{ - // handle data - filterN (input_samples, output_samples, nsamples); -} - - -/*! - * Input range is known to consist of only a data segment sync or a - * portion of a data segment sync. \p nsamples will be in [1,4]. - * \p offset will be in [0,3]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms2::filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset) -{ - // handle data - // adaptN (input_samples, get_data_seg_sync_training_sequence (offset), - // output_samples, nsamples); - filterN (input_samples, output_samples, nsamples); - - // cerr << "Seg Sync: offset " << offset << "\tnsamples\t" << nsamples << "\t pre, 5 -5 -5 5\t" << - // output_samples[0] << "\t" << output_samples[1] << "\t" << output_samples[2] << "\t" << output_samples[3] << endl; - -} - - -/*! - * Input range is known to consist of only a field sync segment or a - * portion of a field sync segment. \p nsamples will be in [1,832]. - * \p offset will be in [0,831]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. We consider the - * 4 symbols of the immediately preceding data segment sync to be the - * first symbols of the field sync segment. \p which_field is in [0,1] - * and specifies which field (duh). - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_lms2::filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field) -{ - // Only the first 4 + 511 + 3 * 63 symbols are completely defined. - // Those after that the symbols are bilevel, so we could use decision feedback and use - // that to train, but for now, don't train on them. - - int n = min (nsamples, get_field_sync_training_sequence_length (offset)); - - // handle known training sequence - adaptN (input_samples, get_field_sync_training_sequence (which_field, offset), - output_samples, n); - - // just filter any unknown portion - if (nsamples > n) - filterN (&input_samples[n], &output_samples[n], nsamples - n); - - if (offset == 0 && nsamples > 0){ - for (int i = 0; i < NFFTAPS; i++) - fprintf(trainingfile,"%f ",d_taps_ff[i]); - for (int i = 0; i < NFBTAPS; i++) - fprintf(trainingfile,"%f ",d_taps_fb[i]); - fprintf (trainingfile,"\n"); - } - -} - -// ---------------------------------------------------------------- - -// -// filter a single output -// -float -atsci_equalizer_lms2::filter1 (const float input[]) -{ - static const int N_UNROLL = 4; - - float acc0 = 0; - float acc1 = 0; - float acc2 = 0; - float acc3 = 0; - float acc = 0; - - - unsigned i = 0; - unsigned n = (NFFTAPS / N_UNROLL) * N_UNROLL; - - for (i = 0; i < n; i += N_UNROLL){ - acc0 += d_taps_ff[i + 0] * input[i + 0]; - acc1 += d_taps_ff[i + 1] * input[i + 1]; - acc2 += d_taps_ff[i + 2] * input[i + 2]; - acc3 += d_taps_ff[i + 3] * input[i + 3]; - } - - for (; i < (unsigned) NFFTAPS; i++) - acc0 += d_taps_ff[i] * input[i]; - - acc = (acc0 + acc1 + acc2 + acc3); - - d_output_ptr = wrap (d_output_ptr + 1); - - for (int i = 0; i < NFBTAPS; i++) { - acc -= d_taps_fb[i] * d_old_output[wrap(i + d_output_ptr)]; - } - - if (boost::math::isnan (acc)){ - abort (); - } - - d_old_output[d_output_ptr] = slice (acc); - return acc; -} - -// -// filter and adapt a single output -// -float kludge () -{ - return 0.0; -} - -float -atsci_equalizer_lms2::adapt1 (const float input[], float ideal_output) -{ - static const double BETA = 0.00005; // FIXME figure out what this ought to be - // FIXME add gear-shifting - - double y = filter1 (input); - double e = y - ideal_output; - - // update taps... - for (int i = 0; i < NFFTAPS; i++){ - d_taps_ff[i] = d_taps_ff[i] - BETA * e * (double)(input[i]); - } - - for (int i = 0; i < NFBTAPS; i++){ - // d_taps_fb[i] = d_taps_fb[i] - BETA * e * (double)d_old_output[wrap(i+d_output_ptr)]; - d_taps_fb[i] = d_taps_fb[i] - kludge() * e * (double)d_old_output[wrap(i+d_output_ptr)]; - } - - return y; -} - -void -atsci_equalizer_lms2::filterN (const float *input_samples, - float *output_samples, - int nsamples) -{ - for (int i = 0; i < nsamples; i++) - output_samples[i] = filter1 (&input_samples[i]); -} - - -void -atsci_equalizer_lms2::adaptN (const float *input_samples, - const float *training_pattern, - float *output_samples, - int nsamples) -{ - for (int i = 0; i < nsamples; i++) - output_samples[i] = adapt1 (&input_samples[i], training_pattern[i]); -} - -// ---------------------------------------------------------------- - -static float -bin_map (int bit) -{ - return bit ? +5 : -5; -} - -static void -init_field_sync_common (float *p, int mask) - -{ - int i = 0; - - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map (atsc_pn511[j]); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map (atsc_pn63[j] ^ mask); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - assert (i == KNOWN_FIELD_SYNC_LENGTH); -} - -#if 0 -static const float * -get_data_seg_sync_training_sequence (int offset) -{ - static const float training_data[4] = { +5, -5, -5, +5 }; - return &training_data[offset]; -} -#endif - -static int -get_field_sync_training_sequence_length (int offset) -{ - return max (0, KNOWN_FIELD_SYNC_LENGTH - offset); -} - -static const float * -get_field_sync_training_sequence (int which_field, int offset) -{ - static float *field_1 = 0; - static float *field_2 = 0; - - if (field_1 == 0){ - field_1 = new float[KNOWN_FIELD_SYNC_LENGTH]; - field_2 = new float[KNOWN_FIELD_SYNC_LENGTH]; - init_field_sync_common (field_1, 0); - init_field_sync_common (field_2, 1); - } - - if (which_field == 0) - return &field_1[offset]; - else - return &field_2[offset]; -} diff --git a/gr-atsc/lib/atsci_equalizer_nop.cc b/gr-atsc/lib/atsci_equalizer_nop.cc deleted file mode 100644 index 39cf2ea1f6..0000000000 --- a/gr-atsc/lib/atsci_equalizer_nop.cc +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/equalizer_nop_impl.h> -#include <gnuradio/atsc/sync_tag_impl.h> -#include <assert.h> - -atsci_equalizer_nop::atsci_equalizer_nop () -{ -} - -atsci_equalizer_nop::~atsci_equalizer_nop () -{ -} - -void -atsci_equalizer_nop::reset () -{ - atsci_equalizer::reset (); // invoke superclass -} - -int -atsci_equalizer_nop::ntaps () const -{ - return 1; -} - -int -atsci_equalizer_nop::npretaps () const -{ - return 0; -} - -/*! - * Input range is known NOT TO CONTAIN data segment syncs - * or field syncs. This should be the fast path. In the - * non decicion directed case, this just runs the input - * through the filter without adapting it. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_nop::filter_normal (const float *input_samples, - float *output_samples, - int nsamples) -{ - for (int i = 0; i < nsamples; i++){ - output_samples[i] = scale (input_samples[i]); - } -} - - -/*! - * Input range is known to consist of only a data segment sync or a - * portion of a data segment sync. \p nsamples will be in [1,4]. - * \p offset will be in [0,3]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_nop::filter_data_seg_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset) -{ - for (int i = 0; i < nsamples; i++){ - output_samples[i] = scale_and_train (input_samples[i]); - } -} - - -/*! - * Input range is known to consist of only a field sync segment or a - * portion of a field sync segment. \p nsamples will be in [1,832]. - * \p offset will be in [0,831]. \p offset is the offset of the input - * from the beginning of the data segment sync pattern. We consider the - * 4 symbols of the immediately preceding data segment sync to be the - * first symbols of the field sync segment. \p which_field is in [0,1] - * and specifies which field (duh). - * - * \p input_samples has (nsamples + ntaps() - 1) valid entries. - * input_samples[0] .. input_samples[nsamples - 1 + ntaps() - 1] may be - * referenced to compute the output values. - */ -void -atsci_equalizer_nop::filter_field_sync (const float *input_samples, - float *output_samples, - int nsamples, - int offset, - int which_field) -{ - int i = 0; - - if (offset == 0 && nsamples > 0){ - output_samples[0] = scale_and_train (input_samples[0]); - i++; - } - - for (; i < nsamples; i++){ - output_samples[i] = scale_and_train (input_samples[i]); - } -} - - -float -atsci_equalizer_nop::scale_and_train (float input) -{ - return input; -} diff --git a/gr-atsc/lib/atsci_exp2_lp.cc b/gr-atsc/lib/atsci_exp2_lp.cc deleted file mode 100644 index ae12db02c2..0000000000 --- a/gr-atsc/lib/atsci_exp2_lp.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <atsc_consts.h> -#include <gnuradio/atsc/exp2_lp_impl.h> -#include <stdexcept> -#include <cmath> -#include <iostream> - -using std::vector; -using std::cerr; -using std::endl; - -/* - * FILTER SPECIFICATION FILE - * FILTER TYPE:LOW PASS 1H - * PASSBAND RIPPLE IN -dB -.0100 - * STOPBAND RIPPLE IN -dB -66.0000 - * PASSBAND CUTOFF FREQUENCY 5.69000 HERTZ - * STOPBAND CUTOFF FREQUENCY 6.12000 HERTZ - * SAMPLING FREQUENCY 21.5200 HERTZ - */ -static const float atsci_exp2_lp2x[] = { -#include "atsci_exp2_lp2x.dat" -}; - -/* - * FILTER SPECIFICATION FILE - * FILTER TYPE:LOW PASS 1H - * PASSBAND RIPPLE IN -dB -.0100 - * STOPBAND RIPPLE IN -dB -66.0000 - * PASSBAND CUTOFF FREQUENCY 5.69000 HERTZ - * STOPBAND CUTOFF FREQUENCY 6.12000 HERTZ - * SAMPLING FREQUENCY 20.0000 HERTZ - */ -static const float atsci_exp2_lp20[] = { -#include "atsci_exp2_lp20.dat" -}; - - -#define NELEM(x) (sizeof (x) / sizeof ((x)[0])) - -// is A within 5% of TARGET? - -static bool -close_enough_p (double a, double target) -{ - double delta = fabs (target * 0.05); // 5 percent - - return fabs (target - a) <= delta; -} - -vector<float> -atsci_exp2_lp::taps (double sampling_freq) -{ - if (close_enough_p (sampling_freq, 20e6)){ - return vector<float>(&atsci_exp2_lp20[0], &atsci_exp2_lp20[NELEM(atsci_exp2_lp20)]); - } - if (close_enough_p (sampling_freq, 2 * ATSC_SYMBOL_RATE)){ - return vector<float>(&atsci_exp2_lp2x[0], &atsci_exp2_lp2x[NELEM(atsci_exp2_lp2x)]); - } - else - throw std::out_of_range ( - "atsci_exp2_lp: no pre-designed filter close enough"); -} diff --git a/gr-atsc/lib/atsci_exp2_lp20.dat b/gr-atsc/lib/atsci_exp2_lp20.dat deleted file mode 100644 index d09c5aca26..0000000000 --- a/gr-atsc/lib/atsci_exp2_lp20.dat +++ /dev/null @@ -1,178 +0,0 @@ -/* - * FILTER SPECIFICATION FILE - * FILTER TYPE:LOW PASS 1H - * PASSBAND RIPPLE IN -dB -.0100 - * STOPBAND RIPPLE IN -dB -66.0000 - * PASSBAND CUTOFF FREQUENCY 5.69000 HERTZ - * STOPBAND CUTOFF FREQUENCY 6.12000 HERTZ - * SAMPLING FREQUENCY 20.0000 HERTZ - */ - -.3137849271297455e-03, - -.6755953654646874e-04, - .2326252870261669e-03, - -.1614624634385109e-03, - -.1158984377980232e-03, - .2114051021635532e-03, - .6828224286437035e-04, - -.3522797487676144e-03, - .1759170554578304e-03, - .2849949523806572e-03, - -.3568925894796848e-03, - -.1521380618214607e-03, - .5445396527647972e-03, - -.1707794144749641e-03, - -.5257474258542061e-03, - .5062967538833618e-03, - .3262492828071117e-03, - -.8037807419896126e-03, - .1136297360062599e-03, - .8607362397015095e-03, - -.6433278322219849e-03, - -.6174184381961823e-03, - .1120670232921839e-02, - .3442214801907539e-04, - -.1305819023400545e-02, - .7387576624751091e-03, - .1056550536304712e-02, - -.1477979123592377e-02, - -.3192713484168053e-03, - .1870564185082912e-02, - -.7502869702875614e-03, - -.1675266306847334e-02, - .1847642473876476e-02, - .7931739091873169e-03, - -.2555002458393574e-02, - .6227688863873482e-03, - .2505954820662737e-02, - -.2186967991292477e-02, - -.1515555195510387e-02, - .3349546808749437e-02, - -.2860687673091888e-03, - -.3578922711312771e-02, - .2438103780150414e-02, - .2555412705987692e-02, - -.4232846200466156e-02, - -.3483905456960201e-03, - .4926202818751335e-02, - -.2523601986467838e-02, - -.3997647203505039e-02, - .5173782818019390e-02, - .1395780127495527e-02, - -.6588382180780172e-02, - .2339247148483992e-02, - .5959283560514450e-02, - -.6131949834525585e-02, - -.3020572476089001e-02, - .8632841985672712e-02, - -.1736589241772890e-02, - -.8627892937511206e-02, - .7060498464852572e-02, - .5489445291459560e-02, - -.1119629153981805e-01, - .4754690453410149e-03, - .1235919492319226e-01, - -.7909852080047131e-02, - -.9316097479313612e-02, - .1459939032793045e-01, - .1910720951855183e-02, - -.1796151325106621e-01, - .8631225209683180e-02, - .1572139468044043e-01, - -.1972115319222212e-01, - -.6601144559681416e-02, - .2775513892993331e-01, - -.9181375615298748e-02, - -.2863558568060398e-01, - .2976502152159810e-01, - .1806837785989046e-01, - -.5192282795906067e-01, - .9526194538921118e-02, - .7172224065288901e-01, - -.6965141417458654e-01, - -.8541030902415514e-01, - .3052920936606824e+00, - .5900069065392017e+00, - .3052920936606824e+00, - -.8541030902415514e-01, - -.6965141417458654e-01, - .7172224065288901e-01, - .9526194538921118e-02, - -.5192282795906067e-01, - .1806837785989046e-01, - .2976502152159810e-01, - -.2863558568060398e-01, - -.9181375615298748e-02, - .2775513892993331e-01, - -.6601144559681416e-02, - -.1972115319222212e-01, - .1572139468044043e-01, - .8631225209683180e-02, - -.1796151325106621e-01, - .1910720951855183e-02, - .1459939032793045e-01, - -.9316097479313612e-02, - -.7909852080047131e-02, - .1235919492319226e-01, - .4754690453410149e-03, - -.1119629153981805e-01, - .5489445291459560e-02, - .7060498464852572e-02, - -.8627892937511206e-02, - -.1736589241772890e-02, - .8632841985672712e-02, - -.3020572476089001e-02, - -.6131949834525585e-02, - .5959283560514450e-02, - .2339247148483992e-02, - -.6588382180780172e-02, - .1395780127495527e-02, - .5173782818019390e-02, - -.3997647203505039e-02, - -.2523601986467838e-02, - .4926202818751335e-02, - -.3483905456960201e-03, - -.4232846200466156e-02, - .2555412705987692e-02, - .2438103780150414e-02, - -.3578922711312771e-02, - -.2860687673091888e-03, - .3349546808749437e-02, - -.1515555195510387e-02, - -.2186967991292477e-02, - .2505954820662737e-02, - .6227688863873482e-03, - -.2555002458393574e-02, - .7931739091873169e-03, - .1847642473876476e-02, - -.1675266306847334e-02, - -.7502869702875614e-03, - .1870564185082912e-02, - -.3192713484168053e-03, - -.1477979123592377e-02, - .1056550536304712e-02, - .7387576624751091e-03, - -.1305819023400545e-02, - .3442214801907539e-04, - .1120670232921839e-02, - -.6174184381961823e-03, - -.6433278322219849e-03, - .8607362397015095e-03, - .1136297360062599e-03, - -.8037807419896126e-03, - .3262492828071117e-03, - .5062967538833618e-03, - -.5257474258542061e-03, - -.1707794144749641e-03, - .5445396527647972e-03, - -.1521380618214607e-03, - -.3568925894796848e-03, - .2849949523806572e-03, - .1759170554578304e-03, - -.3522797487676144e-03, - .6828224286437035e-04, - .2114051021635532e-03, - -.1158984377980232e-03, - -.1614624634385109e-03, - .2326252870261669e-03, - -.6755953654646874e-04, - -.3137849271297455e-03 diff --git a/gr-atsc/lib/atsci_exp2_lp2x.dat b/gr-atsc/lib/atsci_exp2_lp2x.dat deleted file mode 100644 index 67dd204cb4..0000000000 --- a/gr-atsc/lib/atsci_exp2_lp2x.dat +++ /dev/null @@ -1,196 +0,0 @@ -/* - * FILTER SPECIFICATION FILE - * FILTER TYPE:LOW PASS 1H - * PASSBAND RIPPLE IN -dB -.0100 - * STOPBAND RIPPLE IN -dB -66.0000 - * PASSBAND CUTOFF FREQUENCY 5.69000 HERTZ - * STOPBAND CUTOFF FREQUENCY 6.12000 HERTZ - * SAMPLING FREQUENCY 21.5200 HERTZ - */ - -/* - * probably total overkill... -*/ - -.8815620094537735E-04, - -.3356961533427239E-03, - .1227599568665028E-03, - .1281457953155041E-03, - -.1479196362197399E-03, - -.1201131381094456E-03, - .2271742559969425E-03, - .6969040259718895E-04, - -.3000237047672272E-03, - .1565506681799889E-04, - .3562141209840775E-03, - -.1368308439850807E-03, - -.3795824013650417E-03, - .2876669168472290E-03, - .3540110774338245E-03, - -.4550744779407978E-03, - -.2659554593265057E-03, - .6190738640725613E-03, - .1072990708053112E-03, - -.7539116777479649E-03, - .1217066310346127E-03, - .8306214585900307E-03, - -.4104166291654110E-03, - -.8203103207051754E-03, - .7365280762314796E-03, - .6983750499784946E-03, - -.1066216267645359E-02, - -.4491899162530899E-03, - .1356074586510658E-02, - .7050111889839172E-04, - -.1556793693453074E-02, - .4230584017932415E-03, - .1618413720279932E-02, - -.9978362359106541E-03, - -.1497142482548952E-02, - .1601643394678831E-02, - .1162088476121426E-02, - -.2165937330573797E-02, - -.6025419570505619E-03, - .2611500211060047E-02, - -.1667905598878861E-03, - -.2855417784303427E-02, - .1101639121770859E-02, - .2821092493832111E-02, - -.2127973828464747E-02, - -.2448682673275471E-02, - .3145063761621714E-02, - .1706911250948906E-02, - -.4030079115182161E-02, - -.5993186496198177E-03, - .4651836119592190E-02, - -.8259965106844902E-03, - -.4880243912339211E-02, - .2475241199135780E-02, - .4603198729455471E-02, - -.4209769889712334E-02, - -.3741886932402849E-02, - .5853117443621159E-02, - .2264967188239098E-02, - -.7202429696917534E-02, - -.2001645043492317E-03, - .8043776731938124E-02, - -.2357403747737408E-02, - -.8171265944838524E-02, - .5242727231234312E-02, - .7407441269606352E-02, - -.8224328979849815E-02, - -.5622585304081440E-02, - .1101253507658839E-01, - .2751644235104322E-02, - -.1327139046043158E-01, - .1191724557429552E-02, - .1463502133265138E-01, - -.6110311951488257E-02, - -.1471871789544821E-01, - .1182264182716608E-01, - .1312375022098422E-01, - -.1807126961648464E-01, - -.9420783724635840E-02, - .2453883877024055E-01, - .3084233496338129E-02, - -.3086851537227631E-01, - .6689148955047131E-02, - .3669126378372312E-01, - -.2150753932073712E-01, - -.4165294021368027E-01, - .4559329804033041E-01, - .4544338863343000E-01, - -.9483475470915437E-01, - -.4782041534781456E-01, - .3143207929097116E+00, - .5483355415053666E+00, - .3143207929097116E+00, - -.4782041534781456E-01, - -.9483475470915437E-01, - .4544338863343000E-01, - .4559329804033041E-01, - -.4165294021368027E-01, - -.2150753932073712E-01, - .3669126378372312E-01, - .6689148955047131E-02, - -.3086851537227631E-01, - .3084233496338129E-02, - .2453883877024055E-01, - -.9420783724635840E-02, - -.1807126961648464E-01, - .1312375022098422E-01, - .1182264182716608E-01, - -.1471871789544821E-01, - -.6110311951488257E-02, - .1463502133265138E-01, - .1191724557429552E-02, - -.1327139046043158E-01, - .2751644235104322E-02, - .1101253507658839E-01, - -.5622585304081440E-02, - -.8224328979849815E-02, - .7407441269606352E-02, - .5242727231234312E-02, - -.8171265944838524E-02, - -.2357403747737408E-02, - .8043776731938124E-02, - -.2001645043492317E-03, - -.7202429696917534E-02, - .2264967188239098E-02, - .5853117443621159E-02, - -.3741886932402849E-02, - -.4209769889712334E-02, - .4603198729455471E-02, - .2475241199135780E-02, - -.4880243912339211E-02, - -.8259965106844902E-03, - .4651836119592190E-02, - -.5993186496198177E-03, - -.4030079115182161E-02, - .1706911250948906E-02, - .3145063761621714E-02, - -.2448682673275471E-02, - -.2127973828464747E-02, - .2821092493832111E-02, - .1101639121770859E-02, - -.2855417784303427E-02, - -.1667905598878861E-03, - .2611500211060047E-02, - -.6025419570505619E-03, - -.2165937330573797E-02, - .1162088476121426E-02, - .1601643394678831E-02, - -.1497142482548952E-02, - -.9978362359106541E-03, - .1618413720279932E-02, - .4230584017932415E-03, - -.1556793693453074E-02, - .7050111889839172E-04, - .1356074586510658E-02, - -.4491899162530899E-03, - -.1066216267645359E-02, - .6983750499784946E-03, - .7365280762314796E-03, - -.8203103207051754E-03, - -.4104166291654110E-03, - .8306214585900307E-03, - .1217066310346127E-03, - -.7539116777479649E-03, - .1072990708053112E-03, - .6190738640725613E-03, - -.2659554593265057E-03, - -.4550744779407978E-03, - .3540110774338245E-03, - .2876669168472290E-03, - -.3795824013650417E-03, - -.1368308439850807E-03, - .3562141209840775E-03, - .1565506681799889E-04, - -.3000237047672272E-03, - .6969040259718895E-04, - .2271742559969425E-03, - -.1201131381094456E-03, - -.1479196362197399E-03, - .1281457953155041E-03, - .1227599568665028E-03, - -.3356961533427239E-03, - -.8815620094537735E-04 diff --git a/gr-atsc/lib/atsci_fake_single_viterbi.cc b/gr-atsc/lib/atsci_fake_single_viterbi.cc deleted file mode 100644 index 54df24687c..0000000000 --- a/gr-atsc/lib/atsci_fake_single_viterbi.cc +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <math.h> -#include <gnuradio/atsc/fake_single_viterbi_impl.h> -#include <iostream> -#include <algorithm> - -void -atsci_fake_single_viterbi::reset() -{ - post_coder_state = 0; -} - -atsci_fake_single_viterbi::atsci_fake_single_viterbi() -{ - reset(); -} - -/* - * implement simple slicer and post coder - */ -char -atsci_fake_single_viterbi::decode (float input) -{ - int y2, y1; - - if (input < -4){ - y2 = 0; - y1 = 0; - } - else if (input < 0){ - y2 = 0; - y1 = 1; - } - else if (input < 4){ - y2 = 1; - y1 = 0; - } - else { - y2 = 1; - y1 = 1; - } - - int x1 = y1; - int x2 = y2 ^ post_coder_state; - post_coder_state = y2; - - return (x2 << 1) | x1; -} diff --git a/gr-atsc/lib/atsci_fs_checker.cc b/gr-atsc/lib/atsci_fs_checker.cc deleted file mode 100644 index 064edb2f77..0000000000 --- a/gr-atsc/lib/atsci_fs_checker.cc +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/fs_checker_impl.h> - -// empty constructor -atsci_fs_checker::atsci_fs_checker () -{ -} - -// empty virtual destructor -atsci_fs_checker::~atsci_fs_checker () -{ -} diff --git a/gr-atsc/lib/atsci_fs_checker_naive.cc b/gr-atsc/lib/atsci_fs_checker_naive.cc deleted file mode 100644 index 96ec09ad1b..0000000000 --- a/gr-atsc/lib/atsci_fs_checker_naive.cc +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/fs_checker_naive_impl.h> -#include <gnuradio/atsc/syminfo_impl.h> -#include <gnuradio/atsc/pnXXX_impl.h> -#include <iostream> -#include <cstring> - -using std::cerr; -using std::endl; - -static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong -static const int PN63_ERROR_LIMIT = 5; - -unsigned char atsci_fs_checker_naive::s_511[LENGTH_511]; -unsigned char atsci_fs_checker_naive::s_63[LENGTH_2ND_63]; - -static void -init_s_511 (unsigned char *p) -{ - *p++ = 1; // data segment sync pattern - *p++ = 0; - *p++ = 0; - *p++ = 1; - - for (int i = 0; i < 511; i++){ - p[i] = atsc_pn511[i]; - } -} - -static void -init_s_63 (unsigned char *p) -{ - for (int i = 0; i < 63; i++){ - p[i] = atsc_pn63[i]; - } -} - -atsci_fs_checker_naive::atsci_fs_checker_naive () -{ - init_s_511 (s_511); - init_s_63 (s_63); - reset (); -} - -atsci_fs_checker_naive::~atsci_fs_checker_naive () -{ -} - -void -atsci_fs_checker_naive::reset () -{ - d_index = 0; - memset (d_sample_sr, 0, sizeof (d_sample_sr)); - memset (d_tag_sr, 0, sizeof (d_tag_sr)); - memset (d_bit_sr, 0, sizeof (d_bit_sr)); - d_field_num = 0; - d_segment_num = 0; -} - -void -atsci_fs_checker_naive::filter (float input_sample, atsc::syminfo input_tag, - float *output_sample, atsc::syminfo *output_tag) -{ - atsc::syminfo proto_tag = d_tag_sr[d_index]; // oldest tag in the queue - - if (proto_tag.symbol_num == 0){ // check for field sync pattern - - d_segment_num = (d_segment_num + 1) & atsc::SI_SEGMENT_NUM_MASK; // increment - - // check for a hit on the PN 511 pattern - int errors = 0; - int start = wrap (d_index + OFFSET_511); - - for (int i = 0; i < LENGTH_511 && errors < PN511_ERROR_LIMIT; i++) - errors += d_bit_sr[wrap (start + i)] ^ s_511[i]; - - if (errors < PN511_ERROR_LIMIT){ // 511 pattern is good. - // determine if this is field 1 or field 2 - errors = 0; - start = wrap (d_index + OFFSET_2ND_63); - for (int i = 0; i < LENGTH_2ND_63; i++) - errors += d_bit_sr[wrap (start + i)] ^ s_63[i]; - - // we should have either field 1 (== PN63) or field 2 (== ~PN63) - - if (errors <= PN63_ERROR_LIMIT){ - d_segment_num = atsc::SI_FIELD_SYNC_SEGMENT_NUM; // this is FIELD_SYNC_1 - d_field_num = 0; - } - else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)){ - d_segment_num = atsc::SI_FIELD_SYNC_SEGMENT_NUM; // this is FIELD_SYNC_2 - d_field_num = 1; - } - else { - // should be extremely rare. - cerr << "!!! atsci_fs_checker_naive: PN63 error count = " << errors << endl; - } - } - } - - proto_tag.segment_num = d_segment_num; // fill in segment number and field number - proto_tag.field_num = d_field_num; - - // return oldest sample - *output_sample = d_sample_sr[d_index]; - *output_tag = proto_tag; - - // overwrite with newest sample; - d_sample_sr[d_index] = input_sample; - d_bit_sr[d_index] = input_sample < 0 ? 0 : 1; - d_tag_sr[d_index] = input_tag; - d_index = incr (d_index); -} - -int -atsci_fs_checker_naive::delay () const -{ - return SRSIZE; -} diff --git a/gr-atsc/lib/atsci_fs_correlator.cc b/gr-atsc/lib/atsci_fs_correlator.cc deleted file mode 100644 index bc6db0de32..0000000000 --- a/gr-atsc/lib/atsci_fs_correlator.cc +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/fs_correlator_impl.h> - -// empty constructor -atsci_fs_correlator::atsci_fs_correlator () -{ -} - -// empty virtual destructor -atsci_fs_correlator::~atsci_fs_correlator () -{ -} diff --git a/gr-atsc/lib/atsci_fs_correlator_naive.cc b/gr-atsc/lib/atsci_fs_correlator_naive.cc deleted file mode 100644 index 1458dc8527..0000000000 --- a/gr-atsc/lib/atsci_fs_correlator_naive.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/fs_correlator_naive_impl.h> -#include <gnuradio/atsc/sync_tag_impl.h> -#include <gnuradio/atsc/pnXXX_impl.h> -#include <iostream> -#include <cstring> - -using std::cerr; -using std::endl; - -static const int PN511_ERROR_LIMIT = 20; // max number of bits wrong -static const int PN63_ERROR_LIMIT = 5; - -unsigned char atsci_fs_correlator_naive::s_511[LENGTH_511]; -unsigned char atsci_fs_correlator_naive::s_63[LENGTH_2ND_63]; - -static void -init_s_511 (unsigned char *p) -{ - *p++ = 1; // data segment sync pattern - *p++ = 0; - *p++ = 0; - *p++ = 1; - - for (int i = 0; i < 511; i++){ - p[i] = atsc_pn511[i]; - } -} - -static void -init_s_63 (unsigned char *p) -{ - for (int i = 0; i < 63; i++){ - p[i] = atsc_pn63[i]; - } -} - -atsci_fs_correlator_naive::atsci_fs_correlator_naive () -{ - init_s_511 (s_511); - init_s_63 (s_63); - reset (); -} - -atsci_fs_correlator_naive::~atsci_fs_correlator_naive () -{ -} - -void -atsci_fs_correlator_naive::reset () -{ - d_index = 0; - memset (d_sample_sr, 0, sizeof (d_sample_sr)); - memset (d_bit_sr, 0, sizeof (d_bit_sr)); -} - -void -atsci_fs_correlator_naive::filter (float input_sample, - float *output_sample, float *output_tag) -{ - // check for a hit on the PN 511 pattern - int errors = 0; - int start = wrap (d_index + OFFSET_511); - - for (int i = 0; i < LENGTH_511 && errors < PN511_ERROR_LIMIT; i++) - errors += d_bit_sr[wrap (start + i)] ^ s_511[i]; - - if (errors >= PN511_ERROR_LIMIT) - *output_tag = atsc_sync_tag::NORMAL; - - else { // 511 pattern is good. determine if this is field 1 or field 2 - errors = 0; - start = wrap (d_index + OFFSET_2ND_63); - for (int i = 0; i < LENGTH_2ND_63; i++) - errors += d_bit_sr[wrap (start + i)] ^ s_63[i]; - - // we should have either field 1 (== PN63) or field 2 (== ~PN63) - if (errors <= PN63_ERROR_LIMIT) - *output_tag = atsc_sync_tag::START_FIELD_SYNC_1; - - else if (errors >= (LENGTH_2ND_63 - PN63_ERROR_LIMIT)) - *output_tag = atsc_sync_tag::START_FIELD_SYNC_2; - - else { - // should be extremely rare. - cerr << "!!! atsci_fs_correlator_naive: PN63 error count = " << errors << endl; - *output_tag = atsc_sync_tag::NORMAL; - } - } - - // return oldest sample - *output_sample = d_sample_sr[d_index]; - - // overwrite with newest sample; - d_sample_sr[d_index] = input_sample; - d_bit_sr[d_index] = input_sample < 0 ? 0 : 1; - d_index = incr (d_index); -} - -int -atsci_fs_correlator_naive::delay () const -{ - return SRSIZE; -} diff --git a/gr-atsc/lib/atsci_pnXXX.cc b/gr-atsc/lib/atsci_pnXXX.cc deleted file mode 100644 index 250d487c71..0000000000 --- a/gr-atsc/lib/atsci_pnXXX.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/pnXXX_impl.h> - -const unsigned char atsc_pn511[511] = { - 0,0,0,0, 0,0,0,1, 0,1,1,1, 1,1,1,1, 1,1,0,0, 1,0,1,0, 1,0,1,0, 1,1,1,0, - 0,1,1,0, 0,1,1,0, 1,0,0,0, 1,0,0,0, 1,0,0,1, 1,1,1,0, 0,0,0,1, 1,1,0,1, - - 0,1,1,1, 1,1,0,1, 0,0,1,1, 0,1,0,1, 0,0,1,1, 1,0,1,1, 0,0,1,1, 1,0,1,0, - 0,1,0,0, 0,1,0,1, 1,0,0,0, 1,1,1,1, 0,0,1,0, 0,0,0,1, 0,1,0,0, 0,1,1,1, - - 1,1,0,0, 1,1,1,1, 0,1,0,1, 0,0,0,1, 0,1,0,0, 1,1,0,0, 0,0,1,1, 0,0,0,1, - 0,0,0,0, 0,1,0,0, 0,0,1,1, 1,1,1,1, 0,0,0,0, 0,1,0,1, 0,1,0,0, 0,0,0,0, - - 1,1,0,0, 1,1,1,1, 1,1,1,0, 1,1,1,0, 1,0,1,0, 1,0,0,1, 0,1,1,0, 0,1,1,0, - 0,0,1,1, 0,1,1,1, 0,1,1,1, 1,0,1,1, 0,1,0,0, 1,0,1,0, 0,1,0,0, 1,1,1,0, - - 0,1,1,1, 0,0,0,1, 0,1,1,1, 0,1,0,0, 0,0,1,1, 0,1,0,0, 1,1,1,1, 1,0,1,1, - 0,0,0,1, 0,1,0,1, 1,0,1,1, 1,1,0,0, 1,1,0,1, 1,0,1,0, 1,1,1,0, 1,1,0,1, - - 1,0,0,1, 0,1,1,0, 1,1,0,1, 1,1,0,0, 1,0,0,1, 0,0,1,0, 1,1,1,0, 0,0,1,1, - 1,0,0,1, 0,1,1,1, 1,0,1,0, 0,0,1,1, 0,1,0,1, 1,0,0,0, 0,1,0,0, 1,1,0,1, - - 1,1,1,1, 0,0,0,1, 0,0,1,0, 1,0,1,1, 1,1,0,0, 0,1,1,0, 0,1,0,1, 0,0,0,0, - 1,0,0,0, 1,1,0,0, 0,0,0,1, 1,1,1,0, 1,1,1,1, 1,1,0,1, 0,1,1,0, 1,0,1,0, - - 1,1,0,0, 1,0,0,1, 1,0,0,1, 0,0,0,1, 1,1,0,1, 1,1,0,0, 0,0,1,0, 1,1,0,1, - 0,0,0,0, 0,1,1,0, 1,1,0,0, 0,0,0,0, 1,0,0,1, 0,0,0,0, 0,0,0,1, 1,1,0 -}; - -const unsigned char atsc_pn63[63] = { - 1,1,1,0, 0,1,0,0, 1,0,1,1, 0,1,1,1, 0,1,1,0, 0,1,1,0, 1,0,1,0, 1,1,1,1, - 1,1,0,0, 0,0,0,1, 0,0,0,0, 1,1,0,0, 0,1,0,1, 0,0,1,1, 1,1,0,1, 0,0,0 -}; - diff --git a/gr-atsc/lib/atsci_randomizer.cc b/gr-atsc/lib/atsci_randomizer.cc deleted file mode 100644 index e9427c66ea..0000000000 --- a/gr-atsc/lib/atsci_randomizer.cc +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/randomizer_impl.h> -#include <assert.h> - -unsigned char atsci_randomizer::s_output_map[1 << 14]; -bool atsci_randomizer::s_output_map_initialized_p = false; - -atsci_randomizer::atsci_randomizer () -{ - d_state = PRELOAD_VALUE; - - if (!s_output_map_initialized_p) - initialize_output_map (); -} - -/*! - * \brief Generate the table used in the fast_output_map function. - * - * The table has 16K byte entries, but because of how is is used, only - * 256 entries end up being resident in the cache. This seems - * like a good use of memory. We can get away with a 16K table - * because the low two bits of the state do not affect the output - * function. By shifting right those two bits we shrink the table, - * and also get better cache line utilization. - */ -void -atsci_randomizer::initialize_output_map () -{ - s_output_map_initialized_p = true; - - for (int i = 0; i < (1 << 14); i++) - s_output_map[i] = slow_output_map (i << 2); -} - - -void -atsci_randomizer::reset () -{ - d_state = PRELOAD_VALUE; -} - -void -atsci_randomizer::randomize (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet &in) -{ - assert (in.data[0] == MPEG_SYNC_BYTE); // confirm it's there, then drop - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i] = in.data[i + 1] ^ output_and_clk (); -} - -void -atsci_randomizer::derandomize (atsc_mpeg_packet &out, const atsc_mpeg_packet_no_sync &in) -{ - out.data[0] = MPEG_SYNC_BYTE; // add sync byte to beginning of packet - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - out.data[i + 1] = in.data[i] ^ output_and_clk (); -} - - -unsigned char -atsci_randomizer::slow_output_map (int st) -{ - int output = 0; - - if (st & 0x8000) - output |= 0x01; - - if (st & 0x2000) - output |= 0x02; - - if (st & 0x1000) - output |= 0x04; - - if (st & 0x0200) - output |= 0x08; - - if (st & 0x0020) - output |= 0x10; - - if (st & 0x0010) - output |= 0x20; - - if (st & 0x0008) - output |= 0x40; - - if (st & 0x0004) - output |= 0x80; - - return output; -} diff --git a/gr-atsc/lib/atsci_reed_solomon.cc b/gr-atsc/lib/atsci_reed_solomon.cc deleted file mode 100644 index 49cbed1c78..0000000000 --- a/gr-atsc/lib/atsci_reed_solomon.cc +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/reed_solomon_impl.h> -#include <assert.h> -#include <string.h> - -extern "C" { -#include <gnuradio/fec/rs.h> -} - -static const int rs_init_symsize = 8; -static const int rs_init_gfpoly = 0x11d; -static const int rs_init_fcr = 0; // first consecutive root -static const int rs_init_prim = 1; // primitive is 1 (alpha) -static const int rs_init_nroots = 20; - -static const int N = (1 << rs_init_symsize) - 1; // 255 -static const int K = N - rs_init_nroots; // 235 - -static const int amount_of_pad = N - ATSC_MPEG_RS_ENCODED_LENGTH; // 48 - -atsci_reed_solomon::atsci_reed_solomon () -{ - d_rs = init_rs_char (rs_init_symsize, rs_init_gfpoly, - rs_init_fcr, rs_init_prim, rs_init_nroots); - - assert (d_rs != 0); -} - -atsci_reed_solomon::~atsci_reed_solomon () -{ - if (d_rs) - free_rs_char (d_rs); - d_rs = 0; -} - -void -atsci_reed_solomon::encode (atsc_mpeg_packet_rs_encoded &out, const atsc_mpeg_packet_no_sync &in) -{ - unsigned char tmp[K]; - - assert ((int)(amount_of_pad + sizeof (in.data)) == K); - - // add missing prefix zero padding to message - memset (tmp, 0, amount_of_pad); - memcpy (&tmp[amount_of_pad], in.data, sizeof (in.data)); - - // copy message portion to output packet - memcpy (out.data, in.data, sizeof (in.data)); - - // now compute parity bytes and add them to tail end of output packet - encode_rs_char (d_rs, tmp, &out.data[sizeof (in.data)]); -} - -int -atsci_reed_solomon::decode (atsc_mpeg_packet_no_sync &out, const atsc_mpeg_packet_rs_encoded &in) -{ - unsigned char tmp[N]; - int ncorrections; - - assert ((int)(amount_of_pad + sizeof (in.data)) == N); - - // add missing prefix zero padding to message - memset (tmp, 0, amount_of_pad); - memcpy (&tmp[amount_of_pad], in.data, sizeof (in.data)); - - // correct message... - ncorrections = decode_rs_char (d_rs, tmp, 0, 0); - - // copy corrected message to output, skipping prefix zero padding - memcpy (out.data, &tmp[amount_of_pad], sizeof (out.data)); - - return ncorrections; -} diff --git a/gr-atsc/lib/atsci_root_raised_cosine.cc b/gr-atsc/lib/atsci_root_raised_cosine.cc deleted file mode 100644 index 2a8cf928b9..0000000000 --- a/gr-atsc/lib/atsci_root_raised_cosine.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/root_raised_cosine_impl.h> -#include <gnuradio/filter/firdes.h> - -vector<float> -atsc_root_raised_cosine::taps (double sampling_rate) -{ - static const double symbol_rate = ATSC_SYMBOL_RATE/2; // 1/2 as wide because we're designing lp filter - // static const int NTAPS = 93; // good number - // static const int NTAPS = 745; // better number - static const int NTAPS = 279; // better number - - return gr::filter::firdes::root_raised_cosine(1.0, sampling_rate, symbol_rate, .115, NTAPS); -} diff --git a/gr-atsc/lib/atsci_root_raised_cosine_bandpass.cc b/gr-atsc/lib/atsci_root_raised_cosine_bandpass.cc deleted file mode 100644 index 84f9f22cab..0000000000 --- a/gr-atsc/lib/atsci_root_raised_cosine_bandpass.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/root_raised_cosine_bandpass_impl.h> -#include <iostream> -#include <cmath> - -using std::vector; -using std::cerr; -using std::endl; - - -vector<float> -atsc_root_raised_cosine_bandpass::taps (double sampling_freq) -{ - - vector<float> t = atsc_root_raised_cosine::taps (sampling_freq); - - cerr << "atsc_root_raised_cosine_bandpass::taps -- " << t.size () << endl; - - // heterodyne the low pass coefficients up to the specified bandpass - // center frequency. Note that when we do this, the filter bandwidth - // is effectively twice the low pass (2.69 * 2 = 5.38) and hence - // matches the diagram in the ATSC spec. - - double arg = 2 * M_PI * _center_freq / sampling_freq; - for (unsigned int i = 0; i < t.size (); i++) - // the factor of 2 keeps the gain of the passband normalized to 1 - t[i] *= 2 * cos (arg * (double) i); - - return t; -} diff --git a/gr-atsc/lib/atsci_single_viterbi.cc b/gr-atsc/lib/atsci_single_viterbi.cc deleted file mode 100644 index 0458f80998..0000000000 --- a/gr-atsc/lib/atsci_single_viterbi.cc +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <math.h> -#include <gnuradio/atsc/single_viterbi_impl.h> -#include <iostream> - -using std::cerr; -using std::cout; - -const float atsci_single_viterbi::was_sent[32] = { - -7,-3,-7,-3,-7,-3,-7,-3, - -5,-1,-5,-1,-5,-1,-5,-1, - 1,5,1,5,1,5,1,5, - 3,7,3,7,3,7,3,7 -}; - -const int atsci_single_viterbi::transition_table[32] = { - 0,2,4,6, - 2,0,6,4, - 1,3,5,7, - 3,1,7,5, - 4,6,0,2, - 6,4,2,0, - 5,7,1,3, - 7,5,3,1 -}; - -void -atsci_single_viterbi::reset() -{ - for (unsigned int i = 0; i<2; i++) - for (unsigned int j = 0; j<8; j++) { - path_metrics[i][j] = 0; - traceback[i][j] = 0; - } - phase = 0; -} - -atsci_single_viterbi::atsci_single_viterbi() -{ - reset(); -} - -char -atsci_single_viterbi::decode(float input) -{ - for (unsigned int next_state = 0; next_state < 8; next_state++) { - unsigned int index = next_state << 2; - int min_metric_symb = 0; - float min_metric = fabs(input - was_sent[index + 0]) + - path_metrics[phase][transition_table[index + 0]]; - - for (unsigned int symbol_sent = 1; symbol_sent < 4; symbol_sent++) - if( (fabs(input-was_sent[index+symbol_sent]) + - path_metrics[phase][transition_table[index+symbol_sent]]) - < min_metric) { - min_metric = fabs(input-was_sent[index+symbol_sent]) + - path_metrics[phase][transition_table[index+symbol_sent]]; - min_metric_symb = symbol_sent; - } - - path_metrics[phase^1][next_state] = min_metric; - traceback[phase^1][next_state] = (((unsigned long long)min_metric_symb) << 62) | - (traceback[phase][transition_table[index+min_metric_symb]] >> 2); - } - unsigned int best_state = 0; - float best_state_metric = path_metrics[phase^1][0]; - for (unsigned int state = 1; state < 8; state++) - if(path_metrics[phase^1][state] < best_state_metric) { - best_state = state; - best_state_metric = path_metrics[phase^1][state]; - } - if(best_state_metric > 10000) { - for(unsigned int state = 0; state < 8; state++) - path_metrics[phase^1][state] -= best_state_metric; - // cerr << "Resetting Path Metrics from " << best_state_metric << " to 0\n"; - } - phase ^= 1; - return (0x3 & traceback[phase][best_state]); -} diff --git a/gr-atsc/lib/atsci_sliding_correlator.cc b/gr-atsc/lib/atsci_sliding_correlator.cc deleted file mode 100644 index 1e0498931d..0000000000 --- a/gr-atsc/lib/atsci_sliding_correlator.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/sliding_correlator_impl.h> -#include <gnuradio/atsc/pnXXX_impl.h> - -// #define TRY_BACKWARDS - -/* - * Return the number of 1's in v. - * This magic code is explained wonderfully in the AMD Athlon - * optimization guide, pg 136. - */ -static inline int popcount32 (unsigned long v) -{ - unsigned long w = v - ((v >> 1) & 0x55555555); - unsigned long x = (w & 0x33333333) + ((w >> 2) & 0x33333333); - unsigned long y = (x + (x >> 4)) & 0x0f0f0f0f; - unsigned long z = (y * 0x01010101) >> 24; - - return z; -} - -atsci_sliding_correlator::atsci_sliding_correlator () -{ -#if defined(TRY_BACKWARDS) - for (int i = 511 - 1; i >= 0; i--) - mask.shift_in (atsc_pn511[i]); -#else - for (unsigned i = 0; i < 511; i++) - mask.shift_in (atsc_pn511[i]); -#endif - - and_mask.shift_in (0); - for (int i = 0; i < 511; i++) - and_mask.shift_in (1); -} - -/* - * we shift in from the top of the register towards the bottom - * - * +-- bits enter here... - * | - * v - * block 0 | block 1 | block 2 ... | block N-1 - * | - * +--> ... and drop out here - * - */ -inline void -atsci_sliding_correlator::shift_reg::shift_in (int bit) -{ - for (int i = NSRBLOCKS - 1; i > 0; i--) - d[i] = ((d[i-1] & 0x1) << (srblock_bitsize - 1)) | (d[i] >> 1); - - d[0] = (((srblock) bit) << (srblock_bitsize - 1)) | (d[0] >> 1); -} - -int -atsci_sliding_correlator::input_bit (int bit) -{ - input.shift_in (bit); - - // can probably get a win by unrolling the loop, if we need to. - int count = 0; - for (int i = 0; i < NSRBLOCKS; i++) - count += popcount32 ((input.d[i] ^ mask.d[i]) & and_mask.d[i]); - - return count; -} - diff --git a/gr-atsc/lib/atsci_sssr.cc b/gr-atsc/lib/atsci_sssr.cc deleted file mode 100644 index 0906555738..0000000000 --- a/gr-atsc/lib/atsci_sssr.cc +++ /dev/null @@ -1,297 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,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. - */ - -#include <gnuradio/atsc/sssr_impl.h> -#include <algorithm> -#include <cmath> -#include <cstdio> -#include <assert.h> -#include <gnuradio/atsc/diag_output_impl.h> -#include <gnuradio/math.h> -#include <stdio.h> -#include <boost/math/special_functions/sign.hpp> -#include <iostream> - -/* - * ---------------------------------------------------------------- - * Segment Integrator Pre-Processor - * - * Compute weight passed to integrator based on - * correlation result and ncorr_gain2 - */ - -inline static int -sipp (bool digcorr_output) -{ - if (digcorr_output) - return +2; // positive correlation - else - return -1; // no correlation -} - -/* - * ---------------------------------------------------------------- - * Segment Sync Integrator... - */ - -static const int SSI_MIN = -16; -static const int SSI_MAX = 15; - -void -sssr::seg_sync_integrator::reset () -{ - for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++) - d_integrator[i] = SSI_MIN; -} - -int -sssr::seg_sync_integrator::update (int weight, int index) -{ - int t = d_integrator[index] + weight; - t = std::max (t, SSI_MIN); - t = std::min (t, SSI_MAX); - d_integrator[index] = t; - - return t; -} - -int -sssr::seg_sync_integrator::find_max (int *v) -{ - int best_value = d_integrator[0]; - int best_index = 0; - - for (int i = 1; i < ATSC_DATA_SEGMENT_LENGTH; i++) - if (d_integrator[i] > best_value){ - best_value = d_integrator[i]; - best_index = i; - } - - *v = best_value; - return best_index; -} - -/* - * ---------------------------------------------------------------- - * Segment Sync and Symbol recovery - */ - -static const int SYMBOL_INDEX_OFFSET = 3; -static const int MIN_SEG_LOCK_CORRELATION_VALUE = 5; - -atsci_sssr::atsci_sssr () - : d_debug_fp(0) -{ - reset (); - - if (_SSSR_DIAG_OUTPUT_){ - const char *file = "sssr.ssout"; - if ((d_debug_fp = fopen (file, "wb")) == 0){ - perror (file); - exit (1); - } - } -} - -atsci_sssr::~atsci_sssr () -{ - if (d_debug_fp) - fclose (d_debug_fp); -} - -void -atsci_sssr::reset () -{ - d_correlator.reset (); - d_integrator.reset (); - d_quad_filter.reset (); - - for (int i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++) - d_quad_output[i] = 0; - - d_timing_adjust = 0; - d_counter = 0; - d_symbol_index = 0; - d_seg_locked = false; -} - -void -atsci_sssr::update (sssr::sample_t sample_in, // input - bool *seg_locked, // are we seeing segment syncs? - int *symbol_index, // 0..831 - double *timing_adjust) // how much to adjust timing -{ - double qo = d_quad_filter.update (sample_in); - d_quad_output[d_counter] = qo; - - int bit = boost::math::signbit (sample_in); - if (bit != 0) - bit = 0; - else - bit = 1; - int corr_out = d_correlator.update (bit); - int weight = sipp (corr_out); - int corr_value = d_integrator.update (weight, d_counter); - int best_correlation_index = -1; - - incr_symbol_index (); - if (incr_counter ()){ // counter just wrapped... - int best_correlation_value; - best_correlation_index = d_integrator.find_max (&best_correlation_value); - d_seg_locked = best_correlation_value >= MIN_SEG_LOCK_CORRELATION_VALUE; - //std::cout << "best = " << best_correlation_value << " min is " << MIN_SEG_LOCK_CORRELATION_VALUE << std::endl; - d_timing_adjust = d_quad_output[best_correlation_index]; - - d_symbol_index = SYMBOL_INDEX_OFFSET - 1 - best_correlation_index; - if (d_symbol_index < 0) - d_symbol_index += ATSC_DATA_SEGMENT_LENGTH; - } - - *seg_locked = d_seg_locked; - *symbol_index = d_symbol_index; - *timing_adjust = d_timing_adjust; - - if (_SSSR_DIAG_OUTPUT_){ - float iodata[7]; - iodata[0] = bit; - iodata[1] = corr_value; - iodata[2] = qo; - iodata[3] = d_counter; - iodata[4] = d_symbol_index; - iodata[5] = best_correlation_index; - iodata[6] = d_timing_adjust; - - if (fwrite (iodata, sizeof (iodata), 1, d_debug_fp) != 1){ - perror ("fwrite: sssr"); - exit (1); - } - } - -} - -/* - * ---------------------------------------------------------------- - * Interpolator control for Seg & Symbol Sync Recovery - */ - -static const double LOOP_FILTER_TAP = 0.00025; // 0.0005 works -static const double ADJUSTMENT_GAIN = 1.0e-5 / (10 * ATSC_DATA_SEGMENT_LENGTH); - -atsci_interpolator::atsci_interpolator (double nominal_ratio_of_rx_clock_to_symbol_freq) - : d_debug_fp(0) -{ -// Tweaked ratio from 1.8 to 1.78 to support input rate of 19.2MHz - assert (nominal_ratio_of_rx_clock_to_symbol_freq >= 1.78); - d_nominal_ratio_of_rx_clock_to_symbol_freq = - nominal_ratio_of_rx_clock_to_symbol_freq; - - d_loop.set_taps (LOOP_FILTER_TAP); - - reset (); - - if (_SSSR_DIAG_OUTPUT_){ - const char *file = "interp.ssout"; - if ((d_debug_fp = fopen (file, "wb")) == 0){ - perror (file); - exit (1); - } - } - -} - -atsci_interpolator::~atsci_interpolator () -{ - if (d_debug_fp) - fclose (d_debug_fp); -} - -void -atsci_interpolator::reset () -{ - d_w = d_nominal_ratio_of_rx_clock_to_symbol_freq; - d_mu = 0.5; - d_incr = 0; - d_loop.reset (); -} - -bool -atsci_interpolator::update ( - const sssr::sample_t input_samples[], // I: vector of samples - int nsamples, // I: total number of samples - int *index, // I/O: current input index - double timing_adjustment, // I: how much to bump timing - sssr::sample_t *output_sample) -{ - if (*index + (int) ntaps () > nsamples) - return false; - - // FIXME Confirm that this is right. I think it is. It was (1-d_mu) - *output_sample = d_interp.interpolate (&input_samples[*index], d_mu); - - double filter_out = 0; - -#if 0 - - filter_out = d_loop.filter (timing_adjustment); - d_w = d_w + ADJUSTMENT_GAIN * filter_out * 1e-3; - -#elif 1 - - filter_out = d_loop.filter (timing_adjustment); - d_mu = d_mu + ADJUSTMENT_GAIN * 10e3 * filter_out; - -#else - - static const double alpha = 0.01; - static const double beta = alpha * alpha / 16; - - double x = ADJUSTMENT_GAIN * 10e3 * timing_adjustment; - - d_mu = d_mu + alpha * x; // conceptually "phase" - d_w = d_w + beta * x; // conceptually "frequency" - -#endif - - double s = d_mu + d_w; - double float_incr = floor (s); - d_mu = s - float_incr; - d_incr = (int) float_incr; - - assert (d_incr >= 1 && d_incr <= 3); - *index += d_incr; - - if (_SSSR_DIAG_OUTPUT_){ - float iodata[6]; - iodata[0] = timing_adjustment; - iodata[1] = filter_out; - iodata[2] = d_w; - iodata[3] = d_mu; - iodata[4] = d_incr; - iodata[5] = *output_sample; - if (fwrite (iodata, sizeof (iodata), 1, d_debug_fp) != 1){ - perror ("fwrite: interpolate"); - exit (1); - } - } - - return true; -} diff --git a/gr-atsc/lib/atsci_trellis_encoder.cc b/gr-atsc/lib/atsci_trellis_encoder.cc deleted file mode 100644 index 3037f5e0b4..0000000000 --- a/gr-atsc/lib/atsci_trellis_encoder.cc +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/trellis_encoder_impl.h> -#include <assert.h> -#include <stdio.h> -#include <string.h> - -static const int DIBITS_PER_BYTE = 4; - -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE)) -#define SYMOF(x) (((x) % ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE))-4) - -/* How many separate Trellis encoders / Viterbi decoders run in parallel */ -static const int NCODERS = 12; - -#define ENCODER_SEG_BUMP 4 - -/* A Segment sync symbol is an 8VSB +5,-5,-5,+5 sequence that occurs at - the start of each 207-byte segment (including field sync segments). */ -#define DSEG_SYNC_SYM1 0x06 /* +5 */ -#define DSEG_SYNC_SYM2 0x01 /* -5 */ -#define DSEG_SYNC_SYM3 0x01 /* -5 */ -#define DSEG_SYNC_SYM4 0x06 /* +5 */ - - -/* Shift counts to bit numbers (high order, low order); 9x entries unused */ -static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; -static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; - - -atsci_trellis_encoder::atsci_trellis_encoder () -{ - debug = false; - reset (); -} - -atsci_trellis_encoder::~atsci_trellis_encoder () -{ -} - -void -atsci_trellis_encoder::reset () -{ - for (int i = 0; i < NCODERS; i++) - enc[i].reset (); -} - -void -atsci_trellis_encoder::encode (atsc_data_segment out[NCODERS], - const atsc_mpeg_packet_rs_encoded in[NCODERS]) -{ - unsigned char out_copy[OUTPUT_SIZE]; - unsigned char in_copy[INPUT_SIZE]; - - assert (sizeof (in_copy) == sizeof (in[0].data) * NCODERS); - assert (sizeof (out_copy) == sizeof (out[0].data) * NCODERS); - - // copy input into continguous temporary buffer - for (int i = 0; i < NCODERS; i++){ - assert (in[i].pli.regular_seg_p ()); - plinfo::sanity_check (in[i].pli); - memcpy (&in_copy[i * INPUT_SIZE/NCODERS], - &in[i].data[0], - ATSC_MPEG_RS_ENCODED_LENGTH * sizeof (in_copy[0])); - } - - memset (out_copy, 0, sizeof (out_copy)); // FIXME, sanity check - - // do the deed... - encode_helper (out_copy, in_copy); - - // copy output from contiguous temp buffer into final output - for (int i = 0; i < NCODERS; i++){ - memcpy (&out[i].data[0], - &out_copy[i * OUTPUT_SIZE/NCODERS], - ATSC_DATA_SEGMENT_LENGTH * sizeof (out_copy[0])); - - // copy pipeline info - out[i].pli = in[i].pli; - - plinfo::sanity_check (out[i].pli); - assert (out[i].pli.regular_seg_p ()); - } -} - -/* - * This code expects contiguous arrrays. Use it as is, it computes - * the correct answer. Maybe someday, when we've run out of better - * things to do, rework to avoid the copying in encode. - */ -void -atsci_trellis_encoder::encode_helper (unsigned char output[OUTPUT_SIZE], - const unsigned char input[INPUT_SIZE]) -{ - int i; - int encoder; - unsigned char trellis_buffer[NCODERS]; - int trellis_wherefrom[NCODERS]; - unsigned char *out, *next_out_seg; - int chunk; - int shift; - unsigned char dibit; - unsigned char symbol; - int skip_encoder_bump; - - /* FIXME, we may want special processing here - for a flag byte to keep track of which part of the field we're in? */ - - encoder = NCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - out = output; - next_out_seg = out; - - for (chunk = 0; - chunk < INPUT_SIZE; - chunk += NCODERS) { - /* Load a new chunk of bytes into the Trellis encoder buffers. - They get loaded in an order that depends on where we are in the - segment sync progress (sigh). - GRR! When the chunk reload happens at the same time as the - segment boundary, we should bump the encoder NOW for the reload, - rather than LATER during the bitshift transition!!! */ - if (out >= next_out_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - skip_encoder_bump = 1; - } - - for (i = 0; i < NCODERS; i++) { - /* for debug */ trellis_wherefrom[encoder] = chunk+i; - trellis_buffer[encoder] = input [chunk+i]; - encoder++; - if (encoder >= NCODERS) encoder = 0; - } - - for (shift = 6; shift >= 0; shift -= 2) { - - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (out >= next_out_seg) { - /* Segment transition. Output a data segment sync symbol, and - mess with the trellis encoder mux. */ - *out++ = DSEG_SYNC_SYM1; - *out++ = DSEG_SYNC_SYM2; - *out++ = DSEG_SYNC_SYM3; - *out++ = DSEG_SYNC_SYM4; - if (debug) printf ("SYNC SYNC SYNC SYNC\n"); - next_out_seg = out + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) - encoder = (encoder + ENCODER_SEG_BUMP) % NCODERS; - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - Each encoder takes input from the same byte of the chunk, but the - outputs of the encoders come out in various orders. - NOPE -- this is false. The encoders take input from various - bytes of the chunk (which changes at segment sync time), AND - they also come out in various orders. You really do have to - keep separate track of: the input bytes, the encoders, and - the output bytes -- because they're all moving with respect to - each other!!! */ - for (i = 0; i < NCODERS; i++) { - dibit = 0x03 & (trellis_buffer[encoder] >> shift); - if (debug) - printf ("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = dibit %d ", - (long) SEGOF(out-output), (long) SYMOF(out-output), - encoder, trellis_wherefrom[encoder], - bit1[shift], bit2[shift], dibit); - symbol = enc[encoder].encode (dibit); - *out++ = symbol; - encoder++; if (encoder >= NCODERS) encoder = 0; - if (debug) printf ("sym %d\n", symbol); - } /* Encoders */ - } /* Bit shifts */ - } /* Chunks */ - - /* Check up on ourselves */ -#if 0 - assertIntsEqual (0, (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS, "not %"); - assertIntsEqual (OUTPUT_SIZE, out - output, "outptr"); - assertIntsEqual (NCODERS - ENCODER_SEG_BUMP, encoder, "mux sync"); -#else - assert (0 == (INPUT_SIZE * DIBITS_PER_BYTE) % NCODERS); - assert (OUTPUT_SIZE == out - output); - assert (NCODERS - ENCODER_SEG_BUMP == encoder); -#endif -} - diff --git a/gr-atsc/lib/atsci_viterbi_decoder.cc b/gr-atsc/lib/atsci_viterbi_decoder.cc deleted file mode 100644 index 2179cb5a5c..0000000000 --- a/gr-atsc/lib/atsci_viterbi_decoder.cc +++ /dev/null @@ -1,176 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/viterbi_decoder.h> -#include <assert.h> -#include <stdio.h> -#include <cmath> -#include "atsci_viterbi_mux.cc" -#include <string.h> - - -/* How many separate Trellis encoders / Viterbi decoders run in parallel */ -static const int NCODERS = 12; - -static const float DSEG_SYNC_SYM1 = 5; -static const float DSEG_SYNC_SYM2 = -5; -static const float DSEG_SYNC_SYM3 = -5; -static const float DSEG_SYNC_SYM4 = 5; - -atsci_viterbi_decoder::atsci_viterbi_decoder () -{ - debug = true; - - /* - * These fifo's handle the alignment problem caused by the - * inherent decoding delay of the individual viterbi decoders. - * The net result is that this entire block has a pipeline latency - * of 12 complete segments. - * - * If anybody cares, it is possible to do it with less delay, but - * this approach is at least somewhat understandable... - */ - - // the -4 is for the 4 sync symbols - int fifo_size = ATSC_DATA_SEGMENT_LENGTH - 4 - viterbi[0].delay (); - for (int i = 0; i < NCODERS; i++) - fifo[i] = new fifo_t(fifo_size); - - reset (); -} - -atsci_viterbi_decoder::~atsci_viterbi_decoder () -{ - for (int i = 0; i < NCODERS; i++) - delete fifo[i]; -} - -void -atsci_viterbi_decoder::reset () -{ - for (int i = 0; i < NCODERS; i++){ - viterbi[i].reset (); - fifo[i]->reset (); - } -} - - -void -atsci_viterbi_decoder::decode (atsc_mpeg_packet_rs_encoded out[NCODERS], - const atsc_soft_data_segment in[NCODERS]) -{ - unsigned char out_copy[OUTPUT_SIZE]; - float in_copy[INPUT_SIZE]; - - // copy input into continguous temporary buffer - for (int i = 0; i < NCODERS; i++){ - assert (in[i].pli.regular_seg_p ()); - memcpy (&in_copy[i * INPUT_SIZE/NCODERS], - &in[i].data[0], - ATSC_DATA_SEGMENT_LENGTH * sizeof (in_copy[0])); - } - - memset (out_copy, 0, sizeof (out_copy)); // sanity check - - // do the deed... - decode_helper (out_copy, in_copy); - - // copy output from contiguous temp buffer into final output - for (int i = 0; i < NCODERS; i++){ - memcpy (&out[i].data[0], - &out_copy[i * OUTPUT_SIZE/NCODERS], - ATSC_MPEG_RS_ENCODED_LENGTH * sizeof (out_copy[0])); - - - // adjust pipeline info to reflect 12 segment delay - plinfo::delay (out[i].pli, in[i].pli, NCODERS); - } -} - -void -atsci_viterbi_decoder::decode_helper (unsigned char out[OUTPUT_SIZE], - const float symbols_in[INPUT_SIZE]) -{ - int encoder; - unsigned int i; - int dbi; - int dbwhere; - int dbindex; - int shift; - unsigned char dibit; - float symbol; - - /* Memset is not necessary if it's all working... */ - memset (out, 0, OUTPUT_SIZE); - -#define VERBOSE 0 - -#if 1 - /* Check for sync symbols in the incoming data stream */ - /* For now, all we do is complain to stdout. FIXME, pass it back to - caller as an error/quality signal. */ - for (i = 0; i < sync_symbol_indices_max; i++) { - int j = sync_symbol_indices[i]; - if (fabsf (symbols_in[j] - DSEG_SYNC_SYM1) > 1.0) - if (VERBOSE) fprintf (stderr, "** Missing dataseg sync 1 at %d, expect %g, got %g.\n", - j, DSEG_SYNC_SYM1, symbols_in[j]); - j++; - if (fabsf (symbols_in[j] - DSEG_SYNC_SYM2) > 1.0) - if (VERBOSE) fprintf (stderr, "** Missing dataseg sync 2 at %d, expect %g, got %g.\n", - j, DSEG_SYNC_SYM2, symbols_in[j]); - j++; - if (fabsf (symbols_in[j] - DSEG_SYNC_SYM3) > 1.0) - if (VERBOSE) fprintf (stderr, "** Missing dataseg sync 3 at %d, expect %g, got %g.\n", - j, DSEG_SYNC_SYM3, symbols_in[j]); - j++; - if (fabsf (symbols_in[j] - DSEG_SYNC_SYM4) > 1.0) - if (VERBOSE) fprintf (stderr, "** Missing dataseg sync 4 at %d, expect %g, got %g.\n", - j, DSEG_SYNC_SYM4, symbols_in[j]); - } -#endif -#undef VERBOSE - - // printf ("@@@ DIBITS @@@\n"); - - /* Now run each of the 12 Trellis encoders over their subset of - the input symbols */ - for (encoder = 0; encoder < NCODERS; encoder++) { - dbi = 0; /* Reinitialize dibit index for new encoder */ - fifo_t *dibit_fifo = fifo[encoder]; - - /* Feed all the incoming symbols into one encoder; - pump them into the relevant dibits. */ - for (i = 0; i < enco_which_max; i++) { - symbol = symbols_in[enco_which_syms[encoder][i]]; - dibit = dibit_fifo->stuff (viterbi[encoder].decode (symbol)); - // printf ("%d\n", dibit); - /* Store the dibit into the output data segment */ - dbwhere = enco_which_dibits[encoder][dbi++]; - dbindex = dbwhere >> 3; - shift = dbwhere & 0x7; - out[dbindex] = - (out[dbindex] & ~(0x03 << shift)) | (dibit << shift); - } /* Symbols fed into one encoder */ - } /* Encoders */ - - // fflush (stdout); -} diff --git a/gr-atsc/lib/atsci_viterbi_gen.cc b/gr-atsc/lib/atsci_viterbi_gen.cc deleted file mode 100644 index bff3c47736..0000000000 --- a/gr-atsc/lib/atsci_viterbi_gen.cc +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 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 <iostream> -#include <stdio.h> - -using std::cerr; - -/* - * Trellis-encode a whole pile of 12 data segments for ATSC. - * This also includes scrambling the data among twelve Trellis encoders. - * - * Input is twelve 207-byte blocks of raw data (Reed-Solomon output that's - * been scrambled up by interleaving with other blocks). - * - * Output is 12 x 208 x 4 bytes, each byte containing a 3-bit symbol. - * The first 4 bytes are the segment sync symbol. - * - Got the first version of Trellis encoder coded. Compiles, but I - didn't realize that each data segment contains an odd number of BITS! - The second data segment in a field starts by pulling bits out of the - middles of the bytes it's encoding. You actually have to read all the - entries in that table on page 59 AND 60 to get it. - - There's a 4-segment asymmetric pattern of bit accesses. - There's a 3-segment asymmetric pattern of muxing encoders. - - The result is there's a 12-segment pattern that repeats throughout - the encoding of a field. So this routine now encodes 12 segments at once. - - This encoding system was either designed by a complete idiot or by - a complete genius. It's highly complex when it could have been very - simple. Now the question is whether - this incredible complexity buys us anything subtle and important. - */ - -#define SEGMENT_SIZE 207 -#define INPUT_SIZE (SEGMENT_SIZE * 12) -#define DIBITS_PER_BYTE 4 -#define EXTRAS (4 * 12) /* FIXME, sync symbols and such */ -#define SYMBOLS_OUT ((INPUT_SIZE * DIBITS_PER_BYTE) + EXTRAS) -#define SEGOF(x) ( (x) / ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE)) -#define SYMOF(x) (((x) % ((SEGMENT_SIZE+1) * DIBITS_PER_BYTE))-4) -#define ENCODERS 12 -#define ENCODER_SEG_BUMP 4 - - -/* Shift counts to bit numbers (high order, low order); 9x entries unused */ -static const int bit1[8] = {1, 99, 3, 98, 5, 97, 7, 96}; -static const int bit2[8] = {0, 99, 2, 98, 4, 97, 6, 96}; - -/* Detailed Debugging */ -int debug_dec = 0; - -/* - * Build indirect data structures to say which symbols go into which - * encoder, and then where the resulting dibits from the encoders go. - */ -int -build_decode_structures (char *fileout) -{ - int retval = 0; - int i; - int encoder; - int trellis_wheredata[ENCODERS]; - unsigned char *symp, *next_sym_seg; - unsigned char symbols[SYMBOLS_OUT]; - int chunk; - int shift; - int skip_encoder_bump; - int *enco_syms[ENCODERS]; - int *enco_dibits[ENCODERS]; - int j; - /* The data structures we'll build and then spit out... */ - int sync_symbol_indices[1000]; - int sync_symbol_indices_max; - int enco_which_syms[ENCODERS][INPUT_SIZE]; - int enco_which_dibits[ENCODERS][INPUT_SIZE]; - int enco_which_max; - #define BIT_PTR(int,shif) (((int) << 3) | ((shif) & 0x7)) - /* Running indices into them as we build 'em... */ - int *syncsyms = sync_symbol_indices; - - /* Start our running pointers at the start of our per-encoder subarrays */ - for (i = 0; i < ENCODERS; i++) { - enco_dibits[i] = enco_which_dibits[i]; - enco_syms[i] = enco_which_syms[i]; - } - - encoder = ENCODERS - ENCODER_SEG_BUMP; - skip_encoder_bump = 0; - symp = symbols; - next_sym_seg = symp; - - for (chunk = 0; - chunk < INPUT_SIZE; - chunk += ENCODERS) { - /* Associate data bytes with the Trellis encoders. - They get loaded or stored in an order that depends on where we are in the - segment sync progress (sigh). - GRR! When the chunk reload happens at the same time as the - segment boundary, we should bump the encoder NOW for the reload, - rather than LATER during the bitshift transition!!! */ - if (symp >= next_sym_seg) { - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 1; - } - - /* Remember where the data bytes are going to go, once we've - accumulated them from the 12 interleaved decoders */ - for (i = 0; i < ENCODERS; i++) { - trellis_wheredata[encoder] = chunk+i; - encoder++; - if (encoder >= ENCODERS) encoder = 0; - } - - for (shift = 6; shift >= 0; shift -= 2) { - - /* Segment boundaries happen to occur on some bitshift transitions. */ - if (symp >= next_sym_seg) { - /* Segment transition. Output a data segment sync symbol, and - mess with the trellis encoder mux. */ - *syncsyms++ = symp - symbols; - symp += 4; - next_sym_seg = symp + (SEGMENT_SIZE * DIBITS_PER_BYTE); - - if (!skip_encoder_bump) - encoder = (encoder + ENCODER_SEG_BUMP) % ENCODERS; - skip_encoder_bump = 0; - } - - /* Now run each of the 12 Trellis encoders to spit out 12 symbols. - Each encoder takes input from the same byte of the chunk, but the - outputs of the encoders come out in various orders. - NOPE -- this is false. The encoders take input from various - bytes of the chunk (which changes at segment sync time), AND - they also come out in various orders. You really do have to - keep separate track of: the datasegs bytes, the encoders, and - the symbol bytes -- because they're all moving with respect to - each other!!! */ - for (i = 0; i < ENCODERS; i++) { - if (debug_dec) - printf ("Seg %ld Symb %3ld Trell %2d Byte %6d Bits %d-%d = ", - (long) SEGOF(symp-symbols), (long) SYMOF(symp-symbols), - encoder, trellis_wheredata[encoder], - bit1[shift], bit2[shift]); - - /* Decoding: Grab symbol, run through decoder, slice dibit into - buffer. */ - /* This symbol goes into this encoder next */ - *(enco_syms[encoder]++) = symp - symbols; - symp++; - /* The next output from this encoder goes into these dibits */ - *(enco_dibits[encoder]++) = BIT_PTR(trellis_wheredata[encoder], shift); - - encoder++; if (encoder >= ENCODERS) encoder = 0; - } /* Encoders */ - } /* Bit shifts */ - -#if 0 - /* Now dump out the chunk of 12 data bytes that the twelve decoders have - accumulated. */ - unsigned char trellis_buffer[ENCODERS]; - unsigned char dibit; - unsigned char symbol; - int save_state; - for (i = 0; i < ENCODERS; i++) { - datasegs [trellis_wheredata[encoder]] = trellis_buffer[encoder]; - encoder++; - if (encoder >= ENCODERS) encoder = 0; - } /* Dumping encoder bytes */ -#endif - } /* Chunks */ - - /* Now print the resulting data structures in C++ */ - - if (!freopen(fileout, "w", stdout)) - return 2; - - printf ("/*\n\ - * atsc_viterbi_mux.cc\n\ - *\n\ - * Data structures for knowing which symbols are fed to which\n\ - * Viterbi decoders, and then where to put the resulting output dibits.\n\ - *\n\ - * Generated by 'atsc_viterbi_gen.cc'.\n\ - */\n\n"); - sync_symbol_indices_max = syncsyms - sync_symbol_indices; - printf ("const unsigned int sync_symbol_indices_max = %d;\n", - sync_symbol_indices_max); - printf ("const unsigned int sync_symbol_indices[%d] = {\n ", - sync_symbol_indices_max); - for (i = 0; i < sync_symbol_indices_max; i++) { - printf ("%d,%s", sync_symbol_indices[i], (7 == i%8)? "\n ": " "); - } - printf ("};\n\n"); - - enco_which_max = enco_dibits[0] - enco_which_dibits[0]; - for (i = 0; i < ENCODERS; i++) - if (enco_which_max != enco_dibits[i] - enco_which_dibits[i]) { - cerr << "Encoder " << i << " has different max_dibits " << - enco_dibits[i] - enco_which_dibits[i] << " than " << enco_which_max; - retval = 3; - } - - printf ("const unsigned int enco_which_max = %d;\n" , enco_which_max); - - printf ("const unsigned int enco_which_syms[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_syms[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - - printf ("const unsigned int enco_which_dibits[%d][%d] = {\n", - ENCODERS, enco_which_max); - for (i = 0; i < ENCODERS; i++) { - printf (" /* %d */\n {", i); - for (j = 0; j < enco_which_max; j++) - printf ("%d,%s", enco_which_dibits[i][j], (7 == j%8)? "\n ": " "); - printf ("},\n"); - } - printf ("};\n\n"); - return retval; -} - -int -usage() -{ - cerr << "atsc_viterbi_gen: Usage:\n"; - cerr << " ./atsc_viterbi_gen -o atsc_viterbi_mux.cc\n"; - cerr << "That's all, folks!\n"; - return 1; -} - - -int -main(int argc, char **argv) -{ - if (argc != 3) return usage(); - if (argv[1][0] != '-' - || argv[1][1] != 'o' - || argv[1][2] != 0 ) return usage(); - return build_decode_structures(argv[2]); -} diff --git a/gr-atsc/lib/atsci_vsbtx_lp.cc b/gr-atsc/lib/atsci_vsbtx_lp.cc deleted file mode 100644 index 2de5cd7497..0000000000 --- a/gr-atsc/lib/atsci_vsbtx_lp.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/consts.h> -#include <gnuradio/atsc/vsbtx_lp_impl.h> -#include <stdexcept> -#include <cmath> -#include <iostream> - -using std::vector; -using std::cerr; -using std::endl; - -// atsc root raised cosine filter, sampling rate = 21.52 MHz -static const float atsc_vsbtx_lp2x[] = { -#include "atsc_vsbtx_lp.dat" -}; - -#define NELEM(x) (sizeof (x) / sizeof ((x)[0])) - -// is a within 5% of target? - -static bool -close_enough_p (double a, double target) -{ - double delta = fabs (target * 0.05); // 5 percent - - return fabs (target - a) <= delta; -} - -vector<float> -atsc_vsbtx_lp::taps (double sampling_freq) -{ - if (close_enough_p (sampling_freq, 2 * ATSC_SYMBOL_RATE)){ - return vector<float>(&atsc_vsbtx_lp2x[0], &atsc_vsbtx_lp2x[NELEM(atsc_vsbtx_lp2x)]); - } - else - throw std::out_of_range ( - "atsc_vsbtx_lp: no pre-designed filter close enough"); -} diff --git a/gr-atsc/lib/atsci_vsbtx_lp.dat b/gr-atsc/lib/atsci_vsbtx_lp.dat deleted file mode 100644 index 0fa54d42b5..0000000000 --- a/gr-atsc/lib/atsci_vsbtx_lp.dat +++ /dev/null @@ -1,49 +0,0 @@ -/* - * FILTER SPECIFICATION FILE - * FILTER TYPE:LOW PASS 1H - * PASSBAND RIPPLE IN -dB -.0100 - * STOPBAND RIPPLE IN -dB -76.0000 - * PASSBAND CUTOFF FREQUENCY .250000 HERTZ - * STOPBAND CUTOFF FREQUENCY .360000 HERTZ - * SAMPLING FREQUENCY 1.00000 HERTZ - */ -/* - * gain of 2 - */ - 9.23312269151211e-04, - 8.75200144946575e-04, - -2.89211887866259e-03, - 1.31580047309399e-04, - 6.72745611518621e-03, - -5.82943391054869e-03, - -8.86140950024128e-03, - 1.84674616903067e-02, - 1.27039104700089e-03, - -3.39064113795757e-02, - 2.52537783235312e-02, - 3.74889532104135e-02, - -7.35438484698534e-02, - -3.70154529809952e-03, - 1.33745657280087e-01, - -1.12098718993366e-01, - -1.84760546311736e-01, - 5.98605459555984e-01, - 1.20420956425369e+00, - 5.98605459555984e-01, - -1.84760546311736e-01, - -1.12098718993366e-01, - 1.33745657280087e-01, - -3.70154529809952e-03, - -7.35438484698534e-02, - 3.74889532104135e-02, - 2.52537783235312e-02, - -3.39064113795757e-02, - 1.27039104700089e-03, - 1.84674616903067e-02, - -8.86140950024128e-03, - -5.82943391054869e-03, - 6.72745611518621e-03, - 1.31580047309399e-04, - -2.89211887866259e-03, - 8.75200144946575e-04, - 9.23312269151211e-04 diff --git a/gr-atsc/lib/create_atsci_equalizer.cc b/gr-atsc/lib/create_atsci_equalizer.cc deleted file mode 100644 index 2d3b1b1882..0000000000 --- a/gr-atsc/lib/create_atsci_equalizer.cc +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/create_atsci_equalizer.h> -#include <gnuradio/atsc/equalizer_nop_impl.h> -#include <gnuradio/atsc/equalizer_lms_impl.h> -#include <gnuradio/atsc/equalizer_lms2_impl.h> - -atsci_equalizer * -create_atsci_equalizer_nop () -{ - return new atsci_equalizer_nop (); -} - -atsci_equalizer * -create_atsci_equalizer_lms () -{ - return new atsci_equalizer_lms (); -} - -atsci_equalizer * -create_atsci_equalizer_lms2 () -{ - return new atsci_equalizer_lms2 (); -} diff --git a/gr-atsc/lib/create_atsci_fs_checker.cc b/gr-atsc/lib/create_atsci_fs_checker.cc deleted file mode 100644 index 98a904acb7..0000000000 --- a/gr-atsc/lib/create_atsci_fs_checker.cc +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/create_atsci_fs_checker.h> -#include <gnuradio/atsc/fs_checker_naive_impl.h> - -atsci_fs_checker * -create_atsci_fs_checker () -{ - return new atsci_fs_checker_naive (); -} diff --git a/gr-atsc/lib/create_atsci_fs_correlator.cc b/gr-atsc/lib/create_atsci_fs_correlator.cc deleted file mode 100644 index 1dd10e6812..0000000000 --- a/gr-atsc/lib/create_atsci_fs_correlator.cc +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/create_atsci_fs_correlator.h> -#include <gnuradio/atsc/fs_correlator_naive_impl.h> - -atsci_fs_correlator * -create_atsci_fs_correlator () -{ - return new atsci_fs_correlator_naive (); -} diff --git a/gr-atsc/lib/fpll_btloop_coupling.h b/gr-atsc/lib/fpll_btloop_coupling.h deleted file mode 100644 index 9a1a99d86d..0000000000 --- a/gr-atsc/lib/fpll_btloop_coupling.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _FPLL_BTLOOP_COUPLING_H_ -#define _FPLL_BTLOOP_COUPLING_H_ - -/*! - * Magic coupling constant between GrAtscFPLL and GrAtscBitTimingLoop. - * Trust me, you don't want to mess with this. - * - * The agc block buried in the FPLL indirectly sets the level of the input - * to the bit timing loop. The bit timing loop's convergence properties - * depend on the the mean amplitude of it's input. This constant ties - * them together such that you can tweak the input level of the bit timing loop - * (somewhat) without screwing everything. - */ - -static const float FPLL_BTLOOP_COUPLING_CONST = 3.125; - -#endif /* _FPLL_BTLOOP_COUPLING_H_ */ diff --git a/gr-atsc/lib/gen_encoder.py b/gr-atsc/lib/gen_encoder.py deleted file mode 100755 index 6c8fabf7ad..0000000000 --- a/gr-atsc/lib/gen_encoder.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2002 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. -# - -def output(input, state): - x2 = (input >> 1) & 0x1 - x1 = (input >> 0) & 0x1 - s = (state >> 2) & 0x1 - t = (state >> 1) & 0x1 - u = (state >> 0) & 0x1 - - z0 = u - z1 = x1 - z2 = x2 ^ s - return (z2 << 2) | (z1 << 1) | z0 - - -def next_state(input, state): - x2 = (input >> 1) & 0x1 - x1 = (input >> 0) & 0x1 - s0 = (state >> 2) & 0x1 - t0 = (state >> 1) & 0x1 - u0 = (state >> 0) & 0x1 - - s1 = x2 ^ s0 - t1 = u0 - u1 = t0 ^ x1 - - return (s1 << 2) | (t1 << 1) | u1 - -print "@@@ NEXT @@@" - -for i in range (32): - state = (i >> 2) & 0x7 - input = i & 0x3 - print next_state (input, state) - - -print "@@@ OUTPUT @@@" - -for i in range (32): - state = (i >> 2) & 0x7 - input = i & 0x3 - print output (input, state) - diff --git a/gr-atsc/lib/gnuradio-atsc.rc.in b/gr-atsc/lib/gnuradio-atsc.rc.in deleted file mode 100644 index f0d7699f00..0000000000 --- a/gr-atsc/lib/gnuradio-atsc.rc.in +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2013 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 <afxres.h> - -VS_VERSION_INFO VERSIONINFO - FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - FILEFLAGSMASK 0x3fL -#ifndef NDEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_DRV_INSTALLABLE - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "gnuradio-atsc" - VALUE "FileVersion", "@VERSION@" - VALUE "InternalName", "gnuradio-atsc.dll" - VALUE "LegalCopyright", "Licensed under GPLv3 or any later version" - VALUE "OriginalFilename", "gnuradio-atsc.dll" - VALUE "ProductName", "gnuradio-atsc" - VALUE "ProductVersion", "@VERSION@" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END - END diff --git a/gr-atsc/lib/plinfo.cc b/gr-atsc/lib/plinfo.cc deleted file mode 100644 index 0a24f7a073..0000000000 --- a/gr-atsc/lib/plinfo.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gnuradio/atsc/types.h> -#include <assert.h> - -void -plinfo::delay (plinfo &out, const plinfo &in, int nsegs_of_delay) -{ - assert (in.regular_seg_p ()); - assert (nsegs_of_delay >= 0); - - int s = in.segno (); - if (in.in_field2_p ()) - s += ATSC_DSEGS_PER_FIELD; - - s -= nsegs_of_delay; - if (s < 0) - s += 2 * ATSC_DSEGS_PER_FIELD; - - assert (0 <= s && s < 2 * ATSC_DSEGS_PER_FIELD); - - if (s < ATSC_DSEGS_PER_FIELD) - out.set_regular_seg (false, s); // field 1 - else - out.set_regular_seg (true, s - ATSC_DSEGS_PER_FIELD); // field 2 -} - -void -plinfo::sanity_check (const plinfo &x) -{ - // basic sanity checks... - assert (x.segno () >= 0); - assert (x.segno () < (unsigned) ATSC_DSEGS_PER_FIELD); - assert ((x.flags () & ~0x3f) == 0); - - assert (x.regular_seg_p () ^ x.field_sync_p ()); - assert ((x.segno () != 0) ^ x.first_regular_seg_p ()); -} - diff --git a/gr-atsc/lib/qa_atsci.cc b/gr-atsc/lib/qa_atsci.cc deleted file mode 100644 index 611440e96f..0000000000 --- a/gr-atsc/lib/qa_atsci.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * This class gathers together all the test cases for the atsc - * directory into a single test suite. As you create new test cases, - * add them here. - */ - -#include "qa_atsci.h" -#include "qa_atsci_randomizer.h" -#include "qa_atsci_reed_solomon.h" -#include "qa_interleaver_fifo.h" -#include "qa_convolutional_interleaver.h" -#include "qa_atsci_data_interleaver.h" -#include "qa_atsci_basic_trellis_encoder.h" -#include "qa_atsci_sliding_correlator.h" -#include "qa_atsci_fake_single_viterbi.h" -#include "qa_atsci_single_viterbi.h" -#include "qa_atsci_trellis_encoder.h" -#include "qa_atsci_viterbi_decoder.h" -#include "qa_atsci_fs_correlator.h" -#include "qa_atsci_equalizer_nop.h" - -CppUnit::TestSuite * -qa_atsc::suite () -{ - CppUnit::TestSuite *s = new CppUnit::TestSuite ("atsc"); - - s->addTest (qa_atsci_randomizer::suite ()); - s->addTest (qa_atsci_reed_solomon::suite ()); - s->addTest (qa_interleaver_fifo::suite ()); - s->addTest (qa_convolutional_interleaver::suite ()); - s->addTest (qa_atsci_data_interleaver::suite ()); - s->addTest (qa_atsci_basic_trellis_encoder::suite ()); - s->addTest (qa_atsci_sliding_correlator::suite ()); - s->addTest (qa_atsci_fake_single_viterbi::suite ()); - s->addTest (qa_atsci_single_viterbi::suite ()); - s->addTest (qa_atsci_trellis_encoder::suite ()); - s->addTest (qa_atsci_viterbi_decoder::suite ()); - s->addTest (qa_atsci_fs_correlator::suite ()); - s->addTest (qa_atsci_equalizer_nop::suite ()); - - return s; -} diff --git a/gr-atsc/lib/qa_atsci.h b/gr-atsc/lib/qa_atsci.h deleted file mode 100644 index 86aca2d32b..0000000000 --- a/gr-atsc/lib/qa_atsci.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_H_ -#define _QA_ATSC_H_ - -#include <cppunit/TestSuite.h> - -//! collect all the tests for the dtv directory - -class qa_atsc { - public: - //! return suite of tests for all of dtv directory - static CppUnit::TestSuite *suite (); -}; - - -#endif /* _QA_ATSC_H_ */ diff --git a/gr-atsc/lib/qa_atsci_basic_trellis_encoder.cc b/gr-atsc/lib/qa_atsci_basic_trellis_encoder.cc deleted file mode 100644 index 2b64759c1f..0000000000 --- a/gr-atsc/lib/qa_atsci_basic_trellis_encoder.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include "qa_atsci_basic_trellis_encoder.h" -#include <stdlib.h> -#include <stdio.h> - -void -qa_atsci_basic_trellis_encoder::t0 () -{ - const static unsigned char in[14] = { - 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 3 - }; - - const static unsigned char expected_out[14] = { - 0, 2, 3, 1, 1, 3, 0, 1, 2, 0, 0, 2, 5, 2 - }; - - for (unsigned i = 0; i < sizeof (in); i++) - CPPUNIT_ASSERT_EQUAL ((int) expected_out[i], enc.encode (in[i])); - - // reset encoder and test again. - - enc.reset (); - for (unsigned i = 0; i < sizeof (in); i++) - CPPUNIT_ASSERT_EQUAL ((int) expected_out[i], enc.encode (in[i])); -} - - -void -qa_atsci_basic_trellis_encoder::t1 () -{ - // Print data to externally check distribution. - // looks OK. -#if 0 - srandom (27); - - for (int i = 0; i < 8192; i++){ - int t = (random () >> 10) & 0x3; // 2 random bits - printf ("%d %d\n", t, enc.encode (t)); - } -#endif -} diff --git a/gr-atsc/lib/qa_atsci_basic_trellis_encoder.h b/gr-atsc/lib/qa_atsci_basic_trellis_encoder.h deleted file mode 100644 index 6102d72071..0000000000 --- a/gr-atsc/lib/qa_atsci_basic_trellis_encoder.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _QA_ATSC_BASIC_TRELLIS_ENCODER_H_ -#define _QA_ATSC_BASIC_TRELLIS_ENCODER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/basic_trellis_encoder_impl.h> - -class qa_atsci_basic_trellis_encoder : public CppUnit::TestCase { - - CPPUNIT_TEST_SUITE (qa_atsci_basic_trellis_encoder); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_basic_trellis_encoder enc; - - void t0 (); - void t1 (); -}; - -#endif /* _QA_ATSC_BASIC_TRELLIS_ENCODER_H_ */ diff --git a/gr-atsc/lib/qa_atsci_data_interleaver.cc b/gr-atsc/lib/qa_atsci_data_interleaver.cc deleted file mode 100644 index 87cb45f49e..0000000000 --- a/gr-atsc/lib/qa_atsci_data_interleaver.cc +++ /dev/null @@ -1,197 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cppunit/TestAssert.h> -#include "qa_atsci_data_interleaver.h" -#include <string.h> - - -/*! - * write an easy to identify pattern into the packet - */ -void -qa_atsci_data_interleaver::init_test_packet (int counter, - atsc_mpeg_packet_rs_encoded &out) -{ - out.data[0] = 0xf0; - out.data[1] = 0xff; - out.data[2] = (counter >> 8) & 0xff; - out.data[3] = counter & 0xff; - - for (int i = 4; i < 205; i++) - out.data[i] = i; - - out.data[205] = 0xa0; - out.data[206] = 0xaf; -} - -void -qa_atsci_data_interleaver::print_packet (FILE *fp, - int frame_number, - int field_number, - int segment_number, - const atsc_mpeg_packet_rs_encoded &in) -{ - fprintf (fp, "%04d:%d:%03d ", frame_number, field_number, segment_number); - - const unsigned char *p = &in.data[0]; - for (int i = 0; i < 8; i++) - fprintf (fp, "%02X", p[i]); - - fprintf (fp, " "); - p = &in.data[8]; - for (int i = 0; i < 8; i++) - fprintf (fp, "%02X", p[i]); - - - fprintf (fp, " ... "); - p = &in.data[191]; - for (int i = 0; i < 8; i++) - fprintf (fp, "%02X", p[i]); - - fprintf (fp, " "); - p = &in.data[199]; - for (int i = 0; i < 8; i++) - fprintf (fp, "%02X", p[i]); - - fprintf (fp, "\n"); -} - -void -qa_atsci_data_interleaver::chk_assert (const atsc_mpeg_packet_rs_encoded &expected, - const atsc_mpeg_packet_rs_encoded &actual) -{ - if (expected == actual) - return; - - FILE *fp = stderr; - - fprintf (fp, "Expected: "); - print_packet (fp, 0, 0, 0, expected); - - fprintf (fp, "Actual: "); - print_packet (fp, 0, 0, 0, actual); - - CPPUNIT_ASSERT (expected == actual); -} - -void -qa_atsci_data_interleaver::t0 () -{ - int counter = 0; - atsc_mpeg_packet_rs_encoded in, enc, out; - atsc_mpeg_packet_rs_encoded zero; - - memset (&zero, 0, sizeof (zero)); - - for (int frame = 0; frame < 4; frame++){ - for (int field = 0; field < 2; field++){ - for (int segment = 0; segment < 312; segment++, counter++){ - - // build test packet - init_test_packet (counter, in); - in.pli.set_regular_seg (field == 1, segment); - - // interleave it - outbound.interleave (enc, in); - - // deinterleave it - inbound.deinterleave (out, enc); - - if (counter < 52) - // CPPUNIT_ASSERT (zero == out); - chk_assert (zero, out); - - else if (counter >= 52){ - atsc_mpeg_packet_rs_encoded expected; - init_test_packet (counter - 52, expected); - // CPPUNIT_ASSERT (expected == out); - chk_assert (expected, out); - } - } - } - } -} - -// -// Note, this assumes that the interleaver and deinterleaver -// have the state left by t0. -// -// This test pushes crap into the interleaver, and then confirms that -// the deinterleaver recovers. This would be part of what you'd see -// on a channel change. -// - -void -qa_atsci_data_interleaver::t1 () -{ - int counter = 0; - atsc_mpeg_packet_rs_encoded in, enc, out; - atsc_mpeg_packet_rs_encoded zero; - - memset (&zero, 0, sizeof (zero)); - - static const int NCRAP = 13; - - // push NCRAP segments of crap into the interleaver, - // but don't change the deinterleaver state - - for (int i = 0; i < NCRAP; i++){ - init_test_packet (i + 2758, in); - in.pli.set_regular_seg (false, i + 5); - - outbound.interleave (enc, in); - } - - // now run the normal test. - // we should get good segments after NCRAP + 52 - - int starting_counter = 3141; - counter = starting_counter; - - for (int frame = 0; frame < 4; frame++){ - for (int field = 0; field < 2; field++){ - for (int segment = 0; segment < 312; segment++, counter++){ - - // build test packet - init_test_packet (counter, in); - in.pli.set_regular_seg (field == 1, segment); - - // interleave it - outbound.interleave (enc, in); - - // deinterleave it - inbound.deinterleave (out, enc); - - if (counter < starting_counter + 52 + NCRAP){ - // don't care... - } - else if (counter >= starting_counter + 52 + NCRAP){ - atsc_mpeg_packet_rs_encoded expected; - init_test_packet (counter - 52, expected); - // CPPUNIT_ASSERT (expected == out); - chk_assert (expected, out); - } - } - } - } -} diff --git a/gr-atsc/lib/qa_atsci_data_interleaver.h b/gr-atsc/lib/qa_atsci_data_interleaver.h deleted file mode 100644 index d7b94f8e2b..0000000000 --- a/gr-atsc/lib/qa_atsci_data_interleaver.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_DATA_INTERLEAVER_H_ -#define _QA_ATSC_DATA_INTERLEAVER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> -#include <stdio.h> - -#include <gnuradio/atsc/data_interleaver_impl.h> - -class qa_atsci_data_interleaver : public CppUnit::TestCase { - public: - - void setUp (){ - outbound.reset (); - inbound.reset (); - } - - CPPUNIT_TEST_SUITE (qa_atsci_data_interleaver); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_data_interleaver outbound; - atsci_data_deinterleaver inbound; - - void t0 (); - void t1 (); - - void init_test_packet (int counter, atsc_mpeg_packet_rs_encoded &out); - void print_packet (FILE *fp, int frame_number, int field_number, int segment_number, - const atsc_mpeg_packet_rs_encoded &in); - void chk_assert (const atsc_mpeg_packet_rs_encoded &expected, - const atsc_mpeg_packet_rs_encoded &actual); -}; - - -#endif /* _QA_ATSC_DATA_INTERLEAVER_H_ */ diff --git a/gr-atsc/lib/qa_atsci_equalizer_nop.cc b/gr-atsc/lib/qa_atsci_equalizer_nop.cc deleted file mode 100644 index b7aad835d5..0000000000 --- a/gr-atsc/lib/qa_atsci_equalizer_nop.cc +++ /dev/null @@ -1,247 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 "qa_atsci_equalizer_nop.h" -#include <gnuradio/atsc/equalizer_impl.h> -#include <gnuradio/atsc/equalizer_nop_impl.h> -#include <gnuradio/atsc/pnXXX_impl.h> -#include <gnuradio/atsc/types.h> -#include <cppunit/TestAssert.h> -#include <assert.h> -#include <iostream> -#include <string.h> - -using std::cerr; -using std::endl; - - -static const int SYMBOLS_PER_FIELD = (ATSC_DSEGS_PER_FIELD + 1) * ATSC_DATA_SEGMENT_LENGTH; -static const int PAD = 500; -static const int NFIELDS = 2; - -static const int INPUT_SIZE = PAD + (NFIELDS * SYMBOLS_PER_FIELD); - -static float -bin_map (int bit) -{ - return bit ? +5 : -5; -} - -static void -init_tags (atsc::syminfo *tags, int segnum, int fieldnum) -{ - int i; - - for (i = 0; i < ATSC_DATA_SEGMENT_LENGTH; i++){ - tags[i].symbol_num = i; - tags[i].segment_num = segnum; - tags[i].field_num = fieldnum; - tags[i].valid = 1; - } -} - -static void -init_data_seg (float *p, atsc::syminfo *tags, int v, int segnum, int fieldnum) -{ - init_tags (tags, segnum, fieldnum); - - int i = 0; - - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - for (; i < ATSC_DATA_SEGMENT_LENGTH; i++) - p[i] = (float) (i + v); -} - -static void -init_field_sync_tags (atsc::syminfo *tags, int fieldnum) -{ - init_tags (tags, atsc::SI_FIELD_SYNC_SEGMENT_NUM, fieldnum); -} - -static void -init_field_sync_common (float *p, int mask) - -{ - int i = 0; - - p[i++] = bin_map (1); // data segment sync pulse - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map (atsc_pn511[j]); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map (atsc_pn63[j] ^ mask); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map (atsc_pn63[j]); - - p[i++] = bin_map (0); // 24 bits of VSB8 mode identifiera - p[i++] = bin_map (0); - p[i++] = bin_map (0); - p[i++] = bin_map (0); - - p[i++] = bin_map (1); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - p[i++] = bin_map (0); - - p[i++] = bin_map (0); - p[i++] = bin_map (1); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - p[i++] = bin_map (1); - p[i++] = bin_map (1); - p[i++] = bin_map (1); - p[i++] = bin_map (1); - - p[i++] = bin_map (0); - p[i++] = bin_map (1); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - - p[i++] = bin_map (1); - p[i++] = bin_map (0); - p[i++] = bin_map (1); - p[i++] = bin_map (0); - - - for (int j = 0; j < 92; j++) // 92 more bits - p[i++] = bin_map (atsc_pn63[j % 63]); - - // now copy the last 12 symbols of the previous segment - // bogus fill - - for (int j = 0; j < 12; j++) - p[i++] = bin_map (j & 1); - - assert (i == ATSC_DATA_SEGMENT_LENGTH); -} - -void -qa_atsci_equalizer_nop::setUp () -{ - eq = new atsci_equalizer_nop (); -} - -void -qa_atsci_equalizer_nop::tearDown () -{ - delete eq; - eq = 0; -} - -static void -setup_test_data (float *data, atsc::syminfo *tags) -{ - int mask = 0; - int i = 0; - - for (i = 0; i < PAD; i++){ - data[i] = (float) i; - tags[i].symbol_num = 13 + i; - tags[i].segment_num = 17; - tags[i].field_num = 0; - tags[i].valid = 1; - } - - for (int nfields = 0; nfields < NFIELDS; nfields++){ - init_field_sync_common (&data[i], mask); - init_field_sync_tags (&tags[i], mask); - i += ATSC_DATA_SEGMENT_LENGTH; - - for (int segnum = 0; segnum < 312; segnum++){ - init_data_seg (&data[i], &tags[i], i, segnum, mask); - i += ATSC_DATA_SEGMENT_LENGTH; - } - mask ^= 1; - } - assert (i == INPUT_SIZE); -} - -void -qa_atsci_equalizer_nop::t0 () -{ - // these are dynamically allocated because they are bigger - // than the default stack limit. - - float *input_data = new float[INPUT_SIZE]; - atsc::syminfo *input_tags = new atsc::syminfo[INPUT_SIZE]; - float *output_data = new float[INPUT_SIZE]; - - try { - - memset (input_data, 0, sizeof(*input_data)*INPUT_SIZE); - memset (input_tags, 0, sizeof(*input_tags)*INPUT_SIZE); - memset (output_data, 0, sizeof(*output_data)*INPUT_SIZE); - - setup_test_data (input_data, input_tags); - - eq->filter (input_data, input_tags, - output_data, INPUT_SIZE); - - - // now check that data values got copied correctly - - for (int i = 0; i < INPUT_SIZE; i++){ - - if (input_tags[i].segment_num == atsc::SI_FIELD_SYNC_SEGMENT_NUM){ - // ignore entire field sync data segment - } - else if (input_tags[i].symbol_num <= 3){ - // ignore 4 symbols of data segment sync (+5, -5, -5, +5) - } - else { - if (output_data[i] != (float) i){ - cerr << "output_data[" << i << "] == " << output_data[i] << endl; - CPPUNIT_ASSERT_DOUBLES_EQUAL ((float) i, output_data[i], 1e-6); - } - } - } - - delete [] input_data; - delete [] input_tags; - delete [] output_data; - } - - catch ( ... ){ - delete [] input_data; - delete [] input_tags; - delete [] output_data; - } -} - -void -qa_atsci_equalizer_nop::t1 () -{ - // think of another test... -} diff --git a/gr-atsc/lib/qa_atsci_equalizer_nop.h b/gr-atsc/lib/qa_atsci_equalizer_nop.h deleted file mode 100644 index 244daf8b3f..0000000000 --- a/gr-atsc/lib/qa_atsci_equalizer_nop.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_EQUALIZER_NOP_H_ -#define _QA_ATSC_EQUALIZER_NOP_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -class atsci_equalizer; - -class qa_atsci_equalizer_nop : public CppUnit::TestCase { -private: - atsci_equalizer *eq; - -public: - void setUp (); - void tearDown (); - - CPPUNIT_TEST_SUITE (qa_atsci_equalizer_nop); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - -private: - - void t0 (); - void t1 (); - -}; - -#endif /* _QA_ATSC_EQUALIZER_NOP_H_ */ diff --git a/gr-atsc/lib/qa_atsci_fake_single_viterbi.cc b/gr-atsc/lib/qa_atsci_fake_single_viterbi.cc deleted file mode 100644 index 5edb5acbb7..0000000000 --- a/gr-atsc/lib/qa_atsci_fake_single_viterbi.cc +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include <stdio.h> -#include <gnuradio/atsc/fake_single_viterbi_impl.h> -#include "qa_atsci_fake_single_viterbi.h" -#include <gnuradio/random.h> -#include <string.h> - - -static const int NTRIALS = 50; -static const int MAXERRORS = 10; -static const int NN = 200; - -static const int MAXDIBIT = 3; - -static gr::random rndm; - -void -qa_atsci_fake_single_viterbi::encode_block (unsigned char *out, unsigned char *in, - unsigned int n) -{ - for (unsigned int i = 0; i < n; i++) { - out[i] = encoder.encode(in[i]); - } -} - - -void -qa_atsci_fake_single_viterbi::decode_block (unsigned char *out, unsigned char *in, - unsigned int n) -{ - for (unsigned int i = 0; i < n; i++) { - out[i] = decoder.decode ((2*in[i]-7) + noise ()); - } -} - -float -qa_atsci_fake_single_viterbi::noise () -{ -#if 1 - return 2.0 * (rndm.ran1() - 0.5);; -#else - return 0; -#endif -} - -void -qa_atsci_fake_single_viterbi::t0 () -{ - static const int blocklen = NN; - unsigned char in[blocklen]; - unsigned char enc[blocklen]; - unsigned char out[blocklen]; - int decoder_errors = 0; - int delay = decoder.delay (); - int i; - - // printf (" Delay is %d.\n", delay); - - srandom (27); // reproducable sequence of "random" values - - for (int nt = 0; nt < NTRIALS; nt++){ - - // load block with random data and encode - - for (i = 0; i < (blocklen-delay); i++) - in[i] = random () & MAXDIBIT; - for ( ; i < blocklen; i++) - in[i] = 0; /* To empty the delay buffers */ - - encoder.reset (); - encode_block (enc, in, blocklen); - - decoder.reset (); - - // decode the block - decode_block (out, enc, blocklen); - - // int offset = delay/4; - int offset = 2; - bool differs = (memcmp (in+offset, - out+delay+offset, blocklen-(delay+offset))); - - // initial values after reset are 0 - for (i = 0; i < delay; i++){ - if (out[i] != 0) - printf (" initial output at %i is %X, not 0\n", - i, out[i]); - } - - if (differs){ - printf (" incorrect data, trial #%d\n", nt); - - printf ("\n Erroneous result dibits:"); - for (int erri = 0; erri < (NN-delay); erri++) { - if (in[erri] != out[erri+delay]) - printf (" %d", erri); - } - printf ("\n In: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", in[erri]); - } - printf ("\n Out: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", out[erri+delay]); - } - printf ("\n Errs:"); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %c", (in[erri] != out[erri+delay])? '*': ' '); - } - printf ("\n THIS IS A REAL PROBLEM.\n"); - decoder_errors++; - } - } - - printf (" Summary: %d decoder errors out of %d trials.\n", - decoder_errors, NTRIALS); - - CPPUNIT_ASSERT (decoder_errors == 0); -} - diff --git a/gr-atsc/lib/qa_atsci_fake_single_viterbi.h b/gr-atsc/lib/qa_atsci_fake_single_viterbi.h deleted file mode 100644 index 42915ac6e8..0000000000 --- a/gr-atsc/lib/qa_atsci_fake_single_viterbi.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_FAKE_SINGLE_VITERBI_H -#define _QA_ATSC_FAKE_SINGLE_VITERBI_H - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/fake_single_viterbi_impl.h> -#include <gnuradio/atsc/basic_trellis_encoder_impl.h> - -class qa_atsci_fake_single_viterbi : public CppUnit::TestCase { - private: - atsci_fake_single_viterbi decoder; - atsci_basic_trellis_encoder encoder; - - CPPUNIT_TEST_SUITE (qa_atsci_fake_single_viterbi); - CPPUNIT_TEST (t0); - CPPUNIT_TEST_SUITE_END (); - - private: - - void t0 (); - - void encode_block(unsigned char *out, unsigned char *in, unsigned n); - void decode_block(unsigned char *out, unsigned char *in, unsigned n); - float noise (); - -}; - -#endif /* _QA_ATSC_FAKE_SINGLE_VITERBI_H_ */ diff --git a/gr-atsc/lib/qa_atsci_fs_correlator.cc b/gr-atsc/lib/qa_atsci_fs_correlator.cc deleted file mode 100644 index b92e63bad8..0000000000 --- a/gr-atsc/lib/qa_atsci_fs_correlator.cc +++ /dev/null @@ -1,256 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "qa_atsci_fs_correlator.h" -#include <gnuradio/atsc/fs_correlator_impl.h> -#include <gnuradio/atsc/create_atsci_fs_correlator.h> -#include <gnuradio/atsc/sync_tag_impl.h> -#include <stdlib.h> -#include <algorithm> -#include <gnuradio/atsc/pnXXX_impl.h> -#include <gnuradio/atsc/types.h> -#include <cppunit/TestAssert.h> -#include <assert.h> -#include <gnuradio/random.h> - -static gr::random rndm; - -static float -uniform () -{ - return 2.0 * (rndm.ran1() - 0.5); // uniformly (-1, 1) -} - - -static float -bin_map (int bit) -{ - return bit ? +5 : -5; -} - -static void -init_field_sync_common (float *p, int mask) - -{ - int i = 0; - - p[i++] = bin_map(1); // data segment sync pulse - p[i++] = bin_map(0); - p[i++] = bin_map(0); - p[i++] = bin_map(1); - - for (int j = 0; j < 511; j++) // PN511 - p[i++] = bin_map(atsc_pn511[j]); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map(atsc_pn63[j]); - - for (int j = 0; j < 63; j++) // PN63, toggled on field 2 - p[i++] = bin_map(atsc_pn63[j] ^ mask); - - for (int j = 0; j < 63; j++) // PN63 - p[i++] = bin_map(atsc_pn63[j]); - - p[i++] = bin_map(0); // 24 bits of VSB8 mode identifiera - p[i++] = bin_map(0); - p[i++] = bin_map(0); - p[i++] = bin_map(0); - - p[i++] = bin_map(1); - p[i++] = bin_map(0); - p[i++] = bin_map(1); - p[i++] = bin_map(0); - - p[i++] = bin_map(0); - p[i++] = bin_map(1); - p[i++] = bin_map(0); - p[i++] = bin_map(1); - - p[i++] = bin_map(1); - p[i++] = bin_map(1); - p[i++] = bin_map(1); - p[i++] = bin_map(1); - - p[i++] = bin_map(0); - p[i++] = bin_map(1); - p[i++] = bin_map(0); - p[i++] = bin_map(1); - - p[i++] = bin_map(1); - p[i++] = bin_map(0); - p[i++] = bin_map(1); - p[i++] = bin_map(0); - - - for (int j = 0; j < 92; j++) // 92 more bits - p[i++] = bin_map(atsc_pn63[j % 63]); - - // now copy the last 12 symbols of the previous segment - // bogus pad for this test... - - for (int j = 0; j < 12; j++) - p[i++] = bin_map(j & 1); - - assert (i == ATSC_DATA_SEGMENT_LENGTH); -} - -inline static void -init_field_sync_1 (float *s) -{ - init_field_sync_common (s, 0); -} - -inline static void -init_field_sync_2 (float *s) -{ - init_field_sync_common (s, 1); -} - -static void -cause_errors (float *p, int nerrs1, int nerrs2) -{ - static const int offset1 = 4; // offset to PN 511 - static const int offset2 = 578; // offset to 2nd PN 63 - - for (int i = 0; i < nerrs1; i++){ // flip nerrs1 bits in PN 511 - p[i + offset1] = -p[i + offset1]; - } - - for (int i = 0; i < nerrs2; i++){ // flip nerrs2 bits in PN 63 - p[i + offset2] = -p[i + offset2]; - } -} - - -void -qa_atsci_fs_correlator::setUp () -{ - fsc = create_atsci_fs_correlator (); -} - -void -qa_atsci_fs_correlator::tearDown () -{ - delete fsc; - fsc = 0; -} - - -// check sample fifo - -void -qa_atsci_fs_correlator::t0 () -{ - int delay = fsc->delay (); - int i; - float output_sample, output_tag; - - for (i = 0; i < delay; i++){ - fsc->filter ((float) i, &output_sample, &output_tag); - CPPUNIT_ASSERT_DOUBLES_EQUAL (0.0, output_sample, 1e-6); - CPPUNIT_ASSERT_DOUBLES_EQUAL (atsc_sync_tag::NORMAL, output_tag, 1e-6); - } - - for (; i < delay + 5000; i++){ - fsc->filter ((float) i, &output_sample, &output_tag); - CPPUNIT_ASSERT_DOUBLES_EQUAL ((float) (i - delay), output_sample, 1e-6); - CPPUNIT_ASSERT_DOUBLES_EQUAL (atsc_sync_tag::NORMAL, output_tag, 1e-6); - } -} - -void -qa_atsci_fs_correlator::util (int which_field, int nerrs1, int nerrs2) -{ - static const int PAD = 303; - static const int ISIZE = 4096; - int delay = fsc->delay (); - float output_sample, output_tag; - int i; - float input[ISIZE]; - - fsc->reset (); // known starting conditions - - // build input - - for (i = 0; i < PAD; i++) - input[i] = uniform () * 7; - - init_field_sync_common (&input[i], which_field); - cause_errors (&input[i], nerrs1, nerrs2); - i += ATSC_DATA_SEGMENT_LENGTH; - - for (; i < ISIZE; i++) - input[i] = uniform () * 7; - - // run the input and check - - for (i = 0; i < ISIZE; i++){ - fsc->filter (input[i], &output_sample, &output_tag); - if (i == delay + PAD){ // should be field sync - if (which_field == 0) - CPPUNIT_ASSERT_DOUBLES_EQUAL (atsc_sync_tag::START_FIELD_SYNC_1, output_tag, 1e-6); - else - CPPUNIT_ASSERT_DOUBLES_EQUAL (atsc_sync_tag::START_FIELD_SYNC_2, output_tag, 1e-6); - } - else { - CPPUNIT_ASSERT_DOUBLES_EQUAL (atsc_sync_tag::NORMAL, output_tag, 1e-6); - } - } -} - - -void -qa_atsci_fs_correlator::t1 () -{ - util (0, 0, 0); -} - -void -qa_atsci_fs_correlator::t2 () -{ - util (1, 0, 0); -} - -void -qa_atsci_fs_correlator::t3 () -{ - for (int nerrs1 = 0; nerrs1 < 20; nerrs1++){ - for (int nerrs2 = 0; nerrs2 < 5; nerrs2++){ - util (0, nerrs1, nerrs2); - } - } -} - -void -qa_atsci_fs_correlator::t4 () -{ - for (int nerrs1 = 0; nerrs1 < 5; nerrs1++){ - for (int nerrs2 = 0; nerrs2 < 5; nerrs2++){ - util (1, nerrs1, nerrs2); - } - } -} - diff --git a/gr-atsc/lib/qa_atsci_fs_correlator.h b/gr-atsc/lib/qa_atsci_fs_correlator.h deleted file mode 100644 index 4785f096ec..0000000000 --- a/gr-atsc/lib/qa_atsci_fs_correlator.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _QA_ATSC_FS_CORRELATOR_H_ -#define _QA_ATSC_FS_CORRELATOR_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -class atsci_fs_correlator; - -class qa_atsci_fs_correlator : public CppUnit::TestCase { -private: - atsci_fs_correlator *fsc; - - public: - - void setUp (); - void tearDown (); - - CPPUNIT_TEST_SUITE (qa_atsci_fs_correlator); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST (t2); - CPPUNIT_TEST (t3); - CPPUNIT_TEST (t4); - CPPUNIT_TEST_SUITE_END (); - - private: - - void util (int which_field, int nerr1, int nerr2); - - void t0 (); - void t1 (); - void t2 (); - void t3 (); - void t4 (); -}; - -#endif /* _QA_ATSC_FS_CORRELATOR_H_ */ diff --git a/gr-atsc/lib/qa_atsci_randomizer.cc b/gr-atsc/lib/qa_atsci_randomizer.cc deleted file mode 100644 index a750fbb5da..0000000000 --- a/gr-atsc/lib/qa_atsci_randomizer.cc +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 "qa_atsci_randomizer.h" - -#include <cppunit/TestAssert.h> -#include <string.h> - -static unsigned int expected_initial_states[] = { - 0x018f, - 0xd3db, - 0xbaf1, - 0x8e64, - 0x4732, - 0x2399, - 0xc2d0, - 0x6168 -}; - -static unsigned char expected_initial_values[] = { - 0xc0, - 0x6d, - 0x3f, - 0x99, - 0x38, - 0x6a, - 0x29, - 0x52 -}; - -#define NELEMENTS(ary) ((sizeof (ary)) / sizeof (ary[0])) - -void -qa_atsci_randomizer::t0_compare_output_maps () -{ - for (int i = 0; i < 0x10000; i++){ - unsigned char slow = atsci_randomizer::slow_output_map(i); - unsigned char fast = atsci_randomizer::fast_output_map(i); - CPPUNIT_ASSERT_EQUAL (slow, fast); - } -} - -void -qa_atsci_randomizer::t1_initial_states () -{ - // LFSR should start with expected states - - for (unsigned int i = 0; i < NELEMENTS (expected_initial_values); i++){ - unsigned int got = randomizer.state(); - randomizer.clk (); - CPPUNIT_ASSERT_EQUAL (expected_initial_states[i], got); - } -} - -void -qa_atsci_randomizer::t2_initial_values () -{ - // LFSR should start with expected values - - for (unsigned int i = 0; i < NELEMENTS (expected_initial_values); i++){ - unsigned char got = randomizer.output_and_clk (); - CPPUNIT_ASSERT_EQUAL (expected_initial_values[i], got); - } -} - -void -qa_atsci_randomizer::t3_reset () -{ - // LFSR should start with expected values - - for (unsigned int i = 0; i < NELEMENTS (expected_initial_values); i++){ - unsigned char got = randomizer.output_and_clk (); - CPPUNIT_ASSERT_EQUAL (expected_initial_values[i], got); - } - - randomizer.reset (); // reset LFSR - - // and now should repeat expected values - - for (unsigned int i = 0; i < NELEMENTS (expected_initial_values); i++){ - unsigned char got = randomizer.output_and_clk (); - CPPUNIT_ASSERT_EQUAL (expected_initial_values[i], got); - } -} - -void -qa_atsci_randomizer::t4_high_level () -{ - static const int N = 5; - - atsc_mpeg_packet in[N]; - atsc_mpeg_packet_no_sync middle[N]; - atsc_mpeg_packet out[N]; - - memset (in, 0, sizeof (in)); - memset (middle, 0, sizeof (middle)); - memset (out, 0, sizeof (out)); - - // setup input test data - - int counter = 0xff; - for (int n = 0; n < N; n++){ - in[n].data[0] = MPEG_SYNC_BYTE; - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - in[n].data[i + 1] = counter++; - } - - // randomize N packets - - for (int n = 0; n < N; n++) - randomizer.randomize (middle[n], in[n]); - - // reset LFSR and derandomize N packets - - randomizer.reset (); // reset LFSR - - for (int n = 0; n < N; n++) - randomizer.derandomize (out[n], middle[n]); - - // compare packets - - for (int n = 0; n < N; n++){ - CPPUNIT_ASSERT (in[n] == out[n]); - } -} - diff --git a/gr-atsc/lib/qa_atsci_randomizer.h b/gr-atsc/lib/qa_atsci_randomizer.h deleted file mode 100644 index e0e293e85c..0000000000 --- a/gr-atsc/lib/qa_atsci_randomizer.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _QA_ATSC_RANDOMIZER_H_ -#define _QA_ATSC_RANDOMIZER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/randomizer_impl.h> - -class qa_atsci_randomizer : public CppUnit::TestCase { - private: - atsci_randomizer randomizer; - - public: - - void setUp (){ - // nop - } - - void tearDown (){ - // nop - } - - CPPUNIT_TEST_SUITE (qa_atsci_randomizer); - CPPUNIT_TEST (t0_compare_output_maps); - CPPUNIT_TEST (t1_initial_states); - CPPUNIT_TEST (t2_initial_values); - CPPUNIT_TEST (t3_reset); - CPPUNIT_TEST (t4_high_level); - CPPUNIT_TEST_SUITE_END (); - - - private: - void t0_compare_output_maps (); - void t1_initial_states (); - void t2_initial_values (); - void t3_reset (); - void t4_high_level (); - -}; - -#endif /* _QA_ATSC_RANDOMIZER_H_ */ diff --git a/gr-atsc/lib/qa_atsci_reed_solomon.cc b/gr-atsc/lib/qa_atsci_reed_solomon.cc deleted file mode 100644 index f6c21dd8ce..0000000000 --- a/gr-atsc/lib/qa_atsci_reed_solomon.cc +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include <stdlib.h> -#include <stdio.h> -#include <gnuradio/atsc/reed_solomon_impl.h> -#include "qa_atsci_reed_solomon.h" -#include <string.h> - - -static const int NROOTS = 20; -static const int NTRIALS = 100; -static const int NN = ATSC_MPEG_RS_ENCODED_LENGTH; - -void -qa_atsci_reed_solomon::t0_reed_solomon () -{ - atsc_mpeg_packet_no_sync in; - atsc_mpeg_packet_rs_encoded enc; - atsc_mpeg_packet_no_sync out; - int derrors; - int errlocs[NN]; - int errval; - int errloc; - int decoder_errors = 0; - - for (int nt = 0; nt < NTRIALS; nt++){ - - // test up to the error correction capacity of the code - for (int errors = 0; errors <= NROOTS*2; errors++){ - - // load block with random data and encode - - for (int i = 0; i < ATSC_MPEG_DATA_LENGTH; i++) - in.data[i] = random () & 0xff; - - rs.encode (enc, in); - - memset (errlocs, 0, sizeof (errlocs)); - - for (int i = 0; i < errors; i++){ - - do { - errval = random () & 0xff; - } while (errval == 0); // error value must be non-zero - - do { - errloc = random () % NN; - } while (errlocs[errloc] != 0); // must not choose the same location twice - - errlocs[errloc] = 1; - - enc.data[errloc] ^= errval; // cause the error - } - - // decode the errored block - derrors = rs.decode (out, enc); - - if (errors <= NROOTS/2) { - // We should have handled all these errors and corrected them. - if (derrors != errors){ - fprintf (stderr, " decoder says %d errors, true number is %d\n", derrors, errors); - decoder_errors++; - } - - if (in != out){ - fprintf (stderr, " uncorrected errors!\n"); - decoder_errors++; - } - } else { - // We have been given more errors than we could cope with. Make - // sure that we detect these errors. Complain if we get incorrect - // block but don't say it's incorrect. - bool differs = (in != out); - - if (differs && (derrors < 0)) { - // Reported uncorrectable error accurately - } else if (differs) { - fprintf (stderr, - " decoder found %d of %d errors, but incorrect block\n", - derrors, errors); - } else { - fprintf (stderr, " decoder corrected %d of %d errors unexpectedly\n", - derrors, errors); - } - } - } - } - - CPPUNIT_ASSERT (decoder_errors == 0); -} diff --git a/gr-atsc/lib/qa_atsci_reed_solomon.h b/gr-atsc/lib/qa_atsci_reed_solomon.h deleted file mode 100644 index 0afcd1398b..0000000000 --- a/gr-atsc/lib/qa_atsci_reed_solomon.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_REED_SOLOMON_H_ -#define _QA_ATSC_REED_SOLOMON_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/reed_solomon_impl.h> - -class qa_atsci_reed_solomon : public CppUnit::TestCase { - - CPPUNIT_TEST_SUITE (qa_atsci_reed_solomon); - CPPUNIT_TEST (t0_reed_solomon); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_reed_solomon rs; - - void t0_reed_solomon (); -}; - -#endif /* _QA_ATSC_REED_SOLOMON_H_ */ diff --git a/gr-atsc/lib/qa_atsci_single_viterbi.cc b/gr-atsc/lib/qa_atsci_single_viterbi.cc deleted file mode 100644 index cd5b0451b6..0000000000 --- a/gr-atsc/lib/qa_atsci_single_viterbi.cc +++ /dev/null @@ -1,286 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include <stdlib.h> -#include <stdio.h> -#include <gnuradio/atsc/single_viterbi_impl.h> -#include "qa_atsci_single_viterbi.h" -#include <gnuradio/random.h> -#include <string.h> - - -static const int NTRIALS = 50; -static const int MAXERRORS = 10; -static const int NN = 200; - -static const int MAXDIBIT = 3; - -static gr::random rndm; - -void -qa_atsci_single_viterbi::encode_block (unsigned char *out, unsigned char *in, - unsigned int n) -{ - for (unsigned int i = 0; i < n; i++) { - out[i] = encoder.encode(in[i]); - } -} - - -void -qa_atsci_single_viterbi::decode_block (unsigned char *out, unsigned char *in, - unsigned int n, float noise_factor) -{ - for (unsigned int i = 0; i < n; i++) { - out[i] = decoder.decode((2*in[i]-7) + noise () * noise_factor); - } -} - -float -qa_atsci_single_viterbi::noise () -{ - return 2.0 * (rndm.ran1() - 0.5); // uniformly (-1, 1) -} - -void -qa_atsci_single_viterbi::t0 () -{ - static const int blocklen = NN; - unsigned char in[blocklen]; - unsigned char enc[blocklen]; - unsigned char out[blocklen]; - int decoder_errors = 0; - int delay = decoder.delay (); - int i; - - // printf (" Delay is %d.\n", delay); - - srandom (27); // reproducable sequence of "random" values - - for (int nt = 0; nt < NTRIALS; nt++){ - - // load block with random data and encode - - for (i = 0; i < (blocklen-delay); i++) - in[i] = random () & MAXDIBIT; - for ( ; i < blocklen; i++) - in[i] = 0; /* To empty the delay buffers */ - - encoder.reset (); - encode_block (enc, in, blocklen); - - decoder.reset (); - - // decode the block - decode_block (out, enc, blocklen, 1.0); - - // int offset = delay/4; - int offset = 2; - bool differs = (memcmp (in+offset, - out+delay+offset, blocklen-(delay+offset))); - - // initial values after reset are 0 - for (i = 0; i < delay; i++){ - if (out[i] != 0) - printf (" initial output at %i is %X, not 0\n", - i, out[i]); - } - - if (differs){ - printf (" incorrect data\n"); - - printf ("\n Erroneous result dibits:"); - for (int erri = 0; erri < (NN-delay); erri++) { - if (in[erri] != out[erri+delay]) - printf (" %d", erri); - } - printf ("\n In: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", in[erri]); - } - printf ("\n Out: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", out[erri+delay]); - } - printf ("\n Errs:"); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %c", (in[erri] != out[erri+delay])? '*': ' '); - } - printf ("\n THIS IS A REAL PROBLEM.\n"); - decoder_errors++; - } - } - - printf (" Summary: %d decoder errors out of %d trials.\n", - decoder_errors, NTRIALS); - - CPPUNIT_ASSERT (decoder_errors == 0); -} - -void -qa_atsci_single_viterbi::t1 () -{ - static const int blocklen = NN; - unsigned char in[blocklen]; - unsigned char enc[blocklen]; - unsigned char out[blocklen]; - int errlocs[NN]; - int errval; - int errloc; - int decoder_errors = 0; - int delay = decoder.delay (); - int i; - - // printf (" Delay is %d.\n", delay); - - srandom (1); // reproducable sequence of "random" values - - for (int nt = 0; nt < NTRIALS; nt++){ - - // test up to the error correction capacity of the code - for (int errors = 0; errors <= MAXERRORS; errors++){ - - // load block with random data and encode - - for (i = 0; i < (blocklen-delay); i++) - in[i] = random () & MAXDIBIT; - for ( ; i < blocklen; i++) - in[i] = 0; /* To empty the delay buffers */ - - encoder.reset (); - encode_block (enc, in, blocklen); - - // Now generate 0 to N errors in the encoded symbols. - // - // If we restrict ourselves to damaging the low-order bit, - // our decoder finds and fixes the vast majority of errors. - // - // If we munge any or all of the three bits of the symbol, - // our decoder frequently gets the wrong data even with a single - // error. - // - // Let's see what it can do with just the two low-order bits. - // - // ALSO: Don't let any error be within 12 spots of another - // error. This simulates the muxed behavior. - - memset (errlocs, 0, sizeof (errlocs)); - - for (int j = 0; j < errors; j++){ - - do { - // errval = random () & 3; // FIXME: 1; // FIXME: MAXSYM; - errval = random () & 1; // FIXME: 1; // FIXME: MAXSYM; - } while (errval == 0); // error value must be non-zero - - // Don't insert errors in the first delay slot, since we - // don't have valid history to correct them. Also, don't - // insert burst errors (adjacent errors), or errors within 2, - // since we can't reliably correct them. Also we must not choose - // the same location twice when inserting an error. - - do { - errloc = random () % NN; - } while (errloc < delay || errlocs[errloc] != 0 - || (errloc > 0 && errlocs[errloc-1] != 0) - || (errloc > 1 && errlocs[errloc-2] != 0) - || (errloc < (NN-1) && errlocs[errloc+1] != 0) - || (errloc < (NN-2) && errlocs[errloc+2] != 0)); - - errlocs[errloc] = 1; - - enc[errloc] ^= errval; // cause the error - } - - // decode the errored block - decoder.reset (); - decode_block (out, enc, blocklen, 0.5); - - // int offset = delay/4; - int offset = 2; - bool differs = (memcmp (in+offset, - out+delay+offset, blocklen-(delay+offset))); - - // initial values after reset are 0 - for (i = 0; i < delay; i++){ - if (out[i] != 0) - printf (" initial output at %i is %X, not 0\n", - i, out[i]); - } - - if (differs){ - printf (" %2d errors introduced, %scorrect data\n", - errors, differs? "in": ""); - - // FIXME, should we be able to tell how many errs too? - if (differs) { - //const int ERRTOL = 12; /* Or relate to delay? */ - int shouldfix = 1; - //int lasti = -ERRTOL; - - printf ( " Inserted errors: "); - for (int erri = 0; erri < NN; erri++) { - if (errlocs[erri]) { - printf (" %d", erri); - // if (erri < lasti+ERRTOL) - // shouldfix = 0; - //lasti = erri; - } - } - printf ("\n Erroneous result dibits:"); - for (int erri = 0; erri < (NN-delay); erri++) { - if (in[erri] != out[erri+delay]) - printf (" %d", erri); - } - printf ("\n In: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", in[erri]); - } - printf ("\n Out: "); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %d", out[erri+delay]); - } - printf ("\n Errs:"); - for (int erri = 0; erri < (NN-delay); erri++) { - printf (" %c", (in[erri] != out[erri+delay])? '*': ' '); - } - if (shouldfix) - printf ("\n THIS IS A REAL PROBLEM.\n"); - else - printf ("\n BUT THAT'S OK since errors are too close.\n"); - if (shouldfix) - decoder_errors++; - } - } - } - } - - printf (" Summary: %d decoder errors out of %d trials.\n", - decoder_errors, (MAXERRORS*NTRIALS)); - - CPPUNIT_ASSERT (decoder_errors <= (MAXERRORS*NTRIALS) * .1); -} diff --git a/gr-atsc/lib/qa_atsci_single_viterbi.h b/gr-atsc/lib/qa_atsci_single_viterbi.h deleted file mode 100644 index 571988c559..0000000000 --- a/gr-atsc/lib/qa_atsci_single_viterbi.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_SINGLE_VITERBI_H -#define _QA_ATSC_SINGLE_VITERBI_H - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/single_viterbi_impl.h> -#include <gnuradio/atsc/basic_trellis_encoder_impl.h> - -class qa_atsci_single_viterbi : public CppUnit::TestCase { - private: - atsci_single_viterbi decoder; - atsci_basic_trellis_encoder encoder; - - CPPUNIT_TEST_SUITE (qa_atsci_single_viterbi); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - - private: - - void t0 (); - void t1 (); - - void encode_block(unsigned char *out, unsigned char *in, unsigned n); - void decode_block(unsigned char *out, unsigned char *in, unsigned n, float noise_factor); - float noise (); - -}; - -#endif /* _QA_ATSC_SINGLE_VITERBI_H_ */ diff --git a/gr-atsc/lib/qa_atsci_sliding_correlator.cc b/gr-atsc/lib/qa_atsci_sliding_correlator.cc deleted file mode 100644 index 8b00e0ff08..0000000000 --- a/gr-atsc/lib/qa_atsci_sliding_correlator.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cppunit/TestAssert.h> -#include "qa_atsci_sliding_correlator.h" -#include <cstdio> - -void -qa_atsci_sliding_correlator::t0 () -{ - -#if 0 - int count = 0; - int i; - for (i = 0; i < 100; i++) - printf ("%6d: %3d\n", count++, corr.input_bit (i & 1)); - - for (i = 0; i < 511; i++) - printf ("%6d: %3d\n", count++, corr.input_bit (atsc_pn511[i])); - - for (i = 0; i < 100; i++) - printf ("%6d: %3d\n", count++, corr.input_bit ((i & 2) != 0)); - - for (i = 0; i < 511; i++) - printf ("%6d: %3d\n", count++, corr.input_bit (atsc_pn511[i] ^ 1)); - - for (i = 0; i < 100; i++) - printf ("%6d: %3d\n", count++, - corr.input_bit (atsc_pn511[i] ^ atsc_pn511[i+31])); -#endif - -} diff --git a/gr-atsc/lib/qa_atsci_sliding_correlator.h b/gr-atsc/lib/qa_atsci_sliding_correlator.h deleted file mode 100644 index ea02449711..0000000000 --- a/gr-atsc/lib/qa_atsci_sliding_correlator.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_SLIDING_CORRELATOR_H_ -#define _QA_ATSC_SLIDING_CORRELATOR_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> -#include <stdio.h> - -#include <gnuradio/atsc/sliding_correlator_impl.h> - -class qa_atsci_sliding_correlator : public CppUnit::TestCase { - - public: - - void setUp (void) - { - corr.reset (); - } - - CPPUNIT_TEST_SUITE (qa_atsci_sliding_correlator); - CPPUNIT_TEST (t0); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_sliding_correlator corr; - - void t0 (); -}; - - -#endif /* _QA_ATSC_SLIDING_CORRELATOR_H_ */ diff --git a/gr-atsc/lib/qa_atsci_trellis_encoder.cc b/gr-atsc/lib/qa_atsci_trellis_encoder.cc deleted file mode 100644 index 902dcebf82..0000000000 --- a/gr-atsc/lib/qa_atsci_trellis_encoder.cc +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include "qa_atsci_trellis_encoder.h" -#include <cstdio> -#include <string.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - - -static const int NCODERS = atsci_trellis_encoder::NCODERS; - -void -qa_atsci_trellis_encoder::t0 () -{ -#if 0 // generate i/o test data for t1 - - atsc_mpeg_packet_rs_encoded in[NCODERS]; - atsc_data_segment out[NCODERS]; - - - memset (in, 0, sizeof (in)); - memset (out, 0, sizeof (out)); - - srandom (1); - - printf ("@@@ INPUT @@@\n"); - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (in[i].data); j++){ - int t = (random () >> 8) & 0xff; // 8 random bits - in[i].data[j] = t; - printf ("%d\n", t); - } - } - - enc.reset (); - enc.encode (out, in); - - printf ("@@@ OUTPUT @@@\n"); - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (out[i].data); j++){ - printf ("%d\n", out[i].data[j]); - } - } -#endif -} - -void -qa_atsci_trellis_encoder::t1 () -{ - atsc_mpeg_packet_rs_encoded in[NCODERS]; - atsc_data_segment expected_out[NCODERS]; - atsc_data_segment actual_out[NCODERS]; - static const unsigned char raw_input[NCODERS * NELEM (in[0].data)] = { -#include "qa_atsci_trellis_encoder_t1_input.dat" - }; - static const unsigned char raw_output[NCODERS * NELEM (expected_out[0].data)] = { -#include "qa_atsci_trellis_encoder_t1_output.dat" - }; - - - // load up input - const unsigned char *r = &raw_input[0]; - for (int i = 0; i < NCODERS; i++){ - in[i].pli.set_regular_seg (false, i); - for (unsigned int j = 0; j < NELEM (in[i].data); j++){ - in[i].data[j] = *r++; - } - } - - // load up expected output - r = &raw_output[0]; - for (int i = 0; i < NCODERS; i++){ - expected_out[i].pli.set_regular_seg (false, i); - for (unsigned int j = 0; j < NELEM (expected_out[i].data); j++){ - expected_out[i].data[j] = *r++; - } - } - - memset (&actual_out, 0, sizeof (actual_out)); // ensure zero - - enc.reset (); - enc.encode (actual_out, in); // trellis code test data - - for (int i = 0; i < NCODERS; i++){ // check the result - CPPUNIT_ASSERT (expected_out[i] == actual_out[i]); - CPPUNIT_ASSERT (expected_out[i].pli == actual_out[i].pli); - } -} diff --git a/gr-atsc/lib/qa_atsci_trellis_encoder.h b/gr-atsc/lib/qa_atsci_trellis_encoder.h deleted file mode 100644 index 16567488c8..0000000000 --- a/gr-atsc/lib/qa_atsci_trellis_encoder.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_TRELLIS_ENCODER_H_ -#define _QA_ATSC_TRELLIS_ENCODER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> -#include <stdio.h> - -#include <gnuradio/atsc/trellis_encoder_impl.h> - -class qa_atsci_trellis_encoder : public CppUnit::TestCase { - - public: - - void setUp (void) - { - enc.reset (); - } - - CPPUNIT_TEST_SUITE (qa_atsci_trellis_encoder); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_trellis_encoder enc; - - void t0 (); - void t1 (); -}; - - -#endif /* _QA_ATSC_TRELLIS_ENCODER_H_ */ diff --git a/gr-atsc/lib/qa_atsci_trellis_encoder_t1_input.dat b/gr-atsc/lib/qa_atsci_trellis_encoder_t1_input.dat deleted file mode 100644 index e6109ddfc6..0000000000 --- a/gr-atsc/lib/qa_atsci_trellis_encoder_t1_input.dat +++ /dev/null @@ -1,2484 +0,0 @@ -69, -35, -152, -72, -220, -92, -148, -88, -31, -124, -88, -215, -65, -30, -169, -225, -0, -98, -8, -39, -35, -233, -205, -67, -15, -37, -249, -114, -194, -215, -196, -7, -251, -93, -80, -215, -186, -228, -48, -217, -97, -137, -177, -163, -168, -90, -132, -168, -189, -140, -208, -224, -118, -158, -36, -134, -196, -29, -248, -134, -245, -189, -141, -240, -26, -221, -200, -212, -194, -248, -173, -35, -130, -95, -198, -42, -185, -74, -211, -119, -215, -164, -88, -78, -66, -124, -212, -6, -154, -204, -141, -143, -137, -27, -127, -164, -249, -72, -120, -187, -64, -38, -222, -195, -133, -165, -237, -63, -240, -193, -183, -199, -101, -15, -21, -168, -140, -233, -175, -38, -182, -60, -182, -64, -87, -53, -228, -80, -126, -93, -11, -191, -132, -234, -130, -10, -143, -112, -74, -127, -49, -2, -71, -150, -18, -93, -63, -158, -71, -238, -197, -253, -43, -123, -62, -130, -177, -35, -211, -47, -129, -223, -238, -6, -202, -112, -17, -89, -224, -91, -217, -17, -94, -33, -168, -112, -126, -231, -14, -197, -214, -212, -195, -1, -79, -1, -132, -1, -36, -87, -48, -165, -55, -30, -172, -1, -143, -189, -90, -112, -24, -52, -130, -119, -85, -42, -231, -211, -18, -246, -153, -232, -202, -92, -234, -26, -93, -110, -27, -130, -197, -75, -40, -253, -106, -212, -254, -250, -145, -89, -106, -170, -141, -236, -33, -227, -23, -9, -183, -41, -255, -80, -18, -201, -172, -252, -227, -10, -107, -255, -141, -49, -74, -181, -46, -181, -138, -44, -175, -27, -133, -26, -198, -19, -6, -232, -246, -29, -241, -174, -71, -240, -254, -90, -185, -171, -87, -157, -182, -194, -157, -67, -243, -232, -248, -34, -157, -130, -78, -77, -158, -212, -103, -100, -231, -110, -76, -222, -140, -61, -140, -211, -46, -138, -46, -232, -54, -133, -133, -236, -72, -35, -47, -59, -11, -40, -94, -168, -171, -172, -246, -74, -128, -93, -174, -104, -204, -251, -70, -88, -57, -210, -44, -103, -93, -90, -79, -148, -223, -213, -129, -39, -248, -177, -99, -4, -217, -193, -172, -133, -110, -162, -207, -239, -0, -126, -87, -205, -121, -158, -37, -179, -113, -81, -27, -207, -171, -107, -99, -139, -65, -228, -178, -58, -149, -22, -62, -111, -216, -234, -244, -70, -141, -195, -54, -142, -66, -141, -91, -187, -44, -129, -111, -157, -210, -138, -108, -126, -245, -208, -9, -55, -180, -188, -113, -74, -211, -175, -185, -171, -154, -174, -242, -40, -114, -40, -183, -180, -182, -19, -112, -226, -148, -223, -128, -103, -106, -237, -229, -96, -189, -239, -151, -114, -172, -8, -189, -127, -184, -118, -43, -83, -37, -29, -123, -151, -70, -50, -76, -252, -69, -188, -223, -218, -156, -96, -65, -6, -77, -39, -102, -11, -23, -254, -125, -195, -7, -59, -67, -191, -178, -111, -18, -215, -141, -142, -111, -211, -192, -187, -208, -6, -119, -176, -225, -19, -16, -34, -26, -94, -74, -128, -105, -97, -127, -231, -37, -134, -35, -104, -69, -213, -215, -88, -172, -101, -230, -27, -56, -167, -214, -9, -174, -78, -185, -143, -98, -202, -178, -124, -40, -253, -253, -146, -94, -124, -122, -131, -2, -157, -236, -72, -114, -196, -161, -31, -41, -136, -58, -98, -47, -17, -107, -222, -96, -37, -110, -194, -239, -32, -63, -24, -29, -60, -170, -124, -185, -37, -0, -188, -195, -237, -4, -53, -178, -165, -84, -219, -45, -143, -62, -93, -161, -169, -60, -1, -206, -170, -196, -190, -203, -4, -214, -232, -65, -129, -101, -250, -166, -102, -182, -105, -83, -186, -159, -5, -96, -244, -225, -142, -132, -31, -236, -37, -201, -40, -39, -152, -210, -236, -86, -157, -240, -44, -134, -49, -173, -235, -44, -83, -81, -226, -189, -165, -157, -93, -170, -254, -81, -140, -141, -213, -171, -121, -251, -117, -161, -35, -13, -116, -16, -99, -17, -0, -144, -152, -50, -61, -132, -95, -145, -214, -66, -79, -123, -223, -172, -38, -222, -254, -178, -107, -211, -94, -229, -207, -212, -134, -242, -225, -251, -2, -69, -12, -3, -214, -164, -54, -20, -40, -149, -165, -254, -215, -245, -122, -183, -162, -160, -150, -160, -83, -1, -116, -177, -230, -67, -133, -109, -54, -103, -104, -56, -173, -117, -60, -131, -26, -115, -151, -67, -9, -61, -65, -224, -50, -188, -152, -212, -92, -46, -116, -175, -48, -232, -97, -23, -44, -231, -132, -98, -78, -237, -155, -251, -98, -215, -126, -124, -74, -22, -191, -83, -83, -1, -52, -133, -189, -205, -90, -26, -252, -207, -202, -45, -183, -43, -68, -228, -19, -201, -70, -98, -182, -225, -93, -25, -185, -220, -150, -4, -243, -86, -88, -70, -88, -141, -203, -21, -90, -38, -48, -87, -245, -250, -132, -173, -38, -200, -145, -57, -145, -215, -156, -72, -185, -250, -98, -114, -215, -248, -119, -202, -78, -207, -16, -166, -92, -220, -188, -183, -2, -237, -14, -247, -231, -146, -164, -14, -91, -53, -72, -237, -13, -228, -53, -199, -222, -151, -57, -181, -144, -177, -127, -222, -128, -143, -133, -220, -107, -66, -147, -109, -47, -162, -101, -23, -52, -9, -37, -143, -63, -110, -125, -77, -82, -179, -20, -49, -75, -78, -230, -219, -255, -102, -186, -127, -246, -64, -92, -98, -130, -240, -208, -177, -146, -53, -200, -198, -63, -238, -86, -127, -92, -212, -204, -175, -135, -224, -224, -210, -47, -199, -173, -46, -45, -104, -174, -36, -168, -10, -134, -42, -250, -86, -220, -141, -139, -165, -83, -203, -148, -170, -74, -241, -126, -22, -160, -6, -247, -128, -216, -38, -72, -134, -85, -117, -238, -3, -153, -151, -13, -32, -194, -8, -118, -158, -149, -2, -68, -233, -205, -217, -148, -23, -202, -19, -46, -106, -25, -38, -235, -241, -76, -51, -120, -162, -169, -103, -165, -66, -254, -179, -98, -192, -188, -217, -95, -82, -219, -164, -59, -169, -125, -208, -193, -71, -227, -239, -177, -252, -22, -157, -238, -98, -208, -102, -5, -121, -206, -170, -188, -204, -94, -31, -141, -26, -248, -237, -108, -212, -146, -168, -125, -15, -120, -62, -87, -91, -46, -9, -88, -68, -166, -70, -167, -118, -173, -172, -240, -124, -87, -172, -72, -181, -203, -214, -207, -196, -196, -59, -152, -86, -228, -21, -102, -92, -84, -190, -183, -131, -199, -16, -199, -110, -86, -110, -229, -4, -27, -213, -128, -114, -129, -201, -39, -77, -160, -247, -17, -100, -51, -169, -187, -23, -191, -33, -115, -20, -223, -43, -151, -167, -59, -94, -21, -146, -205, -251, -150, -233, -208, -23, -91, -82, -224, -131, -159, -129, -122, -177, -229, -173, -91, -160, -196, -27, -194, -56, -47, -162, -99, -198, -74, -159, -37, -95, -49, -243, -91, -200, -220, -43, -223, -55, -126, -192, -187, -29, -65, -53, -207, -39, -226, -42, -200, -167, -69, -138, -223, -116, -45, -67, -59, -119, -226, -97, -215, -20, -84, -50, -221, -48, -94, -188, -104, -220, -125, -35, -249, -191, -89, -200, -230, -60, -243, -175, -227, -56, -57, -195, -173, -103, -7, -233, -222, -234, -74, -181, -254, -158, -232, -219, -207, -70, -152, -56, -34, -22, -92, -28, -213, -181, -229, -188, -241, -216, -107, -213, -17, -165, -153, -190, -12, -160, -167, -235, -139, -242, -161, -138, -144, -137, -101, -96, -208, -254, -152, -242, -20, -244, -14, -234, -170, -243, -167, -155, -204, -19, -113, -221, -184, -11, -156, -197, -171, -68, -177, -55, -54, -82, -193, -199, -220, -39, -39, -172, -37, -192, -158, -58, -180, -173, -37, -94, -161, -204, -250, -109, -224, -108, -75, -153, -119, -232, -94, -35, -45, -15, -90, -99, -98, -27, -43, -62, -66, -83, -234, -104, -20, -137, -162, -201, -54, -200, -39, -215, -149, -34, -69, -117, -142, -144, -14, -6, -121, -109, -41, -166, -125, -131, -10, -223, -159, -53, -29, -225, -137, -8, -74, -157, -145, -237, -102, -200, -181, -142, -159, -74, -177, -229, -192, -64, -118, -207, -70, -239, -60, -111, -149, -185, -243, -160, -153, -146, -214, -182, -116, -95, -191, -190, -253, -80, -171, -99, -25, -97, -242, -185, -172, -163, -158, -108, -228, -20, -59, -42, -4, -120, -154, -154, -49, -141, -58, -202, -32, -16, -129, -149, -112, -65, -83, -109, -146, -255, -209, -171, -96, -196, -100, -13, -103, -2, -121, -76, -23, -181, -118, -28, -45, -17, -183, -95, -158, -241, -42, -191, -2, -172, -84, -115, -237, -168, -224, -127, -168, -178, -42, -8, -118, -142, -22, -222, -145, -143, -42, -169, -69, -160, -197, -114, -177, -124, -210, -80, -110, -252, -16, -113, -168, -101, -228, -149, -13, -197, -20, -181, -119, -63, -190, -237, -206, -212, -203, -95, -100, -245, -9, -169, -150, -207, -28, -72, -76, -238, -153, -186, -234, -169, -44, -146, -14, -17, -40, -28, -214, -61, -209, -77, -125, -144, -59, -75, -100, -6, -171, -200, -252, -180, -114, -147, -131, -142, -219, -207, -124, -117, -138, -102, -31, -183, -249, -45, -200, -34, -74, -158, -96, -27, -236, -221, -172, -39, -40, -16, -46, -212, -217, -43, -136, -75, -190, -11, -217, -154, -219, -85, -15, -102, -188, -46, -29, -182, -92, -229, -217, -166, -131, -57, -194, -112, -22, -110, -151, -63, -127, -197, -19, -88, -241, -156, -163, -175, -168, -125, -73, -131, -211, -88, -233, -143, -135, -7, -70, -227, -236, -31, -138, -112, -88, -77, -224, -111, -187, -120, -174, -59, -62, -194, -147, -47, -94, -55, -222, -6, -180, -40, -138, -135, -129, -116, -23, -8, -123, -93, -236, -103, -125, -118, -216, -213, -195, -184, -69, -127, -49, -244, -187, -111, -182, -78, -158, -21, -134, -125, -27, -59, -165, -165, -195, -38, -25, -218, -47, -149, -56, -27, -252, -181, -146, -213, -139, -86, -142, -208, -213, -191, -196, -145, -46, -123, -223, -205, -144, -102, -75, -171, -161, -240, -81, -101, -23, -107, -64, -70, -0, -120, -98, -253, -46, -244, -210, -185, -74, -96, -138, -32, -32, -78, -177, -79, -201, -145, -28, -89, -248, -103, -5, -154, -88, -87, -255, -112, -195, -63, -183, -196, -184, -25, -193, -230, -14, -148, -160, -89, -245, -42, -122, -21, -121, -43, -100, -67, -189, -129, -157, -182, -233, -162, -80, -65, -250, -80, -178, -190, -143, -105, -130, -72, -131, -67, -47, -145, -216, -208, -235, -205, -251, -101, -227, -116, -145, -71, -183, -78, -201, -84, -4, -178, -247, -85, -244, -242, -165, -166, -176, -53, -16, -50, -126, -147, -118, -173, -37, -78, -125, -16, -28, -120, -117, -0, -237, -6, -71, -164, -85, -17, -249, -90, -195, -240, -175, -184, -227, -85, -94, -147, -138, -110, -197, -8, -2, -60, -182, -39, -139, -51, -55, -167, -172, -173, -167, -153, -179, -239, -62, -9, -1, -55, -99, -196, -40, -19, -124, -12, -104, -219, -159, -243, -74, -101, -251, -76, -161, -178, -115, -44, -230, -171, -212, -146, -88, -124, -44, -12, -108, -107, -21, -109, -163, -121, -50, -204, -140, -175, -216, -244, -138, -119, -232, -213, -221, -228, -33, -127, -150, -149, -172, -124, -64, -129, -15, -153, -253, -59, -166, -105, -167, -187, -215, -74, -53, -9, -22, -193, -184, -238, -182, -67, -102, -158, -24, -68, -130, -58, -195, -24, -207, -111, -149, -16, -240, -164, -170, -238, -224, -80, -88, -135, -12, -47, -209, -65, -57, -232, -2, -242, -215, -185, -53, -62, -87, -78, -130, -218, -136, -69, -243, -87, -181, -136, -104, -166, -44, -18, -148, -13, -99, -237, -148, -111, -28, -102, -176, -86, -79, -179, -72, -38, -109, -125, -100, -197, -203, -231, -159, -83, -44, -146, -171, -226, -27, -20, -137, -72, -39, -29, -85, -138, -10, -234, -249, -39, -81, -170, -125, -160, -94, -197, -198, -203, -67, -43, -145, -15, -18, -48, -98, -63, -195, -14, -34, -222, -35, -171, -39, -74, -201, -125, -212, -212, -103, -206, -251, -185, -121, -121, -89, -215, -63, -32, -163, -130, -75, -52, -145, -94, -101, -244, -158, -40, -3, -192, -7, -38, -107, -47, -113, -52, -172, -69, -8, -20, -20, -4, -205, -141, -126, -38, -101, -189, -71, -9, -64, -147, -62, -210, -241, -163, -198, -143, -204, -202, -80, -212, -241, -187, -4, -98, -240, -176, -168, -249, -197, -188, -254, -146, -73, -124, -185, -175, -57, -1, -184, -122, -148, -246, -76, -134, -154, -19, -21, -102, -222, -102, -59, -207, -33, -63, -49, -18, -240, -218, -11, -181, -150, -9, -72, -224, -134, -2, -143, -192, -3, -71, -58, -151, -62, -135, -29, -216, -154, -51, -63, -120, -153, -123, -72, -187, -187, -122, -206, -171, -84, -218, -97, -234, -228, -169, -203, -106, -172, -90, -42, -175, -162, -101, -71, -224, -236, -101, -185, -135, -153, -248, -0, -51, -116, -72, -238, -47, -194, -189, -218, -22, -151, -60, -1, -123, -230, -204, -230, -146, -38, -17, -66, -200, -118, -137, -169, -99, -239, -98, -234, -136, -91, -234, -187, -208, -51, -170, -255, -245, -103, -218, -11, -255, -22, -12, -123, -252, -217, -97, -142, -255, -115, -208, -200, -234, -90, -114, -77, -73, -212, -56, -209, -48, -35, -141, -0, -86, -55, -0, -75, -159, -218, -87, -159, -240, -100, -26, -237, -61, -124, -124, -61, -239, -77, -6, -218, -167, -120, -39, -241, -77, -96, -195, -125, -132, -80, -126, -218, -136, -126, -38, -40, -88, -126, -199, -73, -226, -225, -55, -32, -94, -179, -94, -78, -1, -100, -40, -168, -220, -80, -154, -41, -177, -93, -167, -53, -173, -37, -16, -54, -164, -55, -94, -253, -181, -37, -70, -152, -7, -126, -184, -102, -50, -22, -180, -51, -123, -221, -220, -87, -46, -118, -129, -223, -211, -41, -20, -129, -78, -37, -183, -243, -92, -21, -240, -17, -59, -55, -169, -67, -181, -98, -170, -231, -121, -94, -27, -244, -60, -247, -76, -106, -109, -206, -73, -64, -247, -94, -193, -70, -131, -121, -57, -223, -143, -41, -241, -203, -97, -155, -14, -23, -253, -184, -255, -119, -23, -26, -108, -83, -17, -184, -190, -127, -135, -7, -191, -126, -102, -129, -196, -233, -251, -254, -200, -138, -40, -186, -85, -137, -85, -100, -160, -83, -29, -159, -202, -53, -185, -54, -137, -203, -239, -71, -74, -119, -79, -10, -245, -181, -140, -186, -158, -135, -184, -103, -18, -224, -33, -103, -106, -118, -204, -10, -201, -234, -170, -147, -31, -99, -202, -168, -47, -186, -239, -121, -50, -62, -131, -39, -243, -15, -225, -146, -151, -154, -249, -169, -123, -26, -17, -229, -145, -221, -239, -90, -199, -153, -238, -230, -253, -185, -142, -44, -116, -126, -166, -166, -189, -41, -206, -176, -57, -176, -67, -208, -74, -60, -121, -197, -87, -138, -170, -232, -104, -154, -67, -48, -52, -50, -22, -49, -236, -165, -94, -96, -36, -4, -7, -225, -46, -213, -146, -104, -133, -213, -57, -207, -18, -178, -149, -105, -61, -63, -82, -166, -218, -150, -214, -14, -200, -237, -64, -180, -147, -159, -21, -183, -164, -28, -152, -210, -241, -42, -59, -118, -0, -116, -70, -18, diff --git a/gr-atsc/lib/qa_atsci_trellis_encoder_t1_output.dat b/gr-atsc/lib/qa_atsci_trellis_encoder_t1_output.dat deleted file mode 100644 index 175d482b4c..0000000000 --- a/gr-atsc/lib/qa_atsci_trellis_encoder_t1_output.dat +++ /dev/null @@ -1,9984 +0,0 @@ -6, -1, -1, -6, -2, -0, -4, -2, -6, -2, -4, -2, -0, -2, -2, -6, -1, -4, -6, -1, -7, -3, -6, -3, -2, -7, -3, -7, -2, -4, -1, -4, -3, -7, -7, -5, -7, -3, -5, -7, -2, -2, -0, -5, -0, -4, -5, -5, -3, -0, -5, -2, -3, -1, -5, -2, -1, -7, -5, -5, -0, -7, -3, -2, -1, -2, -0, -4, -0, -1, -5, -1, -5, -1, -0, -1, -1, -6, -5, -4, -1, -1, -1, -3, -4, -5, -7, -0, -3, -1, -6, -6, -0, -5, -1, -6, -3, -7, -7, -7, -0, -0, -2, -7, -7, -3, -7, -4, -7, -6, -6, -3, -1, -5, -7, -3, -5, -2, -4, -4, -2, -6, -6, -2, -6, -6, -1, -0, -5, -2, -7, -6, -4, -3, -5, -2, -2, -6, -3, -5, -1, -7, -5, -3, -2, -3, -4, -7, -5, -3, -0, -2, -3, -1, -1, -5, -5, -2, -1, -1, -2, -5, -7, -2, -4, -1, -7, -1, -0, -2, -0, -5, -4, -7, -5, -5, -5, -5, -4, -1, -5, -5, -3, -1, -0, -4, -5, -6, -6, -7, -7, -7, -4, -0, -1, -1, -4, -1, -3, -2, -6, -0, -5, -0, -3, -1, -7, -5, -2, -0, -2, -5, -3, -3, -1, -1, -1, -2, -2, -5, -7, -7, -0, -4, -3, -7, -3, -2, -3, -6, -4, -7, -7, -5, -0, -5, -4, -0, -0, -4, -0, -7, -4, -0, -2, -1, -4, -2, -5, -7, -7, -2, -7, -3, -0, -1, -6, -7, -4, -6, -6, -7, -5, -3, -5, -6, -4, -4, -7, -2, -2, -5, -0, -2, -1, -3, -5, -0, -2, -5, -7, -2, -3, -4, -4, -2, -1, -0, -1, -0, -3, -2, -0, -3, -7, -5, -0, -3, -7, -3, -7, -4, -3, -2, -1, -3, -4, -0, -6, -1, -6, -7, -6, -0, -2, -1, -0, -6, -7, -5, -1, -5, -4, -6, -6, -2, -4, -6, -5, -2, -1, -0, -2, -1, -2, -2, -3, -1, -4, -0, -6, -3, -7, -1, -4, -7, -5, -5, -5, -0, -6, -4, -4, -7, -6, -0, -6, -4, -4, -4, -5, -3, -3, -0, -4, -2, -6, -3, -1, -3, -3, -3, -1, -5, -7, -2, -0, -0, -5, -5, -4, -1, -3, -7, -3, -3, -2, -1, -6, -2, -6, -1, -7, -1, -6, -2, -4, -4, -6, -0, -3, -1, -2, -7, -5, -5, -6, -0, -5, -1, -1, -7, -5, -4, -5, -0, -5, -7, -3, -0, -6, -2, -6, -3, -7, -5, -4, -7, -5, -0, -5, -6, -6, -2, -6, -6, -2, -2, -1, -3, -7, -1, -5, -1, -1, -7, -1, -4, -6, -0, -6, -0, -0, -0, -7, -4, -0, -1, -4, -0, -5, -0, -6, -3, -3, -7, -6, -1, -7, -5, -3, -2, -4, -2, -3, -7, -3, -3, -6, -0, -5, -7, -7, -5, -1, -1, -5, -6, -2, -0, -3, -3, -7, -6, -4, -0, -6, -6, -3, -4, -2, -7, -5, -3, -2, -6, -5, -7, -6, -2, -2, -4, -3, -7, -7, -0, -6, -3, -0, -3, -1, -1, -4, -4, -7, -6, -4, -1, -1, -3, -7, -6, -4, -6, -0, -4, -0, -6, -7, -2, -0, -0, -7, -0, -5, -0, -0, -4, -1, -3, -5, -6, -7, -1, -4, -2, -6, -4, -0, -0, -6, -1, -1, -3, -5, -0, -7, -3, -4, -0, -4, -4, -2, -1, -5, -7, -7, -5, -3, -5, -4, -2, -4, -0, -3, -7, -3, -2, -4, -6, -0, -1, -6, -3, -2, -2, -1, -0, -0, -6, -1, -2, -7, -1, -5, -7, -7, -7, -3, -7, -3, -3, -4, -5, -3, -1, -0, -6, -3, -1, -6, -1, -3, -3, -3, -2, -4, -5, -5, -4, -6, -1, -0, -7, -6, -0, -7, -2, -5, -7, -2, -0, -6, -5, -0, -6, -0, -1, -4, -7, -6, -6, -0, -0, -5, -3, -0, -2, -6, -2, -1, -5, -4, -0, -2, -6, -2, -6, -2, -7, -1, -4, -4, -5, -6, -2, -7, -7, -6, -4, -3, -5, -4, -6, -7, -3, -5, -7, -1, -7, -7, -6, -3, -1, -1, -3, -3, -4, -4, -5, -1, -0, -1, -5, -6, -1, -4, -1, -6, -7, -3, -7, -1, -7, -3, -6, -0, -3, -5, -1, -0, -3, -5, -6, -7, -3, -6, -4, -2, -0, -0, -1, -0, -2, -5, -0, -6, -2, -4, -4, -1, -1, -1, -1, -4, -2, -3, -4, -6, -2, -4, -4, -6, -0, -2, -1, -6, -3, -0, -6, -1, -1, -2, -6, -2, -3, -0, -3, -5, -7, -1, -7, -0, -0, -5, -5, -5, -5, -2, -2, -4, -4, -4, -7, -7, -3, -0, -4, -4, -3, -3, -6, -7, -3, -5, -2, -7, -7, -7, -5, -3, -6, -5, -5, -1, -3, -4, -2, -2, -0, -5, -6, -7, -6, -1, -4, -1, -0, -1, -7, -2, -1, -3, -2, -4, -3, -5, -3, -7, -3, -6, -5, -6, -1, -1, -6, -7, -7, -7, -5, -4, -3, -0, -7, -3, -4, -4, -3, -5, -6, -0, -1, -1, -6, -4, -0, -3, -1, -7, -1, -1, -0, -3, -1, -4, -4, -0, -5, -2, -4, -3, -7, -3, -2, -1, -5, -3, -6, -0, -2, -2, -3, -6, -2, -2, -5, -3, -5, -1, -5, -4, -6, -5, -3, -2, -6, -6, -2, -4, -5, -3, -0, -0, -3, -0, -2, -7, -1, -7, -4, -3, -1, -2, -7, -0, -3, -5, -0, -1, -4, -1, -6, -3, -5, -4, -3, -0, -6, -4, -0, -5, -5, -3, -7, -4, -1, -4, -4, -4, -0, -7, -0, -3, -0, -0, -1, -1, -5, -2, -3, -4, -0, -7, -4, -2, -5, -3, -3, -4, -1, -3, -1, -6, -6, -2, -6, -6, -6, -7, -2, -5, -7, -5, -7, -3, -5, -2, -3, -1, -4, -2, -2, -6, -4, -1, -2, -5, -4, -5, -7, -0, -2, -6, -1, -4, -1, -7, -6, -5, -1, -0, -2, -7, -1, -3, -0, -0, -2, -4, -5, -3, -4, -7, -6, -7, -2, -3, -5, -0, -4, -1, -4, -4, -5, -1, -5, -2, -0, -0, -2, -4, -2, -0, -1, -1, -6, -1, -6, -0, -2, -5, -2, -2, -3, -5, -6, -6, -0, -3, -0, -2, -1, -0, -3, -5, -3, -0, -4, -2, -6, -2, -4, -5, -6, -1, -7, -2, -0, -7, -0, -3, -3, -6, -6, -0, -0, -0, -0, -6, -3, -3, -4, -1, -7, -3, -7, -7, -4, -3, -5, -7, -7, -0, -2, -3, -4, -7, -1, -1, -0, -5, -4, -1, -6, -3, -5, -6, -5, -0, -5, -3, -6, -7, -1, -5, -2, -5, -6, -2, -2, -7, -5, -4, -1, -6, -2, -3, -1, -7, -4, -7, -4, -3, -1, -7, -0, -6, -6, -2, -0, -2, -4, -5, -0, -4, -1, -3, -1, -3, -7, -4, -5, -2, -2, -3, -0, -5, -5, -2, -4, -3, -7, -0, -2, -3, -3, -6, -2, -6, -3, -4, -5, -0, -4, -2, -2, -5, -5, -0, -5, -4, -2, -4, -2, -7, -3, -7, -3, -7, -7, -2, -2, -2, -6, -2, -6, -1, -3, -1, -1, -2, -4, -7, -4, -1, -1, -1, -7, -5, -6, -1, -5, -0, -3, -5, -0, -4, -6, -2, -5, -5, -6, -5, -5, -4, -5, -3, -0, -5, -0, -0, -1, -3, -5, -3, -1, -2, -1, -2, -2, -6, -6, -4, -1, -0, -2, -4, -5, -5, -1, -4, -3, -6, -5, -4, -7, -1, -0, -5, -5, -6, -5, -0, -5, -3, -6, -0, -6, -4, -6, -4, -1, -6, -1, -4, -1, -7, -4, -0, -6, -3, -1, -1, -5, -3, -5, -0, -7, -6, -0, -0, -3, -7, -6, -6, -5, -5, -5, -6, -4, -0, -4, -0, -3, -0, -6, -2, -3, -7, -7, -5, -3, -0, -6, -2, -2, -5, -1, -1, -6, -4, -6, -2, -3, -4, -1, -3, -2, -2, -4, -6, -0, -7, -0, -4, -0, -2, -2, -7, -5, -4, -5, -4, -6, -1, -0, -6, -5, -1, -6, -6, -0, -6, -0, -2, -3, -5, -0, -3, -0, -2, -5, -2, -7, -5, -3, -3, -3, -5, -4, -7, -7, -4, -4, -3, -5, -2, -3, -7, -2, -5, -6, -0, -5, -4, -7, -5, -5, -6, -0, -2, -2, -7, -3, -1, -7, -2, -5, -7, -7, -1, -5, -2, -5, -2, -7, -0, -6, -3, -3, -6, -0, -4, -4, -5, -0, -0, -0, -1, -2, -3, -0, -2, -3, -3, -7, -2, -1, -6, -7, -0, -7, -2, -7, -5, -7, -1, -7, -4, -4, -3, -3, -1, -1, -6, -7, -6, -0, -1, -0, -6, -7, -1, -6, -4, -3, -7, -0, -6, -7, -5, -7, -3, -7, -3, -4, -1, -4, -1, -1, -5, -1, -7, -5, -1, -4, -4, -2, -4, -1, -1, -4, -4, -3, -6, -3, -3, -7, -3, -7, -3, -6, -7, -3, -7, -0, -0, -0, -4, -5, -1, -7, -7, -2, -2, -3, -1, -7, -6, -7, -7, -7, -7, -0, -6, -5, -6, -0, -1, -5, -5, -1, -7, -6, -2, -7, -0, -0, -7, -3, -7, -5, -0, -5, -6, -0, -4, -3, -0, -5, -5, -5, -6, -3, -1, -1, -6, -4, -6, -4, -0, -0, -7, -1, -2, -4, -6, -1, -5, -4, -7, -3, -4, -1, -0, -3, -3, -5, -6, -7, -4, -2, -1, -5, -2, -0, -7, -6, -1, -0, -1, -0, -1, -3, -7, -3, -1, -3, -3, -6, -5, -5, -2, -3, -6, -7, -4, -0, -4, -5, -2, -7, -3, -0, -4, -7, -2, -6, -5, -7, -3, -3, -6, -5, -2, -5, -2, -2, -3, -4, -0, -7, -3, -6, -5, -1, -0, -2, -1, -4, -3, -4, -3, -2, -0, -4, -6, -5, -6, -6, -4, -0, -4, -0, -7, -0, -3, -4, -0, -1, -1, -5, -3, -4, -7, -4, -2, -4, -7, -0, -6, -7, -6, -6, -6, -1, -1, -6, -0, -0, -4, -4, -7, -6, -6, -4, -5, -0, -1, -2, -4, -0, -1, -4, -3, -4, -1, -2, -7, -6, -5, -5, -6, -6, -4, -2, -4, -6, -2, -7, -2, -7, -1, -2, -3, -1, -7, -3, -5, -1, -4, -1, -4, -1, -7, -4, -1, -0, -7, -7, -4, -2, -0, -7, -6, -1, -2, -2, -1, -5, -4, -2, -5, -6, -4, -6, -7, -1, -2, -7, -5, -6, -1, -0, -0, -7, -0, -6, -5, -3, -1, -5, -7, -2, -4, -0, -7, -3, -6, -3, -1, -2, -4, -7, -6, -1, -3, -4, -3, -6, -1, -3, -5, -0, -7, -2, -2, -4, -1, -4, -2, -2, -0, -4, -3, -6, -7, -2, -3, -1, -3, -4, -2, -7, -3, -1, -6, -3, -0, -3, -7, -2, -0, -2, -1, -3, -1, -6, -6, -3, -3, -5, -0, -2, -3, -1, -6, -6, -3, -2, -3, -4, -7, -5, -7, -7, -5, -4, -4, -4, -2, -1, -7, -1, -4, -5, -7, -5, -7, -5, -6, -4, -0, -6, -6, -6, -5, -5, -4, -5, -4, -0, -1, -4, -2, -2, -2, -4, -4, -3, -5, -7, -3, -3, -2, -0, -3, -7, -7, -4, -7, -4, -6, -0, -3, -7, -4, -6, -7, -1, -7, -2, -3, -3, -6, -5, -4, -6, -4, -3, -0, -5, -6, -7, -6, -5, -5, -2, -3, -0, -6, -3, -1, -5, -0, -7, -4, -3, -4, -6, -1, -6, -5, -2, -6, -3, -6, -4, -4, -4, -3, -3, -5, -3, -0, -6, -6, -4, -3, -3, -4, -3, -7, -1, -7, -5, -7, -5, -5, -5, -1, -3, -6, -5, -6, -1, -2, -3, -1, -6, -6, -0, -3, -2, -5, -5, -4, -3, -2, -0, -1, -4, -4, -1, -4, -6, -0, -5, -4, -4, -7, -1, -3, -2, -4, -4, -1, -1, -5, -5, -6, -7, -7, -6, -0, -5, -4, -7, -2, -6, -2, -7, -1, -1, -2, -0, -5, -4, -0, -1, -0, -6, -2, -6, -4, -1, -6, -2, -6, -7, -0, -5, -2, -7, -3, -0, -7, -3, -3, -7, -6, -1, -6, -5, -3, -7, -7, -0, -1, -2, -7, -5, -5, -5, -3, -5, -5, -6, -0, -4, -5, -4, -0, -7, -2, -1, -3, -5, -1, -4, -7, -4, -3, -6, -3, -0, -4, -3, -2, -1, -7, -2, -1, -2, -0, -7, -5, -7, -4, -6, -4, -3, -0, -5, -3, -7, -3, -3, -1, -7, -4, -2, -2, -4, -3, -6, -2, -1, -5, -0, -7, -2, -0, -7, -7, -7, -3, -2, -6, -1, -5, -5, -4, -6, -4, -3, -3, -5, -6, -7, -1, -1, -1, -0, -1, -5, -4, -2, -2, -1, -0, -5, -4, -7, -1, -5, -6, -6, -6, -6, -4, -1, -0, -1, -5, -6, -1, -6, -0, -4, -3, -5, -0, -3, -4, -1, -2, -0, -1, -2, -6, -0, -1, -6, -0, -6, -0, -5, -4, -0, -5, -3, -5, -0, -5, -4, -2, -2, -2, -5, -0, -4, -5, -1, -6, -6, -7, -4, -3, -7, -7, -5, -0, -4, -1, -3, -0, -7, -0, -0, -5, -5, -1, -1, -6, -6, -7, -0, -4, -3, -1, -2, -3, -5, -7, -1, -3, -1, -2, -3, -2, -4, -0, -3, -4, -1, -2, -1, -7, -0, -0, -1, -5, -7, -5, -1, -5, -5, -6, -7, -4, -1, -2, -7, -0, -3, -2, -5, -4, -3, -5, -0, -5, -6, -7, -2, -5, -6, -4, -7, -5, -6, -4, -7, -6, -6, -7, -0, -0, -4, -6, -6, -4, -4, -3, -7, -4, -7, -0, -4, -3, -2, -5, -0, -5, -6, -5, -0, -4, -5, -7, -0, -3, -3, -0, -0, -2, -7, -1, -5, -2, -5, -5, -2, -2, -5, -7, -6, -6, -3, -1, -0, -7, -5, -1, -3, -0, -3, -7, -3, -1, -2, -3, -3, -5, -7, -7, -5, -6, -4, -2, -1, -6, -6, -2, -5, -7, -2, -4, -1, -5, -3, -0, -1, -6, -1, -0, -5, -0, -6, -3, -5, -6, -7, -4, -3, -7, -4, -0, -5, -3, -1, -5, -1, -4, -0, -2, -0, -1, -5, -2, -7, -3, -4, -1, -3, -0, -3, -3, -5, -5, -4, -3, -2, -6, -1, -5, -4, -6, -5, -3, -2, -7, -5, -5, -6, -0, -0, -7, -7, -7, -1, -0, -4, -2, -6, -5, -7, -0, -7, -0, -1, -1, -3, -7, -0, -6, -6, -5, -5, -2, -1, -5, -1, -7, -0, -3, -0, -5, -1, -3, -3, -3, -5, -4, -3, -0, -5, -0, -4, -0, -2, -2, -4, -3, -7, -7, -6, -7, -6, -5, -0, -3, -4, -0, -3, -2, -2, -5, -2, -5, -6, -6, -0, -7, -4, -4, -1, -4, -2, -3, -1, -1, -5, -0, -6, -4, -6, -6, -7, -0, -5, -6, -4, -1, -2, -4, -1, -1, -7, -7, -0, -6, -0, -4, -3, -3, -0, -2, -4, -6, -5, -5, -1, -3, -3, -6, -1, -1, -6, -3, -3, -4, -3, -7, -4, -3, -3, -4, -1, -4, -2, -5, -3, -0, -6, -6, -1, -4, -6, -0, -3, -3, -3, -7, -2, -4, -2, -6, -0, -5, -6, -4, -6, -7, -7, -2, -6, -0, -7, -5, -7, -2, -7, -0, -0, -0, -6, -2, -7, -4, -1, -6, -5, -2, -7, -6, -2, -7, -6, -5, -5, -4, -3, -4, -7, -1, -4, -1, -5, -5, -5, -0, -1, -4, -6, -6, -0, -2, -5, -2, -6, -3, -2, -1, -1, -2, -6, -5, -1, -0, -4, -0, -0, -0, -6, -2, -7, -3, -5, -4, -6, -2, -5, -0, -0, -5, -7, -4, -6, -5, -2, -7, -6, -3, -2, -4, -0, -2, -3, -4, -6, -7, -2, -5, -5, -7, -2, -0, -4, -2, -6, -6, -3, -4, -3, -5, -2, -0, -7, -6, -6, -7, -2, -5, -7, -7, -5, -1, -6, -7, -3, -5, -1, -1, -5, -0, -6, -3, -7, -7, -3, -3, -4, -2, -6, -7, -4, -7, -0, -2, -6, -0, -1, -2, -5, -6, -0, -2, -5, -5, -4, -0, -2, -3, -7, -2, -6, -5, -0, -4, -4, -1, -2, -6, -5, -3, -2, -1, -0, -0, -2, -2, -1, -3, -1, -5, -2, -4, -0, -0, -0, -5, -5, -7, -6, -0, -0, -4, -2, -1, -6, -3, -4, -6, -0, -3, -6, -3, -7, -5, -3, -2, -7, -3, -0, -6, -3, -6, -7, -3, -5, -2, -5, -0, -1, -0, -0, -7, -3, -0, -3, -6, -7, -4, -1, -4, -5, -5, -2, -5, -2, -4, -6, -2, -2, -2, -5, -0, -7, -0, -3, -5, -6, -2, -0, -3, -4, -3, -5, -0, -6, -1, -1, -5, -7, -1, -2, -3, -0, -7, -1, -0, -0, -0, -7, -7, -5, -2, -5, -2, -4, -6, -1, -2, -2, -1, -0, -6, -5, -4, -4, -0, -4, -0, -7, -5, -5, -6, -5, -2, -3, -4, -7, -0, -6, -6, -6, -6, -0, -0, -2, -3, -6, -4, -1, -6, -7, -7, -0, -2, -1, -0, -2, -3, -4, -2, -5, -7, -1, -7, -0, -1, -2, -6, -1, -4, -0, -7, -7, -3, -3, -4, -0, -6, -0, -1, -6, -3, -2, -7, -6, -0, -2, -5, -4, -2, -0, -0, -4, -7, -5, -6, -2, -7, -6, -2, -6, -3, -2, -1, -0, -4, -4, -4, -1, -5, -7, -4, -5, -7, -3, -0, -0, -3, -1, -6, -2, -1, -3, -0, -2, -0, -5, -3, -4, -5, -0, -1, -0, -7, -2, -6, -0, -5, -5, -3, -2, -7, -3, -0, -6, -0, -0, -3, -0, -4, -7, -6, -1, -2, -1, -5, -1, -7, -4, -7, -2, -3, -6, -6, -2, -0, -5, -6, -2, -1, -6, -2, -5, -3, -2, -3, -0, -2, -3, -6, -2, -7, -1, -4, -4, -2, -7, -7, -4, -3, -6, -5, -1, -6, -6, -2, -1, -6, -1, -4, -0, -5, -2, -2, -6, -4, -4, -5, -4, -3, -3, -5, -6, -3, -7, -0, -0, -4, -2, -4, -3, -1, -2, -6, -3, -0, -5, -4, -6, -4, -3, -7, -7, -7, -4, -0, -7, -7, -1, -2, -7, -6, -1, -7, -6, -6, -0, -4, -4, -3, -5, -3, -3, -5, -3, -2, -4, -2, -2, -6, -1, -6, -7, -1, -4, -0, -0, -4, -6, -1, -1, -1, -6, -0, -6, -3, -3, -5, -3, -6, -5, -4, -2, -0, -6, -0, -2, -4, -5, -2, -1, -5, -2, -7, -4, -5, -1, -2, -3, -7, -7, -6, -5, -4, -6, -7, -6, -6, -2, -5, -7, -5, -6, -7, -7, -5, -3, -6, -7, -4, -2, -4, -4, -7, -6, -3, -6, -6, -1, -6, -1, -6, -5, -3, -1, -6, -1, -0, -0, -4, -7, -1, -1, -1, -4, -3, -6, -6, -4, -1, -0, -6, -2, -6, -5, -4, -5, -6, -0, -5, -1, -4, -6, -7, -6, -2, -5, -1, -0, -4, -2, -2, -2, -7, -5, -7, -7, -5, -7, -6, -3, -0, -1, -4, -0, -1, -4, -2, -7, -0, -4, -6, -5, -0, -2, -6, -2, -7, -1, -2, -0, -7, -7, -7, -3, -6, -2, -3, -3, -6, -2, -1, -7, -3, -1, -3, -2, -3, -7, -1, -1, -6, -6, -4, -1, -4, -1, -0, -2, -5, -7, -5, -7, -3, -5, -5, -3, -1, -5, -5, -7, -5, -2, -1, -0, -7, -4, -0, -2, -6, -1, -0, -5, -3, -0, -7, -7, -4, -7, -5, -2, -6, -7, -7, -5, -4, -0, -2, -1, -3, -5, -6, -7, -3, -2, -7, -5, -3, -6, -2, -3, -7, -5, -0, -5, -1, -0, -2, -1, -3, -1, -7, -6, -0, -1, -0, -7, -1, -2, -6, -1, -6, -0, -3, -2, -3, -5, -0, -6, -7, -1, -1, -1, -0, -7, -0, -3, -1, -7, -6, -0, -6, -4, -6, -7, -2, -7, -3, -7, -5, -4, -1, -6, -6, -5, -6, -6, -1, -6, -7, -0, -6, -1, -1, -6, -1, -4, -1, -0, -4, -6, -2, -5, -1, -1, -6, -7, -2, -3, -6, -2, -3, -3, -2, -4, -1, -0, -6, -1, -2, -5, -6, -1, -1, -7, -7, -5, -7, -3, -3, -5, -7, -7, -7, -0, -3, -2, -1, -4, -2, -3, -1, -3, -7, -0, -7, -1, -4, -2, -1, -5, -0, -0, -5, -0, -4, -3, -0, -4, -1, -5, -3, -2, -0, -5, -5, -7, -5, -1, -7, -3, -0, -6, -2, -2, -4, -6, -3, -3, -0, -7, -7, -7, -5, -6, -6, -1, -6, -6, -6, -6, -3, -6, -6, -6, -0, -5, -5, -2, -7, -3, -2, -2, -5, -2, -4, -6, -7, -6, -2, -0, -5, -5, -3, -7, -3, -7, -2, -5, -5, -6, -0, -4, -3, -7, -5, -3, -4, -7, -3, -0, -3, -5, -2, -2, -4, -0, -3, -6, -7, -0, -3, -7, -2, -6, -3, -5, -3, -7, -4, -0, -1, -7, -6, -3, -0, -6, -5, -4, -7, -7, -3, -2, -3, -1, -2, -2, -0, -3, -5, -5, -4, -4, -1, -1, -4, -5, -7, -4, -0, -1, -1, -0, -5, -5, -3, -4, -5, -3, -3, -4, -6, -3, -3, -3, -2, -2, -4, -1, -2, -0, -0, -2, -1, -2, -6, -3, -2, -0, -1, -0, -2, -5, -3, -7, -6, -2, -2, -6, -3, -6, -6, -3, -3, -4, -5, -3, -0, -5, -7, -4, -1, -5, -2, -7, -7, -3, -3, -0, -6, -0, -5, -4, -3, -0, -1, -0, -0, -5, -2, -5, -5, -5, -1, -0, -4, -5, -4, -5, -1, -5, -0, -2, -6, -2, -7, -6, -1, -2, -7, -0, -0, -5, -4, -6, -2, -2, -0, -7, -0, -4, -5, -1, -1, -1, -4, -3, -3, -7, -5, -1, -5, -6, -3, -4, -0, -1, -0, -7, -3, -7, -4, -1, -0, -7, -0, -7, -5, -3, -4, -0, -2, -2, -3, -5, -3, -5, -5, -7, -0, -4, -0, -5, -4, -0, -3, -3, -3, -3, -2, -4, -5, -7, -6, -6, -4, -4, -0, -6, -4, -6, -0, -7, -0, -5, -3, -2, -6, -0, -1, -2, -5, -6, -4, -5, -5, -1, -1, -7, -7, -0, -2, -3, -4, -1, -6, -1, -0, -5, -3, -1, -1, -0, -4, -7, -5, -0, -1, -1, -5, -7, -2, -7, -1, -4, -0, -4, -4, -7, -0, -3, -4, -6, -6, -0, -1, -6, -2, -5, -1, -5, -1, -6, -7, -6, -7, -7, -1, -1, -3, -2, -0, -5, -4, -6, -1, -7, -7, -1, -7, -2, -7, -2, -1, -1, -5, -1, -5, -1, -4, -3, -2, -6, -2, -5, -0, -7, -4, -0, -7, -3, -5, -0, -4, -5, -2, -6, -3, -4, -7, -5, -2, -2, -4, -3, -0, -2, -5, -6, -3, -1, -5, -2, -4, -2, -1, -1, -2, -2, -6, -5, -6, -4, -3, -4, -6, -1, -0, -7, -7, -3, -4, -6, -0, -1, -2, -0, -1, -2, -5, -0, -3, -1, -2, -2, -4, -4, -4, -4, -4, -4, -6, -5, -0, -7, -1, -5, -4, -1, -6, -6, -1, -6, -0, -2, -3, -4, -6, -4, -0, -2, -3, -7, -2, -3, -4, -2, -7, -1, -2, -7, -2, -6, -5, -5, -0, -7, -2, -5, -4, -6, -3, -7, -3, -7, -1, -3, -0, -2, -1, -4, -5, -2, -5, -2, -1, -1, -3, -4, -4, -4, -6, -1, -4, -1, -7, -6, -5, -7, -0, -3, -0, -6, -2, -6, -7, -6, -2, -1, -3, -4, -5, -7, -4, -3, -3, -4, -5, -0, -4, -6, -6, -7, -6, -0, -0, -7, -1, -4, -7, -0, -2, -4, -2, -7, -2, -7, -2, -6, -1, -6, -2, -6, -7, -6, -1, -0, -3, -1, -3, -2, -3, -5, -2, -3, -1, -1, -6, -3, -1, -5, -5, -3, -4, -4, -7, -1, -5, -6, -4, -3, -3, -5, -5, -1, -7, -7, -1, -7, -1, -2, -2, -6, -6, -3, -1, -1, -1, -7, -3, -0, -5, -1, -1, -0, -2, -2, -1, -7, -7, -6, -6, -5, -1, -2, -0, -2, -1, -2, -3, -2, -0, -0, -6, -6, -5, -6, -1, -7, -6, -3, -4, -4, -7, -6, -7, -4, -1, -3, -6, -1, -2, -3, -1, -4, -7, -5, -5, -0, -1, -3, -2, -1, -5, -6, -2, -4, -4, -6, -7, -4, -3, -4, -3, -5, -0, -2, -2, -0, -5, -6, -4, -0, -0, -1, -7, -1, -5, -7, -5, -6, -0, -1, -7, -2, -3, -2, -6, -7, -2, -5, -2, -1, -3, -0, -5, -5, -5, -6, -0, -6, -0, -5, -2, -2, -5, -3, -1, -2, -3, -3, -6, -2, -0, -1, -7, -2, -1, -1, -7, -0, -2, -1, -5, -1, -6, -3, -3, -3, -7, -5, -6, -4, -2, -7, -6, -2, -1, -4, -0, -7, -4, -5, -6, -2, -5, -2, -4, -0, -6, -5, -3, -2, -5, -7, -7, -3, -0, -4, -0, -6, -4, -2, -6, -1, -1, -6, -7, -3, -7, -2, -0, -5, -6, -0, -3, -4, -6, -0, -2, -2, -3, -3, -0, -6, -5, -2, -2, -6, -6, -3, -0, -0, -4, -7, -6, -2, -4, -7, -4, -5, -7, -5, -2, -2, -7, -2, -5, -1, -3, -1, -6, -0, -3, -5, -5, -3, -1, -4, -4, -2, -3, -1, -3, -1, -0, -1, -2, -3, -7, -6, -7, -4, -2, -1, -1, -0, -5, -3, -4, -4, -0, -7, -5, -2, -2, -1, -5, -3, -6, -6, -6, -1, -7, -5, -7, -1, -5, -5, -5, -5, -4, -6, -5, -4, -3, -7, -0, -6, -0, -3, -7, -3, -0, -3, -2, -5, -2, -4, -3, -4, -5, -4, -6, -6, -0, -1, -2, -4, -6, -7, -1, -2, -6, -3, -2, -2, -2, -7, -1, -3, -5, -1, -5, -1, -6, -1, -5, -7, -7, -0, -2, -3, -0, -3, -1, -6, -7, -3, -6, -5, -3, -3, -2, -6, -5, -2, -3, -0, -3, -2, -4, -3, -4, -3, -1, -2, -2, -6, -6, -6, -4, -2, -0, -2, -3, -4, -6, -7, -0, -7, -6, -3, -1, -5, -4, -2, -5, -3, -0, -7, -2, -7, -7, -5, -0, -6, -4, -7, -3, -5, -4, -4, -3, -0, -5, -5, -1, -2, -4, -1, -0, -7, -6, -5, -7, -7, -1, -5, -6, -7, -6, -5, -3, -6, -1, -6, -0, -3, -1, -3, -4, -5, -1, -7, -7, -6, -4, -6, -5, -0, -3, -0, -2, -1, -4, -0, -4, -5, -3, -1, -4, -3, -4, -1, -5, -7, -5, -1, -7, -0, -3, -6, -5, -1, -3, -4, -4, -2, -0, -6, -1, -5, -4, -4, -6, -1, -7, -7, -3, -6, -1, -2, -1, -6, -7, -0, -6, -7, -2, -7, -1, -7, -4, -3, -7, -2, -3, -2, -3, -4, -0, -0, -5, -3, -1, -7, -6, -7, -6, -3, -7, -7, -6, -7, -5, -0, -6, -2, -2, -1, -2, -5, -4, -7, -5, -3, -5, -7, -4, -6, -5, -3, -1, -3, -7, -4, -2, -0, -1, -1, -0, -5, -0, -0, -0, -4, -3, -5, -2, -7, -3, -1, -4, -0, -3, -3, -1, -3, -2, -6, -3, -3, -6, -5, -0, -1, -7, -3, -4, -7, -2, -4, -3, -0, -6, -3, -2, -6, -4, -2, -5, -6, -7, -0, -0, -7, -3, -4, -5, -6, -7, -2, -0, -2, -7, -6, -1, -1, -3, -5, -4, -7, -7, -3, -5, -7, -4, -7, -6, -7, -6, -0, -7, -3, -4, -1, -4, -3, -5, -7, -0, -6, -2, -3, -5, -6, -1, -3, -3, -2, -2, -6, -6, -0, -3, -7, -1, -2, -6, -2, -1, -6, -0, -2, -3, -4, -7, -2, -1, -5, -2, -4, -5, -7, -0, -5, -1, -4, -4, -2, -7, -6, -7, -6, -3, -3, -0, -2, -5, -2, -5, -1, -2, -0, -7, -5, -0, -4, -6, -6, -1, -5, -2, -6, -0, -4, -0, -4, -5, -7, -3, -5, -7, -4, -4, -0, -0, -2, -3, -7, -4, -1, -1, -2, -2, -3, -4, -2, -6, -3, -7, -3, -3, -7, -7, -2, -4, -7, -0, -7, -3, -7, -6, -4, -5, -6, -0, -1, -2, -2, -2, -1, -3, -4, -4, -7, -1, -2, -5, -4, -3, -6, -7, -5, -4, -3, -6, -1, -3, -5, -0, -1, -3, -1, -1, -5, -3, -7, -1, -1, -0, -4, -1, -2, -0, -6, -5, -3, -5, -2, -6, -3, -7, -1, -2, -2, -3, -6, -3, -4, -3, -6, -6, -4, -1, -0, -2, -7, -7, -7, -2, -7, -6, -5, -1, -1, -1, -5, -5, -5, -4, -7, -2, -7, -4, -6, -0, -6, -7, -4, -0, -1, -1, -4, -5, -0, -2, -0, -7, -0, -6, -7, -5, -3, -6, -5, -0, -5, -5, -0, -3, -4, -6, -5, -6, -4, -2, -2, -1, -6, -0, -4, -0, -4, -7, -7, -6, -7, -5, -0, -0, -2, -7, -2, -5, -6, -1, -0, -1, -7, -6, -6, -7, -5, -3, -1, -2, -5, -1, -3, -0, -0, -0, -7, -3, -6, -6, -2, -6, -4, -5, -1, -5, -3, -0, -5, -6, -0, -4, -2, -7, -3, -1, -1, -6, -3, -0, -5, -0, -0, -0, -1, -5, -5, -7, -5, -2, -4, -4, -3, -0, -2, -6, -4, -5, -1, -0, -1, -7, -1, -6, -0, -2, -7, -7, -3, -5, -3, -5, -5, -5, -2, -1, -7, -1, -5, -3, -5, -1, -6, -0, -1, -3, -6, -6, -5, -6, -7, -2, -5, -7, -4, -7, -5, -2, -1, -4, -5, -6, -2, -6, -3, -4, -4, -5, -1, -0, -6, -2, -3, -7, -0, -5, -2, -1, -0, -7, -5, -2, -4, -3, -2, -5, -0, -6, -6, -2, -2, -6, -3, -1, -6, -7, -4, -1, -2, -2, -5, -6, -7, -0, -0, -6, -1, -4, -0, -5, -1, -3, -0, -3, -3, -4, -5, -4, -2, -3, -6, -1, -4, -3, -5, -1, -6, -6, -1, -1, -6, -5, -7, -7, -7, -6, -4, -7, -0, -2, -6, -4, -6, -1, -5, -6, -7, -0, -7, -4, -4, -1, -6, -4, -1, -3, -3, -6, -6, -4, -7, -3, -6, -0, -5, -4, -2, -4, -4, -1, -4, -6, -2, -5, -7, -5, -0, -4, -2, -3, -5, -6, -0, -1, -2, -1, -3, -4, -7, -2, -5, -3, -4, -4, -6, -2, -7, -1, -4, -3, -7, -7, -0, -2, -7, -4, -5, -0, -7, -3, -3, -3, -4, -1, -5, -4, -1, -6, -0, -6, -4, -2, -5, -4, -7, -1, -0, -4, -1, -1, -5, -3, -5, -0, -1, -1, -7, -5, -1, -2, -5, -6, -2, -5, -0, -6, -5, -0, -4, -7, -4, -7, -5, -2, -0, -3, -5, -5, -7, -3, -1, -0, -5, -5, -3, -1, -4, -2, -6, -0, -4, -7, -0, -3, -4, -1, -2, -4, -6, -2, -6, -1, -7, -6, -7, -1, -3, -3, -4, -5, -3, -7, -7, -4, -7, -6, -1, -1, -5, -0, -6, -6, -1, -1, -7, -1, -4, -3, -5, -1, -5, -1, -3, -0, -5, -5, -2, -0, -5, -3, -7, -7, -7, -2, -5, -6, -1, -7, -6, -1, -0, -6, -2, -6, -2, -4, -7, -7, -3, -0, -7, -6, -5, -2, -6, -6, -2, -2, -0, -5, -2, -5, -1, -2, -6, -7, -1, -1, -5, -5, -1, -5, -0, -6, -3, -5, -0, -5, -6, -0, -6, -4, -4, -1, -4, -2, -0, -2, -2, -1, -6, -7, -2, -7, -7, -1, -0, -3, -3, -2, -5, -1, -7, -1, -7, -7, -1, -7, -6, -3, -3, -7, -6, -7, -5, -3, -1, -4, -7, -0, -5, -0, -6, -5, -4, -0, -3, -4, -3, -1, -4, -3, -4, -1, -6, -3, -6, -7, -6, -3, -2, -4, -7, -3, -5, -0, -1, -6, -1, -3, -4, -7, -2, -1, -3, -4, -0, -5, -6, -0, -2, -2, -0, -0, -7, -6, -6, -1, -3, -6, -6, -6, -6, -2, -6, -7, -3, -0, -4, -0, -5, -4, -7, -7, -7, -7, -3, -3, -6, -2, -2, -1, -7, -0, -1, -1, -5, -3, -7, -4, -6, -3, -5, -2, -4, -2, -7, -5, -1, -4, -0, -7, -3, -3, -0, -4, -7, -5, -2, -3, -5, -1, -3, -1, -5, -0, -5, -4, -1, -4, -0, -4, -3, -0, -7, -7, -7, -1, -2, -2, -3, -7, -4, -7, -0, -7, -0, -4, -4, -0, -0, -1, -0, -7, -0, -1, -1, -1, -1, -3, -5, -3, -6, -4, -1, -2, -2, -3, -6, -1, -6, -1, -0, -3, -1, -1, -2, -4, -5, -4, -4, -7, -0, -5, -1, -0, -6, -4, -0, -4, -0, -1, -6, -6, -4, -1, -0, -1, -0, -1, -2, -6, -3, -2, -1, -2, -2, -5, -3, -2, -0, -2, -7, -5, -3, -4, -2, -7, -3, -1, -5, -0, -0, -2, -5, -4, -0, -2, -0, -3, -1, -5, -5, -0, -2, -3, -5, -7, -7, -3, -4, -6, -3, -3, -5, -6, -3, -1, -7, -5, -7, -3, -4, -0, -2, -0, -5, -5, -5, -1, -0, -5, -2, -0, -6, -6, -6, -3, -1, -6, -7, -7, -3, -5, -4, -7, -7, -7, -7, -7, -7, -4, -4, -6, -7, -1, -6, -5, -3, -7, -1, -4, -6, -4, -1, -6, -0, -7, -5, -1, -0, -0, -3, -7, -2, -6, -6, -7, -3, -2, -0, -7, -1, -5, -2, -3, -5, -5, -6, -3, -7, -0, -5, -2, -0, -2, -2, -0, -2, -6, -3, -6, -0, -2, -0, -6, -5, -0, -1, -7, -2, -0, -7, -6, -5, -5, -1, -5, -6, -4, -0, -3, -5, -4, -0, -3, -0, -2, -4, -4, -2, -4, -3, -2, -6, -0, -1, -7, -5, -0, -1, -1, -3, -2, -3, -6, -4, -0, -0, -2, -4, -4, -4, -0, -5, -5, -4, -1, -6, -4, -1, -4, -7, -0, -3, -3, -1, -6, -3, -2, -7, -4, -4, -0, -5, -4, -1, -7, -7, -2, -3, -2, -1, -2, -1, -4, -7, -4, -3, -4, -4, -7, -0, -1, -7, -7, -4, -6, -6, -4, -2, -1, -7, -5, -5, -0, -0, -3, -5, -7, -0, -6, -6, -4, -5, -3, -4, -5, -3, -6, -6, -3, -4, -1, -1, -7, -5, -0, -7, -2, -7, -2, -4, -0, -0, -2, -2, -7, -3, -3, -7, -2, -6, -1, -4, -3, -0, -2, -0, -6, -2, -3, -4, -3, -2, -0, -0, -7, -6, -7, -6, -6, -2, -6, -5, -5, -5, -7, -6, -0, -5, -7, -5, -7, -5, -2, -4, -1, -6, -3, -3, -7, -2, -6, -0, -3, -6, -3, -1, -5, -6, -6, -5, -7, -4, -4, -7, -6, -4, -3, -2, -7, -1, -2, -5, -6, -6, -2, -1, -0, -2, -4, -0, -0, -0, -1, -7, -4, -5, -5, -3, -6, -5, -1, -4, -3, -1, -6, -2, -0, -2, -2, -4, -1, -0, -4, -2, -1, -6, -6, -1, -1, -6, -4, -7, -4, -5, -7, -1, -5, -0, -2, -0, -0, -0, -4, -5, -5, -2, -5, -6, -7, -2, -5, -0, -2, -2, -6, -1, -6, -2, -3, -6, -4, -7, -6, -6, -1, -5, -5, -5, -2, -3, -6, -5, -3, -3, -4, -1, -4, -6, -6, -5, -1, -5, -6, -6, -3, -2, -4, -6, -3, -4, -4, -1, -6, -3, -1, -6, -4, -4, -0, -2, -7, -6, -4, -5, -4, -6, -6, -3, -7, -4, -0, -3, -4, -3, -6, -1, -0, -2, -6, -1, -5, -4, -6, -5, -3, -7, -1, -7, -0, -1, -5, -5, -3, -2, -1, -3, -7, -4, -2, -0, -2, -0, -0, -3, -0, -7, -0, -2, -0, -7, -6, -1, -5, -3, -7, -6, -5, -5, -5, -0, -3, -1, -7, -4, -6, -7, -7, -0, -2, -1, -4, -4, -7, -1, -7, -1, -0, -2, -2, -2, -2, -1, -1, -0, -0, -1, -4, -6, -6, -4, -0, -1, -1, -1, -6, -6, -1, -5, -7, -0, -7, -0, -4, -4, -2, -5, -6, -7, -4, -5, -1, -6, -3, -6, -6, -1, -0, -3, -7, -1, -1, -1, -7, -5, -2, -5, -3, -0, -0, -4, -5, -3, -6, -1, -6, -0, -0, -2, -5, -7, -2, -5, -7, -4, -4, -1, -4, -7, -0, -2, -7, -7, -3, -4, -0, -3, -0, -3, -0, -3, -4, -5, -0, -0, -3, -3, -3, -7, -6, -6, -6, -4, -2, -6, -5, -7, -2, -7, -5, -4, -1, -6, -1, -7, -7, -2, -0, -1, -0, -2, -7, -5, -2, -1, -6, -7, -1, -3, -5, -1, -6, -0, -2, -6, -4, -2, -6, -2, -3, -5, -6, -1, -1, -0, -0, -6, -2, -2, -1, -0, -2, -7, -0, -7, -2, -4, -0, -1, -5, -7, -0, -2, -6, -4, -2, -2, -4, -0, -4, -4, -6, -7, -7, -7, -5, -7, -3, -6, -6, -4, -0, -1, -2, -4, -3, -3, -6, -5, -5, -5, -3, -4, -6, -4, -7, -1, -6, -6, -6, -3, -5, -6, -1, -2, -3, -5, -7, -2, -0, -2, -7, -6, -1, -0, -1, -3, -7, -2, -4, -4, -0, -3, -7, -0, -1, -0, -1, -1, -0, -4, -7, -4, -0, -1, -0, -4, -7, -2, -3, -3, -1, -2, -3, -0, -6, -7, -1, -6, -2, -7, -6, -4, -6, -1, -6, -4, -7, -6, -2, -3, -2, -1, -6, -1, -4, -0, -2, -0, -3, -6, -0, -5, -5, -7, -3, -4, -2, -7, -1, -2, -0, -1, -6, -5, -2, -0, -5, -3, -5, -3, -0, -1, -1, -0, -7, -5, -6, -7, -5, -5, -2, -4, -5, -6, -0, -3, -5, -3, -5, -1, -5, -1, -4, -1, -6, -4, -5, -3, -3, -2, -4, -7, -1, -1, -4, -0, -2, -6, -2, -6, -2, -6, -7, -6, -5, -5, -6, -1, -3, -7, -6, -0, -6, -1, -1, -4, -5, -1, -3, -2, -1, -3, -5, -2, -7, -6, -3, -6, -7, -7, -7, -6, -5, -2, -4, -7, -7, -0, -4, -3, -2, -6, -6, -5, -3, -0, -1, -1, -2, -6, -7, -7, -2, -0, -6, -4, -4, -2, -0, -7, -2, -5, -3, -6, -5, -0, -7, -3, -5, -3, -3, -4, -7, -0, -2, -0, -6, -4, -5, -5, -6, -1, -7, -3, -3, -7, -4, -6, -4, -6, -7, -5, -2, -3, -2, -1, -2, -1, -2, -7, -2, -3, -6, -7, -7, -4, -6, -3, -0, -7, -7, -1, -5, -5, -6, -0, -7, -3, -5, -4, -4, -2, -5, -1, -2, -5, -1, -1, -4, -7, -2, -1, -0, -0, -1, -3, -2, -1, -2, -6, -7, -2, -4, -2, -2, -0, -3, -4, -5, -7, -2, -0, -1, -6, -2, -2, -3, -6, -4, -7, -0, -2, -3, -0, -7, -5, -5, -5, -7, -1, -7, -1, -7, -6, -5, -6, -0, -4, -2, -6, -6, -0, -7, -1, -7, -7, -3, -5, -3, -1, -2, -4, -6, -5, -6, -7, -4, -7, -6, -6, -1, -6, -3, -0, -7, -2, -0, -0, -5, -6, -2, -4, -3, -0, -3, -6, -3, -4, -2, -3, -0, -0, -7, -6, -2, -0, -6, -7, -0, -6, -5, -1, -5, -4, -3, -7, -4, -2, -0, -3, -7, -5, -6, -5, -0, -4, -0, -5, -6, -3, -6, -6, -7, -4, -0, -3, -7, -6, -1, -7, -7, -7, -7, -6, -6, -5, -2, -2, -3, -5, -6, -2, -1, -6, -1, -5, -4, -4, -7, -4, -6, -0, -2, -2, -7, -4, -5, -4, -6, -5, -1, -4, -2, -7, -3, -1, -0, -0, -3, -5, -1, -4, -1, -0, -3, -1, -1, -4, -3, -4, -2, -0, -0, -5, -3, -4, -3, -7, -5, -5, -3, -2, -4, -1, -5, -0, -0, -2, -0, -4, -7, -6, -2, -7, -4, -4, -4, -1, -7, -1, -7, -1, -4, -2, -4, -1, -4, -1, -5, -0, -1, -2, -3, -2, -7, -1, -6, -1, -6, -1, -1, -6, -3, -0, -4, -2, -7, -6, -7, -7, -4, -4, -2, -5, -4, -0, -7, -3, -6, -2, -3, -4, -2, -3, -0, -2, -7, -2, -1, -5, -6, -7, -0, -5, -7, -3, -2, -4, -3, -3, -5, -5, -3, -3, -1, -2, -3, -6, -1, -4, -0, -7, -3, -5, -5, -4, -2, -6, -0, -6, -0, -6, -3, -4, -4, -5, -7, -1, -2, -3, -5, -3, -3, -3, -5, -5, -7, -3, -6, -0, -5, -3, -0, -5, -3, -5, -7, -6, -1, -4, -4, -1, -6, -2, -5, -1, -2, -7, -4, -6, -3, -1, -0, -4, -0, -6, -0, -3, -2, -2, -1, -1, -0, -6, -0, -7, -6, -1, -5, -2, -1, -6, -4, -2, -1, -2, -0, -3, -7, -4, -4, -0, -0, -1, -3, -0, -6, -3, -2, -2, -1, -7, -1, -0, -3, -4, -3, -4, -0, -5, -3, -4, -3, -1, -2, -0, -5, -3, -2, -2, -6, -5, -5, -4, -0, -1, -0, -4, -7, -3, -0, -1, -3, -3, -1, -4, -5, -1, -0, -2, -4, -4, -0, -4, -5, -6, -3, -0, -4, -7, -6, -7, -7, -5, -6, -3, -3, -2, -2, -6, -7, -0, -7, -1, -7, -2, -7, -5, -0, -7, -4, -1, -3, -3, -5, -7, -4, -0, -5, -1, -7, -1, -6, -0, -2, -1, -7, -6, -3, -4, -5, -7, -7, -7, -7, -7, -0, -3, -2, -2, -5, -6, -7, -4, -0, -2, -7, -3, -6, -4, -4, -5, -5, -5, -6, -5, -7, -6, -6, -6, -3, -1, -0, -2, -3, -6, -6, -6, -5, -7, -6, -6, -1, -2, -2, -0, -2, -4, -5, -4, -1, -3, -7, -5, -5, -2, -5, -0, -2, -4, -4, -6, -5, -2, -1, -4, -7, -3, -4, -0, -3, -6, -3, -3, -7, -6, -5, -1, -4, -7, -7, -2, -7, -3, -1, -7, -4, -7, -3, -2, -3, -2, -5, -7, -0, -3, -5, -0, -3, -1, -2, -2, -5, -2, -5, -5, -1, -2, -5, -7, -1, -3, -4, -3, -5, -7, -7, -3, -6, -4, -5, -1, -1, -0, -0, -3, -7, -3, -6, -0, -2, -0, -5, -7, -3, -3, -2, -2, -4, -4, -0, -1, -1, -6, -5, -6, -4, -7, -1, -2, -7, -7, -4, -6, -0, -3, -1, -2, -7, -6, -4, -5, -7, -3, -4, -4, -1, -5, -7, -5, -7, -6, -7, -4, -0, -0, -4, -4, -6, -3, -0, -4, -6, -3, -5, -1, -7, -3, -0, -4, -2, -2, -1, -3, -6, -5, -3, -4, -1, -3, -0, -0, -1, -4, -0, -5, -5, -5, -4, -1, -5, -4, -4, -4, -6, -4, -5, -5, -2, -3, -1, -4, -1, -1, -6, -2, -0, -2, -6, -1, -0, -2, -2, -3, -7, -2, -1, -1, -6, -7, -2, -7, -6, -6, -6, -1, -6, -6, -2, -6, -3, -1, -1, -4, -5, -7, -3, -1, -4, -7, -0, -6, -7, -5, -0, -5, -2, -1, -1, -5, -6, -3, -0, -1, -6, -7, -5, -4, -2, -1, -3, -1, -5, -6, -6, -4, -0, -2, -6, -7, -7, -7, -0, -1, -2, -4, -5, -5, -6, -6, -2, -7, -7, -2, -3, -5, -4, -6, -4, -2, -1, -3, -7, -4, -0, -6, -1, -1, -2, -3, -1, -4, -4, -3, -5, -1, -3, -1, -7, -1, -1, -1, -6, -6, -1, -2, -3, -4, -3, -6, -4, -3, -4, -7, -4, -1, -6, -0, -4, -7, -2, -4, -5, -2, -7, -4, -6, -4, -6, -0, -7, -7, -6, -0, -4, -4, -1, -7, -1, -1, -3, -6, -5, -0, -3, -6, -3, -2, -5, -7, -6, -0, -5, -5, -1, -1, -1, -5, -1, -1, -3, -6, -6, -7, -7, -0, -7, -4, -5, -2, -7, -4, -2, -2, -3, -3, -2, -1, -4, -5, -1, -2, -2, -5, -6, -5, -3, -2, -4, -4, -3, -2, -7, -5, -2, -0, -7, -0, -2, -6, -6, -5, -1, -0, -2, -4, -1, -5, -3, -1, -2, -7, -5, -6, -3, -4, -4, -1, -2, -6, -4, -0, -5, -3, -4, -0, -6, -6, -6, -4, -6, -4, -5, -1, -6, -6, -3, -4, -2, -7, -7, -3, -3, -4, -4, -6, -0, -2, -5, -6, -7, -1, -7, -1, -1, -4, -7, -2, -2, -3, -3, -1, -7, -5, -0, -7, -3, -4, -5, -1, -7, -5, -6, -4, -0, -1, -7, -6, -0, -2, -5, -2, -5, -3, -0, -3, -5, -3, -1, -6, -5, -3, -1, -2, -5, -4, -6, -3, -6, -6, -7, -3, -0, -3, -3, -5, -7, -5, -1, -4, -6, -6, -0, -1, -3, -4, -0, -2, -4, -2, -2, -1, -5, -1, -3, -3, -1, -5, -7, -0, -7, -0, -4, -2, -4, -2, -7, -4, -3, -4, -1, -0, -1, -6, -2, -2, -3, -4, -0, -5, -0, -1, -5, -6, -1, -3, -7, -3, -1, -2, -5, -0, -7, -6, -7, -7, -5, -1, -5, -7, -6, -1, -1, -6, -1, -0, -6, -7, -5, -1, -1, -6, -3, -7, -0, -5, -7, -0, -4, -0, -7, -7, -7, -4, -0, -5, -3, -0, -0, -0, -4, -1, -2, -4, -2, -6, -1, -5, -1, -5, -3, -0, -2, -0, -6, -3, -4, -5, -0, -7, -3, -0, -1, -6, -5, -1, -3, -3, -2, -2, -7, -6, -0, -1, -1, -1, -0, -0, -1, -2, -5, -2, -3, -6, -7, -0, -3, -2, -1, -5, -5, -6, -6, -3, -4, -3, -1, -5, -6, -4, -2, -2, -7, -1, -0, -3, -1, -1, -1, -0, -6, -4, -0, -6, -6, -6, -0, -4, -4, -5, -3, -3, -1, -0, -2, -5, -6, -6, -4, -1, -7, -3, -0, -3, -4, -0, -3, -2, -3, -7, -4, -0, -1, -0, -5, -0, -5, -2, -7, -4, -3, -5, -6, -5, -3, -3, -0, -3, -4, -5, -0, -6, -4, -7, -1, -2, -2, -1, -7, -1, -3, -4, -7, -7, -3, -2, -2, -0, -2, -7, -5, -5, -3, -3, -7, -5, -7, -0, -4, -0, -5, -2, -3, -5, -0, -3, -6, -7, -2, -6, -2, -4, -6, -0, -4, -1, -5, -4, -2, -0, -0, -5, -5, -6, -6, -4, -7, -5, -6, -3, -7, -3, -2, -0, -6, -3, -5, -2, -5, -1, -0, -3, -7, -1, -3, -7, -2, -7, -2, -1, -1, -7, -6, -0, -4, -5, -3, -5, -1, -6, -4, -0, -7, -2, -1, -3, -7, -5, -0, -1, -2, -6, -4, -1, -0, -6, -0, -5, -7, -1, -5, -3, -6, -7, -0, -4, -5, -1, -5, -3, -4, -3, -4, -6, -7, -7, -4, -1, -0, -2, -4, -2, -1, -2, -1, -6, -3, -2, -2, -2, -1, -4, -1, -2, -4, -6, -4, -7, -0, -0, -1, -0, -4, -6, -2, -1, -1, -3, -5, -3, -3, -2, -4, -0, -1, -5, -6, -2, -4, -3, -4, -4, -3, -5, -3, -6, -6, -6, -5, -0, -5, -2, -5, -3, -0, -4, -7, -5, -0, -4, -4, -2, -2, -4, -2, -1, -1, -1, -6, -0, -4, -0, -3, -1, -0, -4, -6, -1, -6, -0, -2, -1, -0, -2, -7, -4, -0, -0, -3, -7, -0, -5, -5, -6, -6, -7, -6, -3, -2, -6, -7, -6, -6, -2, -0, -6, -7, -7, -4, -1, -7, -7, -6, -0, -5, -6, -7, -3, -3, -6, -0, -5, -3, -7, -6, -2, -2, -1, -1, -5, -4, -0, -4, -7, -2, -4, -5, -7, -4, -6, -3, -7, -7, -2, -2, -4, -0, -1, -0, -7, -4, -0, -2, -6, -3, -5, -3, -3, -4, -4, -1, -4, -2, -2, -2, -0, -6, -6, -3, -7, -4, -5, -0, -1, -3, -1, -7, -2, -6, -2, -6, -2, -4, -2, -5, -6, -1, -2, -1, -3, -5, -5, -4, -0, -2, -0, -4, -6, -1, -2, -1, -5, -6, -4, -0, -0, -1, -0, -1, -1, -5, -7, -7, -1, -4, -5, -4, -0, -0, -2, -2, -4, -3, -5, -6, -7, -6, -0, -4, -6, -1, -7, -4, -3, -6, -7, -4, -4, -7, -1, -4, -5, -0, -3, -0, -3, -4, -6, -0, -7, -5, -2, -6, -6, -1, -0, -0, -6, -0, -0, -6, -5, -5, -0, -7, -6, -2, -7, -6, -2, -2, -2, -3, -7, -1, -0, -5, -5, -0, -7, -7, -5, -5, -3, -3, -2, -3, -0, -1, -4, -6, -2, -1, -2, -0, -7, -6, -2, -6, -6, -3, -3, -7, -6, -5, -0, -1, -4, -4, -3, -6, -3, -0, -7, -5, -5, -5, -2, -6, -3, -0, -1, -7, -1, -7, -0, -1, -6, -3, -5, -2, -1, -4, -1, -5, -3, -1, -1, -3, -2, -4, -0, -7, -7, -0, -7, -1, -2, -7, -0, -4, -7, -3, -5, -3, -4, -6, -2, -3, -0, -0, -3, -5, -5, -1, -0, -4, -7, -3, -6, -0, -4, -7, -1, -0, -5, -1, -1, -7, -7, -1, -1, -5, -6, -7, -5, -5, -5, -1, -4, -7, -0, -7, -2, -0, -1, -2, -3, -0, -3, -1, -3, -2, -3, -2, -0, -1, -2, -6, -4, -7, -4, -1, -5, -4, -3, -2, -6, -2, -4, -5, -7, -3, -7, -3, -5, -0, -0, -5, -5, -4, -0, -4, -5, -2, -3, -2, -5, -6, -1, -4, -4, -4, -6, -7, -7, -4, -2, -4, -3, -5, -4, -3, -3, -6, -3, -5, -6, -6, -6, -6, -4, -2, -5, -7, -1, -5, -1, -3, -6, -1, -1, -1, -3, -6, -6, -2, -3, -0, -1, -6, -5, -4, -4, -0, -3, -3, -0, -0, -4, -7, -1, -6, -4, -3, -7, -1, -0, -5, -0, -0, -5, -5, -1, -1, -1, -3, -7, -4, -5, -5, -2, -0, -2, -5, -1, -4, -6, -2, -0, -7, -4, -5, -5, -4, -6, -5, -7, -7, -4, -4, -1, -1, -5, -3, -0, -4, -5, -7, -0, -5, -2, -6, -6, -1, -6, -2, -3, -2, -2, -2, -3, -6, -1, -1, -6, -3, -2, -4, -5, -1, -6, -4, -5, -7, -5, -7, -2, -6, -3, -4, -1, -6, -3, -4, -7, -2, -0, -3, -5, -6, -3, -0, -5, -6, -7, -0, -6, -6, -3, -6, -2, -3, -0, -6, -3, -3, -4, -4, -6, -7, -5, -0, -4, -5, -5, -1, -4, -5, -3, -0, -7, -1, -5, -4, -6, -3, -4, -6, -3, -1, -5, -6, -5, -5, -7, -0, -5, -4, -3, -6, -5, -3, -5, -1, -1, -7, -6, -6, -2, -1, -1, -1, -1, -2, -1, -4, -5, -0, -4, -1, -4, -4, -5, -4, -7, -4, -5, -3, -5, -3, -6, -0, -2, -7, -3, -1, -4, -0, -1, -7, -1, -3, -3, -1, -1, -7, -4, -4, -1, -6, -1, -4, -3, -2, -7, -0, -6, -0, -3, -5, -2, -3, -1, -3, -6, -0, -0, -5, -4, -3, -5, -6, -4, -5, -1, -1, -6, -4, -7, -2, -4, -3, -7, -2, -6, -5, -1, -7, -5, -4, -1, -6, -0, -4, -2, -1, -1, -5, -1, -6, -2, -2, -7, -1, -0, -3, -2, -2, -2, -3, -1, -2, -4, -1, -0, -2, -4, -7, -5, -2, -2, -6, -1, -5, -6, -6, -3, -0, -6, -6, -0, -5, -7, -4, -3, -2, -1, -4, -5, -4, -1, -4, -3, -2, -7, -0, -4, -2, -6, -6, -3, -0, -2, -6, -1, -0, -2, -0, -1, -5, -0, -1, -4, -0, -2, -5, -1, -4, -2, -4, -4, -4, -6, -0, -1, -4, -5, -6, -5, -4, -5, -6, -7, -3, -3, -5, -4, -4, -2, -2, -1, -2, -4, -1, -3, -7, -3, -2, -5, -2, -0, -5, -7, -3, -3, -4, -6, -2, -4, -2, -4, -7, -2, -0, -0, -1, -1, -1, -2, -2, -7, -5, -1, -3, -3, -5, -7, -1, -7, -4, -7, -3, -3, -0, -6, -6, -5, -4, -7, -7, -2, -7, -1, -7, -2, -7, -2, -2, -7, -5, -2, -2, -2, -1, -1, -2, -6, -7, -1, -5, -6, -2, -4, -6, -5, -1, -7, -6, -5, -4, -4, -0, -0, -0, -2, -5, -6, -3, -0, -3, -2, -5, -5, -5, -4, -2, -3, -6, -2, -0, -7, -1, -0, -0, -4, -6, -4, -7, -1, -4, -3, -7, -7, -7, -4, -1, -5, -6, -2, -5, -7, -0, -3, -1, -4, -4, -4, -6, -4, -7, -3, -1, -6, -2, -0, -1, -7, -5, -2, -6, -5, -1, -7, -1, -6, -5, -7, -3, -1, -2, -3, -5, -2, -1, -6, -1, -5, -6, -7, -2, -3, -6, -5, -6, -4, -7, -2, -1, -0, -2, -0, -2, -6, -5, -7, -0, -2, -2, -7, -1, -7, -7, -5, -7, -2, -4, -4, -4, -3, -2, -5, -3, -5, -3, -6, -5, -7, -1, -7, -4, -7, -3, -7, -6, -3, -4, -4, -5, -7, -4, -3, -0, -2, -1, -0, -2, -6, -3, -2, -7, -0, -7, -4, -2, -0, -7, -1, -1, -6, -7, -3, -0, -5, -3, -5, -7, -2, -6, -0, -6, -7, -0, -3, -3, -2, -4, -6, -5, -1, -6, -3, -4, -3, -1, -2, -7, -2, -5, -2, -1, -4, -7, -7, -4, -6, -2, -0, -2, -5, -0, -7, -3, -1, -1, -2, -2, -6, -0, -0, -4, -0, -1, -1, -4, -0, -1, -4, -7, -7, -6, -6, -4, -1, -2, -5, -7, -3, -1, -6, -5, -5, -1, -1, -2, -4, -2, -3, -7, -1, -1, -1, -7, -1, -0, -0, -3, -5, -7, -0, -2, -7, -1, -2, -2, -3, -5, -3, -7, -4, -1, -7, -4, -0, -3, -0, -0, -4, -2, -3, -0, -5, -5, -7, -0, -1, -4, -0, -4, -1, -2, -2, -3, -0, -3, -6, -4, -6, -1, -4, -0, -4, -7, -0, -5, -5, -0, -2, -6, -6, -6, -6, -0, -5, -5, -0, -1, -6, -3, -3, -3, -7, -6, -7, -0, -4, -1, -0, -3, -2, -5, -1, -3, -1, -5, -7, -2, -3, -5, -6, -2, -7, -3, -5, -0, -3, -4, -2, -1, -3, -7, -7, -6, -3, -2, -7, -3, -4, -7, -6, -0, -4, -4, -3, -1, -2, -2, -6, -5, -5, -3, -1, -5, -7, -5, -0, -4, -0, -3, -2, -3, -6, -0, -2, -2, -1, -2, -3, -3, -6, -7, -3, -2, -6, -5, -6, -4, -3, -0, -3, -3, -5, -0, -7, -6, -7, -2, -7, -4, -4, -4, -4, -0, -2, -7, -6, -5, -3, -4, -1, -0, -3, -2, -5, -1, -4, -7, -4, -0, -6, -6, -1, -0, -3, -3, -0, -2, -4, -4, -0, -7, -2, -7, -3, -0, -6, -1, -5, -2, -4, -3, -2, -7, -1, -3, -2, -2, -2, -7, -6, -1, -6, -5, -3, -2, -6, -0, -2, -7, -1, -4, -4, -4, -7, -1, -3, -4, -2, -3, -3, -3, -2, -3, -2, -1, -5, -7, -4, -0, -5, -7, -3, -0, -0, -5, -3, -4, -5, -6, -5, -4, -6, -0, -6, -6, -1, -1, -6, -7, -3, -6, -0, -0, -2, -3, -0, -1, -2, -3, -7, -5, -6, -5, -7, -2, -3, -3, -6, -2, -3, -6, -6, -7, -2, -2, -3, -1, -5, -4, -5, -0, -1, -2, -6, -0, -3, -6, -2, -6, -1, -3, -2, -4, -1, -3, -3, -7, -1, -5, -6, -4, -5, -3, -4, -6, -1, -7, -5, -3, -3, -0, -7, -4, -3, -4, -4, -3, -7, -6, -1, -0, -0, -1, -3, -2, -2, -5, -0, -7, -4, -0, -3, -1, -3, -0, -4, -5, -6, -2, -4, -4, -1, -0, -4, -2, -5, -7, -7, -6, -3, -6, -6, -7, -6, -2, -3, -0, -5, -3, -1, -2, -3, -5, -5, -7, -6, -1, -5, -0, -7, -6, -7, -7, -6, -6, -6, -0, -7, -2, -3, -6, -6, -2, -0, -3, -6, -6, -0, -7, -5, -0, -4, -1, -2, -3, -1, -6, -3, -3, -4, -5, -3, -2, -5, -4, -3, -5, -0, -0, -3, -3, -0, -3, -6, -7, -2, -3, -7, -5, -1, -6, -6, -4, -0, -0, -0, -3, -6, -7, -2, -7, -2, -3, -2, -7, -0, -3, -4, -4, -3, -0, -6, -2, -6, -7, -5, -1, -2, -1, -6, -3, -5, -7, -1, -0, -1, -6, -0, -3, -3, -5, -7, -1, -1, -5, -0, -4, -6, -6, -1, -2, -5, -1, -7, -3, -3, -1, -5, -0, -0, -7, -4, -2, -7, -1, -4, -6, -6, -1, -0, -0, -4, -7, -7, -3, -4, -1, -3, -6, -2, -7, -1, -4, -4, -0, -3, -7, -7, -3, -3, -7, -1, -4, -6, -2, -2, -1, -0, -0, -5, -0, -6, -5, -0, -1, -6, -5, -3, -4, -5, -7, -7, -5, -6, -3, -5, -4, -7, -6, -5, -7, -2, -3, -2, -0, -3, -6, -0, -3, -1, -0, -1, -1, -4, -4, -2, -1, -7, -4, -3, -7, -7, -0, -7, -3, -4, -3, -5, -2, -0, -0, -5, -6, -6, -6, -0, -6, -6, -5, -6, -0, -1, -0, -7, -6, -6, -5, -5, -0, -3, -5, -2, -4, -0, -2, -2, -7, -7, -2, -4, -6, -7, -1, -5, -4, -3, -7, -4, -1, -3, -0, -5, -5, -0, -5, -6, -6, -5, -5, -0, -5, -2, -6, -0, -0, -5, -1, -4, -3, -5, -1, -4, -1, -4, -5, -5, -3, -0, -5, -2, -7, -3, -5, -4, -1, -0, -2, -6, -1, -1, -1, -1, -2, -0, -3, -0, -5, -6, -4, -2, -7, -6, -1, -4, -6, -1, -4, -2, -3, -1, -2, -5, -4, -2, -1, -7, -5, -6, -5, -1, -6, -4, -7, -6, -1, -5, -7, -3, -2, -2, -6, -4, -0, -1, -3, -0, -2, -4, -4, -6, -4, -7, -2, -7, -2, -2, -6, -4, -6, -7, -7, -0, -6, -7, -5, -7, -3, -4, -0, -0, -1, -1, -5, -2, -5, -2, -2, -0, -7, -0, -2, -2, -6, -5, -7, -3, -6, -2, -6, -5, -2, -4, -7, -7, -2, -1, -0, -1, -6, -3, -1, -0, -0, -6, -1, -1, -7, -7, -1, -5, -3, -7, -4, -5, -2, -1, -7, -3, -3, -0, -6, -3, -3, -2, -7, -6, -7, -2, -0, -4, -2, -3, -0, -0, -0, -4, -1, -0, -1, -0, -7, -1, -0, -5, -2, -7, -3, -4, -3, -6, -7, -4, -5, -6, -6, -3, -1, -7, -1, -2, -6, -5, -2, -0, -3, -4, -1, -0, -0, -4, -5, -7, -0, -6, -2, -2, -4, -4, -2, -1, -7, -5, -1, -5, -2, -6, -3, -5, -1, -2, -2, -4, -7, -4, -1, -5, -1, -5, -3, -4, -4, -5, -5, -7, -4, -3, -7, -3, -2, -2, -2, -1, -1, -0, -0, -1, -5, -1, -6, -0, -2, -0, -6, -4, -4, -1, -1, -5, -2, -1, -4, -5, -5, -2, -3, -1, -7, -2, -0, -5, -0, -7, -4, -2, -0, -3, -5, -4, -7, -4, -5, -5, -0, -0, -0, -2, -3, -5, -3, -7, -2, -4, -6, -7, -2, -1, -6, -3, -1, -1, -0, -7, -4, -4, -4, -4, -7, -2, -1, -3, -5, -1, -5, -2, -4, -2, -4, -1, -1, -2, -0, -0, -7, -5, -4, -2, -2, -1, -6, -6, -3, -5, -7, -7, -6, -1, -7, -3, -5, -6, -5, -4, -2, -0, -3, -3, -4, -3, -7, -3, -6, -2, -0, -0, -2, -3, -2, -6, -0, -4, -2, -4, -2, -1, -7, -6, -3, -5, -4, -0, -0, -1, -2, -7, -3, -0, -5, -1, -1, -3, -6, -2, -2, -6, -5, -7, -3, -7, -1, -6, -1, -2, -5, -7, -3, -6, -0, -0, -4, -1, -1, -6, -1, -0, -2, -3, -3, -3, -5, -1, -1, -7, -7, -5, -1, -2, -0, -2, -2, -1, -0, -2, -2, -6, -2, -0, -7, -7, -0, -6, -0, -3, -3, -6, -4, -4, -0, -5, -0, -7, -0, -7, -2, -0, -1, -5, -4, -0, -2, -0, -7, -0, -0, -5, -5, -5 diff --git a/gr-atsc/lib/qa_atsci_viterbi_decoder.cc b/gr-atsc/lib/qa_atsci_viterbi_decoder.cc deleted file mode 100644 index 7f72b22c14..0000000000 --- a/gr-atsc/lib/qa_atsci_viterbi_decoder.cc +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <cppunit/TestAssert.h> -#include "qa_atsci_viterbi_decoder.h" -#include "qa_atsci_trellis_encoder.h" -#include <cstdio> -#include <string.h> -#include <stdlib.h> -#include <time.h> - -#define NELEM(x) (sizeof (x) / sizeof (x[0])) - - -static const int NCODERS = atsci_viterbi_decoder::NCODERS; - -#if 0 -static void -map_to_soft_symbols (atsc_soft_data_segment &out, - const atsc_data_segment &in) -{ - for (unsigned int i = 0; i < NELEM (in.data); i++){ - out.data[i] = in.data[i] * 2 - 7; - } -} -#endif - -static void -pad_decoder_input (atsc_soft_data_segment out[NCODERS]) -{ - memset(out, 0, sizeof(*out)*NCODERS); - - // add data segment sync - for (int i = 0; i < NCODERS; i++){ - out[i].data[0] = 5; - out[i].data[1] = -5; - out[i].data[2] = -5; - out[i].data[3] = 5; - out[i].pli.set_regular_seg (false, i); - } -} - -void -qa_atsci_viterbi_decoder::t0 () -{ -#if 0 - atsci_trellis_encoder enc; - atsc_mpeg_packet_rs_encoded encoder_in[NCODERS]; - atsc_data_segment encoder_out[NCODERS]; - atsc_soft_data_segment decoder_in[NCODERS]; - atsc_soft_data_segment decoder_in_pad[NCODERS]; - atsc_mpeg_packet_rs_encoded decoder_out[NCODERS]; - atsc_mpeg_packet_rs_encoded decoder_out_pad[NCODERS]; - - - memset (encoder_in, 0, sizeof (encoder_in)); - memset (encoder_out, 0, sizeof (encoder_out)); - memset (decoder_out_pad, 0, sizeof (decoder_out_pad)); - - srandom (1); - - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (encoder_in[i].data); j++){ - int t = (random () >> 8) & 0xff; // 8 random bits - encoder_in[i].data[j] = t; - } - } - - fflush (stdout); - printf ("@@@ ENCODER INPUT @@@\n"); - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (encoder_in[i].data); j++){ - printf ("%d\n", encoder_in[i].data[j]); - } - } - - enc.reset (); - enc.encode (encoder_out, encoder_in); - - printf ("@@@ ENCODER OUTPUT @@@\n"); - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (encoder_out[i].data); j++){ - printf ("%d\n", encoder_out[i].data[j]); - } - } - - for (int i = 0; i < NCODERS; i++) - map_to_soft_symbols (decoder_in[i], encoder_out[i]); - - viterbi.reset (); - - // this has only the previous (non-existant) output - viterbi.decode (decoder_out_pad, decoder_in); - - // now we'll see the real output - pad_decoder_input (decoder_in_pad); - viterbi.decode (decoder_out, decoder_in_pad); - - printf ("@@@ DECODER OUTPUT @@@\n"); - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (decoder_out[i].data); j++){ - printf ("%d\n", decoder_out[i].data[j]); - } - } - fflush (stdout); -#endif -} - -void -qa_atsci_viterbi_decoder::t1 () -{ - atsc_soft_data_segment decoder_in[NCODERS]; - atsc_soft_data_segment decoder_in_pad[NCODERS]; - atsc_mpeg_packet_rs_encoded decoder_out[NCODERS]; - atsc_mpeg_packet_rs_encoded decoder_out_pad[NCODERS]; - atsc_mpeg_packet_rs_encoded expected_out[NCODERS]; - static const float raw_input[NCODERS * NELEM (decoder_in[0].data)] = { -#include "qa_atsci_viterbi_decoder_t1_input.dat" - }; - static const unsigned char raw_output[NCODERS * NELEM (expected_out[0].data)] = { -#include "qa_atsci_viterbi_decoder_t1_output.dat" - }; - - - // load up input - const float *ri = &raw_input[0]; - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (decoder_in[i].data); j++){ - decoder_in[i].data[j] = *ri++; - } - decoder_in[i].pli.set_regular_seg (false, i); - } - - // load up expected output - const unsigned char *ro = &raw_output[0]; - for (int i = 0; i < NCODERS; i++){ - for (unsigned int j = 0; j < NELEM (expected_out[i].data); j++){ - expected_out[i].data[j] = *ro++; - } - expected_out[i].pli.set_regular_seg (false, i); - } - - viterbi.reset (); - - // this has only the previous (non-existant) output - viterbi.decode (decoder_out_pad, decoder_in); - - // now we'll see the real output - pad_decoder_input (decoder_in_pad); - viterbi.decode (decoder_out, decoder_in_pad); - - for (int i = 0; i < NCODERS; i++){ // check the result - CPPUNIT_ASSERT (expected_out[i] == decoder_out[i]); - } -} diff --git a/gr-atsc/lib/qa_atsci_viterbi_decoder.h b/gr-atsc/lib/qa_atsci_viterbi_decoder.h deleted file mode 100644 index 47b2776af8..0000000000 --- a/gr-atsc/lib/qa_atsci_viterbi_decoder.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ATSC_VITERBI_DECODER_H_ -#define _QA_ATSC_VITERBI_DECODER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <stdio.h> -#include <gnuradio/atsc/viterbi_decoder_impl.h> - -class qa_atsci_viterbi_decoder : public CppUnit::TestCase { - - public: - - void setUp (void) - { - viterbi.reset (); - } - - CPPUNIT_TEST_SUITE (qa_atsci_viterbi_decoder); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST_SUITE_END (); - - private: - atsci_viterbi_decoder viterbi; - - void t0 (); - void t1 (); -}; - - -#endif /* _QA_ATSC_VITERBI_DECODER_H_ */ diff --git a/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_input.dat b/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_input.dat deleted file mode 100644 index b2f356c877..0000000000 --- a/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_input.dat +++ /dev/null @@ -1,9984 +0,0 @@ - 5 + -0.863407, - -5 + 0.630254, - -5 + 0.766777, - 5 + -0.587788, - -3 + 0.197374, - -7 + -0.928392, - 1 + 0.846137, - -3 + -0.148515, - 5 + 0.20529, - -3 + 0.957658, - 1 + 0.712777, - -3 + -0.783731, - -7 + -0.649688, - -3 + 0.364183, - -3 + 0.766379, - 5 + -0.254228, - -5 + 0.265344, - 1 + -0.0926997, - 5 + -0.729882, - -5 + -0.946608, - 7 + 0.941424, - -1 + 0.00502258, - 5 + 0.353994, - -1 + -0.431315, - -3 + 0.802947, - 7 + 0.0174765, - -1 + 0.107732, - 7 + -0.426013, - -3 + 0.179269, - 1 + -0.334729, - -5 + 0.363112, - 1 + -0.793512, - -1 + -0.386831, - 7 + -0.469307, - 7 + -0.592471, - 3 + -0.0650877, - 7 + 0.465307, - -1 + 0.0575076, - 3 + 0.804467, - 7 + 0.766673, - -3 + 0.177288, - -3 + 0.254259, - -7 + 0.0933109, - 3 + -0.132741, - -7 + 0.226975, - 1 + 0.805, - 3 + 0.474327, - 3 + -0.147847, - -1 + 0.3179, - -7 + -0.141455, - 3 + 0.322113, - -3 + 0.633945, - -1 + -0.950742, - -5 + -0.39542, - 3 + -0.0594983, - -3 + -0.772717, - -5 + 0.545784, - 7 + 0.398416, - 3 + -0.673597, - 3 + -0.790352, - -7 + -0.544624, - 7 + -0.633903, - -1 + -0.908654, - -3 + -0.311397, - -5 + 0.662512, - -3 + -0.135222, - -7 + 0.366291, - 1 + -0.741085, - -7 + -0.29157, - -5 + -0.673842, - 3 + 0.776452, - -5 + -0.0937042, - 3 + 0.683802, - -5 + -0.722854, - -7 + 0.0347072, - -5 + 0.40685, - -5 + 0.31874, - 5 + -0.947299, - 3 + -0.955457, - 1 + 0.742103, - -5 + -0.535021, - -5 + -0.67394, - -5 + -0.108192, - -1 + -0.968649, - 1 + 0.445698, - 3 + -0.476884, - 7 + 0.566045, - -7 + -0.137864, - -1 + -0.190159, - -5 + -0.0220287, - 5 + 0.307356, - 5 + 0.917233, - -7 + 0.320761, - 3 + -0.789388, - -5 + 0.117822, - 5 + -0.604396, - -1 + 0.552753, - 7 + -0.446649, - 7 + -0.810118, - 7 + -0.658175, - -7 + 0.553164, - -7 + -0.344854, - -3 + 0.280593, - 7 + -0.884303, - 7 + 0.720506, - -1 + -0.987799, - 7 + 0.793155, - 1 + -0.850125, - 7 + 0.115369, - 5 + 0.544406, - 5 + -0.276058, - -1 + -0.231108, - -5 + 0.376881, - 3 + -0.559075, - 7 + -0.915446, - -1 + -0.460641, - 3 + 0.818044, - -3 + -0.991244, - 1 + 0.420497, - 1 + 0.485863, - -3 + -0.376003, - 5 + -0.350986, - 5 + 0.430744, - -3 + 0.463798, - 5 + 0.42518, - 5 + -0.290836, - -5 + -0.691567, - -7 + 0.824346, - 3 + 0.450636, - -3 + 0.043629, - 7 + 0.316293, - 5 + -0.120924, - 1 + 0.726472, - -1 + -0.543775, - 3 + 0.933344, - -3 + 0.132114, - -3 + -0.310619, - 5 + 0.911921, - -1 + -0.497207, - 3 + -0.637383, - -5 + -0.732262, - 7 + 0.107649, - 3 + 0.520015, - -1 + 0.157455, - -3 + -0.894858, - -1 + 0.0945327, - 1 + -0.691426, - 7 + 0.144207, - 3 + 0.445607, - -1 + 0.255407, - -7 + 0.306034, - -3 + -0.371352, - -1 + 0.124452, - -5 + 0.359695, - -5 + -0.888643, - 3 + 0.290357, - 3 + -0.0254667, - -3 + 0.407853, - -5 + 0.679174, - -5 + 0.0575717, - -3 + 0.137283, - 3 + 0.729587, - 7 + 0.31509, - -3 + -0.348804, - 1 + 0.57604, - -5 + 0.345748, - 7 + -0.327496, - -5 + -0.425651, - -7 + 0.140657, - -3 + 0.238764, - -7 + -0.143133, - 3 + 0.337288, - 1 + 0.959842, - 7 + -0.977864, - 3 + -0.317419, - 3 + -0.198654, - 3 + 0.955435, - 3 + -0.23876, - 1 + -0.88292, - -5 + -0.511151, - 3 + 0.779996, - 3 + -0.443377, - -1 + -0.192438, - -5 + 0.811447, - -7 + 0.634155, - 1 + -0.762404, - 3 + 0.731365, - 5 + 0.783236, - 5 + -0.307317, - 7 + 0.482175, - 7 + -0.539608, - 7 + -0.775192, - 1 + -0.560785, - -7 + 0.206625, - -5 + -0.038118, - -5 + -0.228189, - 1 + 0.462362, - -5 + 0.72833, - -1 + 0.622996, - -3 + 0.998274, - 5 + 0.142163, - -7 + 0.618011, - 3 + 0.122273, - -7 + -0.483532, - -1 + -0.854097, - -5 + 0.108088, - 7 + -0.193228, - 3 + 0.648767, - -3 + -0.656924, - -7 + -0.991222, - -3 + -0.25652, - 3 + -0.269033, - -1 + 0.324665, - -1 + 0.107827, - -5 + -0.0475933, - -5 + -0.99274, - -5 + -0.30318, - -3 + -0.747831, - -3 + -0.203781, - 3 + -0.010757, - 7 + 0.0734757, - 7 + -0.761203, - -7 + 0.389509, - 1 + -0.25976, - -1 + 0.965806, - 7 + 0.526324, - -1 + -0.298331, - -3 + 0.410725, - -1 + 0.00752225, - 5 + -0.455632, - 1 + -0.884761, - 7 + 0.602377, - 7 + 0.555917, - 3 + -0.160695, - -7 + -0.567533, - 3 + 0.758232, - 1 + -0.587694, - -7 + 0.414466, - -7 + -0.652491, - 1 + 0.0124494, - -7 + 0.389889, - 7 + 0.227003, - 1 + 0.242753, - -7 + 0.913462, - -3 + 0.691642, - -5 + 0.75989, - 1 + -0.596777, - -3 + -0.752662, - 3 + -0.108642, - 7 + -0.60189, - 7 + 0.511322, - -3 + -0.24478, - 7 + -0.849058, - -1 + -0.845527, - -7 + -0.572068, - -5 + -0.661012, - 5 + -0.701889, - 7 + 0.822228, - 1 + -0.00200901, - 5 + -0.71468, - 5 + 0.691151, - 7 + 0.561903, - 3 + -0.527991, - -1 + -0.867353, - 3 + -0.728324, - 5 + -0.813234, - 1 + -0.966217, - 1 + 0.0669532, - 7 + 0.905965, - -3 + -0.937283, - -3 + 0.774056, - 3 + -0.384885, - -7 + 0.175322, - -3 + 0.309913, - -5 + 0.251167, - -1 + 0.381753, - 3 + 0.00625176, - -7 + 0.56373, - -3 + 0.63392, - 3 + 0.762169, - 7 + 0.0347039, - -3 + -0.935108, - -1 + -0.114944, - 1 + -0.424213, - 1 + 0.0317198, - -3 + 0.2139, - -5 + 0.0530905, - -7 + -0.36603, - -5 + -0.851717, - -7 + 0.414219, - -1 + -0.397429, - -3 + -0.995697, - -7 + -0.328063, - -1 + -0.604664, - 7 + -0.45941, - 3 + 0.718596, - -7 + -0.377836, - -1 + 0.915331, - 7 + -0.730175, - -1 + -0.51083, - 7 + -0.923481, - 1 + 0.102495, - -1 + 0.1293, - -3 + 0.812872, - -5 + 0.066343, - -1 + -0.578684, - 1 + 0.926482, - -7 + 0.10389, - 5 + -0.462554, - -5 + -0.108, - 5 + -0.471902, - 7 + -0.34884, - 5 + 0.719192, - -7 + -0.763765, - -3 + 0.257366, - -5 + -0.623314, - -7 + 0.0467943, - 5 + -0.646451, - 7 + 0.54531, - 3 + -0.955682, - -5 + -0.432122, - 3 + -0.886357, - 1 + 0.088559, - 5 + -0.975894, - 5 + -0.105386, - -3 + 0.0978638, - 1 + -0.199998, - 5 + 0.0380346, - 3 + 0.427315, - -3 + 0.214304, - -5 + -0.566543, - -7 + -0.380715, - -3 + -0.877135, - -5 + 0.267701, - -3 + -0.03107, - -3 + 0.595488, - -1 + 0.322574, - -5 + 0.559362, - 1 + -0.0401364, - -7 + 0.528057, - 5 + -0.319427, - -1 + 0.357237, - 7 + 0.222854, - -5 + -0.432566, - 1 + -0.998243, - 7 + 0.742835, - 3 + -0.182255, - 3 + -0.471161, - 3 + 0.606823, - -7 + 0.974148, - 5 + -0.667598, - 1 + -0.811568, - 1 + -0.936551, - 7 + -0.530943, - 5 + 0.908057, - -7 + 0.895185, - 5 + 0.711135, - 1 + -0.95896, - 1 + 0.83532, - 1 + 0.14732, - 3 + 0.90921, - -1 + -0.30945, - -1 + -0.869543, - -7 + -0.360646, - 1 + 0.357157, - -3 + -0.514692, - 5 + 0.896144, - -1 + -0.196886, - -5 + -0.319624, - -1 + -0.472977, - -1 + -0.784624, - -1 + -0.281646, - -5 + -0.559682, - 3 + 0.391078, - 7 + 0.306199, - -3 + 0.962734, - -7 + -0.11162, - -7 + 0.357581, - 3 + 0.0805047, - 3 + -0.922337, - 1 + 0.232492, - -5 + -0.574144, - -1 + 0.710829, - 7 + -0.284843, - -1 + 0.831973, - -1 + -0.336799, - -3 + -0.745866, - -5 + -0.645711, - 5 + 0.0646029, - -3 + 0.252552, - 5 + -0.48003, - -5 + 0.299438, - 7 + 0.738929, - -5 + 0.40337, - 5 + 0.605547, - -3 + -0.525722, - 1 + -0.326724, - 1 + -0.515053, - 5 + 0.261516, - -7 + 0.320474, - -1 + -0.521487, - -5 + 0.903239, - -3 + -0.403525, - 7 + 0.0639151, - 3 + 0.359482, - 3 + 0.823776, - 5 + 0.0387504, - -7 + 0.109849, - 3 + -0.097467, - -5 + -0.832645, - -5 + 0.526237, - 7 + 0.438123, - 3 + -0.519244, - 1 + -0.0476922, - 3 + 0.191197, - -7 + -0.534928, - 3 + 0.462164, - 7 + -0.895527, - -1 + 0.473474, - -7 + 0.146189, - 5 + -0.179909, - -3 + -0.285322, - 5 + 0.613479, - -1 + -0.0315166, - 7 + 0.698841, - 3 + -0.774282, - 1 + 0.818017, - 7 + -0.932623, - 3 + 0.0664446, - -7 + 0.06308, - 3 + -0.519814, - 5 + -0.576546, - 5 + -0.267179, - -3 + -0.837482, - 5 + -0.255068, - 5 + -0.0568383, - -3 + 0.888405, - -3 + -0.366288, - -5 + -0.552696, - -1 + 0.541689, - 7 + -0.0454361, - -5 + 0.608489, - 3 + -0.922755, - -5 + 0.406846, - -5 + -0.506253, - 7 + -0.688017, - -5 + 0.776949, - 1 + -0.378568, - 5 + -0.727209, - -7 + 0.613322, - 5 + 0.962756, - -7 + -0.893482, - -7 + -0.987528, - -7 + 0.456806, - 7 + 0.786419, - 1 + 0.034181, - -7 + 0.790939, - -5 + -0.0300588, - 1 + 0.1652, - -7 + -0.481907, - 3 + 0.0991387, - -7 + -0.564886, - 5 + 0.85039, - -1 + 0.812973, - -1 + -0.407522, - 7 + -0.952524, - 5 + 0.765642, - -5 + -0.337741, - 7 + 0.957819, - 3 + -0.899041, - -1 + -0.671052, - -3 + 0.983954, - 1 + -0.89124, - -3 + 0.0940522, - -1 + 0.611417, - 7 + -0.937967, - -1 + 0.941416, - -1 + -0.359601, - 5 + 0.747211, - -7 + -0.111301, - 3 + -0.640113, - 7 + 0.0550081, - 7 + -0.189345, - 3 + 0.214366, - -5 + 0.135666, - -5 + 0.226602, - 3 + -0.410662, - 5 + -0.843728, - -3 + -0.371912, - -7 + -0.989917, - -1 + 0.690856, - -1 + 0.0420038, - 7 + 0.00959448, - 5 + -0.815518, - 1 + 0.430825, - -7 + 0.609881, - 5 + -0.688188, - 5 + -0.60674, - -1 + 0.0334734, - 1 + 0.722216, - -3 + 0.285942, - 7 + 0.519757, - 3 + -0.27104, - -1 + 0.509289, - -3 + -0.81976, - 5 + 0.481086, - 3 + -0.974128, - 7 + -0.337838, - 5 + 0.962801, - -3 + -0.798452, - -3 + 0.457351, - 1 + 0.103281, - -1 + -0.0256317, - 7 + 0.802218, - 7 + 0.689228, - -7 + -0.276751, - 5 + 0.404102, - -1 + -0.860859, - -7 + -0.0371287, - -1 + 0.370437, - -5 + -0.616334, - -5 + -0.758392, - 1 + -0.454585, - 1 + -0.137519, - 7 + -0.261276, - 5 + 0.558348, - 1 + -0.948463, - -5 + 0.523879, - -5 + 0.555652, - -1 + 0.840325, - 7 + 0.279812, - 5 + 0.617966, - 1 + 0.192231, - 5 + 0.132018, - -7 + -0.11959, - 1 + -0.894721, - -7 + -0.504819, - 5 + -0.419666, - 7 + -0.391328, - -3 + -0.24103, - -7 + -0.852627, - -7 + 0.990221, - 7 + 0.822151, - -7 + 0.170617, - 3 + 0.614475, - -7 + 0.446277, - -7 + -0.371819, - 1 + 0.831829, - -5 + 0.0787276, - -1 + -0.684313, - 3 + -0.611736, - 5 + 0.472613, - 7 + 0.730033, - -5 + -0.811217, - 1 + -0.760817, - -3 + 0.268843, - 5 + 0.584456, - 1 + 0.823053, - -7 + 0.80804, - -7 + 0.457053, - 5 + -0.577104, - -5 + -0.224893, - -5 + -0.107738, - -1 + -0.51484, - 3 + -0.198893, - -7 + 0.278753, - 7 + 0.502244, - -1 + 0.0510433, - 1 + -0.402208, - -7 + 0.343478, - 1 + -0.901047, - 1 + 0.369701, - -3 + -0.944263, - -5 + 0.386476, - 3 + -0.954781, - 7 + -0.688498, - 7 + -0.365083, - 3 + -0.776885, - -1 + -0.598649, - 3 + -0.87102, - 1 + 0.975515, - -3 + -0.467838, - 1 + 0.466075, - -7 + 0.271324, - -1 + 0.978247, - 7 + 0.112029, - -1 + 0.601593, - -3 + -0.412666, - 1 + -0.601096, - 5 + -0.0684049, - -7 + 0.552019, - -5 + 0.313324, - 5 + -0.836011, - -1 + 0.528016, - -3 + 0.284965, - -3 + 0.700575, - -5 + 0.0874079, - -7 + -0.0126598, - -7 + -0.276119, - 5 + -0.218603, - -5 + -0.0014039, - -3 + 0.189325, - 7 + 0.429569, - -5 + 0.837003, - 3 + 0.703335, - 7 + -0.216503, - 7 + 0.0920741, - 7 + 0.750109, - -1 + -0.322132, - 7 + -0.128556, - -1 + 0.00373274, - -1 + -0.17115, - 1 + 0.264227, - 3 + 0.988822, - -1 + 0.0243255, - -5 + 0.605084, - -7 + 0.295968, - 5 + 0.873413, - -1 + 0.434273, - -5 + -0.781778, - 5 + -0.0426681, - -5 + 0.167692, - -1 + -0.334183, - -1 + 0.07798, - -1 + -0.297114, - -3 + 0.816338, - 1 + -0.611242, - 3 + -0.423656, - 3 + -0.432077, - 1 + -0.145807, - 5 + 0.10632, - -5 + 0.756861, - -7 + -0.931971, - 7 + -0.397063, - 5 + 0.283628, - -7 + 0.721398, - 7 + 0.348194, - -3 + -0.33922, - 3 + 0.412108, - 7 + 0.510752, - -3 + -0.263234, - -7 + 0.485708, - 5 + 0.573377, - 3 + 0.244824, - -7 + 0.756185, - 5 + -0.981843, - -7 + 0.890249, - -5 + -0.785723, - 1 + 0.429159, - 7 + 0.891205, - 5 + -0.310018, - 5 + -0.0331806, - -7 + 0.567766, - -7 + -0.172382, - 3 + -0.0973954, - -1 + -0.726783, - -7 + 0.86626, - -3 + 0.640023, - 5 + -0.104726, - -3 + -0.213919, - -5 + -0.131563, - 3 + 0.108026, - 1 + 0.426832, - -7 + 0.631181, - -3 + -0.911012, - 5 + 0.232769, - -3 + -0.124074, - 5 + -0.263584, - -3 + 0.246066, - 7 + 0.833384, - -5 + -0.798822, - 1 + -0.281957, - 1 + -0.527281, - 3 + 0.918325, - 5 + -0.872591, - -3 + 0.987781, - 7 + -0.724259, - 7 + 0.73749, - 5 + -0.179643, - 1 + -0.480496, - -1 + -0.0747694, - 3 + -0.162109, - 1 + 0.655518, - 5 + 0.815859, - 7 + -0.422858, - -1 + 0.19599, - 3 + -0.601651, - 7 + -0.598413, - -5 + -0.951473, - 7 + 0.684015, - 7 + 0.121945, - 5 + 0.330604, - -1 + 0.800472, - -5 + -0.892743, - -5 + -0.0700532, - -1 + 0.143832, - -1 + 0.713388, - 1 + -0.253503, - 1 + -0.0462767, - 3 + 0.140933, - -5 + 0.94534, - -7 + 0.665662, - -5 + 0.207102, - 3 + -0.327194, - 5 + 0.110171, - -5 + 0.225803, - 1 + -0.900872, - -5 + 0.0169889, - 5 + 0.152721, - 7 + 0.125242, - -1 + 0.63948, - 7 + 0.0639926, - -5 + -0.869524, - 7 + -0.160608, - -1 + -0.465428, - 5 + -0.2185, - -7 + -0.465846, - -1 + 0.0973919, - 3 + 0.450568, - -5 + -0.451587, - -7 + -0.83918, - -1 + 0.709855, - 3 + -0.86862, - 5 + 0.676479, - 7 + -0.125049, - -1 + -0.191198, - 5 + -0.925049, - 1 + -0.521026, - -3 + -0.0364143, - -7 + 0.600769, - -7 + 0.164072, - -5 + 0.416589, - -7 + -0.595857, - -3 + 0.220567, - 3 + 0.0636474, - -7 + 0.644101, - 5 + -0.775524, - -3 + -0.192748, - 1 + 0.0538391, - 1 + 0.29524, - -5 + 0.882538, - -5 + -0.816844, - -5 + 0.862396, - -5 + 0.314402, - 1 + -0.392808, - -3 + 0.651255, - -1 + -0.231968, - 1 + 0.738021, - 5 + 0.84997, - -3 + 0.186296, - 1 + 0.741231, - 1 + -0.177977, - 5 + 0.522434, - -7 + 0.597047, - -3 + 0.0266608, - -5 + -0.152547, - 5 + -0.579447, - -1 + -0.357272, - -7 + -0.497293, - 5 + 0.869424, - -5 + -0.0230876, - -5 + -0.132476, - -3 + 0.936738, - 5 + 0.558816, - -3 + -0.0384813, - -1 + 0.483534, - -7 + 0.867384, - -1 + 0.42158, - 3 + 0.420513, - 7 + -0.0754159, - -5 + -0.379954, - 7 + 0.769618, - -7 + 0.340938, - -7 + -0.869991, - 3 + 0.830734, - 3 + 0.94181, - 3 + -0.130749, - 3 + 0.517635, - -3 + -0.252298, - -3 + -0.0496521, - 1 + 0.684225, - 1 + 0.172965, - 1 + 0.417296, - 7 + -0.466398, - 7 + -0.114508, - -1 + -0.109476, - -7 + 0.00148834, - 1 + 0.0949139, - 1 + 0.432791, - -1 + -0.240929, - -1 + 0.652485, - 5 + -0.217385, - 7 + -0.8724, - -1 + 0.387098, - 3 + -0.444865, - -3 + 0.184706, - 7 + -0.730551, - 7 + 0.754565, - 7 + -0.604301, - 3 + -0.119371, - -1 + -0.28214, - 5 + 0.143776, - 3 + 0.957703, - 3 + -0.104371, - -5 + -0.261664, - -1 + 0.495793, - 1 + -0.734588, - -3 + 0.628134, - -3 + 0.817538, - -7 + 0.361645, - 3 + 0.162489, - 5 + -0.536024, - 7 + -0.486136, - 5 + -0.776124, - -5 + -0.629988, - 1 + -0.0367843, - -5 + -0.493533, - -7 + -0.725222, - -5 + 0.492433, - 7 + 0.288113, - -3 + -0.784857, - -5 + 0.824698, - -1 + -0.545993, - -3 + -0.306256, - 1 + -0.877171, - -1 + 0.567034, - 3 + -0.440337, - -1 + 0.14643, - 7 + -0.755017, - -1 + -0.832763, - 5 + -0.498979, - 3 + 0.763625, - 5 + 0.566975, - -5 + 0.0534092, - -5 + -0.963171, - 5 + 0.0216508, - 7 + 0.597324, - 7 + -0.441571, - 7 + 0.0347587, - 3 + 0.983787, - 1 + 0.188113, - -1 + -0.171194, - -7 + -0.641733, - 7 + 0.36138, - -1 + -0.566453, - 1 + 0.882606, - 1 + 0.61524, - -1 + -0.773541, - 3 + 0.153026, - 5 + -0.621578, - -7 + -0.904904, - -5 + 0.0406272, - -5 + 0.415864, - 5 + -0.60085, - 1 + 0.727596, - -7 + -0.0860673, - -1 + -0.785685, - -5 + -0.889453, - 7 + -0.141489, - -5 + 0.04296, - -5 + 0.564742, - -7 + -0.12966, - -1 + 0.841196, - -5 + 0.71528, - 1 + -0.104704, - 1 + -0.263372, - -7 + 0.680698, - 3 + 0.756433, - -3 + -0.200798, - 1 + 0.027729, - -1 + -0.464512, - 7 + -0.60066, - -1 + 0.104495, - -3 + 0.713626, - -5 + -0.776119, - 3 + 0.168751, - -1 + -0.905566, - 5 + -0.955254, - -7 + -0.407108, - -3 + 0.170629, - -3 + -0.453202, - -1 + -0.907515, - 5 + -0.210368, - -3 + -0.98412, - -3 + -0.798125, - 3 + -0.414919, - -1 + -0.236897, - 3 + -0.491091, - -5 + -0.77713, - 3 + 0.230108, - 1 + -0.796737, - 5 + -0.26121, - 3 + 0.397635, - -1 + 0.85451, - -3 + -0.393889, - 5 + 0.983874, - 5 + 0.942163, - -3 + 0.74394, - 1 + 0.242709, - 3 + -0.779053, - -1 + 0.341856, - -7 + -0.116747, - -7 + -0.640877, - -1 + -0.318128, - -7 + 0.00367009, - -3 + 0.617172, - 7 + -0.204651, - -5 + 0.0780388, - 7 + 0.626396, - 1 + -0.638141, - -1 + -0.882934, - -5 + -0.704026, - -3 + 0.851265, - 7 + 0.0141939, - -7 + 0.611678, - -1 + 0.341055, - 3 + -0.405282, - -7 + 0.993071, - -5 + -0.0799289, - 1 + -0.967094, - -5 + -0.893374, - 5 + -0.606802, - -1 + -0.296088, - 3 + 0.578082, - 1 + 0.630626, - -1 + -0.256433, - -7 + 0.023755, - 5 + -0.565901, - 1 + -0.87536, - -7 + 0.591114, - 3 + -0.0151382, - 3 + -0.218575, - -1 + -0.571426, - 7 + -0.817884, - 1 + -0.105616, - -5 + 0.226052, - 1 + -0.197419, - 1 + -0.804454, - 1 + -0.957871, - -7 + 0.869702, - 7 + -0.118016, - -7 + 0.231177, - -1 + 0.143965, - -7 + -0.544014, - -7 + -0.125394, - -5 + 0.66333, - -5 + 0.0453925, - 3 + -0.445539, - -3 + -0.841133, - -1 + 0.406819, - 1 + 0.066009, - -7 + -0.141267, - 7 + 0.20172, - 1 + -0.397711, - -3 + -0.341991, - 3 + -0.66472, - -1 + 0.1133, - -1 + -0.0874664, - 1 + 0.460378, - -5 + 0.833044, - -1 + 0.694845, - -5 + -0.814154, - 5 + 0.190124, - 5 + 0.90168, - -3 + 0.150333, - 5 + -0.832164, - 5 + -0.623571, - 5 + 0.116979, - 7 + -0.623282, - -3 + 0.724953, - 3 + -0.656996, - 7 + 0.0645319, - 3 + 0.0895726, - 7 + -0.776726, - -1 + 0.318608, - 3 + 0.0496206, - -3 + 0.0368759, - -1 + 0.555521, - -5 + -0.673436, - 1 + 0.0103849, - -3 + 0.0743446, - -3 + -0.259726, - 5 + 0.0216708, - 1 + 0.769972, - -5 + -0.441797, - -3 + 0.719177, - 3 + 0.576816, - 1 + -0.95444, - 3 + 0.385715, - 7 + 0.215961, - -7 + -0.0887377, - -3 + 0.9093, - 5 + 0.231244, - -5 + 0.878044, - 1 + 0.237768, - -5 + -0.224173, - 7 + 0.115184, - 5 + -0.507669, - 3 + -0.4694, - -5 + -0.559494, - -7 + 0.256493, - -3 + 0.691867, - 7 + 0.760056, - -5 + -0.0235437, - -1 + -0.491056, - -7 + -0.632234, - -7 + 0.688073, - -3 + 0.448912, - 1 + 0.806255, - 3 + 0.174302, - -1 + 0.924295, - 1 + -0.0079971, - 7 + 0.585534, - 5 + -0.106368, - 7 + -0.647104, - -3 + -0.232442, - -1 + 0.103303, - 3 + -0.545308, - -7 + 0.171427, - 1 + -0.150061, - -5 + 0.124142, - 1 + 0.609533, - 1 + -0.51341, - 3 + 0.372706, - -5 + 0.406665, - 3 + -0.277069, - -3 + 0.316304, - -7 + -0.233404, - -7 + 0.0158354, - -3 + -0.376876, - 1 + -0.914291, - -3 + -0.819444, - -7 + 0.566109, - -5 + -0.582836, - -5 + -0.839922, - 5 + 0.186932, - -5 + -0.675285, - 5 + -0.957952, - -7 + -0.784832, - -3 + 0.403649, - 3 + 0.798144, - -3 + -0.880645, - -3 + 0.528126, - -1 + -0.657318, - 3 + 0.890482, - 5 + -0.46684, - 5 + -0.566931, - -7 + 0.81062, - -1 + -0.0238388, - -7 + -0.377402, - -3 + -0.21429, - -5 + -0.505753, - -7 + -0.951982, - -1 + -0.515628, - 3 + -0.871026, - -1 + -0.838789, - -7 + -0.725925, - 1 + 0.77047, - -3 + 0.858867, - 5 + 0.600752, - -3 + 0.0665514, - 1 + -0.317725, - 3 + -0.843704, - 5 + 0.219384, - -5 + -0.586559, - 7 + -0.240551, - -3 + -0.209033, - -7 + 0.493641, - 7 + 0.152856, - -7 + -0.597324, - -1 + -0.276392, - -1 + 0.831608, - 5 + 0.470546, - 5 + 0.330143, - -7 + 0.642262, - -7 + 0.977435, - -7 + 0.313444, - -7 + -0.10048, - 5 + 0.563594, - -1 + -0.186187, - -1 + -0.365659, - 1 + -0.837578, - -5 + 0.140403, - 7 + -0.78022, - -1 + 0.844668, - 7 + 0.375148, - 7 + -0.0498808, - 1 + 0.40211, - -1 + 0.744509, - 3 + 0.079077, - 7 + 0.296291, - 7 + -0.27219, - -7 + -0.660157, - -3 + 0.915867, - -1 + 0.102478, - 1 + -0.851214, - 7 + -0.634492, - -5 + -0.253903, - -5 + -0.598679, - -7 + -0.223802, - 3 + 0.0226067, - 1 + 0.696982, - -5 + -0.0351859, - 5 + -0.481739, - -1 + -0.00746336, - 3 + 0.416315, - 5 + 0.321218, - 3 + -0.283638, - -7 + 0.752743, - 3 + -0.774599, - -1 + 0.30598, - 5 + -0.0478183, - 7 + 0.791332, - -5 + -0.235768, - 3 + 0.292966, - -3 + 0.414722, - 3 + -0.665212, - 5 + -0.710929, - -3 + -0.588074, - -3 + 0.331691, - 7 + 0.882629, - 3 + -0.550038, - 1 + -0.957022, - -5 + 0.990136, - 5 + -0.558498, - -3 + -0.842342, - -1 + 0.000248163, - -5 + 0.131952, - 7 + -0.167911, - 1 + -0.425364, - 7 + -0.372087, - 1 + 0.526899, - -1 + -0.638801, - -5 + -0.386877, - 7 + 0.871863, - -7 + 0.459965, - 5 + -0.165079, - 5 + 0.296509, - -3 + 0.833452, - -7 + 0.744527, - -3 + 0.626609, - 1 + -0.814472, - 3 + 0.998261, - -7 + 0.270782, - 1 + -0.904688, - -5 + 0.723069, - -1 + -0.664172, - -5 + -0.019654, - -1 + 0.757106, - 7 + 0.780875, - 1 + -0.898937, - 3 + -0.485577, - -3 + -0.140519, - -3 + -0.240458, - -1 + 0.353802, - -7 + -0.918099, - 3 + -0.32276, - 3 + 0.672086, - -3 + -0.335273, - 1 + -0.999146, - -1 + -0.630338, - 7 + -0.544571, - -7 + 0.470793, - -3 + -0.581126, - -1 + 0.135819, - -1 + 0.0451301, - 5 + 0.479837, - -3 + 0.172697, - 5 + 0.796663, - -1 + -0.566894, - 1 + 0.470888, - 3 + 0.0653015, - -7 + 0.792323, - 1 + -0.867727, - -3 + 0.829587, - -3 + -0.740408, - 3 + -0.830687, - 3 + 0.957641, - -7 + -0.423364, - 3 + -0.893497, - 1 + -0.853771, - -3 + 0.92187, - 1 + -0.929865, - -3 + 0.198643, - 7 + 0.961747, - -1 + -0.431994, - 7 + 0.35683, - -1 + -0.871135, - 7 + 0.727451, - 7 + 0.458093, - -3 + 0.22682, - -3 + -0.827643, - -3 + -0.189953, - 5 + -0.688236, - -3 + -0.294562, - 5 + -0.903106, - -5 + 0.444196, - -1 + 0.2121, - -5 + -0.214493, - -5 + -0.392994, - -3 + 0.665017, - 1 + 0.269187, - 7 + -0.745741, - 1 + -0.185388, - -5 + -0.795616, - -5 + -0.989525, - -5 + -0.0291574, - 7 + 0.577641, - 3 + -0.98546, - 5 + 0.696809, - -5 + 0.649647, - 3 + -0.401609, - -7 + 0.29181, - -1 + -0.336865, - 3 + -0.279985, - -7 + 0.819639, - 1 + -0.69903, - 5 + -0.956345, - -3 + 0.917636, - 3 + -0.539845, - 3 + -0.58337, - 5 + 0.0319712, - 3 + -0.682523, - 3 + -0.160175, - 1 + -0.707552, - 3 + -0.197245, - -1 + 0.583643, - -7 + 0.128135, - 3 + 0.240791, - -7 + -0.289134, - -7 + 0.955084, - -5 + 0.495007, - -1 + 0.955188, - 3 + 0.523281, - -1 + 0.468672, - -5 + -0.467838, - -3 + 0.654833, - -5 + 0.85963, - -3 + 0.532693, - -3 + -0.11304, - 5 + 0.947132, - 5 + 0.395143, - 1 + -0.114501, - -5 + 0.275912, - -7 + -0.816982, - -3 + 0.280537, - 1 + -0.290476, - 3 + 0.753207, - 3 + -0.37078, - -5 + -0.73641, - 1 + 0.720629, - -1 + 0.61751, - 5 + -0.114619, - 3 + -0.509509, - 1 + 0.349672, - 7 + 0.426544, - -5 + -0.567438, - -7 + -0.52387, - 3 + -0.376306, - 3 + -0.49252, - 5 + 0.441628, - 3 + 0.703002, - -7 + 0.62187, - 3 + 0.754402, - -1 + -0.344451, - 5 + -0.0148834, - -7 + 0.449515, - 5 + 0.230859, - 1 + 0.724024, - 5 + 0.190704, - 1 + -0.69348, - -5 + 0.586233, - 5 + 0.0794267, - -5 + -0.631736, - 1 + 0.105417, - -5 + 0.136263, - 7 + -0.642064, - 1 + 0.0430542, - -7 + -0.41497, - 5 + 0.775936, - -1 + 0.687085, - -5 + 0.925474, - -5 + 0.0990985, - 3 + -0.277763, - -1 + 0.299999, - 3 + 0.392572, - -7 + -0.546367, - 7 + 0.403084, - 5 + -0.0418944, - -7 + 0.446579, - -7 + 0.372017, - -1 + 0.459786, - 7 + -0.0032825, - 5 + 0.189248, - 5 + -0.155126, - 3 + 0.53685, - 3 + 0.933272, - 3 + -0.384181, - 5 + 0.204225, - 1 + -0.327539, - -7 + 0.348723, - 1 + -0.685387, - -7 + -0.750799, - -1 + -0.627168, - -7 + 0.610837, - 5 + -0.957175, - -3 + 0.834856, - -1 + 0.528653, - 7 + -0.780567, - 7 + 0.0884855, - 3 + 0.648985, - -1 + 0.218943, - -7 + 0.832075, - 5 + 0.811807, - -3 + -0.685713, - -3 + -0.296578, - 3 + 0.000125931, - -5 + -0.996983, - -5 + -0.193044, - 5 + -0.0545228, - 1 + 0.893854, - 5 + 0.97836, - -3 + -0.748222, - -1 + 0.196022, - 1 + 0.163083, - -5 + -0.180233, - -1 + 0.209452, - -3 + 0.744591, - -3 + -0.1817, - 1 + -0.447565, - 5 + 0.528624, - -7 + -0.692082, - 7 + -0.428345, - -7 + 0.0934917, - 1 + 0.678237, - -7 + -0.298993, - -3 + 0.654322, - -3 + -0.942614, - 7 + 0.783697, - 3 + 0.395035, - 1 + -0.372332, - 3 + -0.859733, - 1 + 0.4468, - 5 + 0.822121, - -5 + 0.201003, - -7 + -0.74061, - 5 + -0.568736, - 3 + 0.904994, - -5 + 0.325172, - 5 + 0.292775, - 5 + 0.511914, - -7 + 0.675604, - 5 + 0.907106, - -7 + 0.676053, - -3 + -0.64883, - -1 + -0.451512, - 3 + -0.841985, - -7 + 0.0817016, - -1 + 0.111568, - -7 + -0.594469, - -3 + -0.844349, - 3 + -0.26745, - -3 + -0.559703, - 7 + 0.53067, - 3 + -0.256771, - -1 + -0.170001, - -1 + -0.775529, - -1 + -0.456536, - 3 + -0.998071, - 1 + 0.941052, - 7 + 0.130878, - 7 + 0.838738, - 1 + 0.856186, - 1 + 0.846151, - -1 + -0.737487, - 3 + -0.76553, - -3 + 0.222, - -1 + -0.387758, - 7 + -0.269319, - -3 + 0.0668951, - 3 + 0.731949, - 5 + -0.741075, - -7 + -0.219907, - 3 + 0.487581, - 1 + -0.973969, - 7 + 0.639967, - 3 + 0.809232, - 3 + -0.642748, - 5 + -0.453162, - -7 + -0.474022, - -3 + -0.631836, - -3 + 0.0981818, - 7 + 0.684498, - -1 + -0.654845, - -5 + -0.612608, - 7 + 0.610862, - -3 + -0.369351, - 3 + -0.261936, - 7 + -0.814926, - 7 + 0.390131, - -5 + 0.531136, - 3 + 0.974289, - -3 + -0.111925, - 3 + 0.376471, - -3 + -0.941562, - 7 + -0.410982, - -7 + 0.875953, - 5 + -0.448872, - -1 + -0.806028, - -1 + -0.814961, - 5 + 0.395374, - -7 + 0.814904, - 1 + 0.383855, - 1 + -0.252184, - 3 + 0.524843, - -7 + -0.233859, - -7 + 0.764495, - -7 + 0.817705, - -5 + 0.641853, - -3 + -0.758414, - -1 + -0.260464, - -7 + -0.240351, - -3 + 0.0476139, - -1 + -0.220685, - -1 + -0.993293, - 7 + 0.627481, - -3 + -0.950516, - -5 + -0.0848613, - 5 + 0.670037, - 7 + 0.825011, - -7 + 0.111405, - 7 + 0.0703245, - -3 + 0.177663, - 7 + -0.739343, - 3 + -0.673892, - 7 + -0.947279, - -5 + 0.732764, - 7 + -0.807932, - 1 + -0.494108, - 1 + 0.611574, - -1 + 0.205265, - -1 + -0.485118, - -5 + 0.0552847, - -5 + -0.176059, - 5 + 0.00244508, - 7 + -0.773636, - 5 + 0.951496, - -7 + 0.525518, - -5 + 0.968101, - -7 + 0.10137, - 5 + -0.4487, - 7 + 0.215142, - -5 + -0.162651, - 5 + -0.520808, - 1 + -0.89087, - -1 + -0.804296, - 7 + -0.341382, - -7 + 0.793131, - 5 + -0.724335, - 7 + 0.0832606, - 3 + -0.819473, - 7 + -0.613928, - -1 + -0.975915, - 7 + 0.555494, - -1 + -0.753698, - 1 + -0.570132, - -5 + -0.00221921, - 1 + 0.010534, - -5 + -0.825051, - -5 + 0.528378, - 3 + 0.559274, - -5 + 0.826081, - 7 + -0.349553, - 3 + 0.36511, - -5 + -0.881283, - 1 + 0.833997, - 1 + 0.00815386, - -3 + -0.820684, - 1 + 0.952573, - -5 + 0.378794, - -5 + 0.465909, - 1 + -0.166333, - 1 + 0.0746185, - -1 + 0.431021, - 5 + 0.266922, - -1 + 0.339902, - -1 + 0.372874, - 7 + -0.0149696, - -1 + 0.0317811, - 7 + -0.691387, - -1 + 0.929823, - 5 + -0.295751, - 7 + -0.851862, - -1 + 0.33382, - 7 + -0.589562, - -7 + -0.217095, - -7 + 0.115214, - -7 + 0.220949, - 1 + 0.800567, - 3 + -0.251049, - -5 + -0.626753, - 7 + -0.450723, - 7 + 0.22979, - -3 + -0.342451, - -3 + 0.997709, - -1 + 0.582385, - -5 + 0.191317, - 7 + -0.873862, - 5 + 0.213097, - 7 + -0.762892, - 7 + 0.954305, - 7 + 0.188828, - 7 + 0.931783, - -7 + -0.839115, - 5 + -0.738813, - 3 + 0.926841, - 5 + 0.399905, - -7 + 0.0123429, - -5 + 0.545699, - 3 + -0.661568, - 3 + -0.261673, - -5 + -0.81428, - 7 + 0.866628, - 5 + -0.048188, - -3 + 0.165017, - 7 + -0.698899, - -7 + 0.0783355, - -7 + 0.693822, - 7 + 0.726706, - -1 + 0.148921, - 7 + -0.685703, - 3 + 0.548864, - -7 + -0.878148, - 3 + 0.205964, - 5 + -0.271077, - -7 + -0.15239, - 1 + -0.949635, - -1 + 0.961041, - -7 + 0.0868696, - 3 + -0.361298, - 3 + 0.624626, - 3 + -0.0838945, - 5 + 0.132301, - -1 + 0.192646, - -5 + -0.579731, - -5 + -0.101051, - 5 + 0.870131, - 1 + 0.535988, - 5 + 0.255953, - 1 + 0.314134, - -7 + 0.762894, - -7 + 0.127185, - 7 + -0.222042, - -5 + -0.529038, - -3 + 0.231572, - 1 + 0.788721, - 5 + -0.891869, - -5 + -0.472732, - 3 + -0.0128941, - 1 + -0.623197, - 7 + -0.490687, - -1 + -0.441505, - 1 + -0.0410075, - -5 + 0.847264, - -7 + -0.371955, - -1 + 0.41401, - -1 + -0.742, - 3 + 0.0546079, - 5 + -0.529726, - 7 + -0.0630406, - 1 + 0.196568, - -3 + 0.488722, - -5 + -0.357116, - 3 + -0.179397, - -3 + 0.358234, - -7 + 0.821111, - 7 + -0.634397, - 5 + -0.490498, - -5 + -0.103393, - -7 + -0.996996, - -5 + 0.358586, - -7 + 0.785637, - -5 + 0.46574, - -1 + -0.714036, - 7 + 0.73281, - -1 + -0.980125, - -5 + 0.152175, - -1 + -0.468575, - -1 + -0.154831, - 5 + -0.257122, - 3 + -0.414745, - 3 + 0.663051, - -3 + 0.787162, - -1 + 0.773088, - 5 + -0.0174988, - 7 + 0.348241, - 1 + 0.856018, - -7 + -0.177525, - 1 + 0.409387, - 3 + 0.0205055, - -3 + 0.212273, - 7 + -0.35314, - -1 + 0.253691, - -7 + 0.988757, - 1 + 0.915514, - 7 + -0.0632796, - -3 + -0.0794022, - 5 + 0.905145, - 3 + -0.678132, - 7 + 0.842035, - -1 + 0.189324, - -1 + 0.431813, - 5 + 0.855323, - 3 + -0.285528, - -3 + -0.740299, - 3 + 0.526598, - -3 + -0.807057, - -3 + -0.907001, - -1 + 0.673215, - 1 + -0.806326, - -7 + -0.0179321, - 7 + 0.0822508, - -1 + 0.850969, - 5 + 0.18839, - 3 + -0.692543, - -5 + 0.064437, - -7 + -0.112983, - -3 + -0.0709171, - -5 + 0.327346, - 1 + -0.595314, - -1 + 0.878245, - 1 + 0.291632, - -1 + -0.922109, - -3 + -0.872261, - -7 + -0.212876, - 1 + -0.348517, - 5 + -0.24286, - 3 + 0.777443, - 5 + 0.00615786, - 5 + 0.834023, - 1 + -0.590069, - -7 + 0.653321, - 1 + -0.234737, - -7 + 0.664936, - 7 + 0.411378, - -7 + -0.88205, - -1 + -0.855369, - 1 + 0.377919, - -7 + -0.456485, - -5 + -0.949986, - -5 + -0.0158651, - 3 + 0.535672, - -1 + -0.687636, - 1 + 0.736756, - 7 + -0.696999, - 1 + 0.847792, - -3 + -0.349274, - 1 + -0.544481, - 7 + 0.608189, - -7 + 0.608384, - 5 + -0.323123, - 7 + -0.947181, - 5 + 0.753829, - 5 + -0.573138, - 5 + -0.485321, - -5 + 0.480423, - -5 + -0.371829, - 5 + -0.853753, - -7 + 0.878959, - -7 + 0.0642654, - 1 + 0.680307, - 1 + 0.291632, - 7 + -0.853807, - 5 + 0.644158, - 5 + -0.355364, - 1 + 0.190966, - 3 + -0.294411, - -7 + -0.67303, - -5 + -0.965702, - -3 + 0.55212, - 1 + -0.804562, - -7 + -0.494127, - -5 + -0.983771, - 1 + -0.133138, - -1 + -0.607814, - 1 + -0.742387, - -5 + -0.411707, - -3 + -0.816862, - 7 + 0.426785, - 5 + -0.089001, - 3 + -0.966127, - 3 + -0.784032, - 5 + -0.356036, - 5 + 0.475987, - 1 + 0.970457, - -3 + 0.678356, - 1 + -0.430618, - 5 + 0.942241, - -3 + -0.913966, - 7 + -0.730373, - -3 + 0.640682, - 7 + -0.024488, - -5 + 0.462632, - -3 + -0.609614, - -1 + -0.482857, - -5 + 0.535506, - 7 + 0.821051, - -1 + 0.793945, - 3 + -0.0835013, - -5 + -0.393026, - 1 + -0.415528, - -5 + 0.182819, - 1 + -0.561988, - -5 + -0.417262, - 7 + 0.708211, - 1 + -0.207354, - -5 + -0.844518, - -7 + 0.604461, - 7 + 0.787027, - 7 + 0.763122, - 1 + 0.300372, - -3 + -0.0203687, - -7 + -0.500432, - 7 + -0.5601, - 5 + -0.682225, - -5 + -0.547398, - -3 + 0.769381, - -3 + 0.750163, - -5 + -0.820679, - 3 + 0.236003, - 1 + -0.316465, - -3 + 0.802262, - 3 + -0.399964, - 5 + -0.166494, - 1 + 0.776745, - 5 + 0.716541, - 7 + -0.251088, - -5 + -0.42548, - -3 + -0.761153, - 7 + -0.0766243, - 3 + -0.180629, - 5 + -0.166458, - -5 + -0.833394, - -7 + 0.0297446, - -7 + -0.362676, - 7 + -0.644897, - -7 + 0.283366, - 5 + -0.665628, - 3 + -0.488068, - -1 + -0.902438, - -5 + -0.355751, - 3 + -0.419479, - 7 + -0.370073, - -3 + 0.480753, - 1 + -0.420338, - -7 + -0.24157, - 7 + 0.207747, - -1 + -0.777488, - 5 + 0.341417, - -1 + -0.33618, - -5 + 0.598459, - -3 + -0.280681, - 1 + -0.0398586, - 7 + 0.717195, - 5 + 0.431427, - -5 + -0.839676, - -1 + -0.74745, - 1 + 0.73193, - -1 + 0.729311, - 5 + 0.561066, - -5 + -0.670177, - -1 + -0.254041, - 3 + 0.0451663, - -7 + -0.160697, - 7 + 0.13319, - -3 + 0.360953, - -3 + 0.264897, - 1 + -0.566809, - -5 + 0.291045, - 1 + -0.573798, - -3 + 0.854987, - -3 + -0.973763, - -7 + -0.958898, - 1 + -0.945093, - -1 + -0.72672, - 5 + 0.814473, - 7 + -0.794704, - -3 + 0.229887, - -1 + 0.801239, - -5 + 0.531782, - -1 + 0.247072, - 1 + -0.179189, - -3 + 0.401884, - 7 + 0.236019, - -1 + 0.725281, - -5 + 0.74655, - 5 + -0.427725, - -1 + 0.967868, - -7 + -0.432802, - -1 + 0.541378, - 7 + -0.555299, - -3 + 0.166895, - -7 + 0.921733, - -3 + 0.840396, - -5 + -0.602658, - -1 + -0.189227, - -5 + 0.605957, - 5 + -0.525512, - 5 + 0.433278, - -1 + 0.554043, - -1 + 0.353735, - 3 + -0.493134, - -7 + 0.86014, - -3 + 0.543759, - -1 + 0.248284, - -5 + -0.502769, - 5 + -0.984136, - 5 + 0.407552, - -1 + 0.869081, - -3 + -0.7676, - -1 + 0.940972, - 1 + -0.511719, - 7 + 0.870979, - 3 + -0.0582847, - 7 + -0.628254, - 7 + -0.780393, - 3 + -0.227097, - 1 + -0.738505, - 1 + 0.364707, - 1 + -0.522339, - -3 + -0.123359, - -5 + 0.911237, - 7 + -0.856169, - -5 + 0.878138, - 1 + -0.761068, - 3 + 0.341228, - 7 + 0.0689835, - 3 + -0.15808, - 7 + -0.138551, - 3 + 0.368672, - 5 + -0.617489, - 1 + 0.404668, - -7 + -0.699522, - 5 + -0.997434, - 5 + 0.36597, - 5 + 0.785275, - 3 + -0.231849, - 3 + -0.0999933, - 1 + -0.109, - 3 + -0.686237, - 1 + -0.902631, - -7 + 0.51259, - -5 + 0.0942837, - 1 + 0.708383, - -3 + -0.861124, - -3 + -0.179481, - -3 + 0.779682, - 1 + -0.493657, - 1 + -0.418592, - -1 + 0.856146, - 3 + -0.0875076, - 7 + -0.483033, - -1 + 0.646554, - -1 + 0.974864, - -3 + -0.841565, - -7 + 0.228352, - -1 + -0.0205758, - 7 + -0.359954, - 7 + 0.314803, - 1 + -0.357785, - 7 + 0.751935, - 1 + 0.215695, - 5 + -0.190122, - -7 + 0.428353, - -1 + -0.890184, - 7 + 0.122886, - 1 + -0.557184, - 5 + -0.556109, - 7 + 0.828952, - -5 + -0.989435, - 7 + 0.830655, - -3 + -0.217279, - -1 + -0.835888, - -1 + 0.254548, - 5 + 0.523081, - 3 + 0.584681, - 1 + -0.0839997, - 5 + -0.186458, - 1 + 0.0540011, - -1 + 0.274899, - -7 + 0.116505, - 3 + 0.723544, - 5 + 0.136319, - 7 + -0.419947, - 5 + 0.476982, - 3 + 0.243726, - 3 + 0.0739162, - -3 + -0.028526, - -1 + -0.915011, - -7 + 0.764662, - 5 + -0.449836, - -1 + 0.54113, - -5 + 0.435229, - 3 + 0.0290581, - -7 + -0.416793, - 7 + 0.733392, - 1 + -0.222058, - -1 + -0.70491, - 1 + -0.738726, - 5 + 0.467214, - -5 + -0.820001, - 5 + -0.100838, - 3 + -0.867579, - -3 + 0.682739, - 5 + -0.418042, - -1 + 0.451298, - 5 + 0.494458, - 1 + -0.849409, - 1 + -0.69703, - 1 + 0.852578, - -1 + -0.781506, - -1 + 0.477606, - 3 + -0.215093, - -1 + 0.741802, - -7 + 0.574622, - 5 + 0.855315, - 5 + 0.655386, - 1 + -0.0553299, - -1 + -0.801709, - -1 + 0.610893, - 1 + -0.996069, - -1 + -0.632696, - 7 + 0.337866, - -5 + -0.444426, - 7 + 0.557502, - 3 + 0.171951, - 7 + 0.0341445, - 3 + 0.332677, - 3 + 0.169284, - 3 + -0.273138, - -5 + 0.31627, - -1 + -0.456444, - 5 + -0.892569, - 3 + 0.936689, - 5 + -0.406369, - -5 + 0.589934, - -3 + -0.20777, - -1 + 0.757187, - -5 + 0.629676, - 5 + 0.365524, - 5 + 0.289739, - -7 + -0.182101, - -1 + 0.784527, - -3 + 0.382947, - 3 + -0.380673, - 3 + -0.748491, - 1 + 0.642036, - -1 + 0.423028, - -3 + -0.740949, - -7 + 0.0430477, - -5 + 0.916659, - 1 + -0.858744, - 1 + 0.354461, - -5 + 0.197777, - 1 + 0.132034, - 5 + -0.935967, - -7 + 0.920792, - 3 + -0.456423, - 1 + -0.288826, - 1 + -0.600615, - 7 + -0.975289, - -5 + -0.259924, - -1 + -0.640925, - -3 + 0.531508, - 1 + 0.560676, - 1 + -0.36099, - -5 + 0.122059, - -5 + -0.701523, - 3 + -0.620508, - 3 + -0.918876, - 5 + -0.716268, - 7 + -0.885677, - 7 + -0.812334, - 5 + -0.427292, - -7 + -0.543744, - 3 + -0.917745, - 1 + 0.285421, - 7 + -0.938258, - -3 + 0.845977, - 5 + -0.817096, - -3 + -0.81931, - 7 + 0.384529, - -5 + 0.923807, - -5 + -0.835286, - -3 + 0.495043, - -7 + 0.610036, - 3 + 0.691557, - 1 + 0.262664, - -7 + 0.312157, - -5 + -0.629477, - -7 + -0.396994, - 5 + -0.749666, - -3 + -0.693143, - 5 + 0.427751, - 1 + 0.18179, - -5 + 0.994096, - 5 + -0.868472, - -3 + -0.000652722, - 5 + -0.826959, - 7 + 0.810413, - -7 + 0.624387, - 3 + -0.0808038, - -3 + 0.766962, - 7 + -0.576073, - -1 + 0.549271, - -7 + -0.831344, - 7 + -0.693934, - -1 + 0.494453, - -1 + 0.201426, - 7 + 0.722833, - 5 + -0.156928, - -5 + 0.470001, - 5 + 0.928162, - 3 + 0.282769, - -1 + 0.914984, - 7 + 0.453746, - 7 + 0.641607, - -7 + -0.00260904, - -5 + -0.1964, - -3 + 0.251894, - 7 + 0.528101, - 3 + 0.110567, - 3 + 0.589285, - 3 + -0.820993, - -1 + 0.933257, - 3 + 0.400226, - 3 + 0.307276, - 5 + -0.485213, - -7 + 0.442066, - 1 + -0.967156, - 3 + 0.725474, - 1 + -0.699786, - -7 + 0.506006, - 7 + 0.513752, - -3 + -0.55039, - -5 + 0.997721, - -1 + 0.875475, - 3 + 0.935239, - -5 + 0.114364, - 1 + -0.956559, - 7 + -0.360408, - 1 + 0.198951, - -1 + -0.202082, - 5 + 0.6909, - -1 + 0.530785, - -7 + 0.117763, - 1 + -0.671653, - -1 + -0.301334, - -3 + -0.0852486, - -5 + 0.24372, - 7 + -0.937574, - -3 + 0.970979, - -5 + -0.307326, - -3 + 0.755383, - -7 + -0.0614709, - 7 + -0.354787, - 3 + -0.195025, - 7 + -0.294593, - 1 + 0.679208, - 5 + 0.876946, - 1 + 0.896838, - -1 + 0.343962, - -7 + -0.0557097, - 3 + 0.335734, - -1 + 0.00658689, - 7 + -0.707898, - -1 + 0.355665, - -1 + -0.598976, - -5 + -0.591982, - 7 + -0.485165, - 1 + -0.624015, - -3 + -0.545053, - -3 + -0.584821, - 1 + -0.748295, - -1 + 0.603633, - 5 + -0.281878, - -3 + 0.887608, - -5 + -0.701604, - 3 + 0.583568, - -7 + -0.987855, - 7 + 0.0166069, - -3 + 0.156798, - -7 + 0.693214, - 7 + 0.197865, - 7 + 0.461644, - 7 + -0.751676, - -1 + 0.989154, - -3 + -0.828416, - 5 + 0.478627, - -5 + -0.225786, - 3 + 0.146553, - 3 + 0.242108, - 1 + -0.991743, - 5 + -0.23658, - 1 + 0.712781, - -1 + -0.320432, - -1 + -0.272036, - 3 + 0.601587, - 5 + -0.176224, - 7 + -0.599448, - -5 + 0.821199, - -5 + -0.650962, - -5 + 0.54749, - -7 + 0.846249, - -5 + 0.895817, - 3 + -0.368985, - 1 + -0.479081, - -3 + 0.780251, - -3 + 0.30783, - -5 + -0.0721856, - -7 + -0.0359803, - 3 + -0.559485, - 1 + 0.296459, - 7 + 0.19517, - -5 + -0.686891, - 3 + 0.126611, - 5 + -0.0218955, - 5 + -0.0897653, - 5 + -0.476869, - 5 + -0.36738, - 1 + -0.905938, - -5 + 0.769578, - -7 + -0.911913, - -5 + 0.243897, - 3 + 0.688956, - 5 + 0.278523, - -5 + 0.119666, - 5 + -0.0967183, - -7 + -0.925501, - 1 + -0.609733, - -1 + 0.538315, - 3 + -0.49403, - -7 + 0.00403903, - -1 + 0.422778, - 1 + -0.676254, - -5 + -0.495082, - -3 + 0.887213, - -7 + -0.210539, - -5 + 0.802399, - -3 + -0.205944, - 5 + -0.684772, - -7 + 0.844196, - -5 + -0.69577, - 5 + -0.822575, - -7 + -0.158769, - 5 + 0.942987, - -7 + -0.739025, - 3 + 0.791325, - 1 + -0.931093, - -7 + -0.8201, - 3 + -0.732275, - -1 + 0.945871, - 3 + -0.891814, - -7 + 0.0258538, - 3 + 0.892123, - 1 + -0.880949, - -3 + -0.633805, - -3 + -0.709181, - -3 + -0.383623, - 3 + -0.150093, - -7 + -0.117931, - 1 + -0.307017, - 3 + 0.380702, - -5 + -0.594801, - 5 + -0.43212, - 5 + 0.920089, - 7 + -0.804395, - 1 + -0.918654, - -1 + -0.904769, - 7 + -0.78175, - 7 + 0.322011, - 3 + -0.294538, - -7 + 0.930585, - 1 + -0.477718, - -5 + -0.989844, - -1 + 0.902946, - -7 + -0.350604, - 7 + 0.126035, - -7 + -0.920143, - -7 + 0.851657, - 3 + -0.136341, - 3 + 0.593154, - -5 + -0.803969, - -5 + 0.503475, - 5 + 0.0188022, - 5 + 0.631931, - 7 + 0.91577, - -7 + -0.549304, - 1 + -0.723671, - -1 + -0.305956, - -5 + 0.74761, - -3 + 0.355676, - -1 + 0.855675, - 3 + 0.613764, - 7 + 0.700543, - -5 + -0.132191, - -1 + -0.0646009, - -5 + 0.590769, - -3 + -0.49326, - -1 + 0.216807, - -3 + -0.946063, - 1 + 0.186966, - -7 + 0.790963, - -1 + 0.45715, - 1 + 0.743977, - -5 + -0.136574, - -3 + -0.888679, - -5 + -0.732167, - 7 + -0.397459, - -7 + -0.0469681, - -7 + 0.615953, - -5 + 0.439568, - 3 + 0.273846, - 7 + 0.314949, - 3 + 0.911291, - -5 + -0.453662, - 3 + 0.80863, - 3 + -0.0106643, - 5 + 0.607597, - 7 + 0.356758, - 1 + -0.6931, - -5 + 0.371134, - -3 + -0.711628, - 7 + 0.944743, - -7 + 0.202408, - -1 + 0.728236, - -3 + 0.684351, - 3 + -0.40255, - 1 + -0.186503, - -1 + 0.0150248, - 3 + 0.185297, - -7 + 0.36002, - 3 + 0.750152, - 5 + -0.381467, - 7 + 0.334737, - -3 + 0.0568684, - 3 + -0.567396, - 5 + -0.995164, - 1 + 0.602424, - 7 + 0.0454783, - 3 + 0.516061, - 5 + -0.199994, - 1 + 0.737877, - 7 + 0.411311, - 5 + -0.853456, - 5 + -0.121685, - 7 + -0.507778, - -7 + 0.152738, - -7 + 0.094981, - 1 + -0.681713, - 5 + 0.442789, - 5 + 0.973592, - 1 + -0.323444, - 1 + 0.863931, - -1 + 0.396984, - 7 + 0.249854, - 1 + 0.807021, - 7 + 0.644638, - -7 + -0.422386, - 1 + 0.0698824, - -1 + 0.24009, - -3 + -0.406826, - 3 + -0.997362, - -7 + -0.410919, - 3 + 0.0102449, - 5 + -0.495212, - 3 + 0.260833, - -7 + -0.397034, - 1 + -0.379961, - 3 + 0.483326, - 7 + -0.909255, - -7 + 0.950334, - -1 + -0.970264, - -1 + 0.276129, - -7 + -0.0553154, - -7 + 0.322334, - -3 + -0.902084, - 7 + 0.29514, - -5 + 0.864139, - 3 + 0.925323, - -3 + 0.338491, - 3 + -0.0651398, - 3 + 0.912289, - -3 + 0.52022, - -3 + -0.709139, - 3 + -0.742856, - 7 + 0.565104, - 5 + 0.894589, - 5 + -0.556394, - -1 + -0.864631, - -5 + 0.794986, - -7 + -0.869075, - 7 + 0.774674, - 3 + 0.428512, - -5 + 0.839244, - -1 + 0.357717, - -7 + 0.199788, - -1 + -0.458671, - 7 + 0.526558, - -1 + -0.318607, - -5 + 0.630471, - -3 + -0.441537, - -1 + -0.580994, - -1 + 0.690485, - 3 + -0.547178, - 7 + 0.0732123, - 7 + -0.552486, - 3 + -0.133145, - 5 + -0.933638, - 1 + 0.255392, - -3 + -0.280157, - -5 + -0.150034, - 5 + -0.122912, - 5 + 0.941452, - -3 + 0.188547, - 3 + -0.211247, - 7 + 0.946076, - -3 + 0.92071, - 1 + 0.972226, - -5 + 0.852144, - 3 + 0.377145, - -1 + 0.413943, - -7 + 0.439598, - -5 + -0.13615, - 5 + 0.171454, - -5 + 0.845844, - -7 + 0.783942, - 3 + -0.618869, - -7 + 0.760145, - 5 + -0.0578561, - -1 + -0.582842, - 3 + -0.155049, - 5 + -0.220217, - 7 + -0.73738, - 1 + -0.767926, - -1 + -0.1484, - 7 + 0.834785, - 1 + 0.101825, - -7 + -0.449194, - 3 + 0.11657, - -1 + 0.904672, - -5 + 0.054498, - 3 + 0.924094, - -5 + -0.0965653, - 1 + -0.613703, - -7 + 0.4126, - -3 + 0.584113, - -7 + 0.159096, - -5 + -0.485646, - 3 + -0.0365765, - -3 + -0.417187, - 7 + 0.916336, - -1 + 0.725319, - 1 + 0.494014, - -5 + -0.532621, - -1 + 0.646111, - -7 + -0.417253, - -1 + -0.0992868, - -1 + 0.654899, - 3 + -0.444689, - 3 + 0.800794, - 1 + -0.112122, - -1 + -0.712385, - -3 + 0.166391, - 5 + 0.314575, - -5 + 0.950806, - 3 + -0.44719, - 1 + -0.175398, - 5 + -0.225897, - 3 + 0.258122, - -1 + -0.571683, - -3 + 0.745108, - 7 + -0.489975, - 3 + 0.869279, - 3 + -0.536627, - 5 + -0.828879, - -7 + -0.62512, - -7 + -0.456803, - 7 + 0.142581, - 7 + -0.220935, - 7 + 0.012534, - -5 + -0.681989, - -7 + 0.622798, - 1 + -0.557702, - -3 + 0.482869, - 5 + 0.197984, - 3 + 0.934018, - 7 + -0.094445, - -7 + 0.325073, - 7 + 0.917923, - -7 + 0.17338, - -5 + -0.354761, - -5 + 0.71292, - -1 + -0.877613, - 7 + -0.857628, - -7 + 0.5547, - 5 + 0.819892, - 5 + 0.550559, - 3 + -0.0277248, - 3 + 0.0711193, - -3 + -0.0491096, - -5 + -0.860672, - 3 + -0.0807872, - -5 + 0.651853, - 7 + 0.104082, - -7 + 0.236164, - -1 + -0.330286, - -7 + -0.480073, - 3 + 0.406925, - -5 + -0.518305, - -1 + -0.605615, - -1 + 0.381587, - -1 + -0.11044, - 3 + -0.160278, - 1 + -0.304637, - -1 + -0.527384, - -7 + 0.882399, - 3 + -0.777911, - -7 + -0.0419154, - 1 + -0.719173, - -7 + 0.936713, - -3 + -0.751213, - -3 + 0.441754, - 1 + -0.0637285, - -1 + 0.375699, - 7 + -0.153902, - 7 + -0.792171, - 5 + 0.655847, - 7 + 0.882999, - 5 + 0.0812634, - 3 + 0.546496, - -7 + -0.223494, - -1 + -0.356427, - 1 + 0.310918, - -7 + 0.571231, - -1 + 0.798337, - -3 + 0.598408, - -3 + 0.72025, - 3 + 0.51356, - -3 + -0.167374, - 3 + 0.240713, - 5 + 0.933577, - 5 + 0.267443, - -7 + 0.853163, - 7 + 0.751923, - 1 + -0.76546, - 1 + -0.464537, - -5 + -0.307334, - 1 + 0.78241, - -3 + -0.998566, - -1 + 0.35207, - -5 + 0.427847, - -5 + 0.110459, - 3 + 0.834955, - -7 + 0.254993, - 5 + 0.368997, - 1 + 0.697111, - 5 + 0.458215, - 5 + 0.0957664, - 7 + -0.97862, - -7 + -0.615026, - 3 + 0.859467, - 5 + -0.306685, - 1 + 0.305295, - -5 + 0.093081, - -3 + 0.673005, - 1 + 0.985715, - -5 + -0.944994, - -5 + 0.817741, - 7 + -0.898887, - 7 + -0.742699, - -7 + 0.298725, - 5 + -0.180113, - -7 + 0.18706, - 1 + 0.185461, - -1 + -0.522394, - -1 + -0.117225, - -7 + -0.143794, - -3 + -0.273471, - 1 + 0.139797, - 5 + -0.265773, - 3 + 0.427259, - 3 + -0.869272, - -5 + -0.144366, - -1 + 0.337665, - -1 + 0.171026, - 5 + -0.79788, - -5 + 0.192947, - -5 + -0.311556, - 5 + 0.785642, - -1 + -0.505434, - -1 + 0.233518, - 1 + 0.420173, - -1 + 0.163412, - 7 + 0.605216, - 1 + -0.593143, - -1 + -0.957213, - -1 + -0.515973, - 1 + 0.525257, - -5 + 0.446536, - 1 + 0.486375, - -3 + -0.5737, - 3 + -0.217493, - -1 + 0.517623, - -7 + 0.920525, - 5 + 0.365421, - 5 + 0.00848039, - -5 + 0.153402, - 1 + 0.13929, - 5 + 0.977456, - -7 + 0.22807, - -1 + -0.119464, - -1 + -0.351284, - -1 + -0.991155, - 7 + 0.889795, - -3 + 0.691846, - 1 + -0.746596, - -3 + 0.586713, - 5 + 0.596188, - -7 + -0.477961, - 3 + -0.620132, - 5 + -0.0775085, - 1 + -0.165338, - 5 + -0.211165, - 7 + -0.0470844, - 7 + -0.748061, - -3 + -0.810057, - 5 + -0.196284, - -7 + 0.0831261, - 7 + 0.823358, - 3 + -0.628647, - 7 + 0.576381, - -3 + -0.347779, - 7 + 0.223497, - -7 + -0.526754, - -7 + 0.806814, - -7 + -0.725776, - 5 + -0.793048, - -3 + -0.678268, - 7 + -0.718848, - 1 + 0.914832, - -5 + 0.808905, - 5 + 0.664148, - 3 + -0.151127, - -3 + -0.289634, - 7 + 0.276275, - 5 + 0.0411116, - -3 + 0.180697, - 7 + -0.957571, - 5 + -0.931349, - 3 + 0.346197, - 3 + 0.855933, - 1 + -0.9529, - -1 + -0.687524, - 1 + 0.393423, - 7 + 0.946512, - -5 + 0.361563, - 1 + 0.197133, - -5 + 0.313557, - 3 + -0.932788, - 3 + -0.342819, - 3 + 0.07439, - -7 + 0.703045, - -5 + -0.37896, - 1 + -0.175719, - 5 + 0.223835, - 5 + -0.516742, - -7 + 0.791386, - -3 + 0.594912, - 3 + 0.917958, - -3 + -0.550284, - 5 + 0.161439, - -1 + 0.308031, - -3 + 0.129603, - -5 + -0.755601, - -5 + -0.0725142, - -3 + 0.900576, - 5 + -0.0439364, - 3 + -0.571107, - -5 + -0.696274, - -7 + -0.101347, - 1 + 0.364593, - -7 + -0.428825, - -7 + 0.723648, - -7 + -0.196055, - 5 + -0.466505, - -3 + 0.906948, - 7 + 0.869376, - -1 + 0.965839, - 3 + -0.279962, - 1 + 0.734883, - 5 + 0.829225, - -3 + 0.931521, - 3 + 0.362365, - -7 + 0.797885, - -7 + 0.497423, - 3 + 0.776487, - 7 + 0.636682, - 1 + 0.285877, - 5 + 0.662518, - 3 + -0.273415, - -3 + -0.609258, - 7 + -0.621225, - 5 + 0.795938, - -1 + 0.330694, - -3 + 0.690014, - 1 + -0.493836, - -7 + 0.308625, - -3 + -0.948984, - -1 + -0.553156, - 1 + -0.561592, - 5 + 0.835248, - 7 + -0.722998, - -3 + -0.147382, - 3 + -0.986829, - 3 + -0.428939, - 7 + -0.486681, - -3 + -0.512164, - -7 + -0.849359, - 1 + 0.169338, - -3 + 0.794093, - 5 + -0.54137, - 5 + -0.526859, - -1 + 0.452928, - 1 + -0.42493, - -1 + 0.121008, - 3 + 0.227603, - -3 + -0.933629, - -7 + -0.176661, - 7 + -0.444884, - 5 + 0.0810715, - 5 + -0.139102, - 7 + -0.726052, - -3 + 0.342913, - 3 + -0.586903, - 7 + 0.619812, - 7 + 0.513767, - 3 + 0.179749, - -5 + 0.28388, - 5 + 0.494988, - 7 + -0.697871, - -1 + 0.320561, - 3 + 0.336703, - -5 + 0.277044, - -5 + 0.637778, - 3 + -0.778878, - -7 + 0.563479, - 5 + 0.933587, - -1 + -0.0155785, - 7 + 0.967945, - 7 + -0.441443, - -1 + 0.476776, - -1 + 0.784109, - 1 + 0.282272, - -3 + 0.120237, - 5 + 0.909491, - 7 + 0.0166548, - 1 + 0.0874624, - 7 + -0.943263, - -7 + 0.404136, - -3 + -0.425458, - 5 + -0.279096, - -7 + 0.297659, - -5 + -0.909941, - -3 + 0.417617, - 3 + 0.541595, - 5 + 0.553146, - -7 + -0.758788, - -3 + 0.810651, - 3 + 0.824127, - 3 + -0.860216, - 1 + -0.301784, - -7 + 0.774392, - -3 + -0.409294, - -1 + -0.233762, - 7 + -0.169785, - -3 + 0.0785076, - 5 + 0.612462, - 3 + -0.436439, - -7 + 0.879343, - 1 + 0.639467, - 1 + 0.052389, - -5 + -0.0166562, - -3 + 0.341038, - 5 + -0.828713, - 3 + 0.794875, - -1 + 0.45125, - -3 + 0.681263, - -5 + 0.420113, - -7 + -0.367513, - -7 + 0.706676, - -3 + -0.494458, - -3 + -0.834332, - -5 + -0.683485, - -1 + -0.0354494, - -5 + -0.604827, - 3 + 0.413222, - -3 + 0.275839, - 1 + 0.456946, - -7 + -0.171177, - -7 + -0.518215, - -7 + 0.0480101, - 3 + -0.543404, - 3 + 0.634555, - 7 + 0.509344, - 5 + 0.032606, - -7 + 0.847702, - -7 + -0.382019, - 1 + -0.893403, - -3 + 0.0839257, - -5 + -0.605519, - 5 + -0.398689, - -1 + 0.777001, - 1 + 0.557634, - 5 + -0.203117, - -7 + 0.388056, - -1 + -0.841352, - 5 + 0.571447, - -1 + 0.540101, - 7 + 0.707744, - 3 + 0.0310338, - -1 + -0.222217, - -3 + 0.878539, - 7 + 0.0656955, - -1 + 0.579365, - -7 + 0.77745, - 5 + -0.330132, - -1 + -0.181327, - 5 + -0.936911, - 7 + -0.28417, - -1 + 0.184943, - 3 + 0.470113, - -3 + -0.668268, - 3 + 0.443922, - -7 + -0.254059, - -5 + -0.998164, - -7 + -0.293805, - -7 + 0.0910158, - 7 + 0.692813, - -1 + -0.0799075, - -7 + 0.721993, - -1 + 0.385094, - 5 + -0.00619203, - 7 + 0.552784, - 1 + -0.596967, - -5 + -0.00704482, - 1 + -0.110811, - 3 + 0.121887, - 3 + 0.674047, - -3 + 0.170743, - 3 + 0.760664, - -3 + 0.42977, - 1 + 0.315997, - 5 + 0.154003, - -3 + 0.369766, - -3 + 0.646692, - -3 + -0.0673465, - 3 + -0.0560396, - -7 + 0.138723, - 7 + -0.0105182, - -7 + -0.742613, - -1 + -0.0661037, - 3 + 0.00532501, - 5 + -0.755478, - -3 + 0.363332, - -7 + -0.299669, - -1 + 0.27668, - 1 + -0.117032, - -1 + -0.0241725, - 3 + 0.0823766, - -7 + -0.207114, - 5 + -0.0581861, - -5 + 0.689536, - -5 + -0.206481, - 3 + -0.457966, - 7 + -0.489086, - -5 + 0.467335, - -3 + -0.360001, - -1 + -0.138445, - -7 + -0.914763, - 7 + 0.588969, - -5 + 0.283839, - -7 + 0.959326, - -7 + -0.67792, - -7 + -0.334574, - 7 + 0.370579, - 7 + -0.171007, - 3 + -0.868796, - -3 + -0.319757, - 3 + -0.879288, - -3 + -0.435152, - 1 + -0.700487, - 5 + -0.313853, - -5 + 0.0436639, - -3 + -0.579779, - -3 + -0.778584, - -5 + -0.789192, - -7 + -0.0165036, - 5 + -0.746662, - 3 + 0.423599, - 1 + -0.896458, - 1 + 0.884175, - -7 + -0.861808, - 1 + 0.0740701, - -7 + 0.338526, - 7 + 0.292062, - 3 + 0.948647, - 3 + -0.473585, - 5 + -0.420246, - 3 + -0.949748, - -3 + -0.593698, - -1 + -0.996076, - 1 + -0.862255, - 7 + 0.137548, - -7 + -0.28388, - 5 + 0.534124, - 5 + 0.434866, - 5 + 0.139012, - 5 + -0.468484, - -7 + 0.740186, - -7 + -0.376626, - -3 + -0.183861, - -1 + 0.669948, - 5 + 0.859722, - 1 + -0.138174, - -5 + -0.573832, - 5 + -0.940617, - 7 + -0.267174, - 7 + -0.3461, - -7 + -0.741914, - -3 + -0.322358, - -5 + 0.718059, - -7 + -0.97611, - -3 + 0.154576, - -1 + -0.183644, - 1 + -0.575116, - -3 + 0.825954, - 3 + -0.751385, - 7 + -0.607166, - -5 + -0.500472, - 7 + 0.882115, - -7 + 0.0493956, - -5 + 0.362625, - -3 + 0.492293, - 5 + 0.389105, - -5 + 0.800949, - 1 + 0.94705, - -7 + -0.377441, - 7 + 0.351678, - 7 + -0.44366, - -1 + 0.320667, - -1 + 0.752543, - 1 + 0.969968, - -7 + 0.0223379, - 5 + -0.91498, - -7 + -0.172866, - -5 + -0.173087, - 5 + 0.996417, - -1 + -0.490241, - -3 + 0.91821, - 7 + -0.563976, - 5 + -0.485962, - -7 + 0.892581, - -3 + -0.460805, - 3 + 0.941525, - 1 + -0.174042, - -3 + 0.838862, - -7 + -0.156077, - -7 + 0.466488, - 1 + -0.724364, - 7 + 0.587571, - 3 + -0.274185, - 5 + -0.514854, - -3 + 0.254629, - 7 + -0.291446, - 5 + -0.0912776, - -3 + -0.54812, - 5 + -0.0964439, - -1 + -0.952324, - -3 + 0.477252, - -5 + -0.75421, - -7 + -0.536212, - 1 + 0.97589, - 1 + -0.534707, - 1 + -0.610279, - -5 + -0.380512, - 3 + -0.213305, - 7 + 0.951862, - 1 + 0.514467, - 3 + -0.52728, - 7 + -0.107415, - -1 + 0.530744, - -7 + -0.780547, - -7 + 0.601507, - -1 + -0.884028, - -5 + 0.295033, - 5 + 0.216542, - -3 + 0.803556, - -5 + 0.408551, - -1 + 0.0640241, - -7 + 0.337687, - -3 + 0.973948, - -7 + -0.112561, - 3 + 0.497891, - -1 + -0.360651, - 1 + 0.429832, - 3 + 0.599578, - -7 + 0.62018, - -5 + 0.00679079, - -7 + 0.214149, - 7 + 0.840447, - -3 + -0.167543, - 5 + 0.0564775, - -7 + 0.824302, - 3 + 0.0793194, - 3 + 0.999321, - -1 + -0.446545, - -3 + 0.703463, - 7 + 0.991686, - -1 + -0.894842, - -7 + -0.011711, - 5 + 0.280148, - -7 + 0.854388, - -7 + -0.187445, - -1 + 0.594443, - -7 + 0.933654, - 1 + 0.297684, - 7 + 0.305794, - 5 + -0.871352, - -5 + -0.415714, - -3 + -0.437484, - -5 + 0.425868, - 3 + 0.413091, - -5 + 0.413299, - 7 + -0.94675, - 1 + 0.403995, - 7 + 0.792962, - -3 + -0.663822, - -1 + 0.782255, - 5 + 0.740358, - 5 + 0.64335, - -3 + -0.677456, - -7 + 0.318753, - 3 + 0.637624, - 5 + 0.716802, - -3 + 0.506525, - -5 + -0.0154431, - 5 + -0.413524, - -3 + -0.97805, - 3 + -0.715193, - -1 + 0.855351, - -3 + -0.547344, - -1 + 0.707832, - -7 + -0.100186, - -3 + 0.1044, - -1 + 0.834975, - 5 + 0.950804, - -3 + -0.146867, - 7 + -0.922332, - -5 + 0.361724, - 1 + -0.376783, - 1 + -0.979652, - -3 + -0.860688, - 7 + -0.0470151, - 7 + -0.29374, - 1 + -0.820914, - -1 + -0.811114, - 5 + -0.585238, - 3 + 0.0997306, - -5 + -0.789875, - 5 + -0.240234, - 5 + -0.795669, - -3 + 0.834812, - -5 + -0.0813862, - 5 + -0.154017, - -5 + 0.414384, - 1 + 0.878358, - -7 + -0.0818945, - 3 + -0.239543, - -3 + -0.203324, - -3 + -0.921207, - 5 + 0.69081, - 1 + -0.727172, - 1 + 0.287061, - 3 + 0.216088, - 1 + -0.47675, - -1 + 0.679726, - -1 + 0.147156, - 3 + 0.785956, - 5 + -0.0128753, - -1 + -0.198679, - 7 + 0.16421, - -7 + -0.41241, - -7 + 0.785757, - 1 + 0.502945, - -3 + -0.611199, - 1 + 0.589565, - -1 + -0.0650551, - -5 + -0.575992, - -3 + -0.744359, - 5 + -0.856259, - -1 + 0.95337, - -7 + 0.285215, - 3 + -0.692112, - 1 + 0.427753, - 5 + -0.771773, - 1 + 0.469569, - -1 + -0.428564, - 7 + 0.465778, - 7 + -0.468184, - 7 + 0.958522, - 1 + -0.129728, - -7 + 0.48096, - 7 + -0.127209, - 7 + -0.725595, - -5 + -0.100204, - -3 + 0.231591, - 7 + 0.54961, - 5 + 0.714396, - -5 + -0.891057, - 7 + 0.0990063, - 5 + -0.0485793, - 5 + 0.350462, - -7 + 0.683771, - 1 + -0.69861, - 1 + 0.0453779, - -1 + -0.609794, - 3 + -0.30366, - -1 + -0.0804034, - -1 + -0.119469, - 3 + 0.0833771, - -1 + 0.365207, - -3 + 0.569098, - 1 + 0.122556, - -3 + 0.383273, - -3 + 0.873332, - 5 + -0.992991, - -5 + -0.888515, - 5 + 0.0792137, - 7 + -0.949043, - -5 + -0.311345, - 1 + 0.129391, - -7 + 0.514229, - -7 + -0.889496, - 1 + -0.188848, - 5 + -0.47186, - -5 + -0.0947434, - -5 + -0.860318, - -5 + 0.240262, - 5 + -0.855161, - -7 + -0.682376, - 5 + -0.268279, - -1 + 0.574063, - -1 + -0.607989, - 3 + 0.563884, - -1 + -0.28172, - 5 + 0.889506, - 3 + 0.961434, - 1 + 0.701135, - -3 + -0.36667, - -7 + -0.665516, - 5 + -0.982884, - -7 + -0.444751, - -3 + -0.0457394, - 1 + 0.686493, - 3 + -0.763344, - -3 + -0.969778, - -5 + 0.557193, - 3 + -0.70817, - -3 + -0.0794386, - 7 + -0.674222, - 1 + 0.776054, - 3 + 0.0315101, - -5 + 0.629314, - -3 + 0.0376186, - -1 + 0.363226, - 7 + -0.829763, - 7 + -0.252856, - 5 + -0.622667, - 3 + -0.409799, - 1 + 0.33154, - 5 + 0.731536, - 7 + 0.702268, - 5 + 0.926338, - 5 + 0.843521, - -3 + -0.505366, - 3 + 0.034738, - 7 + 0.935227, - 3 + -0.633068, - 5 + 0.612473, - 7 + -0.0785781, - 7 + -0.209858, - 3 + -0.519326, - -1 + -0.900059, - 5 + 0.167903, - 7 + -0.237923, - 1 + 0.568017, - -3 + 0.338209, - 1 + -0.262908, - 1 + 0.0486361, - 7 + 0.05413, - 5 + -0.900298, - -1 + 0.13673, - 5 + 0.256166, - 5 + 0.302061, - -5 + 0.399097, - 5 + -0.379186, - -5 + 0.623826, - 5 + -0.436995, - 3 + 0.15716, - -1 + -0.839201, - -5 + -0.0482146, - 5 + -0.580043, - -5 + -0.276397, - -7 + -0.224163, - -7 + 0.569099, - 1 + 0.112961, - 7 + 0.695617, - -5 + -0.985498, - -5 + 0.624633, - -5 + -0.698944, - 1 + 0.290597, - -1 + 0.492301, - 5 + -0.873225, - 5 + 0.517916, - 1 + -0.739614, - -5 + -0.118872, - -7 + 0.429263, - 5 + -0.374059, - -3 + -0.196779, - 5 + 0.845428, - 3 + -0.825515, - 1 + -0.324621, - 3 + -0.321085, - 5 + 0.659568, - -7 + 0.507627, - 3 + -0.762506, - -5 + 0.0177499, - 1 + -0.969493, - 5 + -0.989013, - 7 + 0.639013, - 5 + -0.293451, - -3 + -0.399314, - 3 + -0.164182, - -5 + -0.0115777, - -7 + 0.728109, - 1 + 0.0601385, - -3 + 0.53905, - -3 + 0.557821, - -3 + 0.267226, - 7 + 0.484006, - 3 + -0.462906, - 7 + 0.593879, - 7 + 0.70928, - 3 + 0.783019, - 7 + -0.390819, - 5 + 0.447453, - -1 + -0.327203, - -7 + -0.249398, - -5 + -0.100986, - 1 + -0.155282, - -7 + -0.798511, - -5 + -0.415777, - 1 + 0.971724, - -3 + -0.087326, - 7 + 0.946116, - -7 + -0.681513, - 1 + -0.564743, - 5 + 0.939016, - 3 + -0.437047, - -7 + -0.551414, - -3 + 0.489793, - 5 + -0.535763, - -3 + -0.98994, - 7 + 0.192269, - -5 + 0.802636, - -3 + 0.335588, - -7 + -0.346334, - 7 + 0.710128, - 7 + 0.359396, - 7 + 0.167325, - -1 + -0.359781, - 5 + -0.450043, - -3 + -0.399062, - -1 + 0.220616, - -1 + -0.713507, - 5 + -0.323577, - -3 + -0.324612, - -5 + -0.0478501, - 7 + 0.0652244, - -1 + 0.694262, - -5 + 0.234324, - -1 + 0.684074, - -3 + 0.885926, - -1 + 0.709219, - 7 + -0.403976, - -5 + 0.0613845, - -5 + 0.578585, - 5 + 0.531759, - 5 + -0.823466, - 1 + 0.885001, - -5 + 0.678863, - 1 + 0.235131, - -5 + 0.741793, - -7 + 0.831432, - -3 + 0.524304, - 3 + -0.740704, - 7 + 0.507732, - 3 + -0.0357639, - 7 + 0.863181, - -1 + 0.576264, - 3 + 0.516363, - 3 + -0.764998, - -1 + -0.362159, - -5 + 0.197446, - 3 + -0.446453, - 3 + 0.981725, - 7 + 0.0734841, - 3 + 0.256196, - -3 + -0.77722, - -5 + 0.791577, - -7 + 0.402091, - 7 + 0.553504, - 1 + -0.93853, - -7 + 0.584471, - -3 + -0.437479, - 5 + 0.997935, - -5 + 0.682598, - -7 + 0.641139, - 3 + -0.732735, - -1 + 0.930625, - -7 + -0.488808, - 7 + -0.985779, - 7 + 0.526349, - 1 + 0.412067, - 7 + 0.405549, - 3 + 0.95903, - -3 + 0.304788, - 5 + -0.344784, - 7 + -0.707093, - 7 + 0.508233, - 3 + 0.704947, - 1 + 0.790839, - -7 + -0.789173, - -3 + -0.320104, - -5 + -0.0990607, - -1 + -0.181266, - 3 + 0.413149, - 5 + -0.445842, - 7 + 0.114297, - -1 + -0.0193645, - -3 + -0.630197, - 7 + 0.549956, - 3 + 0.832843, - -1 + 0.709999, - 5 + 0.35154, - -3 + 0.488788, - -1 + -0.367693, - 7 + 0.81898, - 3 + -0.977579, - -7 + 0.677679, - 3 + 0.0798718, - -5 + -0.361776, - -7 + 0.029239, - -3 + 0.752219, - -5 + 0.36909, - -1 + -0.845805, - -5 + 0.552649, - 7 + -0.320622, - 5 + -0.0791636, - -7 + 0.155842, - -5 + -0.383591, - -7 + -0.921708, - 7 + 0.262659, - -5 + -0.311854, - -3 + 0.909658, - 5 + 0.220908, - -5 + -0.24149, - 5 + 0.424055, - -7 + -0.115968, - -1 + -0.837231, - -3 + -0.943953, - -1 + -0.501246, - 3 + -0.30943, - -7 + 0.726022, - 5 + 0.468604, - 7 + -0.536298, - -5 + 0.180367, - -5 + 0.478635, - -5 + -0.983354, - -7 + 0.948823, - 7 + -0.964671, - -7 + 0.83219, - -1 + -0.00482819, - -5 + 0.910779, - 7 + 0.0379913, - 5 + 0.958815, - -7 + 0.37621, - 5 + -0.348852, - 1 + 0.251557, - 5 + 0.421582, - 7 + 0.100173, - -3 + -0.343514, - 7 + 0.866663, - -1 + 0.442026, - 7 + 0.0442502, - 3 + -0.617214, - 1 + -0.743735, - -5 + 0.458965, - 5 + -0.572788, - 5 + 0.040819, - 3 + -0.445056, - 5 + -0.58016, - 5 + 0.386475, - -5 + 0.470098, - 5 + -0.00197146, - 7 + -0.614743, - -7 + 0.632339, - 5 + -0.445174, - -5 + -0.462788, - -5 + 0.994442, - 5 + -0.0414883, - -5 + 0.882532, - 1 + 0.694469, - -5 + -0.36298, - -7 + 0.836014, - 1 + 0.247427, - 5 + -0.623588, - -3 + 0.509161, - 3 + -0.0136789, - -5 + 0.551708, - -5 + 0.714889, - 5 + 0.948555, - 7 + -0.542934, - -3 + 0.284379, - -1 + 0.445103, - 5 + -0.302788, - -3 + 0.782427, - -1 + -0.137974, - -1 + 0.874363, - -3 + -0.450784, - 1 + -0.962429, - -5 + 0.938102, - -7 + -0.879492, - 5 + 0.666352, - -5 + 0.146655, - -3 + 0.505806, - 3 + -0.90168, - 5 + -0.00662362, - -5 + 0.401645, - -5 + 0.516729, - 7 + -0.325518, - 7 + -0.670081, - 3 + -0.898185, - 7 + 0.725776, - -1 + -0.519448, - -1 + 0.101936, - 3 + -0.800607, - 7 + -0.407942, - 7 + -0.249011, - 7 + 0.974777, - -7 + 0.984282, - -1 + 0.177661, - -3 + 0.165499, - -5 + -0.145106, - 1 + 0.092101, - -3 + -0.287475, - -1 + -0.160128, - -5 + 0.20695, - -1 + 0.278086, - 7 + 0.376328, - -7 + 0.854766, - 7 + 0.242705, - -5 + -0.623362, - 1 + -0.755314, - -3 + -0.498729, - -5 + -0.742776, - 3 + -0.17839, - -7 + -0.141452, - -7 + 0.0890251, - 3 + -0.761854, - -7 + 0.316197, - 1 + 0.531921, - -1 + 0.763375, - -7 + 0.398482, - 1 + -0.930327, - -5 + 0.559533, - 3 + -0.782727, - -1 + -0.809251, - -3 + -0.827661, - -7 + -0.790187, - 3 + 0.886559, - 3 + -0.312838, - 7 + -0.205646, - 3 + 0.538917, - -5 + -0.151619, - 7 + -0.498444, - -1 + -0.777891, - -7 + 0.709902, - 5 + -0.842215, - -3 + -0.0873613, - -3 + 0.88423, - 1 + 0.50133, - 5 + 0.87654, - -1 + 0.775389, - -1 + 0.274183, - -7 + -0.1128, - 7 + 0.129837, - 7 + -0.138116, - 7 + 0.697651, - 3 + -0.363404, - 5 + -0.51758, - 5 + 0.276224, - -5 + -0.843988, - 5 + 0.965171, - 5 + -0.433201, - 5 + 0.77057, - 5 + -0.347871, - -1 + -0.337877, - 5 + 0.0192994, - 5 + -0.00149202, - 5 + -0.705596, - -7 + 0.848062, - 3 + -0.780618, - 3 + 0.33526, - -3 + -0.0251735, - 7 + -0.148926, - -1 + -0.655041, - -3 + -0.559493, - -3 + -0.604536, - 3 + -0.0386967, - -3 + 0.830413, - 1 + -0.428, - 5 + -0.0231212, - 7 + -0.199671, - 5 + -0.396984, - -3 + 0.687779, - -7 + -0.126673, - 3 + -0.14281, - 3 + -0.663755, - -1 + 0.590741, - 7 + -0.259138, - -1 + 0.36915, - 7 + -0.193918, - -3 + 0.074994, - 3 + 0.0734893, - 3 + -0.87442, - 5 + -0.277579, - -7 + 0.874191, - 1 + 0.603273, - -1 + -0.933543, - 7 + 0.952655, - 3 + -0.0753299, - -1 + -0.0547395, - 1 + 0.298926, - 7 + 0.89666, - -1 + -0.169361, - -7 + -0.0164988, - -1 + 0.536616, - 3 + 0.123214, - -3 + -0.686119, - -3 + 0.207928, - 1 + 0.690104, - -7 + -0.840309, - -1 + 0.22515, - 5 + -0.848586, - 7 + -0.266778, - -7 + -0.573275, - -1 + 0.792824, - 7 + -0.984161, - -3 + -0.188004, - 5 + -0.461688, - -1 + -0.62303, - 3 + -0.513087, - -1 + -0.0713464, - 7 + -0.4341, - 1 + 0.791935, - -7 + -0.216476, - -5 + -0.472753, - 7 + 0.887405, - 5 + -0.629382, - -1 + 0.960013, - -7 + -0.225607, - 5 + -0.783357, - 3 + 0.238133, - 1 + -0.939504, - 7 + 0.300807, - 7 + 0.714341, - -1 + 0.0662017, - -3 + 0.709742, - -1 + 0.80212, - -5 + 0.78005, - -3 + 0.252241, - -3 + -0.848605, - -7 + -0.928371, - -1 + 0.6205, - 3 + -0.355202, - 3 + -0.884526, - 1 + 0.766157, - 1 + -0.48066, - -5 + 0.148214, - -5 + 0.416083, - 1 + 0.141582, - 3 + 0.954276, - 7 + -0.598539, - 1 + 0.302432, - -7 + -0.302829, - -5 + 0.365095, - -5 + 0.291996, - -7 + -0.853708, - 3 + -0.27352, - 3 + 0.544414, - -1 + -0.459018, - 1 + 0.184556, - 3 + -0.52332, - -1 + -0.191827, - -1 + 0.670293, - 1 + 0.519123, - 5 + 0.841211, - -1 + -0.940759, - -1 + -0.251439, - -1 + 0.695483, - -3 + 0.557767, - -3 + 0.26932, - 1 + 0.0599606, - -5 + -0.731488, - -3 + -0.559606, - -7 + -0.161615, - -7 + -0.269363, - -3 + 0.700813, - -5 + -0.598768, - -3 + 0.805228, - 5 + -0.856961, - -1 + -0.385613, - -3 + -0.323487, - -7 + 0.411967, - -5 + 0.21551, - -7 + 0.010317, - -3 + 0.573196, - 3 + -0.360943, - -1 + 0.564722, - 7 + 0.0449874, - 5 + -0.230872, - -3 + -0.394789, - -3 + 0.992717, - 5 + 0.241152, - -1 + -0.849168, - 5 + 0.828781, - 5 + -0.408953, - -1 + -0.289148, - -1 + 0.222295, - 1 + -0.537086, - 3 + 0.306834, - -1 + -0.585661, - -7 + 0.538775, - 3 + -0.204193, - 7 + -0.77022, - 1 + -0.540422, - -5 + 0.104483, - 3 + 0.0113785, - -3 + 0.358089, - 7 + 0.83108, - 7 + -0.810261, - -1 + 0.0540461, - -1 + 0.87434, - -7 + -0.379698, - 5 + -0.722662, - -7 + -0.587491, - 3 + -0.152501, - 1 + -0.137736, - -1 + 0.137048, - -7 + -0.993715, - -5 + -0.817584, - -7 + 0.192652, - -7 + 0.965716, - 3 + -0.497121, - -3 + -0.583623, - 3 + 0.724106, - 3 + 0.906286, - 3 + 0.369401, - -5 + -0.333858, - -7 + 0.201107, - 1 + -0.481391, - 3 + 0.214079, - 1 + -0.634333, - 3 + 0.32668, - -5 + 0.438198, - 3 + 0.0183425, - -7 + -0.854446, - -3 + -0.749623, - 5 + 0.260525, - -3 + -0.246166, - 7 + -0.256046, - 5 + -0.0506104, - -5 + -0.546944, - -3 + 0.70895, - 7 + 0.671615, - -7 + -0.178744, - -7 + -0.296848, - 3 + -0.786894, - 1 + 0.486466, - 5 + 0.984005, - -3 + 0.755768, - -3 + 0.60431, - -7 + -0.658241, - 7 + -0.99308, - -7 + 0.730603, - 1 + -0.147345, - 3 + -0.914348, - -5 + 0.176437, - -5 + -0.883513, - -5 + -0.746214, - 1 + 0.599807, - -1 + -0.826388, - -1 + -0.231019, - 7 + -0.427187, - 3 + 0.436418, - -5 + -0.0296006, - 3 + 0.342193, - 5 + -0.02255, - -1 + 0.332447, - 1 + 0.627013, - -7 + -0.257934, - -5 + -0.61819, - -7 + 0.660406, - 7 + -0.749068, - -1 + -0.826357, - 7 + 0.259934, - 1 + 0.624619, - -5 + -0.409846, - -7 + 0.175771, - 7 + 0.841248, - -7 + -0.182872, - 7 + 0.728087, - 3 + -0.272224, - -1 + 0.694387, - 1 + 0.87123, - -7 + -0.36121, - -3 + 0.231829, - -3 + -0.288232, - -1 + 0.860921, - 3 + -0.667815, - -1 + -0.9711, - 3 + -0.778314, - 3 + -0.298502, - 7 + 0.460686, - -7 + -0.972103, - 1 + -0.791205, - -7 + -0.527057, - 3 + 0.680872, - 1 + 0.854739, - -7 + -0.673826, - -1 + 0.137268, - -1 + 0.333986, - -1 + 0.901741, - -1 + -0.202348, - -3 + -0.774122, - 1 + 0.589625, - 3 + -0.849021, - 7 + -0.456618, - 5 + 0.567717, - 5 + -0.636284, - 1 + 0.365766, - 1 + -0.511727, - -7 + 0.166757, - 5 + 0.919885, - 1 + -0.642062, - 5 + -0.296797, - -7 + -0.385574, - 7 + 0.591877, - -7 + 0.436025, - 3 + 0.451077, - -1 + -0.716762, - -3 + 0.374155, - 5 + 0.337632, - -7 + 0.723804, - -5 + 0.383933, - -3 + -0.0862489, - 3 + 0.990362, - 5 + 0.133119, - 1 + -0.12971, - 3 + 0.044241, - 3 + -0.964742, - -5 + 0.702827, - -5 + 0.52507, - 7 + 0.813182, - 7 + 0.456129, - -7 + -0.564425, - -3 + 0.681494, - -1 + 0.503007, - 1 + 0.488921, - -5 + -0.978964, - 5 + -0.978504, - -5 + 0.458051, - -7 + 0.0654869, - 3 + -0.245564, - -1 + -0.337528, - -5 + -0.55446, - -5 + 0.273099, - -7 + 0.215733, - 1 + -0.138924, - 7 + -0.219671, - 3 + -0.887201, - -7 + -0.516248, - -5 + -0.396037, - -5 + 0.818756, - 3 + -0.712209, - 7 + -0.282743, - -3 + 0.707385, - 7 + 0.359774, - -5 + -0.845302, - 1 + -0.1686, - -7 + -0.483578, - 1 + 0.720247, - 1 + 0.626128, - 7 + -0.2298, - -7 + -0.491252, - -1 + 0.568972, - 1 + 0.348875, - 5 + -0.21767, - 5 + -0.844788, - -7 + 0.212711, - -5 + -0.728646, - 5 + -0.257998, - -3 + 0.91577, - 3 + -0.356945, - -5 + -0.727851, - 3 + -0.839908, - -5 + -0.87513, - 5 + 0.492427, - 7 + 0.859239, - 5 + 0.63738, - 7 + -0.567552, - 7 + -0.311746, - -5 + -0.293624, - -5 + -0.0892278, - -1 + 0.68692, - -3 + -0.584071, - -7 + -0.368564, - 3 + 0.685985, - 1 + -0.443952, - 5 + -0.799968, - -5 + 0.849293, - 7 + 0.419622, - 7 + -0.719699, - -5 + 0.776349, - 7 + 0.353652, - -3 + -0.957607, - 7 + -0.233657, - -3 + 0.110137, - -5 + -0.825374, - -5 + 0.936229, - 3 + 0.611605, - -5 + 0.598961, - 3 + 0.914424, - -5 + 0.185668, - 1 + -0.506371, - -1 + 0.19368, - -3 + 0.135954, - 5 + 0.0317122, - -3 + 0.926598, - 3 + 0.841409, - -7 + -0.995628, - 7 + -0.516938, - 1 + -0.327213, - -7 + -0.988622, - 7 + 0.0436381, - -1 + -0.736482, - 3 + 0.0252206, - -7 + -0.999107, - 1 + 0.287324, - 3 + -0.710148, - -3 + -0.863982, - 5 + -0.110109, - -1 + -0.382303, - 1 + -0.00955381, - 7 + 0.574434, - 3 + 0.772632, - -3 + 0.427061, - -3 + -0.47615, - 1 + 0.159639, - -1 + 0.0973485, - -7 + 0.670094, - -3 + 0.66009, - 3 + -0.966069, - 5 + 0.729848, - -1 + -0.165828, - -5 + -0.991247, - 3 + -0.796155, - -3 + -0.665567, - 1 + 0.705734, - -3 + -0.0729422, - -5 + 0.569012, - -5 + 0.532164, - -3 + 0.114169, - -3 + -0.79896, - 5 + -0.434429, - 3 + 0.0409003, - 5 + -0.656138, - 1 + 0.80331, - -1 + -0.832592, - 1 + -0.512036, - 5 + 0.821594, - -5 + 0.153262, - -7 + 0.742653, - 7 + 0.775938, - 7 + 0.794682, - -1 + 0.436735, - 1 + 0.232814, - 5 + 0.173647, - -7 + 0.0346826, - -5 + -0.764013, - -3 + 0.414464, - -7 + -0.107918, - -5 + -0.909358, - -3 + -0.855809, - 3 + 0.321112, - -7 + -0.853217, - -1 + 0.240779, - -5 + 0.308181, - -3 + -0.101137, - -3 + 0.0592809, - 1 + -0.475771, - 1 + -0.805118, - 1 + -0.497502, - 1 + 0.0533702, - 1 + 0.256822, - 1 + 0.943496, - 5 + 0.195682, - 3 + 0.84158, - -7 + 0.691885, - 7 + 0.702398, - -5 + -0.0240126, - 3 + 0.0729154, - 1 + 0.683697, - -5 + 0.261411, - 5 + 0.953329, - 5 + -0.728981, - -5 + -0.635009, - 5 + -0.630682, - -7 + 0.122834, - -3 + 0.959923, - -1 + 0.374435, - 1 + 0.720612, - 5 + 0.664998, - 1 + 0.00891615, - -7 + 0.432124, - -3 + 0.0339184, - -1 + -0.257549, - 7 + 0.584476, - -3 + 0.0935045, - -1 + -0.804627, - 1 + -0.992967, - -3 + 0.538947, - 7 + 0.180181, - -5 + -0.90103, - -3 + -0.368599, - 7 + 0.775146, - -3 + -0.990663, - 5 + -0.991429, - 3 + 0.229796, - 3 + 0.933547, - -7 + 0.629628, - 7 + -0.128119, - -3 + 0.993864, - 3 + -0.518632, - 1 + 0.431409, - 5 + 0.162359, - -1 + 0.340156, - 7 + 0.99834, - -1 + -0.37602, - 7 + 0.798388, - -5 + -0.977304, - -1 + -0.714549, - -7 + 0.371461, - -3 + 0.429763, - -5 + -0.176519, - 1 + 0.130875, - 3 + -0.192991, - -3 + 0.926126, - 3 + -0.756796, - -3 + 0.0799201, - -5 + -0.885874, - -5 + -0.922719, - -1 + 0.788957, - 1 + 0.876735, - 1 + 0.505541, - 1 + 0.0568082, - 5 + -0.546276, - -5 + 0.987925, - 1 + 0.559679, - -5 + 0.240393, - 7 + 0.460363, - 5 + 0.194578, - 3 + 0.987203, - 7 + 0.781711, - -7 + -0.0489823, - -1 + -0.776679, - -7 + -0.496617, - 5 + -0.488827, - -3 + -0.501392, - 5 + 0.703741, - 7 + -0.0924905, - 5 + -0.948555, - -3 + -0.508697, - -5 + -0.211705, - -1 + -0.0656021, - 1 + 0.526428, - 3 + 0.977313, - 7 + 0.717488, - 1 + 0.987358, - -1 + -0.492118, - -1 + 0.765235, - 1 + -0.576154, - 3 + 0.52365, - -7 + 0.253303, - 1 + -0.492177, - 5 + 0.865942, - 5 + 0.977195, - 7 + 0.161001, - 5 + -0.907593, - -7 + -0.557902, - -7 + 0.825849, - 7 + -0.120301, - -5 + 0.531996, - 1 + 0.80755, - 7 + 0.969872, - -7 + -0.738685, - -3 + 0.636749, - 1 + -0.655666, - -3 + 0.999979, - 7 + -0.843387, - -3 + 0.693217, - 7 + 0.615595, - -3 + -0.585734, - 5 + -0.349962, - -5 + -0.708827, - 5 + 0.767043, - -3 + -0.561155, - 5 + 0.0547506, - 7 + -0.00058388, - 5 + 0.683614, - -5 + 0.933133, - -7 + -0.705963, - -1 + 0.432718, - -5 + -0.745574, - -1 + 0.578781, - -3 + 0.265256, - -1 + -0.723166, - 3 + -0.609362, - -3 + 0.897704, - -1 + 0.630349, - -5 + 0.582721, - -5 + -0.0955401, - 5 + -0.235266, - -1 + 0.829279, - -5 + -0.824548, - 3 + -0.803079, - 3 + -0.505004, - -1 + -0.492252, - 1 + -0.92866, - 1 + -0.193727, - 7 + 0.855165, - -5 + -0.409258, - 3 + 0.483943, - 5 + -0.711778, - 1 + -0.291856, - -1 + -0.309453, - -1 + -0.961907, - 3 + 0.239915, - 3 + 0.333033, - -5 + -0.520074, - 7 + 0.80808, - 7 + -0.392463, - -5 + -0.268562, - 7 + 0.963694, - -5 + -0.27416, - -3 + 0.136372, - -3 + -0.533467, - 5 + 0.0336407, - 5 + 0.269954, - -1 + 0.481331, - -5 + 0.883264, - -5 + 0.917248, - -5 + 0.841082, - 7 + -0.272449, - -1 + 0.612493, - -7 + -0.0456689, - 3 + -0.468522, - -5 + -0.783857, - -5 + -0.963398, - -7 + 0.0600612, - -3 + 0.80801, - -3 + -0.969476, - -5 + 0.949233, - 7 + -0.954761, - 7 + -0.0774834, - 5 + -0.245508, - 5 + 0.345368, - 3 + -0.476338, - -5 + -0.322511, - -3 + 0.450538, - -7 + -0.678719, - -3 + -0.172123, - -5 + -0.209171, - -3 + -0.420884, - -1 + 0.00383168, - -3 + -0.312955, - -7 + -0.0884187, - -7 + 0.201349, - 5 + -0.601248, - 5 + -0.413319, - 3 + -0.246626, - 5 + 0.977104, - -5 + 0.0133906, - 7 + 0.349431, - 5 + 0.216145, - -1 + -0.529927, - 1 + -0.249291, - 1 + 0.658874, - 7 + 0.43074, - 5 + 0.124815, - 7 + -0.553229, - 1 + 0.116857, - -5 + 0.734356, - -1 + -0.647581, - 5 + -0.323226, - -5 + -0.810003, - -3 + 0.822276, - -1 + -0.591676, - -5 + -0.434047, - 1 + 0.15821, - 7 + 0.165069, - 3 + 0.253866, - 3 + 0.973848, - -7 + 0.713996, - -5 + 0.215808, - -1 + 0.0812883, - -3 + 0.846565, - -5 + -0.947667, - 3 + 0.409641, - 5 + -0.385462, - -3 + 0.787733, - 1 + 0.844418, - 1 + 0.349241, - 5 + -0.586969, - 7 + 0.257519, - 1 + -0.315586, - -1 + -0.327033, - 1 + 0.767669, - -1 + -0.292183, - 3 + 0.389264, - -7 + 0.339534, - -3 + 0.477526, - -3 + 0.11475, - -7 + -0.119439, - 3 + 0.406966, - 5 + 0.419678, - 1 + 0.76062, - -7 + 0.536916, - -7 + -0.510681, - -5 + 0.905296, - 7 + 0.13423, - -5 + 0.748596, - 3 + -0.431882, - 7 + 0.33909, - 3 + 0.341309, - 5 + -0.172616, - -7 + -0.778667, - -5 + -0.984483, - 7 + 0.04289, - -3 + 0.791158, - -1 + -0.606419, - -3 + 0.939034, - 5 + -0.688122, - 7 + -0.0797096, - -3 + -0.176378, - 3 + -0.200208, - -3 + 0.539966, - -5 + 0.55811, - -1 + -0.965644, - -7 + -0.62776, - 3 + -0.327998, - 3 + -0.518732, - 3 + 0.713363, - 5 + 0.082287, - -7 + -0.799949, - 5 + -0.144101, - -7 + -0.416404, - 3 + 0.926589, - -3 + -0.0426248, - -3 + 0.823828, - 3 + -0.899492, - -1 + 0.925421, - -5 + -0.987104, - -3 + -0.667032, - -1 + -0.376583, - -1 + 0.776434, - 5 + 0.838315, - -3 + -0.411202, - -7 + -0.918427, - -5 + 0.627889, - 7 + -0.542975, - -3 + -0.0689918, - -5 + -0.55104, - -5 + 0.829815, - 7 + 0.466128, - -7 + -0.910729, - -3 + 0.587943, - -5 + -0.989778, - 3 + 0.429693, - -5 + 0.363276, - 5 + 0.48865, - -1 + 0.462889, - -1 + 0.933537, - -1 + -0.237365, - 7 + -0.503287, - 3 + 0.898831, - 5 + -0.88925, - 1 + 0.491187, - -3 + 0.819494, - 7 + -0.841093, - 5 + -0.172405, - -3 + 0.296082, - -5 + 0.230588, - 1 + -0.135964, - -7 + -0.24852, - 7 + 0.779819, - 1 + -0.0197039, - 3 + 0.690689, - 5 + 0.201188, - -3 + 0.316178, - 3 + -0.790151, - -3 + 0.353513, - 1 + 0.482168, - -7 + 0.5088, - 5 + -0.619387, - 3 + -0.572638, - -1 + 0.737113, - -3 + -0.330907, - 3 + -0.642647, - 7 + -0.587751, - 7 + 0.705296, - -1 + 0.765705, - -7 + 0.342622, - 1 + -0.443867, - -7 + 0.64285, - 5 + 0.119933, - 1 + 0.146719, - -3 + 0.808331, - 5 + 0.362826, - -5 + 0.649288, - -5 + -0.919914, - 5 + 0.530805, - 7 + 0.836641, - -1 + -0.33567, - 7 + -0.814941, - -3 + 0.521328, - -7 + -0.0633902, - 3 + 0.637973, - 5 + -0.448024, - -7 + 0.529787, - -1 + 0.158647, - 1 + -0.343875, - 5 + 0.862299, - -7 + 0.269423, - -3 + 0.205924, - -3 + 0.543444, - -1 + -0.0442747, - -1 + -0.514346, - -7 + -0.538346, - 5 + -0.134437, - 3 + -0.242908, - -3 + 0.960616, - -3 + 0.613265, - 5 + -0.578398, - 5 + -0.196621, - -1 + 0.99966, - -7 + -0.206926, - -7 + 0.149597, - 1 + -0.618079, - 7 + -0.779085, - 5 + 0.78756, - -3 + -0.461424, - 1 + -0.8271, - 7 + -0.779893, - 1 + -0.034591, - 3 + -0.618594, - 7 + -0.508509, - 3 + 0.858569, - -3 + -0.292217, - -3 + 0.638647, - 7 + 0.429429, - -3 + 0.0850469, - 3 + 0.840684, - -5 + -0.361285, - -1 + -0.0439304, - -5 + -0.464768, - 5 + 0.814776, - -7 + 0.838205, - -1 + 0.932473, - 3 + 0.0800499, - 3 + 0.430625, - -1 + -0.379486, - -5 + 0.566269, - 1 + -0.191075, - 1 + 0.426799, - -3 + -0.865195, - -1 + -0.286844, - -5 + -0.347813, - -1 + 0.254653, - -5 + -0.0217081, - -7 + 0.712565, - -5 + 0.626585, - -3 + 0.407399, - -1 + -0.495544, - 7 + 0.988263, - 5 + 0.752268, - 7 + -0.57751, - 1 + -0.699522, - -3 + -0.559222, - -5 + -0.142211, - -5 + -0.984406, - -7 + 0.478908, - 3 + -0.492842, - -1 + -0.75382, - 1 + 0.00969996, - 1 + -0.893656, - -7 + 0.928332, - 7 + -0.310557, - 3 + -0.203997, - -3 + -0.119623, - -3 + 0.23919, - -5 + 0.89898, - 3 + -0.000236075, - -1 + -0.75715, - 5 + -0.946444, - 5 + 0.830343, - 5 + 0.170209, - -5 + 0.0682683, - 7 + 0.490712, - 3 + 0.0912319, - 7 + -0.939061, - -5 + -0.27871, - 3 + 0.292512, - 3 + 0.7815, - 3 + 0.780423, - 3 + -0.995218, - 1 + -0.971244, - 5 + 0.863878, - 3 + 0.605471, - 1 + 0.615707, - -1 + -0.430001, - 7 + 0.137532, - -7 + 0.420738, - 5 + -0.511889, - -7 + -0.894203, - -1 + -0.442678, - 7 + 0.58245, - -1 + -0.302989, - -7 + 0.046658, - -1 + 0.213312, - -3 + -0.40466, - 3 + 0.119842, - -3 + -0.209236, - 1 + 0.489636, - -1 + 0.0750853, - 1 + -0.138393, - 3 + 0.197677, - 1 + 0.801, - 5 + -0.737093, - 5 + 0.0908536, - -7 + -0.604504, - -5 + 0.56203, - -3 + 0.309546, - 1 + -0.966521, - 5 + 0.977852, - 7 + 0.73063, - -5 + -0.256762, - -3 + -0.431265, - 5 + 0.661912, - -1 + 0.865871, - -3 + 0.10026, - -3 + 0.979883, - -3 + -0.50973, - 7 + -0.387004, - -5 + 0.872216, - -1 + -0.552574, - 3 + -0.00281111, - -5 + -0.433458, - 3 + 0.228333, - -5 + -0.784953, - 5 + 0.571488, - -5 + -0.107047, - 3 + 0.598395, - 7 + -0.209076, - 7 + 0.968037, - -7 + 0.133602, - -3 + 0.197601, - -1 + -0.737348, - -7 + -0.0987225, - -1 + -0.680374, - -5 + 0.902133, - 5 + -0.065214, - 7 + 0.820436, - -1 + -0.994703, - 5 + 0.928257, - 3 + 0.387782, - -1 + -0.867014, - -1 + -0.343716, - -3 + -0.0119044, - 5 + -0.882348, - 3 + -0.349223, - -3 + -0.423901, - -1 + -0.358375, - -7 + 0.877898, - -1 + -0.0346012, - -3 + -0.731243, - 1 + -0.0103546, - -1 + -0.662776, - 1 + 0.486511, - -1 + -0.0129122, - -5 + 0.0121863, - -3 + 0.550817, - -3 + 0.0375324, - 5 + 0.371006, - 5 + -0.111812, - 5 + 0.963243, - 1 + 0.36354, - -3 + -0.0390213, - -7 + -0.512331, - -3 + 0.530897, - -1 + -0.961326, - 1 + -0.128698, - 5 + -0.0345879, - 7 + -0.724934, - -7 + -0.990395, - 7 + -0.0956077, - 5 + 0.998217, - -1 + -0.38503, - -5 + 0.431693, - 3 + -0.322315, - 1 + -0.520076, - -3 + -0.403514, - 3 + -0.638799, - -1 + -0.665616, - -7 + 0.866326, - 7 + -0.314543, - -3 + -0.752403, - 7 + 0.180847, - 7 + -0.924565, - 3 + 0.431162, - -7 + -0.844134, - 5 + -0.621084, - 1 + 0.678683, - 7 + -0.643627, - -1 + 0.464485, - 3 + 0.311484, - 1 + 0.61938, - 1 + -0.362697, - -1 + -0.545854, - -7 + -0.693428, - 3 + -0.162961, - 3 + 0.362332, - -5 + -0.0418496, - -3 + -0.790282, - 1 + -0.362329, - -5 + -0.679632, - -7 + 0.193632, - 7 + 0.169699, - 5 + -0.0276975, - 3 + 0.145423, - 7 + -0.526892, - 7 + 0.23963, - -5 + -0.0191274, - 3 + 0.267953, - 5 + -0.963432, - 7 + 0.72934, - 5 + -0.0415711, - 3 + -0.0615771, - -1 + -0.441843, - 5 + -0.196666, - -5 + 0.656983, - 5 + 0.764159, - -7 + -0.0188419, - -1 + 0.515285, - -5 + 0.77527, - -1 + -0.362528, - 1 + 0.360052, - 3 + 0.134359, - -5 + 0.37625, - 7 + -0.511201, - 7 + -0.846493, - 5 + 0.94168, - 1 + -0.100134, - 5 + -0.157002, - 3 + -0.374631, - -7 + -0.364117, - -1 + -0.142558, - -7 + 0.0265685, - -3 + 0.138828, - -5 + -0.289868, - 1 + 0.664193, - -7 + 0.887828, - 1 + -0.652588, - 3 + -0.527631, - -1 + 0.284251, - -5 + 0.278712, - 1 + -0.105013, - -1 + 0.853542, - 1 + -0.436623, - -5 + -0.867476, - 3 + 0.96232, - 7 + 0.427617, - 3 + -0.501165, - -5 + 0.411637, - 7 + 0.891616, - -7 + 0.664072, - -1 + -0.888475, - 5 + 0.548079, - 3 + 0.503912, - -5 + -0.612317, - -1 + -0.180983, - 1 + -0.239876, - 1 + 0.596635, - -3 + -0.0827705, - -7 + 0.277359, - 5 + -0.941413, - -5 + 0.697875, - 3 + 0.714356, - 1 + -0.558584, - 1 + -0.0174082, - 5 + -0.587225, - -5 + -0.512741, - 7 + -0.434388, - 7 + -0.473811, - -1 + 0.285865, - 5 + 0.988991, - -5 + -0.991867, - -3 + 0.864291, - -5 + 0.661288, - 5 + -0.460111, - 7 + 0.366331, - -7 + 0.784093, - 5 + 0.918848, - 7 + 0.965396, - -3 + -0.161624, - 7 + -0.476323, - -5 + 0.501047, - 7 + 0.964268, - 1 + -0.388995, - -1 + 0.308069, - 7 + 0.449621, - -3 + 0.517261, - -1 + -0.931887, - -3 + -0.314139, - -1 + -0.88269, - 1 + -0.641202, - -7 + 0.426506, - -7 + 0.765908, - 3 + -0.839435, - -1 + 0.85062, - -5 + -0.068266, - 7 + -0.336073, - 5 + -0.552052, - 7 + 0.968225, - 5 + -0.489061, - -1 + 0.549817, - 7 + 0.155363, - 7 + 0.287813, - 5 + -0.0712527, - 7 + -0.539294, - 3 + 0.515963, - -7 + 0.309448, - 5 + -0.400565, - -3 + 0.772515, - -3 + 0.47223, - -5 + -0.377265, - -3 + -0.277457, - 3 + -0.0481647, - 1 + 0.253072, - 7 + -0.701416, - 3 + -0.983524, - -1 + 0.859256, - 3 + 0.684439, - 7 + -0.715583, - 1 + -0.927083, - 5 + -0.820364, - 3 + -0.818987, - -1 + 0.0484889, - -5 + 0.88172, - -1 + 0.642372, - 7 + -0.486761, - 1 + -0.154892, - -3 + 0.620922, - -7 + -0.307461, - -5 + 0.958143, - -5 + -0.945751, - -7 + 0.420205, - 3 + 0.212257, - -7 + 0.343969, - -7 + -0.56883, - -7 + 0.542757, - 1 + 0.338133, - -1 + 0.205287, - 3 + -0.678275, - -3 + 0.162556, - 7 + 0.7356, - -1 + -0.366469, - -5 + 0.818684, - 1 + -0.375059, - -7 + -0.326917, - -1 + 0.21386, - -1 + 0.933421, - -5 + -0.0965871, - -1 + -0.327707, - -3 + -0.293112, - 5 + -0.399372, - -1 + -0.243464, - -1 + -0.477791, - 5 + 0.160018, - 3 + 0.0379489, - -7 + -0.468135, - -5 + -0.924231, - 7 + -0.559268, - -1 + -0.869929, - 1 + 0.644987, - 7 + -0.416144, - -3 + -0.64862, - 1 + 0.0932449, - -1 + -0.941752, - -7 + -0.448205, - 5 + 0.816932, - -1 + -0.010022, - -3 + -0.611324, - 5 + -0.688206, - 1 + 0.868089, - -3 + -0.454031, - 3 + -0.633225, - 5 + -0.11036, - 7 + 0.119173, - -7 + -0.663239, - -7 + 0.86954, - 7 + 0.335132, - -1 + 0.512855, - 1 + -0.130088, - 3 + -0.225548, - 5 + -0.745615, - 7 + 0.963223, - -3 + -0.678778, - -7 + -0.430329, - -3 + 0.964206, - 7 + 0.808534, - 5 + -0.632605, - -5 + -0.728056, - -5 + -0.0283051, - -1 + -0.292853, - 3 + -0.960114, - 1 + 0.266249, - 7 + -0.94076, - 7 + -0.680042, - -1 + 0.678469, - 3 + 0.553279, - 7 + 0.392802, - 1 + -0.308376, - 7 + -0.588163, - 5 + -0.235282, - 7 + -0.490381, - 5 + 0.412499, - -7 + -0.148118, - 7 + -0.20069, - -1 + -0.256974, - 1 + -0.946528, - -5 + -0.190544, - 1 + -0.774484, - -1 + 0.939011, - 3 + 0.401197, - 7 + 0.763682, - -7 + 0.970152, - 5 + -0.471915, - -3 + -0.0230657, - -1 + 0.666549, - 3 + -0.312851, - 5 + 0.909774, - -5 + 0.608703, - -1 + -0.398985, - -1 + -0.579955, - -3 + 0.427466, - -3 + -0.406024, - 5 + -0.923879, - 5 + -0.124516, - -7 + 0.389177, - -1 + 0.978163, - 7 + 0.321733, - -5 + -0.401276, - -3 + -0.669763, - 5 + 0.837051, - -3 + -0.507979, - -5 + 0.650163, - 5 + -0.533125, - -7 + -0.352708, - -3 + 0.975917, - -1 + 0.333199, - 1 + 0.786429, - 7 + 0.588826, - -3 + -0.254794, - -5 + 0.577074, - 3 + -0.445216, - -3 + -0.913091, - 1 + 0.833436, - 3 + 0.879009, - 7 + -0.420452, - -7 + -0.841488, - 3 + 0.941771, - -5 + -0.516194, - 1 + -0.111796, - 1 + 0.913016, - -3 + 0.831405, - 7 + -0.456459, - 5 + 0.52518, - 7 + 0.407003, - 5 + 0.477567, - -1 + 0.420401, - -1 + 0.437449, - -7 + -0.0206778, - -3 + 0.132506, - 3 + -0.0369548, - -3 + -0.66723, - 3 + 0.639026, - -5 + 0.818826, - -3 + 0.521142, - -7 + 0.239988, - 7 + 0.798847, - 3 + 0.568449, - -7 + -0.322325, - 1 + 0.74602, - 5 + -0.820488, - 5 + 0.422569, - -5 + 0.154974, - 3 + -0.598438, - -3 + -0.0493216, - 5 + -0.437171, - -7 + 0.91565, - 1 + -0.76322, - -7 + 0.655683, - 1 + -0.221855, - 3 + 0.499042, - 7 + -0.551781, - -1 + 0.776521, - 3 + 0.364049, - 7 + 0.76778, - 1 + 0.98362, - 1 + 0.901754, - -7 + -0.301171, - -7 + -0.154012, - -3 + -0.967804, - -1 + 0.205987, - 7 + -0.231608, - 1 + 0.577335, - -5 + 0.133768, - -5 + 0.959646, - -3 + -0.0372217, - -3 + 0.404834, - -1 + 0.457923, - 1 + 0.0552233, - -3 + 0.2, - 5 + -0.787169, - -1 + 0.572437, - 7 + -0.18741, - -1 + 0.0523727, - -1 + -0.804208, - 7 + -0.303471, - 7 + 0.73635, - -3 + -0.804122, - 1 + 0.962955, - 7 + 0.065147, - -7 + -0.464851, - 7 + 0.410402, - -1 + -0.213138, - 7 + 0.323269, - 5 + -0.812589, - 1 + -0.924136, - 3 + -0.0515391, - 5 + -0.942719, - -7 + 0.0813437, - -5 + -0.919358, - -3 + 0.09817, - -3 + 0.204768, - -3 + 0.895305, - -5 + 0.426145, - -1 + -0.654514, - 1 + -0.527968, - 1 + -0.93447, - 7 + -0.259295, - -5 + -0.357566, - -3 + 0.820761, - 3 + 0.061946, - 1 + -0.365104, - -1 + -0.484186, - 5 + -0.0747202, - 7 + 0.373292, - 3 + -0.225615, - 1 + 0.387072, - -1 + 0.0964885, - 5 + 0.318965, - -5 + -0.574407, - -1 + -0.5876, - 3 + -0.0651205, - -7 + -0.131517, - -5 + -0.700999, - -1 + 0.431009, - -5 + -0.378572, - -5 + -0.438665, - 3 + -0.0663064, - -1 + 0.303877, - 7 + 0.252822, - -5 + 0.127981, - -5 + -0.979741, - -7 + -0.977809, - 1 + -0.939208, - -5 + -0.619289, - -3 + -0.817288, - -7 + -0.682975, - 5 + 0.945473, - 3 + 0.696275, - -1 + 0.466816, - 3 + -0.632966, - -3 + 0.078222, - 5 + 0.546507, - -1 + 0.977089, - 7 + -0.133295, - -5 + -0.604371, - -3 + 0.365631, - -3 + 0.673212, - -1 + 0.180141, - 5 + 0.223484, - -1 + 0.146777, - 1 + -0.319683, - -1 + 0.857262, - 5 + -0.356152, - 5 + -0.598653, - 1 + 0.975409, - -5 + -0.881246, - -7 + -0.472377, - -3 + 0.0214979, - 7 + -0.788032, - 7 + -0.333508, - 7 + -0.750094, - -3 + -0.814424, - 7 + -0.965833, - 5 + -0.36787, - 3 + -0.612635, - -5 + 0.236003, - -5 + -0.785485, - -5 + 0.745934, - 3 + 0.841095, - 3 + 0.331357, - 3 + -0.341722, - 1 + 0.0449292, - 7 + -0.256584, - -3 + -0.666529, - 7 + -0.203782, - 1 + -0.442113, - 5 + 0.281735, - -7 + -0.600958, - 5 + -0.297631, - 7 + 0.834514, - 1 + -0.965433, - -7 + 0.980322, - -5 + -0.275104, - -5 + 0.501189, - 1 + 0.861033, - 3 + -0.186388, - -7 + -0.783021, - -3 + -0.331772, - -7 + -0.923864, - 7 + 0.981171, - -7 + 0.677146, - 5 + -0.764622, - 7 + 0.544671, - 3 + -0.149741, - -1 + -0.115158, - 5 + 0.315554, - 3 + -0.0435786, - -7 + -0.198421, - 3 + 0.728623, - 3 + 0.917598, - -7 + -0.222429, - -1 + -0.839337, - 1 + -0.837996, - 5 + 0.7184, - 3 + 0.279682, - 5 + 0.89931, - 1 + -0.0903269, - -3 + 0.311248, - -3 + -0.0615842, - -5 + 0.978228, - 5 + -0.0288547, - -7 + -0.319235, - 1 + 0.459872, - -7 + -0.762583, - 1 + 0.430673, - 7 + -0.202576, - 7 + -0.508028, - 5 + -0.563939, - 7 + 0.431253, - 3 + 0.924691, - -7 + -0.929823, - -7 + -0.745149, - -3 + -0.54763, - 7 + -0.233056, - -3 + 0.0728049, - 3 + 0.173541, - 5 + -0.99085, - -5 + -0.509606, - -7 + -0.0573629, - -5 + 0.146235, - 7 + -0.530049, - 5 + -0.92378, - 5 + -0.150627, - 7 + -0.632136, - 3 + -0.544558, - -1 + -0.559563, - -5 + -0.183858, - -3 + -0.0823922, - 3 + -0.845123, - -5 + 0.740183, - -1 + -0.864943, - -7 + -0.517753, - -7 + 0.273158, - -7 + 0.597718, - 7 + -0.960088, - -1 + 0.628689, - 5 + -0.100486, - 5 + -0.28978, - -3 + 0.591832, - 5 + -0.225949, - 1 + 0.434438, - 3 + 0.701275, - -5 + -0.110868, - 3 + -0.993528, - -1 + -0.279674, - -7 + -0.695508, - 3 + 0.208776, - 5 + 0.280286, - -7 + 0.098819, - 1 + -0.270841, - -3 + 0.163315, - 7 + -0.339504, - -1 + 0.503129, - -5 + -0.42331, - -5 + 0.289597, - 5 + -0.48842, - -1 + -0.301035, - -7 + 0.307344, - 3 + 0.149469, - -7 + -0.91815, - -7 + 0.735915, - -7 + 0.651662, - -5 + -0.367747, - 3 + 0.571618, - 3 + -0.0886024, - 7 + -0.287501, - 3 + -0.332199, - -3 + 0.103811, - 1 + 0.281067, - 1 + -0.380718, - -1 + 0.343006, - -7 + -0.940098, - -3 + 0.722196, - 5 + 0.874495, - 1 + 0.990522, - 3 + -0.915597, - -5 + -0.278943, - -7 + 0.203699, - -5 + 0.170043, - 7 + 0.536621, - -5 + 0.824829, - 5 + -0.832656, - -7 + 0.333, - -3 + -0.667407, - 7 + 0.105231, - 7 + -0.905234, - -1 + -0.810245, - 3 + 0.294136, - -1 + -0.514902, - 3 + -0.2467, - 3 + -0.587121, - 3 + 0.60538, - -3 + 0.0694657, - -5 + 0.0962229, - 7 + -0.291999, - -5 + 0.450209, - 3 + -0.147034, - -1 + -0.0838816, - 3 + 0.112086, - -5 + 0.194085, - 5 + -0.0903105, - -7 + -0.919954, - -5 + -0.967825, - -1 + -0.441373, - 5 + 0.768526, - 5 + 0.38484, - 3 + -0.947454, - 5 + -0.262922, - 7 + -0.593716, - -3 + 0.219333, - 3 + 0.076773, - 7 + 0.192425, - 1 + 0.970687, - 7 + -0.00340885, - 3 + -0.199764, - -3 + 0.255666, - -5 + 0.439951, - 1 + 0.505418, - 3 + -0.356007, - 5 + -0.318271, - -3 + 0.788047, - 5 + -0.924415, - -1 + 0.394691, - 1 + 0.972997, - 1 + 0.357046, - 3 + 0.419342, - -5 + -0.774465, - -7 + 0.0996104, - 5 + -0.458399, - -3 + -0.133173, - -1 + -0.671463, - 7 + -0.916153, - -7 + 0.110461, - 3 + 0.409689, - -3 + -0.355372, - -5 + -0.896134, - -7 + -0.950039, - 7 + 0.386037, - 3 + -0.798405, - -3 + -0.744455, - 1 + -0.572819, - -1 + 0.839239, - -3 + 0.570676, - 3 + -0.835377, - -7 + 0.034378, - 5 + 0.724415, - 5 + -0.252927, - -3 + 0.287315, - -3 + 0.334237, - 5 + -0.118203, - -1 + 0.502825, - -5 + -0.154511, - 5 + -0.127665, - 7 + 0.0817964, - 1 + 0.132329, - -5 + -0.546248, - -3 + 0.874254, - -3 + 0.421468, - 3 + -0.928829, - 5 + 0.620968, - 7 + 0.0580643, - -7 + -0.687253, - -7 + -0.628005, - 5 + -0.883083, - -5 + -0.270135, - 1 + -0.623219, - -7 + 0.277921, - 3 + 0.116588, - -5 + 0.264649, - -1 + -0.593871, - -7 + 0.329278, - -1 + -0.0926952, - -1 + 0.64349, - 1 + -0.10689, - 3 + -0.541441, - 1 + 0.499186, - -3 + 0.920398, - -1 + 0.381933, - 5 + -0.518618, - -5 + 0.618314, - 1 + 0.110954, - -1 + 0.576074, - 3 + 0.45385, - -5 + -0.917242, - 5 + -0.451152, - 5 + -0.705703, - -5 + -0.97524, - -5 + -0.732996, - 5 + 0.702813, - 3 + -0.229341, - 7 + -0.13257, - 7 + 0.994484, - 7 + -0.0231948, - 5 + 0.538224, - 1 + -0.838791, - 7 + 0.848763, - -7 + -0.539283, - -3 + 0.321736, - 5 + 0.22943, - 1 + -0.626804, - 5 + 0.209983, - -5 + 0.977037, - 3 + 0.448198, - 5 + -0.419565, - 7 + 0.666147, - -7 + 0.412532, - 7 + -0.0260039, - 1 + 0.545681, - 1 + 0.657399, - -5 + 0.275525, - 5 + 0.563082, - 1 + 0.88785, - -5 + 0.855898, - -1 + -0.758617, - -1 + 0.0505126, - 5 + 0.0387102, - 5 + 0.574784, - 1 + 0.1487, - 7 + -0.234118, - -1 + 0.458783, - 5 + -0.798949, - -7 + -0.300432, - 3 + -0.455072, - 1 + 0.24667, - -3 + 0.034758, - 1 + -0.491485, - 1 + 0.27987, - -5 + -0.92334, - 1 + 0.486993, - 5 + -0.624284, - -3 + 0.259474, - 3 + 0.384827, - 7 + -0.744943, - 3 + 0.669036, - -7 + -0.171024, - 1 + -0.963747, - -3 + -0.457945, - -1 + -0.271542, - 3 + -0.642662, - 5 + 0.867933, - -7 + 0.872486, - -5 + -0.0610653, - -3 + 0.0567537, - -5 + -0.384634, - -1 + -0.810843, - 1 + -0.210336, - 7 + -0.782186, - -3 + 0.206301, - 3 + -0.532726, - -1 + 0.792476, - 1 + -0.0254994, - 1 + -0.38317, - 5 + -0.444631, - -3 + 0.202259, - 7 + 0.906256, - -5 + -0.283238, - 1 + 0.761982, - -1 + 0.456456, - 7 + -0.213898, - 7 + -0.98443, - -7 + -0.984132, - -3 + -0.549083, - 7 + 0.946917, - 1 + -0.817794, - 3 + -0.902041, - -7 + 0.667457, - 7 + 0.476978, - -1 + 0.864841, - -1 + -0.100561, - -1 + 0.589944, - 1 + -0.417731, - -5 + -0.291668, - 3 + -0.341364, - 1 + -0.116372, - -5 + -0.678389, - 5 + -0.621016, - -7 + -0.557662, - 5 + -0.916104, - 1 + 0.416737, - -3 + -0.397013, - 3 + -0.767577, - 1 + 0.340769, - 7 + -0.54333, - -5 + 0.825698, - -7 + -0.0227328, - 1 + 0.688705, - -5 + 0.783876, - -5 + 0.36354, - 3 + -0.405894, - -1 + -0.505203, - 3 + -0.280375, - -7 + -0.0717587, - -5 + 0.254936, - -5 + -0.792482, - 7 + -0.425804, - 3 + 0.295604, - -5 + 0.294844, - -3 + 0.730185, - 3 + 0.0271969, - 5 + -0.303161, - -3 + 0.883759, - 3 + 0.827756, - -7 + 0.450664, - 5 + 0.435759, - 3 + 0.360285, - -7 + 0.409698, - 1 + 0.230758, - 7 + -0.352144, - 1 + -0.389721, - 7 + -0.718911, - 3 + 0.41957, - -3 + 0.620353, - -7 + 0.254944, - -1 + 0.81995, - 3 + -0.280774, - 3 + 0.906947, - 7 + -0.349169, - -1 + -0.00793728, - -5 + -0.64104, - -7 + 0.445183, - 3 + 0.914473, - 3 + -0.570084, - -1 + 0.594879, - -5 + -0.521969, - 1 + 0.0416743, - -3 + -0.799298, - 5 + -0.041766, - -7 + -0.218755, - 1 + 0.173665, - 7 + -0.880771, - -7 + 0.339146, - -1 + 0.961946, - 1 + 0.859441, - -5 + 0.0599979, - -3 + -0.243646, - 1 + 0.642304, - 5 + 0.427633, - -3 + 0.337803, - 5 + -0.876868, - -5 + 0.124084, - 7 + -0.390476, - 5 + -0.889517, - 7 + -0.0881519, - -5 + -0.985327, - -1 + 0.364205, - -1 + 0.481156, - 1 + 0.878136, - 3 + 0.270873, - -1 + -0.133771, - 7 + -0.599314, - 7 + 0.784159, - 1 + 0.555296, - 7 + -0.974226, - 5 + 0.520163, - -5 + 0.046348, - -5 + -0.487602, - 3 + 0.0383354, - -7 + -0.969134, - 5 + -0.00830264, - 5 + 0.582434, - -5 + 0.498667, - -5 + 0.0475678, - 7 + -0.011481, - -5 + 0.0134767, - 1 + 0.897857, - -1 + 0.859261, - 3 + -0.741447, - -5 + 0.61813, - 3 + 0.976057, - -5 + 0.671342, - -1 + -0.480269, - -7 + -0.183415, - 3 + -0.955847, - 3 + 0.770801, - -3 + 0.470981, - -7 + -0.778816, - 3 + -0.906343, - -1 + -0.727997, - 7 + -0.39431, - 7 + 0.80919, - 7 + -0.973433, - -3 + -0.627311, - 3 + 0.373299, - 5 + 0.907636, - -5 + 0.658848, - 7 + 0.681815, - 5 + 0.589045, - -5 + 0.0950571, - -7 + 0.112081, - 5 + 0.34511, - -3 + 0.315859, - 5 + -0.181386, - -3 + -0.714938, - 1 + 0.308135, - 7 + 0.535557, - 7 + -0.0709868, - -1 + 0.552407, - -7 + -0.847801, - 7 + 0.160415, - 5 + -0.51117, - 3 + -0.951139, - -3 + 0.0406191, - 5 + -0.895575, - 5 + 0.0746354, - -3 + 0.915248, - -3 + 0.842174, - -7 + 0.595946, - 3 + 0.700337, - -3 + -0.23779, - 3 + -0.655733, - -5 + -0.894634, - -3 + -0.695807, - 5 + -0.476673, - 7 + -0.279169, - -5 + 0.507948, - -5 + 0.499507, - 3 + 0.0916842, - 3 + -0.837399, - -5 + 0.143527, - 3 + 0.58052, - -7 + 0.378768, - 5 + 0.811361, - -1 + 0.0748057, - 3 + 0.453959, - -7 + 0.990606, - 3 + -0.450379, - 5 + 0.395584, - -7 + -0.114441, - 5 + 0.426232, - 1 + -0.711673, - 1 + 0.077825, - -5 + -0.584918, - 1 + -0.457057, - -3 + -0.366392, - -7 + 0.00484131, - -3 + 0.215838, - -3 + -0.19239, - -5 + 0.300349, - 5 + 0.925702, - 7 + 0.693147, - -3 + -0.771327, - 7 + 0.850479, - 7 + 0.55379, - -5 + -0.622361, - -7 + -0.797468, - -1 + 0.865325, - -1 + 0.594149, - -3 + 0.402537, - 3 + 0.5647, - -5 + 0.408661, - 7 + 0.434393, - -5 + 0.369053, - 7 + 0.193313, - 7 + 0.0768285, - -5 + -0.966767, - 7 + 0.316068, - 5 + 0.393416, - -1 + 0.678055, - -1 + -0.426397, - 7 + -0.0972791, - 5 + 0.863534, - 7 + 0.857534, - 3 + -0.591288, - -1 + -0.978807, - -5 + 0.47735, - 1 + -0.387742, - 7 + 0.418231, - -7 + -0.918646, - 3 + -0.487032, - -7 + 0.169229, - 5 + 0.963037, - 3 + -0.651308, - 1 + -0.963926, - -7 + -0.870113, - -1 + -0.598625, - 1 + 0.578904, - -1 + -0.0948276, - -5 + 0.227649, - 1 + 0.555606, - -1 + -0.668322, - 1 + 0.0749024, - -5 + -0.607571, - 5 + -0.349931, - -1 + -0.898107, - 5 + 0.312465, - 7 + 0.772347, - 5 + 0.0899041, - -1 + -0.741034, - -3 + 0.26158, - 1 + -0.539694, - 7 + -0.115106, - -1 + -0.411724, - 3 + 0.0316011, - -7 + -0.810337, - -5 + 0.181813, - 5 + 0.318575, - -5 + -0.176396, - -1 + -0.639559, - 1 + 0.966577, - 7 + -0.685124, - -3 + -0.036449, - -5 + -0.456288, - -1 + 0.80942, - 1 + -0.842449, - -7 + 0.390273, - 3 + -0.931459, - 5 + 0.693488, - -7 + 0.247743, - -3 + -0.848713, - -3 + 0.137249, - -7 + -0.213185, - -7 + -0.755191, - 7 + -0.639001, - 5 + 0.91416, - 5 + -0.193425, - -5 + 0.80731, - -1 + -0.716912, - 5 + -0.503475, - 5 + -0.0585372, - 5 + -0.0209306, - 5 + -0.150028, - -3 + 0.634776, - 5 + 0.538764, - 7 + 0.704398, - -1 + -0.61061, - -7 + -0.624288, - 1 + -0.926651, - -7 + 0.580724, - 3 + 0.24162, - 1 + 0.447202, - 7 + -0.76537, - 7 + -0.753749, - 7 + -0.93289, - 7 + 0.570568, - -1 + 0.901893, - -1 + -0.297356, - 5 + -0.189813, - -3 + 0.21001, - -3 + 0.541859, - -5 + -0.73421, - 7 + 0.928552, - -7 + -0.355678, - -5 + -0.221657, - -5 + -0.0512875, - 3 + -0.298442, - -1 + -0.820576, - 7 + -0.771328, - 1 + -0.961217, - 5 + -0.161851, - -1 + -0.405209, - 3 + -0.662432, - -3 + 0.528404, - 1 + -0.226934, - -3 + 0.0363932, - 7 + 0.886687, - 3 + 0.393918, - -5 + -0.507128, - 1 + -0.189558, - -7 + -0.823271, - 7 + -0.180617, - -1 + 0.321553, - -1 + 0.989206, - -7 + -0.874277, - 1 + -0.113906, - 7 + 0.161257, - 3 + 0.670416, - -3 + -0.763578, - -1 + 0.424893, - 3 + -0.0447045, - -5 + -0.957789, - -1 + 0.196626, - -5 + 0.00535004, - 3 + 0.254757, - -7 + -0.927024, - 3 + -0.959979, - 1 + -0.949363, - -5 + 0.674222, - 1 + -0.848884, - -7 + 0.0919615, - 1 + -0.58394, - -1 + -0.515551, - -7 + -0.961024, - 7 + -0.978422, - 7 + 0.86705, - 7 + -0.323448, - -5 + -0.916549, - -3 + -0.512443, - -3 + -0.892435, - -1 + 0.0811992, - 7 + -0.1951, - 1 + -0.31832, - 7 + 0.389861, - -7 + -0.429737, - 7 + 0.14079, - -7 + -0.306634, - 1 + -0.0533624, - 1 + -0.438584, - -7 + -0.63111, - -7 + -0.559344, - -5 + 0.783094, - -7 + -0.735777, - 7 + -0.58636, - -7 + -0.116192, - -5 + -0.801831, - -5 + 0.969511, - -5 + 0.144718, - -5 + 0.363059, - -1 + -0.667404, - 3 + -0.134134, - -1 + 0.734085, - 5 + -0.165216, - 1 + 0.149468, - -5 + -0.15301, - -3 + 0.83035, - -3 + -0.27281, - -1 + 0.688733, - 5 + -0.406828, - -5 + -0.018298, - 5 + 0.219722, - -5 + 0.840822, - -7 + 0.256695, - -1 + -0.300632, - -5 + 0.403999, - -5 + 0.574885, - -3 + -0.92988, - 1 + -0.837794, - 3 + 0.510347, - 1 + 0.946242, - 1 + -0.558269, - 7 + -0.945935, - -7 + -0.106771, - 3 + -0.383966, - -5 + 0.370004, - -7 + 0.428693, - 5 + 0.936122, - 1 + -0.782085, - -7 + 0.528864, - 1 + 0.697761, - -7 + -0.681381, - -5 + 0.152231, - 5 + -0.900638, - 5 + -0.334353, - 1 + 0.862458, - -5 + -0.694343, - -7 + -0.938721, - -5 + 0.119729, - -7 + -0.874769, - -5 + -0.120494, - -3 + 0.506938, - 5 + 0.965172, - -1 + -0.888394, - -3 + -0.595798, - -5 + 0.802503, - -3 + -0.789257, - -3 + 0.351862, - 3 + -0.750966, - -1 + 0.584273, - -3 + -0.0831131, - -7 + -0.28384, - -3 + 0.806411, - 7 + -0.200101, - 3 + 0.640918, - -1 + 0.977479, - 1 + 0.865009, - -3 + -0.368203, - 7 + 0.556652, - -1 + -0.991885, - -5 + 0.332904, - 3 + 0.470344, - -7 + 0.205081, - -7 + -0.314842, - -3 + -0.62, - 3 + 0.34363, - 1 + -0.425907, - -7 + -0.702084, - -3 + -0.288143, - -7 + 0.243932, - -1 + 0.0855131, - -5 + -0.139345, - 3 + -0.959163, - 3 + 0.431497, - -7 + 0.261823, - -3 + 0.914225, - -1 + 0.325961, - 3 + -0.359881, - 7 + -0.468639, - 7 + -0.803865, - -1 + 0.343444, - 1 + 0.736499, - 5 + 0.382909, - -1 + -0.721058, - -1 + -0.823382, - 3 + -0.176144, - 5 + 0.251272, - -1 + -0.786581, - -5 + 0.273133, - 7 + -0.41622, - 3 + 0.121719, - 7 + 0.620911, - -1 + 0.237504, - 1 + -0.335624, - -7 + 0.42324, - -3 + 0.729575, - -7 + -0.723781, - 3 + 0.273075, - 3 + -0.229695, - 3 + 0.507748, - -5 + 0.294614, - -7 + -0.490011, - 3 + 0.297713, - -3 + -0.330685, - -7 + 0.441233, - 5 + -0.622061, - 5 + -0.208099, - 5 + -0.710362, - -1 + 0.154774, - -5 + 0.486696, - 5 + -0.168477, - 7 + -0.653855, - 7 + -0.0172002, - -1 + -0.1059, - 3 + 0.654305, - 1 + -0.459053, - 7 + 0.751362, - 7 + 0.407269, - 7 + 0.871658, - 7 + 0.654213, - 7 + 0.0624889, - 7 + -0.583527, - 1 + -0.252231, - 1 + -0.320237, - 5 + -0.0136125, - 7 + -0.729181, - -5 + -0.0353086, - 5 + -0.0951113, - 3 + -0.0836304, - -1 + -0.11923, - 7 + 0.962136, - -5 + -0.830669, - 1 + 0.29644, - 5 + 0.045498, - 1 + 0.76292, - -5 + -0.929796, - 5 + -0.083544, - -7 + 0.472663, - 7 + -0.746787, - 3 + 0.662228, - -5 + -0.41748, - -7 + 0.850784, - -7 + -0.130054, - -1 + 0.432904, - 7 + -0.787268, - -3 + -0.248262, - 5 + 0.406222, - 5 + -0.775207, - 7 + -0.0549824, - -1 + 0.930082, - -3 + 0.651628, - -7 + -0.373963, - 7 + -0.38767, - -5 + -0.199335, - 3 + -0.0845591, - -3 + -0.400573, - -1 + -0.423932, - 3 + 0.496079, - 3 + -0.0049753, - 5 + -0.937373, - -1 + 0.00805519, - 7 + -0.387026, - -7 + 0.379173, - 3 + -0.509631, - -3 + 0.0652572, - -7 + 0.292195, - -3 + -0.0630124, - -3 + 0.210706, - -7 + 0.0474516, - -3 + 0.088253, - 5 + -0.729131, - -1 + -0.118407, - 5 + 0.587638, - -7 + 0.963741, - -3 + 0.912494, - -7 + 0.723939, - 5 + 0.977461, - 3 + 0.230908, - -7 + 0.0875093, - -5 + 0.827526, - 7 + -0.821136, - -3 + 0.402932, - -7 + 0.441547, - 7 + 0.416953, - 5 + 0.70044, - 3 + 0.973559, - 3 + 0.407091, - -5 + -0.826277, - 3 + -0.389221, - 5 + -0.583906, - 1 + -0.0841909, - -7 + 0.530444, - -1 + -0.918261, - 3 + -0.638232, - 1 + -0.776938, - -7 + 0.706762, - -1 + 0.16429, - -7 + -0.306863, - -3 + -0.670615, - 1 + -0.819745, - 1 + -0.014878, - -3 + 0.178679, - 1 + 0.441678, - -1 + -0.193108, - -3 + -0.33399, - 5 + 0.275276, - -7 + 0.167054, - -5 + 0.134306, - 7 + -0.394252, - 3 + 0.941986, - -7 + -0.878877, - -5 + 0.770656, - -5 + 0.730814, - -1 + 0.143592, - -3 + 0.442492, - -1 + -0.712593, - 5 + 0.599122, - 1 + 0.263907, - -7 + 0.47737, - -7 + 0.0559669, - -3 + 0.208639, - 1 + 0.827161, - 1 + 0.886639, - 1 + 0.598246, - -7 + -0.191541, - 3 + 0.511962, - 3 + -0.645528, - 1 + -0.593154, - -5 + 0.52999, - 5 + -0.653963, - 1 + 0.574099, - -5 + -0.0896155, - 1 + -0.636268, - 7 + 0.343794, - -7 + 0.155548, - -1 + -0.121609, - -1 + -0.297629, - -5 + -0.468962, - 5 + -0.555227, - -1 + -0.296793, - -3 + -0.855934, - 7 + -0.739775, - 1 + -0.756048, - 1 + -0.46236, - -7 + -0.179736, - 3 + 0.125628, - 1 + 0.10038, - -5 + -0.380856, - 7 + 0.450066, - 7 + 0.959734, - -3 + 0.796831, - -1 + 0.23315, - -3 + 0.298099, - -5 + -0.383893, - -3 + -0.296636, - -5 + 0.138614, - 1 + -0.114746, - 7 + 0.555051, - 1 + -0.950471, - -1 + 0.124465, - 1 + 0.037862, - 1 + 0.719934, - 7 + -0.0167727, - -7 + -0.983453, - -5 + -0.418557, - 7 + -0.192828, - 7 + -0.0814223, - 1 + 0.224621, - 5 + -0.597524, - 5 + 0.415634, - 1 + -0.954608, - -3 + 0.227498, - -5 + -0.108549, - 7 + 0.0881721, - 3 + 0.845206, - 3 + -0.913562, - -7 + 0.24586, - -7 + 0.289418, - -1 + 0.194941, - 3 + 0.793157, - 7 + -0.434518, - -7 + 0.820917, - 5 + 0.2382, - 5 + -0.946464, - 1 + 0.686291, - 3 + -0.265611, - -1 + -0.215793, - 1 + 0.247293, - 3 + 0.370775, - -1 + -0.1934, - 5 + 0.306202, - 5 + -0.454743, - -1 + -0.529622, - 1 + 0.856026, - -5 + -0.672594, - -5 + -0.429688, - 7 + -0.898493, - 3 + -0.296784, - -7 + -0.839249, - 7 + -0.238149, - -3 + 0.87197, - 7 + -0.985437, - -3 + 0.243879, - 1 + -0.0590569, - -7 + 0.3087, - -7 + -0.415904, - -3 + 0.238146, - -3 + -0.00380364, - 7 + -0.524692, - -1 + 0.715206, - -1 + -0.382632, - 7 + -0.433315, - -3 + 0.671116, - 5 + 0.319951, - -5 + -0.467809, - 1 + -0.914862, - -1 + -0.848039, - -7 + 0.916399, - -3 + 0.158824, - -7 + 0.432194, - 5 + 0.939947, - -3 + -0.938313, - -1 + 0.111712, - 1 + -0.830159, - -1 + 0.269145, - -3 + -0.282773, - -7 + 0.397815, - -7 + 0.312644, - 7 + 0.101858, - 5 + 0.398991, - 7 + 0.931748, - 5 + -0.216404, - 5 + -0.739909, - -3 + 0.837449, - 5 + -0.292918, - 3 + -0.811216, - 3 + -0.54535, - 3 + -0.206546, - 7 + 0.287012, - 5 + 0.416343, - -7 + 0.226965, - 3 + 0.650639, - 7 + -0.513567, - 3 + 0.35494, - 7 + 0.251297, - 3 + 0.222854, - -3 + 0.631017, - 1 + -0.834925, - -5 + 0.302606, - 5 + -0.161238, - -1 + -0.717755, - -1 + 0.163733, - 7 + 0.683634, - -3 + -0.0890416, - 5 + -0.0241376, - -7 + -0.331885, - -1 + -0.566607, - 5 + -0.0680727, - -1 + 0.69374, - -5 + -0.441671, - 3 + -0.917287, - 5 + -0.447226, - 5 + 0.530121, - 3 + -0.393156, - 7 + -0.625747, - 1 + 0.660945, - 1 + 0.0093144, - 7 + -0.198812, - 5 + 0.442133, - 1 + -0.569587, - -1 + 0.969233, - -3 + 0.831887, - 7 + -0.129281, - -5 + 0.790104, - -3 + -0.329582, - 3 + -0.846209, - 5 + 0.921283, - 5 + 0.0625507, - -3 + 0.292014, - -5 + 0.833173, - -7 + -0.674783, - -3 + -0.846611, - 1 + 0.893338, - -7 + 0.983207, - -7 + -0.776993, - -7 + 0.250987, - -5 + 0.0683537, - 7 + -0.183423, - 1 + -0.0923144, - 3 + 0.316882, - 3 + 0.436083, - -1 + 0.561959, - 5 + 0.199397, - 3 + 0.998894, - -5 + -0.762317, - 1 + -0.264652, - -1 + 0.000935957, - -5 + -0.737429, - 5 + -0.449802, - -3 + -0.153005, - -7 + -0.825486, - -3 + 0.381528, - -3 + -0.834704, - 1 + -0.869081, - -5 + 0.658949, - -7 + 0.538412, - 1 + -0.274676, - -3 + -0.131948, - -5 + -0.89239, - 5 + -0.216419, - 5 + 0.0464617, - -5 + -0.202859, - -5 + 0.937449, - 5 + 0.424624, - 1 + 0.22882, - 7 + 0.683182, - 1 + -0.649762, - 3 + -0.764787, - 7 + -0.573145, - -5 + 0.304541, - 3 + 0.3929, - -7 + -0.210616, - -3 + 0.373165, - -7 + -0.21229, - -7 + 0.897832, - -7 + 0.909656, - 1 + 0.948898, - 3 + -0.42523, - 3 + 0.567772, - -3 + -0.527982, - 3 + -0.189502, - 5 + 0.970517, - 7 + 0.282051, - -3 + 0.430664, - 3 + -0.793949, - -7 + 0.545716, - -3 + 0.35154, - -3 + -0.821351, - 5 + -0.395689, - -5 + -0.620034, - 5 + -0.608408, - -3 + 0.94029, - -1 + 0.0666049, - 5 + -0.51607, - 1 + 0.991041, - 7 + 0.172753, - 5 + -0.0221328, - 5 + -0.193889, - -5 + -0.13076, - 3 + 0.138734, - 3 + 0.59089, - 3 + -0.887206, - -3 + 0.845891, - -1 + -0.347074, - 5 + -0.0834612, - 3 + -0.876824, - -1 + -0.810422, - -1 + -0.231434, - 1 + -0.239487, - -5 + 0.0323537, - 1 + -0.581238, - 5 + 0.00602403, - 5 + 0.0905542, - 3 + 0.498012, - -5 + 0.254225, - 3 + 0.314102, - 5 + 0.0299345, - 5 + -0.45939, - -1 + 0.448653, - -3 + 0.647585, - 1 + 0.318478, - 5 + 0.455767, - -1 + 0.133022, - 1 + 0.614847, - 1 + 0.120892, - -5 + 0.224634, - 5 + 0.132055, - -1 + 0.743952, - -5 + 0.425553, - 5 + -0.111105, - 1 + 0.174118, - 1 + 0.221772, - -7 + -0.845315, - -3 + 0.19196, - 7 + -0.840461, - 5 + -0.129635, - 1 + -0.596764, - 3 + -0.955832, - 1 + 0.585824, - 5 + 0.0742671, - 5 + -0.517633, - -1 + 0.48289, - 7 + 0.0644312, - 1 + -0.795109, - -7 + -0.782286, - -1 + 0.0230929, - 1 + -0.718512, - -1 + 0.764088, - 5 + 0.510258, - -5 + 0.657883, - -7 + -0.345766, - -3 + 0.430414, - 5 + 0.0833478, - -5 + -0.264892, - 3 + 0.710985, - 1 + 0.150336, - 5 + -0.861506, - 3 + -0.0429562, - -1 + 0.434927, - 7 + 0.815823, - -5 + -0.824405, - 7 + -0.262346, - -7 + -0.164051, - -5 + -0.646918, - 3 + -0.147091, - 3 + 0.13859, - -1 + -0.575533, - -3 + 0.103353, - -5 + 0.992246, - -1 + -0.611302, - 7 + -0.0318776, - 1 + 0.460203, - -3 + 0.548152, - -7 + 0.0172631, - -3 + -0.485489, - -7 + -0.980713, - -7 + -0.827265, - -1 + -0.864176, - -7 + 0.851271, - 7 + -0.466744, - -7 + 0.436088, - -3 + 0.576107, - -7 + -0.637538, - 7 + 0.655137, - 5 + -0.826798, - -5 + 0.848056, - 3 + 0.666798, - -1 + -0.180115, - 7 + 0.419637, - 5 + -0.0167801, - 3 + -0.68837, - 3 + 0.946745, - 3 + -0.0950071, - -7 + -0.827281, - -1 + 0.78343, - -5 + -0.582113, - 7 + 0.299523, - 1 + -0.488113, - 5 + -0.341736, - 7 + 0.530617, - 7 + -0.326339, - -7 + -0.817531, - -3 + -0.221869, - -5 + 0.416757, - 1 + 0.506333, - 1 + -0.2654, - 7 + 0.763487, - -5 + -0.943085, - 7 + 0.791527, - -5 + 0.0668543, - -7 + 0.938847, - -3 + 0.143887, - -3 + 0.381707, - -3 + 0.19505, - -3 + -0.920517, - -5 + 0.145063, - -5 + 0.237513, - -7 + -0.120207, - -7 + -0.0991134, - -5 + 0.0680013, - 1 + -0.0638738, - 5 + 0.970159, - 5 + 0.213576, - 1 + -0.263613, - -7 + -0.544301, - -5 + -0.828692, - -5 + 0.166918, - -5 + -0.761728, - 5 + 0.120694, - 5 + 0.903705, - -5 + 0.211521, - 3 + 0.290967, - 7 + -0.464751, - -7 + 0.186847, - 7 + 0.32524, - -7 + 0.111797, - 1 + -0.788556, - 1 + -0.14745, - -3 + -0.968889, - 3 + -0.37981, - 5 + 0.00729347, - 7 + 0.504821, - 1 + -0.961113, - 3 + 0.710415, - -5 + -0.613475, - 5 + -0.895771, - -1 + -0.895503, - 5 + -0.461719, - 5 + 0.0161815, - -5 + -0.24625, - -7 + -0.572922, - -1 + -0.459816, - 7 + -0.419624, - -5 + 0.696952, - -5 + 0.927165, - -5 + 0.243638, - 7 + 0.360799, - 3 + 0.347879, - -3 + -0.0232377, - 3 + 0.712201, - -1 + 0.759489, - -7 + 0.438561, - -7 + -0.572822, - 1 + -0.737766, - 3 + 0.0680258, - -1 + 0.686509, - 5 + -0.262713, - -5 + -0.79966, - 5 + -0.236232, - -7 + -0.0260004, - -7 + 0.218216, - -3 + 0.370607, - 3 + 0.816354, - 7 + 0.452291, - -3 + -0.822625, - 3 + 0.848817, - 7 + 0.365835, - 1 + -0.676283, - 1 + -0.0594598, - -5 + 0.521534, - 1 + -0.486592, - 7 + -0.986362, - -7 + 0.0779941, - -3 + -0.08751, - 7 + -0.491647, - 7 + -0.270531, - -1 + -0.204778, - 1 + -0.231377, - -7 + -0.469895, - -1 + -0.844354, - -7 + -0.264911, - -1 + -0.1599, - -7 + -0.44972, - -1 + 0.194789, - 1 + -0.104809, - 3 + -0.228419, - -7 + -0.803297, - -7 + 0.625464, - -1 + -0.352292, - -1 + -0.755153, - -1 + -0.67635, - 7 + 0.297913, - 5 + 0.57017, - 5 + -0.173484, - 5 + 0.668881, - 1 + 0.277459, - -3 + -0.784868, - 5 + -0.499577, - 3 + -0.10745, - 7 + 0.92074, - -3 + -0.987991, - 7 + 0.915782, - 3 + -0.98239, - 1 + -0.781632, - -5 + 0.853114, - 5 + -0.13405, - -5 + 0.870097, - 7 + -0.696323, - 7 + -0.94934, - -3 + -0.398685, - -7 + 0.869119, - -5 + -0.903581, - -7 + 0.131423, - -3 + 0.834563, - 7 + 0.143985, - 3 + 0.145958, - -3 + 0.536994, - -5 + -0.691582, - 5 + 0.556042, - 7 + -0.58014, - -5 + -0.103551, - -1 + 0.15221, - 3 + -0.757364, - -5 + 0.580815, - 5 + 0.852026, - -7 + -0.470408, - -3 + 0.0561844, - 5 + -0.515549, - 1 + 0.173103, - -3 + -0.168945, - 5 + -0.762956, - -3 + 0.793081, - -1 + -0.676991, - 3 + 0.665824, - 5 + 0.121066, - -5 + 0.731384, - -5 + 0.671191, - -7 + -0.175862, - -7 + 0.486734, - 5 + 0.163906, - -3 + -0.529629, - -3 + -0.741516, - -5 + 0.780671, - -7 + -0.230291, - -3 + 0.302234, - 7 + -0.987584, - -7 + 0.429419, - 7 + -0.123349, - -3 + -0.693596, - 1 + 0.156304, - -7 + -0.070418, - -5 + 0.939389, - 3 + -0.282077, - 7 + -0.461724, - -7 + -0.266467, - -3 + 0.973726, - 5 + 0.324534, - 1 + 0.798357, - -3 + -0.225007, - -3 + 0.326469, - 1 + 0.217389, - -7 + 0.771884, - 1 + -0.448262, - 1 + 0.834186, - 5 + -0.8447, - 7 + 0.265382, - 7 + 0.882236, - 7 + 0.951853, - 3 + -0.212489, - 7 + -0.900493, - -1 + 0.827988, - 5 + -0.96957, - 5 + -0.794382, - 1 + -0.360357, - -7 + 0.686111, - -5 + -0.770717, - -3 + 0.777591, - 1 + -0.164214, - -1 + 0.85202, - -1 + -0.838606, - 5 + 0.727194, - 3 + 0.628267, - 3 + 0.94657, - 3 + 0.664833, - -1 + -0.545169, - 1 + -0.791937, - 5 + -0.863989, - 1 + -0.433051, - 7 + 0.604505, - -5 + 0.469176, - 5 + 0.521661, - 5 + -0.652277, - 5 + -0.956757, - -1 + 0.179364, - 3 + 0.0835185, - 5 + 0.379708, - -5 + -0.00418501, - -3 + 0.802623, - -1 + 0.127959, - 3 + 0.740128, - 7 + 0.0877058, - -3 + -0.644691, - -7 + 0.803557, - -3 + 0.35763, - 7 + -0.896354, - 5 + -0.985988, - -5 + -0.475576, - -7 + -0.837911, - -5 + 0.399102, - -1 + 0.180557, - 7 + -0.257409, - -3 + 0.748304, - 1 + 0.488153, - 1 + -0.528074, - -7 + -0.568786, - -1 + -0.209861, - 7 + 0.758874, - -7 + 0.690599, - -5 + 0.29666, - -7 + 0.14263, - -5 + -0.580595, - -5 + 0.436222, - -7 + -0.230854, - 1 + -0.0199466, - 7 + 0.0582533, - 1 + -0.241347, - -7 + 0.120772, - -5 + 0.158568, - -7 + 0.590528, - 1 + 0.26066, - 7 + 0.696681, - -3 + 0.343628, - -1 + -0.341235, - -1 + 0.426748, - -5 + -0.39029, - -3 + 0.0793041, - -1 + 0.240872, - -7 + -0.986816, - 5 + -0.546091, - 7 + -0.435825, - -5 + 0.631116, - 5 + 0.793044, - -3 + -0.219459, - 7 + 0.140597, - 5 + 0.447243, - 1 + -0.968491, - 5 + 0.843524, - -5 + -0.860415, - 5 + -0.620946, - 1 + -0.41902, - 7 + -0.81125, - 5 + 0.753432, - -3 + -0.727435, - -1 + -0.141588, - -3 + -0.551413, - -5 + 0.381663, - 5 + -0.0711982, - -5 + 0.390526, - 1 + 0.783724, - -7 + 0.573399, - -3 + -0.939007, - -7 + 0.238314, - -1 + -0.521158, - 5 + 0.779281, - -7 + -0.53298, - 3 + 0.21555, - 3 + 0.482487, - 7 + -0.514751, - -1 + -0.800237, - 1 + -0.764197, - -3 + 0.647617, - 7 + 0.0499004, - -5 + 0.979748, - -3 + 0.67735, - -7 + 0.183253, - -5 + 0.362151, - 5 + -0.545888, - 3 + 0.771438, - -3 + 0.255733, - -7 + 0.115492, - 3 + 0.469995, - -1 + 0.129762, - 3 + -0.767167, - -1 + 0.59735, - -7 + 0.999858, - -5 + -0.412252, - -5 + -0.240744, - -7 + -0.94988, - 7 + -0.533656, - 3 + 0.842152, - 5 + -0.0103345, - 7 + 0.0454008, - 3 + 0.333439, - 3 + -0.456548, - -3 + -0.295064, - 1 + -0.0291067, - 3 + -0.980701, - 5 + 0.0998633, - -7 + -0.236756, - -1 + -0.209321, - 3 + -0.238139, - -1 + 0.873939, - 3 + -0.723713, - -5 + 0.814455, - 3 + 0.679885, - -5 + -0.309287, - 1 + 0.911921, - -5 + -0.330781, - 5 + 0.780826, - 1 + 0.715838, - 3 + -0.334343, - -1 + 0.986761, - -1 + -0.439617, - -3 + -0.590452, - 1 + -0.263775, - 7 + 0.667562, - -5 + -0.76034, - -5 + 0.362745, - 1 + -0.472352, - -7 + 0.206034, - -3 + 0.376895, - 5 + 0.551758, - -3 + 0.0431443, - 5 + -0.310862, - -3 + -0.430074, - 5 + 0.275111, - 7 + -0.912242, - 5 + -0.535872, - 3 + 0.320622, - 3 + 0.381784, - 5 + 0.39575, - -5 + 0.419947, - -1 + 0.632249, - 7 + 0.699329, - 5 + -0.53677, - -7 + 0.160241, - 5 + -0.293807, - -5 + 0.291076, - -5 + 0.691705, - 1 + 0.759055, - 3 + -0.907042, - -5 + -0.23742, - -1 + -0.718808, - -3 + 0.324324, - -5 + 0.768603, - -1 + -0.765854, - 3 + -0.270759, - -3 + -0.780064, - 7 + 0.530695, - 5 + -0.923683, - -1 + -0.209208, - 5 + -0.3521, - 7 + -0.81082, - 7 + -0.472168, - 7 + 0.56371, - 5 + -0.87698, - 3 + -0.0658053, - -3 + 0.646983, - 1 + -0.603423, - 7 + 0.458566, - 7 + 0.32752, - -7 + 0.852152, - 1 + 0.996179, - -1 + 0.686456, - -3 + -0.484814, - 5 + -0.675017, - 5 + -0.458211, - 3 + -0.984357, - -1 + 0.266912, - -7 + -0.589247, - -5 + 0.082882, - -5 + -0.885084, - -3 + -0.560765, - 5 + -0.942018, - 7 + 0.572901, - 7 + -0.171902, - -3 + 0.895929, - -7 + -0.655681, - 5 + -0.029179, - 1 + -0.978318, - 1 + -0.0494022, - -3 + 0.315903, - -7 + -0.249841, - 7 + -0.960858, - -3 + 0.444645, - 3 + -0.725221, - -1 + -0.250617, - 5 + 0.072717, - 3 + -0.348692, - -7 + 0.465731, - 7 + 0.770554, - -1 + 0.161133, - 3 + 0.0440529, - -1 + -0.245592, - -1 + -0.286838, - 1 + 0.710223, - 7 + -0.744359, - -7 + 0.754745, - -3 + 0.268595, - -7 + -0.952184, - 5 + -0.12754, - 1 + -0.113531, - 3 + -0.965244, - 3 + -0.295564, - 5 + -0.589246, - -5 + 0.901493, - 7 + 0.499927, - -1 + 0.205479, - -1 + 0.799496, - 7 + 0.159986, - 1 + 0.0494691, - 5 + 0.414586, - 1 + 0.160234, - 5 + -0.754135, - 7 + 0.533292, - 3 + 0.20959, - -3 + 0.265984, - -1 + -0.596171, - -3 + 0.59227, - -5 + 0.809165, - -3 + 0.731077, - -5 + 0.77249, - -3 + 0.114624, - 7 + -0.612689, - -3 + -0.226237, - -1 + -0.491637, - 5 + -0.902752, - 7 + -0.340862, - 7 + -0.764615, - 1 + 0.361337, - 5 + 0.907293, - -1 + -0.207671, - -7 + 0.749045, - 7 + -0.736116, - 7 + 0.331618, - -5 + -0.0821605, - 3 + -0.784978, - 3 + -0.962937, - 5 + 0.0240877, - -7 + -0.357058, - 7 + 0.582812, - -1 + 0.300038, - 3 + 0.442207, - 1 + 0.311886, - 1 + -0.0907658, - -3 + -0.190202, - 3 + 0.752307, - -5 + 0.110897, - -3 + -0.130689, - 3 + 0.604778, - -5 + 0.832513, - -5 + 0.20769, - 1 + 0.918947, - 7 + 0.635097, - -3 + -0.250696, - -5 + -0.673562, - -7 + 0.188827, - -7 + 0.859836, - -5 + -0.553663, - -1 + -0.693482, - -3 + -0.0370091, - -5 + -0.945403, - -3 + -0.0942642, - 5 + -0.788987, - 7 + 0.130865, - -3 + -0.0568169, - 1 + 0.469934, - -3 + 0.236228, - -3 + 0.969961, - -7 + 0.777844, - -1 + -0.863909, - 1 + -0.0100366, - 3 + -0.901984, - 7 + -0.188674, - -3 + -0.0859814, - -7 + 0.289988, - -5 + 0.216434, - 5 + 0.373371, - -3 + 0.756403, - -3 + -0.327696, - -1 + 0.500791, - 5 + 0.577182, - 1 + 0.846249, - 7 + -0.851769, - -7 + 0.957447, - -3 + -0.351796, - -1 + -0.985339, - -7 + -0.840053, - 7 + -0.911335, - 3 + 0.856743, - 3 + -0.901107, - 3 + -0.966849, - 7 + -0.885129, - -5 + -0.284155, - 7 + -0.344691, - -5 + 0.355503, - 7 + 0.752017, - 5 + -0.243656, - 3 + -0.928544, - 5 + 0.782105, - -7 + -0.759649, - 1 + -0.0744518, - -3 + 0.609258, - 5 + -0.125631, - 5 + 0.25112, - -7 + -0.339128, - 7 + 0.412046, - -5 + 0.555857, - 7 + -0.635087, - 7 + 0.516426, - -1 + 0.74659, - 3 + 0.969918, - -1 + 0.436694, - -5 + 0.0135384, - -3 + 0.340553, - 1 + -0.333334, - 5 + -0.401135, - 3 + 0.217065, - 5 + -0.585701, - 7 + 0.283774, - 1 + 0.436392, - 7 + 0.636664, - 5 + -0.0233952, - 5 + 0.966634, - -5 + 0.792896, - 5 + 0.946402, - -1 + -0.831078, - -7 + -0.944117, - 7 + 0.832928, - -3 + -0.37542, - -7 + -0.951767, - -7 + -0.414159, - 3 + -0.440777, - 5 + -0.591346, - -3 + -0.942129, - 1 + -0.475855, - -1 + -0.452418, - -7 + 0.0502203, - -1 + -0.715986, - 5 + -0.39207, - -1 + 0.00692897, - 1 + -0.305166, - -3 + -0.469096, - -1 + 0.214434, - -7 + 0.0882326, - -7 + -0.311931, - 7 + 0.289892, - 5 + 0.529032, - -3 + 0.543897, - -7 + 0.734108, - 5 + 0.760244, - 7 + -0.921361, - -7 + -0.499923, - 5 + 0.932586, - 3 + -0.492252, - -5 + 0.29961, - 3 + 0.40997, - 1 + 0.607012, - -1 + 0.0977883, - 7 + -0.666918, - 1 + 0.092606, - -3 + 0.48582, - -7 + -0.413194, - -1 + 0.657655, - 7 + -0.790176, - 3 + -0.79396, - 5 + -0.401432, - 3 + 0.241941, - -7 + -0.0372352, - 1 + -0.422785, - -7 + 0.412112, - 3 + -0.649941, - 5 + -0.885332, - -1 + 0.918587, - 5 + 0.580861, - 5 + -0.56943, - 7 + -0.313623, - 1 + 0.508329, - -7 + -0.311971, - -1 + 0.384163, - 7 + -0.407872, - 5 + 0.252608, - -5 + -0.748733, - 7 + -0.766854, - 7 + 0.963027, - 7 + 0.370056, - 7 + 0.91614, - 5 + -0.10655, - 5 + 0.114024, - 3 + 0.6354, - -3 + 0.526766, - -3 + 0.0656808, - -1 + 0.273656, - 3 + -0.518891, - 5 + 0.602608, - -3 + 0.14799, - -5 + -0.304276, - 5 + 0.282315, - -5 + 0.525241, - 3 + 0.917138, - 1 + -0.407829, - 1 + 0.148744, - 7 + 0.374387, - 1 + 0.719541, - 5 + -0.845279, - -7 + -0.271885, - -3 + 0.498453, - -3 + -0.108517, - 7 + -0.916167, - 1 + -0.00524844, - 3 + 0.230628, - 1 + 0.928817, - 5 + 0.961846, - 3 + -0.970376, - -5 + -0.991187, - 1 + -0.988078, - -3 + -0.321644, - 7 + 0.299365, - -1 + 0.260651, - -5 + 0.901838, - -7 + 0.905185, - -7 + -0.998068, - -1 + -0.717301, - 3 + -0.448447, - -5 + 0.853505, - 1 + 0.691012, - -5 + 0.858187, - -7 + 0.744305, - -1 + -0.546463, - -5 + 0.0513083, - -5 + 0.113148, - 1 + 0.753596, - -1 + 0.453985, - 1 + -0.558975, - -3 + -0.931769, - -7 + -0.421414, - -7 + -0.61578, - 3 + -0.601418, - -1 + 0.384031, - 1 + 0.180447, - -1 + 0.160505, - 7 + -0.14269, - 3 + 0.553436, - 3 + 0.842422, - -1 + -0.298941, - -3 + -0.704512, - 1 + -0.817883, - -5 + 0.689056, - 3 + 0.54275, - -7 + -0.244876, - -7 + 0.497505, - -3 + -0.385801, - -7 + -0.228079, - 1 + 0.607185, - 7 + -0.625709, - 5 + -0.851795, - -3 + 0.657661, - 7 + 0.568546, - 1 + -0.0359739, - 1 + 0.836243, - 1 + -0.747603, - -5 + 0.463366, - 7 + -0.62775, - -5 + -0.129517, - 7 + -0.0784853, - -5 + -0.338617, - 1 + -0.0951821, - -3 + -0.0586496, - 1 + 0.548171, - -5 + -0.142791, - 1 + -0.137619, - -5 + 0.86615, - 3 + 0.337578, - -7 + -0.0597365, - -5 + -0.843939, - -3 + -0.607342, - -1 + -0.630138, - -3 + -0.393534, - 7 + 0.354908, - -5 + 0.184251, - 5 + -0.154522, - -5 + 0.828516, - 5 + 0.817169, - -5 + 0.833938, - -5 + 0.689288, - 5 + -0.995259, - -1 + -0.932191, - -7 + 0.964076, - 1 + -0.85304, - -3 + -0.0782913, - 7 + -0.696813, - 5 + 0.231297, - 7 + 0.688421, - 7 + 0.0322752, - 1 + 0.839409, - 1 + -0.362455, - -3 + 0.561378, - 3 + -0.496498, - 1 + 0.841212, - -7 + -0.299443, - 7 + 0.527505, - -1 + 0.51827, - 5 + -0.348049, - -3 + -0.983604, - -1 + 0.694304, - 1 + -0.31786, - -3 + 0.643969, - -1 + -0.650723, - -7 + -0.14479, - -3 + 0.455813, - 7 + -0.627596, - -3 + -0.245695, - -5 + 0.0893783, - 3 + -0.236629, - 5 + -0.277597, - 7 + 0.481512, - -7 + 0.143052, - 3 + 0.615401, - 7 + -0.975698, - -1 + 0.50143, - -3 + 0.0737497, - 1 + 0.345961, - -1 + 0.944933, - -1 + 0.00710848, - 3 + -0.908855, - 3 + -0.104037, - -1 + -0.0996714, - -1 + 0.480154, - -5 + -0.684452, - -3 + -0.104955, - -1 + -0.972497, - 5 + 0.619405, - -5 + -0.361996, - 1 + -0.780079, - -7 + 0.443635, - 7 + 0.527956, - -1 + 0.927314, - 3 + 0.606136, - 3 + -0.22611, - 1 + -0.288871, - -3 + 0.683856, - 5 + 0.486252, - -7 + -0.781706, - 5 + 0.348522, - -7 + -0.743252, - 5 + 0.790582, - -1 + -0.417564, - 1 + 0.971814, - 1 + -0.394633, - 3 + -0.538042, - 7 + -0.82342, - -5 + 0.46215, - -3 + -0.725289, - -1 + -0.248699, - 3 + 0.194388, - -1 + 0.572686, - -1 + 0.57203, - -1 + -0.73258, - 3 + -0.841193, - 3 + 0.846292, - 7 + -0.106951, - -1 + -0.82125, - 5 + -0.565781, - -7 + -0.178221, - 3 + -0.396988, - -1 + -0.194377, - -7 + -0.184276, - 3 + 0.530178, - -1 + 0.0792818, - 3 + 0.698151, - 7 + 0.540132, - 5 + -0.0324876, - -5 + -0.539282, - 1 + -0.0612176, - 1 + -0.00825787, - -5 + -0.594088, - 5 + -0.720534, - -3 + -0.726017, - 3 + -0.247803, - -5 + -0.0351876, - -3 + -0.485217, - 7 + -0.711281, - 1 + -0.143779, - 5 + 0.830104, - -1 + -0.680937, - -5 + -0.406956, - -7 + -0.572693, - 1 + -0.916711, - -7 + -0.361021, - 5 + -0.669143, - -7 + 0.0977001, - -1 + -0.351618, - -3 + -0.292778, - -3 + 0.94385, - -5 + 0.64688, - -5 + 0.462901, - -7 + 0.139473, - 5 + -0.923586, - -7 + 0.100025, - 7 + 0.762592, - 5 + -0.669251, - -5 + 0.552417, - 3 + 0.578362, - -3 + 0.286511, - -5 + -0.819517, - 5 + -0.174663, - 1 + 0.898405, - -3 + 0.276757, - -5 + -0.860502, - -3 + -0.508774, - -7 + -0.619703, - -1 + -0.576515, - 7 + 0.442863, - 1 + -0.792524, - 1 + -0.967062, - -7 + 0.495375, - -7 + -0.497338, - -5 + -0.649645, - -1 + -0.692724, - -7 + -0.681675, - 5 + 0.80008, - -1 + -0.476369, - -3 + 0.102149, - -3 + -0.595665, - -5 + -0.961165, - 7 + -0.990363, - -5 + 0.716457, - -7 + -0.404208, - -1 + -0.483432, - 1 + 0.236347, - -1 + 0.376305, - 1 + -0.0533286, - -7 + -0.610223, - 3 + 0.843043, - -1 + -0.609047, - 1 + 0.725496, - -1 + -0.31617, - -5 + -0.0189003, - -3 + -0.425178, - -7 + -0.321938, - 3 + 0.0120751, - -1 + 0.315381, - -3 + -0.324733, - -3 + -0.571329, - 5 + -0.30955, - 3 + -0.997293, - 3 + 0.105692, - 1 + 0.0166829, - -7 + 0.295209, - -5 + 0.0396503, - -7 + -0.698527, - 1 + -0.983116, - 7 + 0.659054, - -1 + 0.33142, - -7 + -0.0377453, - -5 + -0.0574753, - -1 + 0.852526, - -1 + 0.983994, - -5 + 0.938022, - 1 + 0.513438, - 3 + 0.0546758, - -5 + 0.0823434, - -7 + 0.166195, - -3 + -0.852176, - 1 + 0.366113, - 1 + -0.397224, - -7 + 0.665549, - 1 + -0.0446258, - 3 + 0.702024, - 5 + -0.733169, - -1 + -0.0454769, - -7 + -0.668073, - 1 + 0.27592, - 7 + -0.323333, - 5 + -0.674522, - 7 + 0.0814798, - 7 + -0.782666, - 3 + -0.0710991, - 5 + 0.773968, - -1 + 0.803732, - -1 + 0.142462, - -3 + -0.243322, - -3 + -0.958958, - 5 + 0.308394, - 7 + -0.500096, - -7 + 0.914925, - 7 + 0.150591, - -5 + 0.58597, - 7 + 0.251341, - -3 + -0.636188, - 7 + 0.909046, - 3 + -0.577617, - -7 + -0.903661, - 7 + -0.275888, - 1 + -0.21705, - -5 + 0.736324, - -1 + -0.820161, - -1 + -0.545268, - 3 + -0.0618935, - 7 + -0.126791, - 1 + -0.792842, - -7 + -0.398747, - 3 + -0.583208, - -5 + -0.325178, - 7 + -0.0370357, - -5 + -0.083306, - 5 + 0.819585, - -7 + 0.0991425, - -3 + -0.130402, - -5 + -0.157376, - 7 + 0.691842, - 5 + -0.748137, - -1 + 0.758925, - 1 + -0.312916, - 3 + -0.820843, - 7 + -0.261816, - 7 + -0.172358, - 7 + 0.536986, - 7 + 0.759576, - 7 + -0.754446, - -7 + 0.567095, - -1 + -0.524981, - -3 + -0.802519, - -3 + 0.3109, - 3 + -0.248219, - 5 + 0.0748601, - 7 + 0.960564, - 1 + 0.667926, - -7 + -0.706296, - -3 + 0.635725, - 7 + 0.978146, - -1 + -0.574543, - 5 + -0.430696, - 1 + 0.0996064, - 1 + -0.00163434, - 3 + 0.14937, - 3 + -0.0844981, - 3 + -0.136261, - 5 + 0.973049, - 3 + 0.282247, - 7 + 0.579739, - 5 + -0.0823847, - 5 + -0.0467881, - 5 + 0.596636, - -1 + -0.297972, - -5 + 0.706257, - -7 + 0.604586, - -3 + 0.0669439, - -1 + -0.453354, - 5 + -0.477196, - 5 + 0.311931, - 5 + 0.166079, - 3 + 0.412152, - 7 + 0.474994, - 5 + -0.771076, - 5 + 0.536177, - -5 + -0.0305953, - -3 + 0.580228, - -3 + 0.284461, - -7 + -0.726361, - -3 + -0.726564, - 1 + -0.345421, - 3 + 0.80056, - 1 + 0.878273, - -5 + 0.654627, - -1 + 0.295187, - 7 + 0.591756, - 3 + 0.260911, - 3 + 0.481528, - -3 + -0.77778, - 3 + -0.683316, - -7 + -0.658198, - -3 + -0.74585, - 1 + 0.938157, - 1 + 0.192402, - 5 + 0.361699, - 3 + -0.163265, - -3 + 0.783476, - -5 + 0.737259, - 1 + -0.569672, - 7 + 0.10586, - -1 + -0.173976, - 1 + 0.935026, - -7 + 0.356488, - -1 + 0.0017309, - 5 + -0.675919, - -1 + 0.0665381, - -1 + -0.307875, - 7 + 0.0983045, - 5 + 0.963101, - 3 + -0.519587, - -5 + 0.899631, - 1 + 0.31666, - 7 + -0.756871, - 7 + 0.333545, - -3 + -0.168074, - 7 + 0.87813, - -1 + 0.779471, - -5 + 0.754198, - 7 + -0.868269, - 1 + 0.333521, - 7 + -0.731973, - -1 + 0.33527, - -3 + -0.467703, - -1 + 0.234056, - -3 + -0.237028, - 3 + 0.74204, - 7 + -0.257894, - -7 + 0.690854, - -1 + 0.652636, - 3 + 0.0301753, - -7 + 0.814373, - -1 + -0.951698, - -5 + 0.976247, - -3 + 0.431324, - -3 + 0.192437, - 3 + 0.31289, - -3 + 0.422132, - 3 + -0.00384281, - 3 + 0.72445, - -5 + 0.920278, - -3 + -0.324996, - 3 + 0.181187, - 7 + 0.658717, - -5 + -0.977313, - -1 + 0.378038, - 1 + 0.615551, - -1 + 0.475454, - 3 + 0.735309, - 7 + -0.398705, - 7 + 0.0674037, - -1 + 0.273941, - 5 + -0.376697, - 1 + -0.934663, - 3 + 0.764279, - -5 + -0.67983, - -5 + -0.951744, - -7 + 0.559239, - -7 + 0.123601, - -1 + 0.279154, - 7 + -0.349745, - -1 + 0.881504, - 5 + 0.743417, - -7 + -0.126299, - -3 + 0.129631, - -7 + -0.248369, - 3 + -0.582388, - 7 + 0.606937, - -1 + -0.766819, - -1 + -0.887898, - -3 + 0.628891, - -3 + 0.797051, - 1 + 0.258235, - 1 + -0.289372, - -7 + -0.689227, - -5 + -0.223412, - -5 + -0.0717334, - 5 + 0.444987, - 3 + -0.47443, - 5 + -0.622907, - 1 + 0.231064, - 7 + 0.0643792, - -5 + -0.545879, - -3 + 0.881704, - 7 + 0.421487, - 7 + -0.163227, - 1 + -0.19334, - 5 + 0.754454, - -7 + -0.173896, - -1 + -0.148776, - -5 + 0.342022, - -3 + 0.00779013, - 7 + -0.959293, - 5 + 0.888742, - 1 + -0.0373372, - 3 + 0.154647, - 7 + 0.522902, - -1 + -0.91692, - 1 + -0.762814, - 1 + -0.308587, - -5 + 0.252501, - 3 + 0.186752, - 7 + -0.897854, - 3 + -0.314141, - 7 + -0.123752, - 5 + -0.986531, - 7 + 0.89791, - 1 + -0.133572, - -7 + -0.828677, - -7 + -0.362269, - 1 + -0.231981, - 1 + 0.6903, - 5 + 0.212784, - -1 + 0.790468, - -7 + -0.822496, - 1 + -0.215268, - 5 + -0.232525, - -1 + -0.479589, - 3 + -0.79679, - -5 + -0.604188, - 7 + -0.201313, - -1 + -0.525663, - -7 + -0.155085, - 1 + -0.820419, - -3 + -0.37499, - -3 + -0.983146, - -5 + -0.793733, - -1 + -0.0931721, - 5 + -0.601751, - 3 + 0.0783009, - -1 + 0.768638, - 1 + 0.492399, - -5 + -0.0098969, - -1 + 0.19191, - -7 + -0.979377, - -7 + -0.0178371, - -5 + -0.329518, - 1 + 0.373382, - -7 + -0.845312, - 3 + -0.922893, - 3 + 0.315986, - 3 + 0.486665, - 1 + -0.263414, - -5 + 0.375741, - 3 + 0.909047, - 1 + -0.905982, - 1 + -0.887325, - 1 + -0.20989, - 5 + -0.476245, - 1 + -0.937806, - 3 + -0.749343, - 3 + -0.786876, - -3 + -0.67605, - -1 + 0.0446474, - -5 + 0.652167, - 1 + 0.543258, - -5 + 0.15279, - -5 + 0.148326, - 5 + 0.254656, - -3 + 0.856795, - -7 + 0.751831, - -3 + 0.630068, - 5 + 0.0417778, - -5 + -0.789099, - -7 + 0.741281, - -3 + 0.391712, - -3 + -0.134653, - -1 + 0.326939, - 7 + -0.0234458, - -3 + -0.23408, - -5 + -0.239154, - -5 + -0.832932, - 5 + -0.305414, - 7 + 0.447744, - -3 + -0.729455, - 7 + 0.48413, - 5 + 0.236162, - 5 + -0.534741, - 5 + 0.00340226, - -5 + -0.92795, - 5 + -0.802271, - 5 + -0.486955, - -3 + -0.958796, - 5 + -0.576444, - -1 + 0.107654, - -5 + -0.759059, - -5 + 0.292163, - 1 + -0.785662, - 3 + -0.374019, - 7 + -0.0159586, - -1 + 0.70116, - -5 + 0.0846993, - 1 + 0.401001, - 7 + 0.0279956, - -7 + -0.394888, - 5 + 0.505212, - 7 + 0.786975, - 3 + 0.532436, - -7 + 0.204459, - 3 + -0.615921, - -3 + 0.0758607, - -5 + 0.130031, - -5 + -0.772899, - 3 + -0.274121, - 5 + 0.056024, - -1 + -0.218418, - -7 + -0.183809, - -5 + 0.109609, - 5 + -0.821093, - 7 + -0.353014, - 3 + 0.228901, - 1 + -0.594237, - -3 + 0.39832, - -5 + 0.575415, - -1 + 0.398899, - -5 + -0.239754, - 3 + -0.535948, - 5 + -0.487767, - 5 + 0.282845, - 1 + -0.720766, - -7 + 0.678491, - -3 + 0.389419, - 5 + -0.862186, - 7 + -0.942864, - 7 + -0.341864, - 7 + -0.332763, - -7 + 0.290539, - -5 + -0.076314, - -3 + 0.14099, - 1 + -0.0547188, - 3 + 0.735025, - 3 + -0.197414, - 5 + 0.690544, - 5 + 0.630046, - -3 + -0.117688, - 7 + 0.656909, - 7 + 0.417193, - -3 + -0.489404, - -1 + 0.66448, - 3 + 0.109689, - 1 + -0.601325, - 5 + 0.930691, - 1 + 0.122041, - -3 + 0.991223, - -5 + -0.700354, - -1 + 0.0347951, - 7 + 0.122125, - 1 + 0.218395, - -7 + -0.177617, - 5 + 0.209456, - -5 + -0.976741, - -5 + -0.41843, - -3 + -0.580374, - -1 + -0.424389, - -5 + -0.183439, - 1 + 0.159905, - 1 + -0.825052, - -1 + -0.783269, - 3 + 0.150836, - -5 + 0.385557, - -1 + -0.657701, - -5 + 0.739214, - 7 + -0.990613, - -5 + 0.787245, - -5 + 0.604144, - -5 + -0.871588, - 5 + 0.721765, - 5 + 0.118939, - -5 + -0.859039, - -3 + 0.111408, - -1 + -0.479201, - 1 + -0.470303, - -1 + -0.136117, - 5 + 0.956995, - 1 + -0.39388, - -1 + 0.614385, - 1 + 0.556813, - 7 + 0.844387, - 1 + -0.436025, - -5 + -0.108634, - 5 + -0.100592, - -7 + -0.723946, - 1 + 0.0688398, - 7 + 0.180889, - -3 + 0.628736, - 1 + 0.112598, - 3 + 0.318029, - -3 + 0.634139, - 7 + -0.691032, - 1 + 0.356673, - 5 + 0.0566803, - 1 + -0.351812, - 5 + 0.531286, - -7 + -0.157417, - 7 + -0.99541, - 7 + -0.681986, - 5 + -0.997084, - -7 + 0.741155, - 1 + -0.622678, - 1 + 0.705248, - -5 + 0.711669, - 7 + 0.377357, - -5 + -0.62871, - -5 + 0.0214289, - -1 + -0.997903, - 5 + 0.0933239, - 3 + -0.526274, - -7 + -0.951203, - -1 + -0.755676, - 5 + 0.339232, - -1 + 0.773219, - -3 + 0.426269, - 3 + -0.396471, - 7 + 0.567064, - 5 + 0.633394, - -7 + 0.791714, - 3 + 0.787449, - 3 + -0.472383, - -5 + -0.155762, - -5 + -0.0783671, - -5 + -0.338965, - 3 + -0.793645, - -5 + 0.876857, - -5 + -0.02886, - -1 + 0.566931, - 5 + 0.623439, - 5 + 0.50836, - 7 + -0.3025, - 7 + -0.714796, - -7 + 0.179475, - 7 + -0.662018, - 1 + -0.348355, - 3 + -0.794334, - -3 + -0.157082, - 7 + 0.149085, - 1 + 0.640906, - -3 + 0.349559, - -3 + 0.857413, - -1 + -0.0283983, - -1 + 0.693171, - -3 + -0.214092, - -5 + -0.98936, - 1 + 0.639767, - 3 + -0.194655, - -5 + 0.940209, - -3 + 0.20604, - -3 + -0.564045, - 3 + -0.590761, - 5 + 0.685986, - 3 + -0.764822, - -1 + 0.42185, - -3 + -0.295677, - 1 + 0.216797, - 1 + -0.814246, - -1 + 0.206404, - -3 + 0.328757, - 7 + -0.566083, - 3 + 0.597134, - -3 + 0.642763, - -7 + -0.395769, - 7 + -0.935252, - -7 + 0.626113, - -3 + -0.849858, - 5 + 0.917923, - 5 + -0.376758, - 3 + 0.849631, - -5 + -0.327594, - -7 + -0.0529906, - -3 + -0.923709, - 1 + 0.0692206, - -5 + 0.056296, - 3 + 0.467438, - -1 + -0.814233, - -5 + -0.302013, - -3 + 0.695497, - 7 + 0.651437, - 3 + 0.168943, - 5 + 0.605341, - -1 + -0.372329, - 1 + 0.765342, - 1 + 0.947534, - -5 + 0.116956, - -3 + 0.577997, - 5 + 0.810715, - 1 + -0.779946, - -7 + -0.370998, - 3 + 0.558406, - -1 + -0.233575, - 1 + 0.77588, - -7 + -0.311882, - 5 + -0.910265, - 5 + -0.992932, - 5 + -0.760745, - 1 + 0.318678, - 5 + -0.210387, - 1 + 0.872963, - 3 + 0.220112, - -5 + -0.811578, - 5 + -0.711665, - 5 + -0.150111, - -1 + 0.641725, - 1 + 0.898414, - -3 + -0.650104, - 7 + -0.14629, - 7 + 0.865109, - -1 + -0.347701, - -1 + 0.921759, - 1 + 0.697452, - 1 + 0.0354798, - 5 + -0.176528, - -7 + 0.664795, - -3 + 0.896781, - 3 + -0.958731, - 5 + -0.141991, - 7 + 0.120368, - -5 + 0.485083, - 7 + -0.376901, - -5 + -0.43829, - -5 + -0.586847, - 1 + -0.959211, - 7 + 0.0708796, - -3 + 0.0492324, - -3 + -0.993246, - -1 + 0.650188, - -1 + -0.865149, - -5 + 0.37034, - 7 + -0.338674, - 3 + 0.623087, - -7 + -0.321175, - 7 + -0.764244, - -1 + 0.378604, - 1 + -0.812146, - 3 + 0.444655, - -5 + 0.253273, - 7 + 0.481744, - 3 + 0.455208, - 5 + 0.908443, - 1 + 0.0686094, - -7 + 0.844868, - -5 + -0.976591, - 7 + -0.72575, - 5 + 0.675135, - -7 + 0.274097, - -3 + 0.409609, - 3 + -0.175133, - -3 + 0.796693, - 3 + -0.247288, - -1 + -0.549564, - -7 + 0.967288, - -1 + -0.839667, - 3 + -0.681989, - -1 + -0.523145, - -5 + 0.396439, - 5 + -0.120618, - 3 + 0.693885, - -1 + -0.816144, - -5 + -0.968818, - -3 + -0.390704, - 3 + -0.448062, - 1 + 0.569756, - 5 + -0.336729, - -1 + 0.136729, - 5 + 0.941006, - 5 + -0.465103, - 7 + 0.468966, - -1 + 0.355103, - -7 + 0.615847, - -1 + -0.692941, - -1 + -0.173114, - 3 + 0.594599, - 7 + 0.557483, - 3 + 0.997697, - -5 + 0.24401, - 1 + -0.00963287, - 5 + 0.0275448, - 5 + 0.659747, - -7 + -0.567272, - -5 + -0.405348, - -1 + -0.614457, - 1 + 0.19472, - -7 + 0.553533, - -3 + -0.612328, - 1 + -0.348393, - -3 + 0.771169, - -3 + 0.354427, - -5 + 0.785281, - 3 + -0.318974, - -5 + -0.170041, - -1 + -0.667593, - -1 + -0.514524, - -5 + -0.76729, - 3 + 0.924267, - 7 + -0.893804, - -7 + -0.250356, - 7 + -0.732358, - -7 + 0.490774, - 1 + -0.437992, - -3 + 0.469562, - 1 + 0.436426, - -3 + -0.400156, - 7 + -0.860264, - 1 + 0.0900252, - -1 + -0.754367, - 1 + -0.838147, - -5 + 0.404529, - -7 + -0.437069, - -5 + -0.496662, - 5 + 0.952867, - -3 + 0.894237, - -3 + -0.555447, - -1 + -0.354976, - 1 + -0.60926, - -7 + 0.759444, - 3 + 0.662752, - -7 + -0.815089, - -5 + 0.98253, - 3 + -0.817391, - 5 + -0.61243, - -5 + -0.456923, - -1 + -0.824931, - 7 + 0.514605, - -1 + 0.828664, - -5 + -0.195044, - -3 + -0.333318, - 3 + 0.164695, - -7 + 0.0349422, - 7 + 0.118845, - 5 + -0.174882, - 7 + -0.872202, - 7 + 0.710986, - 3 + 0.699916, - -5 + 0.066256, - 3 + -0.148756, - 7 + 0.508584, - 5 + 0.825367, - -5 + -0.729841, - -5 + -0.887612, - 5 + -0.758424, - -5 + 0.998181, - -7 + 0.65577, - 5 + -0.474471, - 7 + -0.269234, - 3 + 0.104569, - -5 + -0.102212, - -5 + 0.738547, - 5 + -0.94242, - -1 + 0.15571, - 7 + -0.421775, - -7 + 0.804305, - 3 + 0.770802, - 7 + 0.642568, - -7 + 0.971034, - 1 + -0.144741, - -7 + 0.902049, - 7 + 0.157032, - 7 + -0.710021, - 7 + 0.719006, - 1 + -0.119823, - -7 + 0.156298, - 3 + 0.970851, - -1 + -0.163907, - -7 + -0.353286, - -7 + 0.497258, - -7 + 0.283671, - 1 + 0.0405689, - -5 + -0.962454, - -3 + -0.219818, - 1 + -0.436599, - -3 + -0.651331, - 5 + 0.192501, - -5 + 0.627465, - 3 + -0.0387857, - -5 + 0.235464, - 3 + -0.0781319, - -1 + 0.372664, - -7 + 0.144817, - -3 + -0.981248, - -7 + -0.438408, - 5 + 0.851478, - -1 + -0.473764, - 1 + 0.00188464, - 3 + 0.433134, - -7 + -0.132385, - 7 + -0.0645663, - -1 + -0.202906, - -7 + -0.19273, - -5 + 0.490564, - 5 + -0.986688, - 3 + -0.259055, - -5 + -0.0975989, - -1 + -0.599443, - -1 + 0.313751, - -3 + 0.839625, - -3 + 0.0875769, - 7 + 0.531778, - 5 + 0.78374, - -7 + -0.568377, - -5 + -0.772801, - -5 + -0.0559519, - -5 + 0.945151, - -7 + 0.260123, - -7 + -0.909106, - -5 + 0.0617756, - -3 + -0.0675705, - 3 + 0.425518, - -3 + 0.0981296, - -1 + -0.137702, - 5 + 0.353555, - 7 + 0.895279, - -7 + 0.247132, - -1 + 0.346749, - -3 + 0.748198, - -5 + 0.584672, - 3 + -0.731422, - 3 + 0.0579248, - 5 + 0.212579, - 5 + 0.1419, - -1 + -0.51401, - 1 + -0.844899, - -1 + -0.478985, - -5 + 0.918879, - 3 + -0.0802303, - 5 + 0.995209, - 1 + 0.228169, - -3 + 0.580333, - -3 + -0.866062, - 7 + -0.978268, - -5 + 0.501526, - -7 + 0.334392, - -1 + 0.442487, - -5 + 0.0704108, - -5 + -0.711541, - -5 + 0.982968, - -7 + 0.722414, - 5 + -0.799889, - 1 + -0.853645, - -7 + 0.997917, - 5 + -0.513696, - 5 + 0.0364606, - 5 + -0.248071, - -7 + -0.387232, - 1 + -0.811699, - 1 + 0.732048, - 3 + -0.679307, - -1 + -0.978209, - -1 + -0.964028, - -5 + -0.611812, - -7 + -0.902063, - -3 + 0.398009, - 3 + 0.00542146, - 5 + 0.601782, - 5 + -0.104203, - 1 + 0.506752, - -5 + 0.436524, - 7 + 0.982469, - -1 + -0.0633421, - -7 + 0.446072, - -1 + 0.927761, - 1 + 0.658156, - -7 + 0.785148, - -1 + -0.591183, - -3 + 0.0137029, - -1 + -0.388246, - 7 + -0.675978, - 1 + 0.0143937, - -7 + 0.690042, - -5 + -0.693171, - -7 + -0.352858, - 3 + -0.970363, - -7 + -0.723423, - 3 + 0.724452, - -3 + 0.158585, - 7 + -0.175004, - 1 + -0.19285, - -1 + 0.992788, - 3 + -0.851952, - 5 + 0.81, - 3 + -0.0435364, - -1 + -0.0813053, - -1 + -0.765415, - -7 + -0.0372974, - -1 + 0.694064, - 1 + -0.136753, - 3 + 0.826244, - -7 + 0.140024, - 5 + -0.0882701, - 1 + 0.295136, - 7 + -0.5227, - -5 + -0.237363, - -3 + 0.709084, - -3 + 0.629578, - -5 + 0.643857, - 7 + -0.668263, - -5 + 0.249376, - -1 + -0.760648, - 1 + -0.927984, - 7 + -0.659877, - 7 + -0.567002, - -1 + 0.0565217, - -3 + 0.805679, - -3 + -0.528236, - -7 + -0.13752, - -3 + 0.887507, - 7 + 0.63262, - 3 + -0.119278, - 3 + 0.890306, - -1 + -0.274285, - -1 + 0.369489, - 7 + 0.0317755, - 3 + -0.856605, - 7 + 0.912634, - -7 + 0.0492215, - 1 + -0.276292, - -7 + -0.177337, - 3 + -0.787517, - -3 + -0.53, - -1 + -0.186417, - 3 + -0.949098, - -7 + -0.517213, - -1 + -0.986841, - 5 + 0.600896, - 7 + 0.48168, - -3 + -0.458465, - 5 + 0.321443, - -3 + -0.234238, - 1 + -0.954936, - 5 + -0.0275234, - -7 + 0.924262, - 1 + 0.977532, - -5 + -0.669258, - 3 + 0.364021, - 1 + 0.135028, - -3 + -0.473695, - -7 + -0.185051, - -7 + -0.232574, - 3 + -0.944187, - 3 + -0.0543526, - 5 + 0.673031, - 5 + 0.195805, - 1 + -0.45507, - 7 + 0.404971, - 3 + -0.610784, - 5 + 0.0659073, - -1 + -0.207704, - 7 + 0.644995, - -1 + 0.121214, - -3 + -0.483027, - -7 + 0.711033, - 5 + -0.673219, - -1 + -0.895776, - 3 + 0.951024, - -3 + 0.56215, - 3 + -0.329154, - -5 + -0.577541, - -7 + -0.309147, - -1 + -0.511309, - 7 + 0.499812, - -5 + -0.681876, - -1 + -0.801156, - 7 + 0.151605, - -3 + 0.241685, - 7 + 0.992835, - -3 + 0.982038, - -5 + 0.0631867, - -5 + 0.950436, - 7 + 0.31088, - 5 + -0.708879, - -7 + 0.460315, - 1 + 0.397522, - 3 + -0.830289, - -1 + -0.146992, - 3 + 0.667571, - -5 + 0.870575, - 5 + -0.692335, - 1 + -0.399896, - -7 + -0.421033, - 7 + -0.740574, - -3 + 0.0441913, - -5 + 0.000759854, - -1 + -0.526559, - 7 + -0.50311, - 3 + -0.00944866, - -7 + 0.250031, - -5 + 0.579793, - -3 + 0.554107, - 5 + 0.737397, - 1 + 0.434328, - -5 + -0.698991, - -7 + 0.0322755, - 5 + -0.995791, - -7 + 0.233862, - 3 + -0.201264, - 7 + -0.297969, - -5 + 0.377501, - 3 + -0.571389, - -1 + 0.530284, - 5 + -0.179379, - 7 + -0.356844, - -7 + 0.941165, - 1 + 0.339271, - 3 + -0.66842, - -5 + -0.423012, - 3 + 0.316588, - -1 + -0.984114, - 1 + -0.5428, - -1 + 0.766658, - 1 + -0.960606, - 5 + -0.620487, - 7 + 0.266202, - 7 + 0.901102, - 1 + -0.268669, - -5 + -0.607472, - -7 + -0.52709, - -3 + 0.0705389, - 1 + -0.608374, - -3 + -0.288577, - -5 + 0.843351, - -3 + 0.612135, - -5 + 0.230486, - 5 + -0.244291, - -1 + 0.576229, - -3 + 0.446377, - -3 + -0.106511, - -3 + 0.889909, - -5 + -0.918941, - 1 + 0.848997, - -5 + 0.10993, - -3 + 0.256356, - 1 + 0.504098, - 5 + -0.170462, - 1 + 0.835316, - 7 + 0.644516, - -7 + 0.90372, - -7 + 0.463742, - -5 + 0.349377, - -7 + -0.553437, - 1 + 0.330349, - 5 + 0.710921, - -3 + 0.654504, - -5 + -0.447801, - -5 + 0.0517276, - -1 + 0.975718, - 3 + 0.874352, - -1 + 0.678769, - -1 + -0.264881, - -3 + -0.0680661, - 1 + -0.824504, - -7 + -0.0992408, - -5 + -0.862084, - 3 + -0.805812, - 5 + 0.237566, - -3 + 0.888929, - 1 + -0.476846, - -1 + 0.621217, - 1 + 0.65046, - 1 + -0.177248, - -1 + 0.0533044, - 3 + -0.176522, - -1 + 0.676266, - 5 + 0.0818662, - 5 + -0.0801649, - 5 + -0.430938, - 3 + -0.763183, - -7 + -0.453813, - 3 + 0.555379, - -3 + 0.858594, - 3 + 0.227172, - -1 + -0.632746, - -7 + 0.627382, - 1 + -0.0489046, - 7 + -0.828429, - 3 + 0.555978, - -7 + -0.130752, - 1 + 0.978551, - 1 + 0.985192, - -3 + -0.601231, - -3 + 0.3876, - 1 + 0.907771, - -3 + -0.183183, - -5 + -0.297217, - -5 + 0.579173, - -5 + 0.751301, - 5 + 0.675477, - -7 + -0.700691, - 1 + 0.947316, - -7 + -0.635739, - -1 + -0.1091, - -5 + -0.655627, - -7 + -0.74121, - 1 + 0.334598, - 5 + -0.133385, - -5 + 0.364959, - 5 + -0.692856, - -7 + -0.432334, - -3 + 0.0911902, - -5 + 0.670209, - -7 + -0.0777559, - -3 + 0.769741, - 7 + 0.0235715, - 1 + 0.181115, - -7 + -0.688748, - -7 + -0.641734, - -1 + 0.972104, - 7 + -0.474228, - -7 + -0.984007, - 3 + 0.25339, - 3 + 0.87889, - 5 + 0.624509, - 5 + -0.896409, - 7 + -0.146804, - 5 + 0.79753, - -1 + 0.0419583, - -3 + -0.978575, - 5 + -0.799147, - 7 + -0.100029, - 5 + 0.34877, - 5 + 0.726533, - -3 + 0.902539, - -7 + -0.0300989, - 5 + 0.843366, - 7 + 0.98872, - 7 + -0.428589, - 1 + 0.644193, - -5 + 0.0228081, - 7 + -0.754224, - 7 + 0.805301, - 5 + 0.695254, - -7 + -0.188701, - 3 + -0.581044, - 5 + 0.799149, - 7 + 0.353339, - -1 + -0.9622, - -1 + -0.230887, - 5 + -0.787056, - -7 + -0.706222, - 3 + 0.0197935, - -1 + 0.805143, - 7 + 0.951379, - 5 + -0.333186, - -3 + -0.0693998, - -3 + 0.993613, - -5 + -0.548791, - -5 + -0.964111, - 3 + -0.584394, - 1 + 0.867385, - -7 + -0.480054, - 1 + -0.994699, - 7 + 0.090273, - -3 + 0.901709, - 1 + 0.715806, - 3 + 0.304813, - 7 + 0.403796, - 1 + -0.473723, - 5 + 0.475125, - -1 + 0.0271961, - 7 + -0.487227, - 7 + 0.229468, - -3 + -0.189796, - -3 + -0.625003, - 1 + -0.401116, - -7 + 0.67123, - -5 + -0.927091, - -7 + 0.270972, - 7 + -0.617139, - 1 + -0.91671, - -7 + -0.712691, - -3 + -0.840406, - 5 + -0.406998, - -1 + -0.849947, - 3 + -0.158653, - -1 + 0.0696663, - -1 + 0.758415, - 1 + 0.0694559, - 1 + 0.462296, - -5 + 0.217909, - 1 + 0.473663, - -3 + 0.473242, - -3 + -0.890317, - -3 + -0.397198, - -7 + -0.508332, - 5 + 0.990104, - 5 + -0.32464, - -1 + -0.869012, - 7 + 0.567209, - 1 + -0.495974, - 3 + -0.101183, - -7 + -0.74694, - -5 + -0.675854, - -1 + 0.110992, - -5 + 0.247456, - 7 + 0.840274, - -3 + 0.395728, - 5 + -0.362192, - -3 + -0.680363, - 5 + -0.602484, - -3 + 0.738772, - 1 + -0.644167, - -3 + 0.634913, - 3 + -0.384876, - 5 + -0.916855, - -5 + -0.227988, - -3 + -0.625356, - -5 + -0.740278, - -1 + -0.41118, - 3 + 0.443345, - 3 + 0.736942, - 1 + -0.354426, - -7 + -0.870946, - -3 + -0.546137, - -7 + 0.272889, - 1 + 0.0801028, - 5 + -0.274639, - -5 + -0.154875, - -3 + -0.580005, - -5 + -0.398665, - 3 + -0.385197, - 5 + -0.285359, - 1 + 0.362706, - -7 + -0.855772, - -7 + 0.0454971, - -5 + -0.424857, - -7 + -0.504577, - -5 + -0.00591926, - -5 + 0.149346, - 3 + -0.328489, - 7 + 0.015029, - 7 + 0.747577, - -5 + -0.714686, - 1 + -0.101717, - 3 + 0.656319, - 1 + 0.5271, - -7 + -0.64961, - -7 + -0.359428, - -3 + -0.298523, - -3 + -0.0788614, - 1 + 0.621573, - -1 + 0.0175043, - 3 + -0.579268, - 5 + 0.710546, - 7 + -0.511833, - 5 + 0.162637, - -7 + -0.226472, - 1 + 0.0095225, - 5 + 0.21144, - -5 + -0.582375, - 7 + 0.231257, - 1 + 0.248058, - -1 + 0.922646, - 5 + 0.00967738, - 7 + -0.00782117, - 1 + 0.930862, - 1 + 0.920455, - 7 + -0.994076, - -5 + -0.462763, - 1 + 0.627409, - 3 + 0.936991, - -7 + 0.800793, - -1 + 0.193107, - -7 + 0.703299, - -1 + 0.132479, - 1 + -0.152733, - 5 + -0.953622, - -7 + -0.997253, - 7 + 0.556477, - 3 + 0.272056, - -3 + -0.51489, - 5 + 0.398802, - 5 + 0.602265, - -5 + 0.274229, - -7 + -0.700344, - -7 + 0.0901991, - 5 + 0.0552389, - -7 + -0.536972, - -7 + -0.0797897, - 5 + 0.291342, - 3 + -0.846983, - 3 + 0.700542, - -7 + 0.192372, - 7 + -0.362972, - 5 + 0.180049, - -3 + 0.792655, - 7 + -0.662956, - 5 + -0.142891, - -3 + 0.244501, - -3 + -0.510171, - -3 + 0.321085, - -1 + 0.664982, - 7 + -0.905902, - -5 + 0.966882, - -7 + 0.735439, - 3 + 0.261407, - 3 + 0.963571, - -7 + -0.475502, - 7 + 0.78978, - 7 + 0.365208, - 3 + 0.820723, - 3 + -0.594815, - -1 + -0.942558, - -1 + -0.304459, - -3 + 0.391556, - -1 + -0.795303, - -7 + 0.136453, - -5 + -0.955505, - 1 + -0.534127, - 5 + -0.981382, - -3 + 0.557188, - -5 + -0.118641, - -3 + -0.621408, - -7 + -0.74375, - 7 + 0.0227463, - 5 + 0.112073, - -3 + 0.950711, - 5 + 0.643199, - 5 + -0.351889, - -1 + -0.221595, - -1 + 0.00700172, - 7 + 0.928086, - 5 + 0.0356548, - 3 + -0.370036, - -7 + -0.830755, - -5 + -0.222917, - 1 + -0.782772, - 1 + 0.237148, - -1 + 0.86974, - 5 + -0.537617, - -1 + -0.434889, - -7 + -0.0111739, - 7 + -0.715952, - 3 + -0.40804, - 3 + -0.360795, - 3 + 0.653046, - -3 + 0.706949, - 5 + -0.554727, - -1 + 0.183029, - -7 + -0.239732, - -5 + -0.658072, - 7 + -0.752212, - -5 + 0.293207, - 7 + -0.34722, - -7 + -0.326367, - -5 + -0.0589863, - 5 + -0.927616, - -1 + -0.866135, - 3 + 0.00235856, - -3 + -0.0437649, - -5 + -0.585851, - 1 + -0.481841, - -5 + 0.632601, - 3 + -0.874934, - -1 + -0.230124, - -5 + 0.403241, - -5 + -0.986698, - -1 + 0.968435, - -3 + -0.530127, - 1 + 0.919559, - -7 + 0.425743, - 7 + 0.123378, - 7 + -0.142707, - -7 + -0.494815, - 7 + 0.440976, - -5 + 0.890096, - -3 + -0.708126, - 7 + 0.943091, - -7 + -0.0667361, - 1 + 0.417654, - 7 + 0.25984, - -1 + 0.846645, - 3 + -0.416033, - -1 + -0.149707, - 1 + 0.889424, - 5 + 0.866725, - -3 + 0.625568, - -1 + -0.376365, - -7 + 0.362419, - -7 + 0.212156, - -1 + 0.898672, - 3 + -0.684527, - 3 + 0.350536, - -5 + -0.10858, - -7 + 0.363887, - 1 + 0.431342, - 7 + -0.426099, - -1 + -0.0357183, - 5 + 0.969688, - -7 + 0.436647, - 1 + 0.144824, - 7 + -0.689202, - -5 + -0.369132, - -7 + 0.447801, - 3 + 0.991838, - -5 + -0.95315, - -5 + -0.486236, - 7 + 0.635678, - 7 + -0.672488, - -5 + -0.134572, - -5 + -0.698523, - 3 + 0.0914014, - 5 + 0.826151, - 7 + 0.179363, - 3 + 0.905552, - 3 + 0.460779, - 3 + -0.195297, - -5 + 0.965511, - 1 + -0.98716, - 7 + 0.142015, - -7 + -0.156042, - 7 + 0.338355, - -3 + 0.630815, - -7 + -0.716086, - -5 + 0.30445, - -3 + -0.0663283, - -1 + 0.954605, - -7 + -0.516684, - -1 + 0.739518, - -5 + 0.0926331, - -1 + -0.964479, - -3 + 0.738004, - -1 + -0.0623072, - -3 + 0.994729, - -7 + -0.483703, - -5 + -0.116232, - -3 + 0.608111, - 5 + -0.169533, - 1 + 0.700974, - 7 + 0.344404, - 1 + -0.234486, - -5 + 0.753821, - 3 + 0.264031, - 1 + 0.365123, - -1 + 0.735946, - -3 + 0.075701, - 5 + 0.0457206, - -3 + 0.594172, - 1 + 0.144428, - 3 + -0.945545, - 7 + -0.49231, - -1 + 0.196516, - 7 + 0.397096, - -1 + 0.68979, - 3 + -0.283773, - -7 + -0.891651, - -7 + 0.0992016, - 3 + 0.364927, - 3 + 0.692215, - 1 + 0.902593, - -7 + 0.511356, - 1 + -0.329667, - 3 + 0.151807, - -3 + -0.469367, - -1 + 0.839886, - -3 + 0.990307, - 3 + 0.318869, - 5 + -0.74034, - -5 + -0.339204, - 1 + -0.452787, - 1 + -0.736788, - 1 + -0.248248, - 5 + 0.785201, - 7 + -0.243082, - 7 + -0.107551, - 1 + -0.729608, - -3 + -0.358678, - 1 + -0.786071, - -1 + 0.370913, - 3 + -0.398804, - 1 + 0.0692376, - -1 + -0.103113, - -1 + 0.153375, - 5 + 0.548651, - -1 + -0.306503, - 3 + -0.96292, - 5 + -0.221047, - 5 + 0.567843, - 5 + 0.41284, - 5 + 0.88284, - 1 + -0.629206, - -3 + -0.494796, - 3 + 0.424972, - 7 + 0.365256, - -5 + -0.739219, - 3 + 0.640667, - -5 + 0.633005, - -1 + 0.759701, - 5 + -0.0691017, - -5 + -0.0647394, - -5 + -0.348828, - -5 + 0.665346, - -1 + -0.135857, - 5 + 0.437672, - 5 + 0.381016, - -3 + -0.842788, - -1 + -0.85829, - -7 + 0.19863, - -5 + -0.877027, - 5 + -0.776832, - 3 + -0.591161, - 1 + 0.272311, - 1 + 0.729332, - -7 + -0.085479, - -1 + 0.867551, - -1 + 0.850484, - -7 + 0.688455, - -7 + 0.657501, - 1 + -0.781022, - 7 + -0.853813, - -5 + 0.963325, - 5 + -0.61377, - 1 + -0.946282, - -1 + -0.398061, - 7 + -0.618336, - -5 + 0.210241, - -7 + 0.245468, - 3 + -0.503244, - -7 + -0.991443, - -7 + -0.832428, - 3 + 0.633537, - 3 + -0.0513143, - -5 + -0.740331, - -5 + -0.571087, - -5 + 0.932409, - -1 + 0.310949, - 7 + 0.803959, - 1 + -0.37293, - 3 + 0.625741, - 3 + 0.335055, - -3 + -0.0665732, - -7 + -0.546747, - -3 + -0.824097, - 3 + 0.185571, - -5 + -0.963157, - 1 + -0.575186, - 5 + -0.380057, - -3 + -0.0146486, - -7 + 0.548562, - 7 + -0.294831, - 1 + 0.190966, - 3 + -0.200531, - 3 + 0.769514, - 1 + -0.758442, - 5 + -0.563297, - 3 + -0.268245, - 7 + 0.115331, - 7 + 0.635215, - 1 + -0.393521, - 1 + -0.618453, - -5 + 0.766947, - -5 + -0.89702, - 3 + -0.290726, - -1 + -0.146228, - -7 + -0.671038, - 1 + -0.598244, - 3 + -0.56863, - 7 + -0.501319, - -7 + 0.627518, - 3 + -0.389303, - -3 + 0.0746856, - 5 + -0.0666037, - 5 + -0.275337, - -5 + 0.132165, - 5 + -0.379456, - -3 + -0.232648, - -1 + -0.722393, - -3 + -0.848371, - -3 + -0.894514, - -3 + -0.52825, - -1 + 0.868408, - 5 + 0.305525, - -5 + -0.274425, - -5 + 0.22874, - 5 + 0.71816, - -1 + -0.744417, - -3 + 0.874223, - 1 + -0.0454682, - 3 + 0.998097, - -5 + 0.393407, - 5 + 0.187479, - 1 + 0.85875, - 3 + -0.930842, - 7 + -0.683711, - 3 + -0.625096, - 7 + -0.363623, - -3 + -0.478099, - 5 + 0.0397175, - -1 + 0.772844, - 1 + 0.0351828, - -5 + -0.450596, - 5 + -0.747949, - -1 + -0.901913, - 1 + -0.396489, - 7 + 0.266602, - -3 + -0.144345, - -7 + 0.357022, - -1 + 0.17734, - 3 + -0.490206, - 5 + -0.0589478, - -1 + 0.0215372, - -7 + 0.626992, - 3 + 0.805443, - 5 + -0.774861, - 7 + 0.548483, - -7 + -0.659366, - 5 + -0.399126, - 5 + 0.280639, - -1 + 0.382537, - 5 + 0.253533, - -3 + 0.484453, - -1 + -0.182041, - -7 + 0.403929, - 5 + 0.799799, - -1 + 0.872509, - -1 + 0.446505, - 1 + 0.072863, - 1 + 0.511757, - 5 + -0.0447141, - 7 + 0.418114, - 3 + -0.412815, - -7 + 0.270519, - 1 + -0.691355, - 3 + -0.197421, - 3 + -0.86134, - -5 + -0.0102158, - 1 + 0.35777, - 3 + 0.447566, - -1 + 0.0185418, - -7 + 0.78905, - 7 + 0.691196, - -5 + -0.980607, - 3 + 0.307422, - 1 + 0.612522, - 5 + -0.199466, - -1 + -0.459671, - 1 + 0.170203, - 5 + 0.345741, - -1 + 0.442178, - -5 + 0.431563, - 3 + -0.534043, - 5 + -0.76423, - 3 + 0.121284, - 3 + 0.645713, - 7 + 0.96808, - -7 + 0.488072, - 3 + -0.00669708, - 1 + -0.971889, - -1 + -0.315525, - 5 + 0.541525, - 3 + -0.787017, - -1 + 0.544075, - 3 + -0.0730717, - -5 + 0.522401, - -5 + -0.323174, - 7 + 0.526918, - 5 + -0.385761, - 5 + -0.895487, - -3 + 0.0897052, - -5 + -0.670281, - -5 + -0.182219, - -5 + 0.303178, - -5 + -0.947146, - -3 + -0.721791, - -5 + -0.626817, - 1 + -0.583032, - 3 + 0.641241, - -7 + -0.520007, - 1 + -0.425207, - -5 + 0.0712658, - 1 + 0.812682, - 1 + -0.143148, - 3 + 0.0762144, - 1 + 0.0785892, - 7 + -0.568785, - 1 + -0.59096, - 3 + 0.756584, - -1 + 0.128497, - 3 + -0.975302, - -1 + -0.757146, - 5 + 0.448678, - -7 + 0.00292395, - -3 + -0.0190117, - 7 + -0.211027, - -1 + -0.668733, - -5 + -0.447823, - 1 + -0.502645, - -7 + 0.47152, - -5 + -0.364533, - 7 + 0.745433, - -5 + 0.753726, - -1 + -0.307681, - -1 + 0.791775, - -5 + -0.151863, - -5 + 0.815651, - 7 + -0.0787568, - 1 + 0.901984, - 1 + 0.446558, - -5 + 0.035328, - 5 + -0.461488, - -5 + 0.702664, - 1 + 0.477797, - -1 + -0.0921929, - -3 + -0.231008, - 7 + 0.369765, - -7 + 0.0220315, - 5 + -0.0497525, - -7 + -0.0740606, - -1 + 0.885344, - 3 + 0.332343, - -3 + 0.220104, - -1 + 0.384649, - -5 + -0.196536, - -1 + 0.442901, - 5 + 0.226845, - -7 + 0.378706, - -7 + 0.165296, - 3 + 0.201761, - 1 + -0.666372, - -1 + -0.0523257, - 3 + 0.636851, - 5 + -0.717434, - 1 + -0.354993, - 3 + -0.720888, - -5 + -0.133448, - -5 + -0.12999, - 5 + -0.64646, - 1 + 0.66513, - 7 + 0.38796, - -3 + 0.983196, - 1 + 0.156689, - -1 + -0.598867, - 7 + 0.0891009, - -3 + 0.564803, - 5 + 0.647083, - 3 + 0.28552, - -5 + -0.550295, - 7 + -0.535946, - 3 + -0.323109, - 1 + 0.968116, - -5 + 0.670887, - 5 + 0.723851, - -7 + 0.14941, - 1 + 0.751713, - -3 + 0.379236, - -5 + 0.339108, - -5 + -0.301987, - 3 + -0.683341, - -5 + -0.359829, - 5 + -0.84713, - -3 + 0.304565, - -3 + 0.861481, - 7 + -0.877059, - -5 + 0.289428, - -7 + -0.434084, - -1 + -0.481805, - -3 + 0.932735, - -3 + -0.309733, - -3 + -0.656653, - -1 + 0.858222, - -5 + -0.945002, - -3 + -0.379574, - 1 + -0.329053, - -5 + -0.965912, - -7 + -0.0862743, - -3 + 0.564742, - 1 + 0.430712, - 7 + -0.134825, - 3 + -0.0142276, - -3 + 0.461407, - -3 + 0.237931, - 5 + 0.189721, - -5 + -0.164975, - 3 + 0.158177, - 5 + 0.761349, - 5 + -0.603701, - -1 + 0.343416, - -7 + 0.479708, - 5 + -0.54804, - 5 + 0.0522417, - -7 + -0.975275, - 3 + 0.908053, - 7 + -0.324028, - 1 + 0.20481, - -1 + 0.501097, - -3 + -0.562607, - -5 + 0.555231, - 1 + -0.158267, - 3 + -0.0687857, - 1 + 0.511831, - -5 + -0.607408, - 1 + 0.360143, - -1 + 0.437194, - -3 + -0.092719, - 7 + 0.66663, - -7 + 0.610324, - 1 + 0.477642, - -3 + -0.690053, - 5 + -0.239834, - 5 + 0.430824, - -1 + -0.74709, - -7 + 0.666542, - -3 + 0.787307, - 5 + 0.12119, - -5 + 0.468506, - -7 + -0.655536, - -3 + -0.362963, - -7 + -0.444575, - -5 + -0.813438, - 3 + -0.658917, - -7 + -0.846612, - -5 + 0.47478, - 1 + -0.486082, - -7 + 0.325601, - -3 + 0.10135, - 3 + 0.616988, - -5 + 0.030061, - 1 + 0.546106, - -3 + -0.107568, - 1 + -0.526698, - 1 + -0.402568, - 1 + 0.476488, - 5 + -0.876816, - -7 + -0.814004, - -5 + -0.742022, - 1 + 0.396799, - 3 + 0.302924, - 5 + -0.330856, - 3 + -0.20346, - 1 + -0.0134361, - 3 + 0.603609, - 5 + -0.531407, - 7 + 0.711484, - -1 + 0.520469, - -1 + 0.148813, - 3 + 0.0432309, - 1 + 0.669779, - 1 + -0.428549, - -3 + 0.260938, - -3 + 0.941317, - -5 + -0.780941, - -3 + -0.747831, - 1 + -0.998692, - -5 + 0.892504, - -1 + 0.62686, - 7 + 0.940684, - -1 + -0.157277, - -3 + -0.215904, - 3 + -0.149222, - -3 + -0.876603, - -7 + -0.20916, - 3 + -0.984649, - 7 + -0.60173, - -1 + -0.806134, - -1 + 0.209397, - 1 + 0.310198, - 5 + -0.348507, - -3 + 0.966827, - 1 + -0.781644, - -3 + -0.417686, - 1 + -0.618801, - 7 + 0.862017, - -3 + -0.405402, - -7 + 0.125069, - -7 + 0.815787, - -5 + 0.135567, - -5 + 0.652664, - -5 + 0.509215, - -3 + -0.247757, - -3 + -0.697007, - 7 + -0.760593, - 3 + -0.772638, - -5 + 0.870941, - -1 + 0.864873, - -1 + -0.695855, - 3 + -0.952328, - 7 + -0.984213, - -5 + -0.825547, - 7 + -0.937066, - 1 + -0.030252, - 7 + -0.370309, - -1 + 0.976445, - -1 + 0.105839, - -7 + -0.151788, - 5 + 0.329837, - 5 + 0.484323, - 3 + -0.185114, - 1 + -0.450171, - 7 + -0.174316, - 7 + -0.840168, - -3 + -0.188744, - 7 + 0.4487, - -5 + 0.0857224, - 7 + 0.836002, - -3 + -0.180574, - 7 + 0.933189, - -3 + 0.850465, - -3 + 0.217683, - 7 + -0.504985, - 3 + -0.244207, - -3 + 0.827852, - -3 + 0.231895, - -3 + -0.210397, - -5 + 0.225256, - -5 + -0.424323, - -3 + 0.584223, - 5 + -0.21417, - 7 + 0.0492111, - -5 + 0.717212, - 3 + 0.127463, - 5 + -0.412335, - -3 + -0.235105, - 1 + -0.142685, - 5 + -0.499895, - 3 + -0.081105, - -5 + -0.145618, - 7 + -0.823428, - 5 + -0.860577, - 3 + -0.433851, - 1 + -0.917788, - 1 + 0.0316082, - -7 + 0.825787, - -7 + -0.453454, - -7 + 0.00504467, - -3 + 0.495271, - 3 + 0.0318126, - 5 + -0.344928, - -1 + -0.550629, - -7 + -0.352606, - -1 + -0.122732, - -3 + 0.159171, - 3 + 0.261004, - 3 + -0.691171, - 3 + -0.746879, - 1 + 0.626657, - -3 + 0.0388675, - -1 + 0.51117, - 5 + -0.673213, - -3 + 0.864677, - -7 + -0.726019, - 7 + -0.729394, - -5 + 0.330155, - -7 + -0.0177368, - -7 + -0.300845, - 1 + 0.615713, - 5 + 0.00178831, - 1 + 0.0232089, - 7 + 0.0501066, - -5 + -0.620755, - 1 + -0.446627, - -1 + -0.417687, - 7 + 0.871591, - 7 + -0.750383, - 7 + 0.402812, - 1 + -0.147176, - -5 + 0.443187, - 3 + 0.286959, - 5 + 0.608735, - -3 + 0.380043, - 3 + -0.175819, - 7 + -0.829562, - -7 + -0.79598, - -1 + -0.192267, - -5 + -0.110678, - 1 + 0.6394, - 1 + -0.0846046, - 1 + 0.714054, - 5 + 0.811509, - 1 + -0.398193, - 7 + 0.760568, - -1 + -0.452345, - -5 + 0.687367, - 5 + -0.318674, - -3 + 0.324117, - -7 + 0.236211, - -5 + 0.649759, - 7 + -0.548562, - 3 + 0.0579074, - -3 + 0.967526, - 5 + 0.205966, - 3 + -0.575908, - -5 + -0.137605, - 7 + 0.927195, - -5 + 0.454236, - 5 + -0.445633, - 3 + 0.770301, - 7 + -0.281772, - -1 + -0.810031, - -5 + 0.104421, - -3 + 0.920684, - -1 + 0.868938, - 3 + -0.0053164, - -3 + -0.718631, - -5 + 0.455326, - 5 + -0.820026, - -5 + -0.768273, - 3 + 0.0752762, - 5 + 0.714693, - 7 + -0.17771, - -3 + 0.42292, - -1 + -0.0175617, - 5 + 0.528179, - 3 + 0.568353, - 5 + -0.587159, - 1 + 0.801071, - 7 + 0.0826319, - -3 + 0.0275306, - -5 + 0.676104, - -7 + 0.583124, - -3 + 0.218791, - -7 + 0.227567, - -3 + -0.430536, - 5 + 0.654163, - 3 + -0.467692, - 7 + -0.155845, - -7 + 0.089255, - -3 + 0.938383, - -3 + 0.906627, - 7 + 0.950595, - -5 + -0.489709, - 7 + 0.671718, - 7 + 0.164742, - 3 + -0.852821, - 7 + 0.582895, - -3 + -0.742699, - 1 + -0.0381558, - 1 + 0.752823, - 1 + 0.749102, - -1 + 0.403834, - -3 + -0.442988, - 3 + 0.769955, - -1 + 0.729227, - 3 + -0.464394, - -1 + 0.982971, - 5 + 0.32225, - 3 + 0.707018, - 7 + 0.284523, - -5 + -0.390641, - 7 + 0.838552, - 1 + -0.261646, - 7 + 0.763129, - -1 + 0.26582, - 7 + 0.47961, - 5 + 0.195016, - -1 + 0.442942, - 1 + -0.566928, - 1 + -0.885894, - 3 + 0.809517, - 7 + -0.794782, - 1 + 0.396051, - -1 + -0.717371, - -7 + -0.372855, - -3 + -0.435502, - -5 + 0.486243, - -7 + 0.226385, - -3 + -0.674962, - 5 + -0.818546, - -1 + 0.662066, - -3 + 0.371445, - 7 + -0.181262, - -7 + -0.96998, - 7 + -0.243668, - 1 + -0.622788, - -3 + -0.934349, - -7 + -0.531977, - 7 + 0.913129, - -5 + 0.0873188, - -5 + -0.802866, - 5 + 0.176445, - 7 + 0.931233, - -1 + -0.345816, - -7 + -0.698489, - 3 + -0.0641756, - -1 + 0.20042, - 3 + -0.225253, - 7 + 0.611709, - -3 + -0.526143, - 5 + -0.494852, - -7 + -0.543889, - 5 + -0.865676, - 7 + -0.361067, - -7 + 0.157247, - -1 + -0.148807, - -1 + 0.754306, - -3 + -0.232635, - 1 + 0.285416, - 5 + 0.977439, - 3 + -0.545843, - -5 + -0.684446, - 5 + 0.00538877, - -1 + -0.416723, - 1 + 0.455052, - -1 + -0.694408, - -5 + 0.5697, - -3 + 0.239728, - 7 + -0.157425, - -3 + 0.307093, - 3 + 0.598074, - -3 + -0.192316, - -5 + 0.683009, - 1 + -0.276813, - 7 + -0.0605859, - 7 + -0.160651, - 1 + 0.745574, - 5 + -0.595225, - -3 + 0.679057, - -7 + 0.681067, - -3 + 0.254237, - 3 + -0.309311, - -7 + 0.537294, - 7 + -0.527087, - -1 + -0.914636, - -5 + 0.3696, - -5 + 0.758544, - -3 + 0.615554, - -3 + -0.800559, - 5 + 0.857245, - -7 + 0.911095, - -7 + -0.476043, - 1 + 0.286482, - -7 + -0.106087, - -5 + 0.396264, - -5 + -0.897017, - 1 + -0.963821, - -7 + -0.566173, - -5 + 0.578676, - 1 + 0.813064, - 7 + 0.491473, - 7 + -0.270985, - 5 + 0.132949, - 5 + 0.0161494, - 1 + 0.474008, - -5 + 0.796655, - -3 + -0.63918, - 3 + -0.967985, - 7 + 0.879643, - -1 + 0.214509, - -5 + 0.00227151, - 5 + 0.0762274, - 3 + 0.59941, - 3 + 0.340686, - -5 + -0.518312, - -5 + -0.6534, - -3 + -0.133582, - 1 + 0.772737, - -3 + -0.796512, - -1 + -0.232784, - 7 + -0.567475, - -5 + -0.612535, - -5 + -0.743451, - -5 + 0.922795, - 7 + -0.360325, - -5 + 0.664416, - -7 + 0.537588, - -7 + 0.090611, - -1 + -0.411909, - 3 + -0.926915, - 7 + 0.395344, - -7 + -0.661518, - -3 + -0.170838, - 7 + -0.357837, - -5 + 0.471491, - -3 + -0.382249, - -3 + -0.52305, - -1 + -0.97666, - 3 + 0.0582765, - -1 + -0.0656394, - 7 + -0.406727, - 1 + 0.00918714, - -5 + -0.137935, - 7 + -0.614004, - 1 + -0.979364, - -7 + 0.416733, - -1 + -0.759126, - -7 + -0.370293, - -7 + -0.100497, - 1 + 0.869131, - -3 + 0.164885, - -1 + -0.0975662, - -7 + 0.186475, - 3 + -0.918565, - 3 + -0.0801415, - 7 + -0.100654, - -7 + -0.0564053, - -5 + -0.266266, - 1 + -0.250558, - -7 + 0.00064827, - 1 + 0.0900851, - -5 + -0.598895, - -3 + -0.300177, - -3 + -0.733429, - -1 + 0.644141, - -7 + 0.473614, - -1 + -0.641922, - 5 + -0.771156, - 1 + -0.408759, - 5 + 0.12316, - -5 + 0.293248, - 1 + -0.878825, - -7 + -0.414203, - 1 + -0.158712, - 7 + 0.739709, - -7 + -0.86936, - 3 + 0.642115, - 3 + -0.385535, - -7 + 0.143439, - -3 + 0.698413, - 5 + -0.678345, - 5 + 0.565038, - 5 + 0.815733, - 5 + -0.707831, - -7 + -0.849665, - 3 + -0.293231, - 3 + 0.511878, - -7 + 0.0476101, - -5 + -0.612903, - 5 + 0.912856, - -1 + -0.229084, - -1 + -0.228542, - -1 + 0.543728, - 7 + -0.254476, - 5 + -0.538093, - 7 + 0.873386, - -7 + -0.797387, - 1 + 0.472407, - -5 + 0.952256, - -7 + 0.795923, - -1 + -0.0898826, - -3 + 0.851045, - 3 + 0.649821, - -5 + -0.623912, - -1 + -0.232825, - -5 + -0.293336, - 3 + -0.175406, - 7 + -0.126623, - -3 + -0.458458, - -1 + -0.716308, - 3 + -0.442831, - 5 + -0.240306, - -3 + 0.62798, - 7 + -0.901771, - -1 + 0.980463, - 3 + -0.502372, - -7 + -0.861722, - -1 + 0.827093, - 1 + 0.12554, - -3 + 0.270311, - -5 + 0.348095, - -1 + 0.913085, - 7 + 0.957399, - 7 + 0.340458, - 5 + 0.0422461, - -1 + -0.369125, - -3 + 0.43044, - 7 + -0.632377, - -1 + -0.90659, - 1 + -0.89239, - 7 + 0.828316, - 5 + 0.824523, - -7 + -0.0536567, - 1 + -0.0399239, - 1 + 0.197041, - -1 + -0.554157, - -5 + 0.0431199, - -3 + -0.304071, - -3 + -0.331796, - 5 + 0.822257, - 3 + -0.638709, - 3 + 0.639501, - -1 + -0.549931, - -5 + 0.893208, - 3 + 0.791099, - 7 + 0.153618, - 3 + -0.838246, - -7 + 0.475597, - 1 + -0.354901, - -7 + -0.761264, - -1 + 0.106035, - -3 + -0.481434, - -1 + 0.234136, - 5 + 0.375285, - -7 + -0.539323, - -3 + -0.671027, - -3 + 0.212608, - -5 + 0.992672, - -3 + -0.655146, - -1 + -0.675066, - -1 + 0.944776, - 5 + 0.653261, - 7 + 0.703227, - -1 + -0.329846, - -3 + -0.29662, - 5 + 0.0306179, - 3 + 0.308382, - 5 + -0.37852, - 1 + 0.569875, - -1 + 0.262195, - -7 + 0.65172, - -1 + -0.324076, - -1 + -0.592955, - 3 + 0.330534, - -7 + 0.236835, - 7 + -0.16363, - 5 + -0.350766, - 7 + 0.33076, - -3 + 0.713702, - 7 + 0.986953, - 1 + -0.484957, - 1 + 0.232317, - 1 + -0.241183, - 1 + -0.652168, - -7 + -0.969083, - -3 + -0.00466762, - 7 + -0.643621, - 5 + -0.512406, - 3 + 0.559345, - -1 + 0.876841, - 1 + 0.0247327, - -5 + 0.579806, - -7 + -0.45585, - -1 + -0.978404, - -3 + -0.211921, - 3 + 0.0595151, - -5 + -0.772737, - 1 + 0.701463, - 7 + -0.055659, - 1 + -0.434081, - -7 + -0.748698, - 5 + -0.742137, - 5 + -0.0588123, - -5 + 0.446934, - -7 + -0.9576, - -1 + -0.910423, - -1 + -0.798973, - -7 + 0.643822, - -3 + -0.240149, - 1 + -0.366265, - 1 + -0.168219, - -7 + -0.030838, - 7 + -0.591915, - -3 + -0.92018, - 7 + 0.57597, - -1 + 0.351344, - -7 + 0.647625, - 5 + -0.537432, - -5 + -0.69753, - 3 + 0.489766, - -3 + -0.263308, - 1 + 0.40383, - -1 + 0.0716793, - -3 + 0.0739884, - 7 + -0.543397, - -5 + 0.313842, - -1 + -0.290457, - -3 + -0.84267, - -3 + -0.568324, - -3 + -0.18694, - 7 + 0.544842, - 5 + 0.340199, - -5 + -0.465435, - 5 + 0.386054, - 3 + -0.248471, - -1 + -0.536871, - -3 + -0.00456425, - 5 + 0.30784, - -7 + 0.567282, - -3 + -0.689596, - 7 + -0.973479, - -5 + -0.292588, - 1 + -0.0853992, - 1 + 0.54008, - 1 + 0.933126, - 7 + 0.308498, - -5 + 0.933511, - -1 + -0.616556, - 1 + 0.5256, - -3 + 0.11786, - -1 + 0.742156, - -1 + 0.169955, - -1 + -0.96657, - -3 + 0.556796, - -1 + -0.865691, - -3 + -0.238262, - -5 + 0.647911, - 3 + 0.359834, - 7 + 0.613736, - 1 + 0.507745, - -7 + -0.892512, - 3 + 0.444704, - 7 + -0.939748, - -1 + 0.672554, - -7 + 0.136662, - -7 + 0.565658, - 3 + 0.942443, - -1 + 0.0449975, - 1 + 0.92684, - 3 + -0.297685, - 5 + 0.568496, - 3 + -0.144333, - 1 + -0.166059, - 5 + 0.245617, - -7 + 0.0561295, - 5 + -0.053852, - 5 + 0.796947, - -5 + 0.352517, - -5 + 0.967329, - 5 + -0.892274, - 7 + -0.335576, - -1 + -0.545664, - 5 + 0.768217, - -7 + -0.188918, - -7 + 0.285642, - -3 + -0.467917, - -1 + 0.356141, - -7 + -0.382192, - -5 + 0.0410403, - -3 + 0.593099, - -1 + -0.407076, - 7 + 0.399012, - 3 + -0.215368, - 5 + 0.00567285, - 3 + 0.833758, - 7 + -0.469107, - -3 + 0.84339, - -1 + -0.648244, - -1 + 0.45709, - 5 + 0.221697, - -3 + 0.2979, - -1 + -0.801441, - 5 + 0.358525, - 5 + 0.0155232, - 7 + -0.613239, - -3 + 0.770038, - -3 + 0.386763, - -1 + -0.977012, - -5 + 0.0247041, - 3 + -0.774763, - 1 + -0.269862, - 3 + 0.598317, - -7 + -0.604919, - -5 + -0.295425, - -3 + -0.501016, - 5 + 0.893051, - -7 + 0.592268, - -1 + -0.135156, - 5 + -0.766252, - -3 + 0.445672, - 5 + 0.612924, - -5 + 0.107889, - -1 + 0.306333, - -3 + -0.720024, - 1 + -0.256542, - -5 + -0.644907, - -1 + -0.198375, - -1 + 0.530318, - 7 + 0.865427, - -5 + -0.186188, - 3 + 0.15118, - 5 + 0.652307, - 1 + 0.908472, - 3 + 0.747761, - -1 + -0.654492, - 1 + -0.454527, - 5 + 0.682724, - -5 + 0.372245, - 7 + 0.871819, - 3 + -0.80367, - -1 + 0.448117, - -1 + 0.948526, - -7 + -0.348271, - 7 + -0.927127, - 1 + 0.449701, - -1 + -0.680563, - 1 + 0.892784, - 1 + -0.0924386, - -1 + -0.959661, - 7 + -0.081394, - 5 + -0.963336, - -5 + 0.805157, - -7 + -0.285785, - -7 + -0.592211, - -5 + 0.413432, - -1 + -0.723101, - -3 + -0.0432179, - -3 + 0.357774, - 3 + -0.969629, - -7 + 0.840992, - 7 + -0.0670359, - 1 + -0.230027, - -7 + 0.00539775, - -1 + 0.992222, - -5 + 0.508197, - -1 + -0.0701932, - -7 + -0.916136, - 1 + 0.121754, - 3 + 0.979212, - 5 + 0.710977, - -3 + -0.444553, - 1 + 0.775755, - 1 + -0.731095, - -5 + -0.962054, - -7 + -0.137716, - 1 + 0.0744596, - -3 + -0.298853, - 3 + -0.287877, - 7 + -0.537653, - 7 + -0.370057, - 5 + 0.558642, - -1 + -0.306097, - 5 + 0.298301, - 5 + 0.890951, - 7 + 0.461226, - 5 + -0.273165, - -3 + 0.767864, - -1 + -0.427128, - -7 + 0.0742497, - 3 + -0.628171, - -1 + -0.383706, - -5 + 0.926895, - -3 + -0.111893, - -1 + -0.568481, - 3 + 0.982367, - 3 + -0.746265, - 7 + 0.602531, - 5 + 0.639663, - -5 + 0.640932, - 3 + -0.339199, - -7 + -0.872224, - 7 + 0.493771, - 5 + -0.0426846, - 7 + -0.222289, - 7 + -0.802753, - 5 + -0.998975, - 5 + 0.739618, - 5 + -0.949418, - -7 + -0.348646, - 7 + -0.122117, - -3 + -0.786274, - -1 + -0.910026, - 5 + -0.521515, - 5 + 0.786492, - -3 + -0.956601, - -7 + -0.935189, - -1 + 0.816024, - 5 + 0.675236, - 5 + 0.0495799, - -7 + 0.738648, - 7 + 0.424409, - 3 + -0.438266, - -7 + -0.491474, - 1 + 0.22495, - -5 + -0.0235629, - -3 + 0.479672, - -1 + 0.84058, - -5 + -0.166951, - 5 + -0.0577841, - -1 + -0.642721, - -1 + 0.723607, - 1 + -0.873909, - 3 + -0.888751, - -1 + -0.370589, - -3 + -0.0403842, - 3 + 0.564038, - 1 + -0.590923, - -1 + -0.301823, - 3 + -0.525907, - -7 + -0.700129, - -7 + -0.286343, - -1 + -0.746766, - -1 + 0.510312, - -7 + 0.68781, - -1 + -0.071507, - 5 + 0.20512, - 7 + 0.193939, - -3 + 0.0940258, - -1 + -0.815724, - 7 + 0.914182, - 3 + 0.582396, - -5 + 0.182791, - 5 + -0.169328, - 5 + -0.539398, - 1 + -0.544711, - -7 + -0.29523, - -7 + -0.220718, - -7 + -0.424836, - -1 + -0.583509, - 5 + -0.998364, - 7 + -0.624936, - -3 + 0.682019, - 7 + -0.0926723, - -3 + -0.596477, - -1 + -0.380871, - -3 + -0.215605, - 7 + -0.0981703, - -7 + -0.181927, - -1 + 0.668344, - 1 + 0.550972, - 1 + -0.362117, - -1 + 0.434212, - -7 + 0.529025, - 5 + -0.166071, - -3 + 0.473601, - 5 + 0.555215, - 7 + 0.878004, - 3 + 0.90408, - -5 + 0.504969, - -3 + -0.667642, - -5 + -0.538538, - 5 + 0.188161, - -1 + 0.914107, - 3 + 0.472097, - 7 + 0.510842, - -5 + 0.985461, - -7 + -0.394255, - -5 + 0.890095, - 5 + 0.634067, - -7 + -0.944812, - -1 + -0.199624, - -1 + -0.447444, - 3 + -0.228946, - 7 + 0.22322, - -5 + 0.654362, - -5 + -0.200935, - 3 + -0.833657, - -7 + 0.802499, - 1 + -0.704644, - 5 + -0.415231, - 5 + -0.488818, - -5 + -0.405574, - -3 + -0.551587, - 3 + -0.143344, - -5 + 0.992058, - 7 + 0.973004, - -1 + 0.899068, - -1 + -0.201666, - -5 + -0.327868, - 3 + -0.727053, - -7 + 0.268601, - -7 + 0.109424, - 7 + -0.950672, - 1 + 0.76586, - -3 + 0.875399, - 7 + 0.0168127, - -5 + -0.751942, - 1 + 0.455423, - 5 + -0.133098, - 5 + 0.576325, - -5 + -0.760309, - -7 + -0.273288, - -7 + -0.766843, - 1 + -0.862775, - 7 + -0.885211, - 7 + 0.696724, - -1 + 0.0780369, - 1 + 0.275855, - -5 + 0.21323, - -1 + 0.30191, - 5 + -0.129398, - -3 + -0.659394, - 7 + -0.537345, - -5 + 0.726379, - 1 + -0.351187, - 1 + 0.413273, - -7 + -0.460414, - -1 + 0.780082, - 7 + -0.750839, - 7 + 0.140123, - -1 + 0.431409, - -1 + 0.467309, - 7 + -0.189717, - -5 + -0.619566, - 1 + -0.664491, - 5 + -0.259023, - -3 + 0.956683, - -3 + -0.749516, - -5 + 0.131912, - -7 + 0.20736, - -7 + -0.370862, - 3 + -0.38448, - -7 + -0.0683076, - 5 + -0.0808511, - 3 + -0.716107, - -7 + 0.282494, - -5 + 0.690208, - 5 + -0.0140297, - 3 + -0.0253589, - -1 + -0.286539, - 1 + 0.632755, - 3 + 0.678366, - 7 + -0.298717, - 7 + 0.931446, - 3 + -0.000155271, - 5 + 0.593412, - -1 + -0.237465, - 3 + 0.495449, - 1 + 0.854041, - 7 + 0.417438, - 5 + 0.130533, - 3 + 0.11828, - 7 + -0.492641, - -3 + 0.31251, - -1 + -0.746348, - -3 + 0.00667295, - -7 + -0.849606, - -1 + -0.621633, - 5 + -0.780689, - -7 + 0.325068, - -1 + 0.14253, - -5 + -0.467373, - -7 + -0.215694, - -5 + 0.473324, - -5 + -0.0749665, - 1 + 0.0177372, - 1 + 0.874646, - -3 + -0.548775, - -5 + -0.644173, - 7 + 0.890543, - 1 + -0.258939, - -1 + -0.381203, - 7 + -0.989668, - 7 + -0.370075, - -7 + 0.0443089, - 7 + -0.655745, - -1 + 0.576317, - 1 + -0.867409, - -1 + -0.242211, - 3 + -0.414673, - -3 + -0.668824, - -7 + -0.880169, - -7 + -0.337623, - 3 + 0.421604, - 5 + 0.213655, - 5 + -0.797275, - 5 + 0.0784746, - -7 + 0.29279, - 5 + -0.266808, - 5 + -0.847968, - 3 + 0.627592, - 5 + 0.100925, - -7 + -0.836569, - -5 + -0.484448, - -7 + -0.260665, - 7 + 0.98659, - 5 + 0.811925, - 5 + -0.263092, - 3 + -0.423208, - 3 + -0.219005, - -7 + -0.0725037, - -1 + -0.814871, - 3 + 0.181891, - -3 + 0.309198, - 1 + 0.951535, - -7 + 0.694465, - -3 + 0.851734, - -3 + 0.240617, - 7 + -0.545582, - 7 + -0.582447, - -3 + -0.895393, - 1 + -0.607017, - 5 + 0.575812, - 7 + 0.0485804, - -5 + -0.609581, - 3 + -0.991071, - 1 + -0.69817, - -1 + 0.612983, - 7 + 0.124632, - 1 + -0.934992, - -5 + 0.629333, - -1 + -0.479678, - -7 + -0.690851, - 3 + 0.0123024, - 3 + 0.579883, - -7 + -0.797862, - 3 + 0.930494, - 5 + 0.0959856, - 5 + 0.799511, - 3 + -0.702544, - 3 + 0.863534, - -7 + 0.723902, - 3 + -0.925485, - -3 + 0.0838314, - 5 + -0.539124, - -7 + 0.795782, - -7 + -0.508871, - 3 + -0.666186, - -5 + -0.437818, - 1 + 0.430824, - -1 + 0.890288, - 3 + 0.0323077, - -5 + -0.451717, - 1 + -0.994217, - -5 + -0.889329, - 1 + -0.154296, - 3 + -0.139546, - 3 + 0.783946, - -1 + 0.843542, - -7 + 0.742655, - 3 + 0.0644047, - -3 + 0.707173, - 7 + -0.292937, - -1 + 0.978045, - 3 + -0.495493, - 1 + 0.576421, - -5 + 0.830068, - -7 + -0.7389, - -3 + 0.545496, - 5 + 0.525718, - -5 + 0.491613, - -5 + 0.0724149, - -5 + -0.581892, - -5 + 0.148299, - -3 + -0.0143521, - -7 + 0.224096, - -1 + -0.58379, - -7 + -0.746189, - 3 + 0.678161, - 5 + -0.60352, - 1 + -0.0123151, - -3 + 0.935789, - 7 + 0.146463, - 5 + 0.0833464, - -5 + 0.0973773, - 1 + -0.634221, - 5 + -0.199689, - -5 + -0.977316, - 1 + -0.468532, - -3 + 0.912407, - -1 + 0.618525, - -5 + 0.641828, - -3 + 0.161639, - 3 + -0.521444, - 1 + 0.217545, - -3 + 0.776886, - -5 + -0.0861521, - 7 + -0.684462, - 3 + 0.025459, - 5 + -0.588791, - 3 + -0.968869, - -5 + 0.936218, - 5 + -0.962381, - 1 + 0.102731, - 7 + 0.487412, - 5 + -0.586347, - -5 + 0.483033, - 3 + 0.147303, - 7 + 0.545176, - -1 + -0.346122, - -3 + -0.550012, - -3 + 0.175068, - 5 + -0.32015, - 1 + 0.524341, - -7 + 0.645118, - -5 + -0.940018, - -1 + -0.97908, - -7 + -0.515108, - -3 + 0.367395, - 1 + 0.545659, - 1 + -0.286328, - 5 + -0.58779, - 1 + 0.337098, - 7 + -0.330973, - -3 + 0.374149, - 7 + -0.0352384, - -3 + 0.100802, - -3 + -0.496571, - 5 + -0.780307, - 1 + -0.478443, - 5 + 0.67526, - 7 + -0.425565, - 7 + 0.754558, - -7 + -0.775828, - 5 + 0.655701, - 7 + -0.438407, - 3 + -0.775985, - 7 + -0.666725, - -1 + 0.797674, - 1 + -0.749333, - -7 + 0.194764, - -7 + 0.625181, - -5 + -0.060977, - -5 + 0.643178, - 3 + -0.933005, - -3 + -0.998434, - 3 + 0.713815, - -3 + -0.574046, - -3 + -0.0416154, - -7 + 0.296629, - 7 + 0.191779, - -7 + 0.833033, - -3 + 0.487987, - -3 + -0.575328, - 5 + 0.496461, - 3 + 0.589905, - 7 + -0.924183, - -1 + 0.696718, - 5 + -0.875373, - -3 + 0.0319824, - 5 + -0.207871, - 3 + 0.177233, - -3 + -0.761711, - 1 + 0.401589, - 7 + 0.538526, - 7 + -0.320289, - -3 + -0.281917, - -5 + -0.547839, - -7 + -0.322797, - -5 + -0.605992, - 5 + 0.785395, - -1 + 0.0550308, - -5 + 0.511285, - -7 + 0.402531, - -7 + -0.464181, - 5 + -0.160938, - -5 + -0.735561, - -5 + 0.0996571, - 7 + 0.593118, - 7 + -0.0328994, - -5 + -0.98964, - 3 + 0.205471, - -1 + 0.200857, - 7 + -0.771514, - 1 + -0.587245, - 3 + 0.26805, - -3 + 0.784424, - -5 + -0.963779, - 7 + -0.505932, - -1 + -0.171588, - -1 + 0.670593, - -7 + 0.301767, - 5 + 0.0138393, - -1 + -0.984387, - -1 + 0.0391519, - -3 + -0.222087, - 7 + 0.0864488, - 5 + -0.4927, - 7 + 0.257574, - -3 + 0.232144, - -7 + 0.327466, - 1 + -0.464061, - -3 + -0.275329, - -1 + -0.0648923, - -7 + 0.674159, - -7 + -0.413218, - -7 + -0.692417, - 1 + -0.762459, - -5 + -0.913253, - -7 + 0.36255, - -5 + 0.917413, - -7 + 0.556944, - 7 + 0.869794, - -5 + 0.599393, - -7 + -0.957509, - 3 + -0.0653876, - -3 + 0.542317, - 7 + -0.919778, - -1 + 0.389195, - 1 + -0.694826, - -1 + -0.684451, - 5 + -0.232338, - 7 + 0.107159, - 1 + -0.408376, - 3 + -0.669585, - 5 + 0.257082, - 5 + 0.831891, - -1 + 0.211606, - -5 + -0.384855, - 7 + 0.020007, - -5 + -0.428625, - -3 + -0.0360878, - 5 + -0.848203, - 3 + 0.0254734, - -3 + 0.749542, - -7 + -0.804563, - -1 + -0.0972806, - 1 + -0.248763, - -5 + -0.480906, - -7 + 0.494774, - -7 + 0.809284, - 1 + 0.892301, - 3 + -0.866702, - 7 + 0.549121, - -7 + -0.807113, - 5 + 0.817796, - -3 + -0.258985, - -3 + -0.652257, - 1 + 0.857754, - 1 + 0.602559, - -3 + 0.459551, - -5 + 0.12109, - 7 + 0.228169, - 3 + 0.268535, - -5 + -0.511365, - 3 + 0.473797, - -3 + 0.789188, - 5 + -0.233201, - -1 + 0.337202, - 3 + 0.0872898, - -5 + -0.577231, - -3 + -0.794605, - -3 + 0.948282, - 1 + 0.86739, - 7 + -0.853303, - 1 + 0.585277, - -5 + -0.0480538, - 3 + 0.131517, - -5 + 0.256086, - 3 + -0.220017, - -1 + 0.968746, - 1 + -0.866085, - 1 + -0.75045, - 3 + 0.103057, - 3 + -0.280213, - 7 + -0.915525, - 1 + 0.910469, - -1 + 0.122471, - 7 + 0.756213, - -1 + -0.979998, - -3 + -0.526045, - -3 + -0.515105, - -3 + 0.191857, - -5 + 0.861293, - -5 + 0.557644, - -7 + 0.955665, - -7 + -0.218954, - -5 + 0.843849, - 3 + 0.700339, - -5 + 0.308848, - 5 + -0.671504, - -7 + -0.977673, - -3 + -0.243973, - -7 + -0.21181, - 5 + -0.722984, - 1 + -0.679969, - 1 + -0.943541, - -5 + 0.705531, - -5 + -0.327772, - 3 + -0.462895, - -3 + 0.0536484, - -5 + -0.181505, - 1 + -0.89014, - 3 + -0.24572, - 3 + -0.890222, - -3 + 0.668824, - -1 + -0.785433, - -5 + -0.835302, - 7 + -0.464588, - -3 + -0.970526, - -7 + -0.881556, - 3 + -0.690873, - -7 + 0.627452, - 7 + 0.162041, - 1 + 0.574909, - -3 + -0.436167, - -7 + -0.415736, - -1 + -0.330565, - 3 + -0.0637465, - 1 + -0.952135, - 7 + 0.820211, - 1 + 0.670167, - 3 + -0.227245, - 3 + 0.784935, - -7 + -0.114356, - -7 + -0.79073, - -7 + -0.0845568, - -3 + 0.0352457, - -1 + 0.23913, - 3 + -0.319363, - -1 + -0.784674, - 7 + 0.182406, - -3 + -0.208943, - 1 + -0.0539068, - 5 + -0.793545, - 7 + -0.926668, - -3 + -0.327488, - -5 + 0.286006, - 5 + 0.755716, - -1 + 0.396711, - -5 + 0.50953, - -5 + 0.0396668, - -7 + 0.294158, - 7 + 0.191498, - 1 + -0.157408, - 1 + -0.341843, - 1 + 0.34502, - 1 + 0.892611, - 7 + 0.205394, - -3 + 0.558871, - -5 + 0.209696, - -1 + 0.119176, - 3 + -0.0071817, - -5 + -0.177535, - 3 + 0.909066, - -3 + -0.741923, - 1 + -0.539941, - -3 + -0.037078, - 1 + 0.791042, - -5 + 0.482362, - -5 + -0.0119576, - -3 + 0.52501, - -7 + 0.76094, - -7 + 0.813217, - 7 + 0.985842, - 3 + -0.529906, - 1 + -0.423377, - -3 + 0.0981717, - -3 + -0.223135, - -5 + -0.61793, - 5 + -0.559953, - 5 + -0.469591, - -1 + 0.342377, - 3 + -0.0782716, - 7 + -0.684588, - 7 + 0.389739, - 5 + 0.10658, - -5 + 0.922608, - 7 + 0.602939, - -1 + 0.464956, - 3 + -0.789037, - 5 + 0.429394, - 3 + -0.550469, - 1 + -0.900731, - -3 + -0.623247, - -7 + -0.650424, - -1 + 0.131661, - -1 + -0.806985, - 1 + 0.960326, - -1 + -0.193632, - 7 + 0.582939, - -1 + -0.468436, - 5 + 0.0584084, - -3 + 0.989501, - -7 + -0.836051, - -7 + 0.494241, - -3 + 0.338635, - -1 + -0.648491, - -3 + 0.319444, - 5 + -0.976509, - -7 + -0.560152, - 1 + 0.968145, - -3 + 0.506876, - 1 + -0.446687, - -3 + -0.557403, - -5 + 0.386343, - 7 + -0.26601, - 5 + 0.768097, - -1 + -0.862516, - 3 + 0.092811, - 1 + 0.688699, - -7 + 0.437148, - -7 + 0.819611, - -5 + 0.433439, - -3 + 0.0525214, - 7 + -0.875873, - -1 + -0.318693, - -7 + 0.941041, - 3 + -0.938497, - -5 + -0.700787, - -5 + -0.208713, - -1 + -0.926069, - 5 + 0.763435, - -3 + -0.753673, - -3 + -0.436892, - 5 + 0.25309, - 3 + 0.376517, - 7 + 0.234089, - -1 + 0.602584, - 7 + -0.729457, - -5 + 0.528713, - 5 + -0.0616122, - -5 + 0.485624, - -3 + 0.341517, - 3 + -0.364478, - 7 + 0.124957, - -1 + -0.27282, - 5 + 0.606241, - -7 + 0.409408, - -7 + 0.326685, - 1 + -0.778263, - -5 + -0.479604, - -5 + 0.454517, - 5 + -0.236371, - -5 + -0.208087, - -7 + -0.336902, - -3 + 0.704184, - -1 + -0.607403, - -1 + 0.790341, - -1 + -0.458402, - 3 + 0.29028, - -5 + 0.608615, - -5 + 0.064577, - 7 + -0.440438, - 7 + 0.518133, - 3 + -0.400959, - -5 + 0.957821, - -3 + 0.832433, - -7 + -0.941491, - -3 + -0.158894, - -3 + 0.735858, - -5 + -0.942659, - -7 + 0.362461, - -3 + 0.175003, - -3 + 0.756938, - 5 + -0.586989, - -3 + -0.867437, - -7 + 0.204605, - 7 + -0.447344, - 7 + 0.37656, - -7 + 0.548076, - 5 + -0.720016, - -7 + -0.533887, - -1 + 0.0948688, - -1 + 0.921622, - 5 + -0.363181, - 1 + 0.875163, - 1 + -0.975703, - -7 + -0.991177, - 3 + 0.142339, - -7 + -0.670125, - 7 + 0.835181, - -7 + -0.176508, - 7 + -0.391808, - -3 + 0.659639, - -7 + 0.311382, - -5 + 0.965804, - 3 + 0.127325, - 1 + -0.000208556, - -7 + -0.777168, - -3 + 0.467445, - -7 + -0.274472, - 7 + -0.125423, - -7 + -0.341567, - -7 + -0.152778, - 3 + 0.328462, - 3 + 0.96799, - 3 + -0.863599, diff --git a/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_output.dat b/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_output.dat deleted file mode 100644 index 462b664b5d..0000000000 --- a/gr-atsc/lib/qa_atsci_viterbi_decoder_t1_output.dat +++ /dev/null @@ -1,2484 +0,0 @@ -69, -35, -24, -72, -92, -92, -20, -88, -31, -124, -88, -87, -65, -30, -169, -225, -0, -98, -8, -39, -35, -233, -205, -67, -15, -37, -249, -114, -194, -215, -196, -7, -251, -93, -80, -215, -186, -228, -48, -217, -97, -137, -177, -163, -168, -90, -132, -168, -189, -140, -208, -224, -118, -158, -36, -134, -196, -29, -248, -134, -245, -189, -141, -240, -26, -221, -200, -212, -194, -248, -173, -35, -130, -95, -198, -42, -185, -74, -211, -119, -215, -164, -88, -78, -66, -124, -212, -6, -154, -204, -141, -143, -137, -27, -127, -164, -249, -72, -120, -187, -64, -38, -222, -195, -133, -165, -237, -63, -240, -193, -183, -199, -101, -15, -21, -168, -140, -233, -175, -38, -182, -60, -182, -64, -87, -53, -228, -80, -126, -93, -11, -191, -132, -234, -130, -10, -143, -112, -74, -127, -49, -2, -71, -150, -18, -93, -63, -158, -71, -238, -197, -253, -43, -123, -62, -130, -177, -35, -211, -47, -129, -223, -238, -6, -202, -112, -17, -89, -224, -91, -217, -17, -94, -33, -168, -112, -126, -231, -14, -197, -214, -212, -195, -1, -79, -1, -132, -1, -36, -87, -48, -165, -55, -30, -172, -1, -143, -189, -90, -112, -24, -52, -130, -119, -85, -42, -231, -211, -18, -246, -153, -232, -202, -92, -234, -26, -93, -110, -27, -130, -197, -75, -40, -253, -106, -212, -254, -250, -145, -89, -106, -170, -141, -236, -33, -227, -23, -9, -183, -41, -255, -80, -18, -201, -172, -252, -227, -10, -107, -255, -141, -49, -74, -181, -46, -181, -138, -44, -175, -27, -133, -26, -198, -19, -6, -232, -246, -29, -241, -174, -71, -240, -254, -90, -185, -171, -87, -157, -182, -194, -157, -67, -243, -232, -248, -34, -157, -130, -78, -77, -158, -212, -103, -100, -231, -110, -76, -222, -140, -61, -140, -211, -46, -138, -46, -232, -54, -133, -133, -236, -72, -35, -47, -59, -11, -40, -94, -168, -171, -172, -246, -74, -128, -93, -174, -104, -204, -251, -70, -88, -57, -210, -44, -103, -93, -90, -79, -148, -223, -213, -129, -39, -248, -177, -99, -4, -217, -193, -172, -133, -110, -162, -207, -239, -0, -126, -87, -205, -121, -158, -37, -179, -113, -81, -27, -207, -171, -107, -99, -139, -65, -228, -178, -58, -149, -22, -62, -111, -216, -234, -244, -70, -141, -195, -54, -142, -66, -141, -91, -187, -44, -129, -111, -157, -210, -138, -108, -126, -245, -208, -9, -55, -180, -188, -113, -74, -211, -175, -185, -171, -154, -174, -242, -40, -114, -40, -183, -180, -182, -19, -112, -226, -148, -223, -128, -103, -106, -237, -229, -96, -189, -239, -151, -114, -172, -8, -189, -127, -184, -118, -43, -83, -37, -29, -123, -151, -70, -50, -76, -252, -69, -188, -223, -218, -156, -96, -65, -6, -77, -39, -102, -11, -23, -254, -125, -195, -7, -59, -67, -191, -178, -111, -18, -215, -141, -142, -111, -211, -192, -187, -208, -6, -119, -176, -225, -19, -16, -34, -26, -94, -74, -128, -105, -97, -127, -231, -37, -134, -35, -104, -69, -213, -215, -88, -172, -101, -230, -27, -56, -167, -214, -9, -174, -78, -185, -143, -98, -202, -178, -124, -40, -253, -253, -146, -94, -124, -122, -131, -2, -157, -236, -72, -114, -196, -161, -31, -41, -136, -58, -98, -47, -17, -107, -222, -96, -37, -110, -194, -239, -32, -63, -24, -29, -60, -170, -124, -185, -37, -0, -188, -195, -237, -4, -53, -178, -165, -84, -219, -45, -143, -62, -93, -161, -169, -60, -1, -206, -170, -196, -190, -203, -4, -214, -232, -65, -129, -101, -250, -166, -102, -182, -105, -83, -186, -159, -5, -96, -244, -225, -142, -132, -31, -236, -37, -201, -40, -39, -152, -210, -236, -86, -157, -240, -44, -134, -49, -173, -235, -44, -83, -81, -226, -189, -165, -157, -93, -170, -254, -81, -140, -141, -213, -171, -121, -251, -117, -161, -35, -13, -116, -16, -99, -17, -0, -144, -152, -50, -61, -132, -95, -145, -214, -66, -79, -123, -223, -172, -38, -222, -254, -178, -107, -211, -94, -229, -207, -212, -134, -242, -225, -251, -2, -69, -12, -3, -214, -164, -54, -20, -40, -149, -165, -254, -215, -245, -122, -183, -162, -160, -150, -160, -83, -1, -116, -177, -230, -67, -133, -109, -54, -103, -104, -56, -173, -117, -60, -131, -26, -115, -151, -67, -9, -61, -65, -224, -50, -188, -152, -212, -92, -46, -116, -175, -48, -232, -97, -23, -44, -231, -132, -98, -78, -237, -155, -251, -98, -215, -126, -124, -74, -22, -191, -83, -83, -1, -52, -133, -189, -205, -90, -26, -252, -207, -202, -45, -183, -43, -68, -228, -19, -201, -70, -98, -182, -225, -93, -25, -185, -220, -150, -4, -243, -86, -88, -70, -88, -141, -203, -21, -90, -38, -48, -87, -245, -250, -132, -173, -38, -200, -145, -57, -145, -215, -156, -72, -185, -250, -98, -114, -215, -248, -119, -202, -78, -207, -16, -166, -92, -220, -188, -183, -2, -237, -14, -247, -231, -146, -164, -14, -91, -53, -72, -237, -13, -228, -53, -199, -222, -151, -57, -181, -144, -177, -127, -222, -128, -143, -133, -220, -107, -66, -147, -109, -47, -162, -101, -23, -52, -9, -37, -143, -63, -110, -125, -77, -82, -179, -20, -49, -75, -78, -230, -219, -255, -102, -186, -127, -246, -64, -92, -98, -130, -240, -208, -177, -146, -53, -200, -198, -63, -238, -86, -127, -92, -212, -204, -175, -135, -224, -224, -210, -47, -199, -173, -46, -45, -104, -174, -36, -168, -10, -134, -42, -250, -86, -220, -141, -139, -165, -83, -203, -148, -170, -74, -241, -126, -22, -160, -6, -247, -128, -216, -38, -72, -134, -85, -117, -238, -3, -153, -151, -13, -32, -194, -8, -118, -158, -149, -2, -68, -233, -205, -217, -148, -23, -202, -19, -46, -106, -25, -38, -235, -241, -76, -51, -120, -162, -169, -103, -165, -66, -254, -179, -98, -192, -188, -217, -95, -82, -219, -164, -59, -169, -125, -208, -193, -71, -227, -239, -177, -252, -22, -157, -238, -98, -208, -102, -5, -121, -206, -170, -188, -204, -94, -31, -141, -26, -248, -237, -108, -212, -146, -168, -125, -15, -120, -62, -87, -91, -46, -9, -88, -68, -166, -70, -167, -118, -173, -172, -240, -124, -87, -172, -72, -181, -203, -214, -207, -196, -196, -59, -152, -86, -228, -21, -102, -92, -84, -190, -183, -131, -199, -16, -199, -110, -86, -110, -229, -4, -27, -213, -128, -114, -129, -201, -39, -77, -160, -247, -17, -100, -51, -169, -187, -23, -191, -33, -115, -20, -223, -43, -151, -167, -59, -94, -21, -146, -205, -251, -150, -233, -208, -23, -91, -82, -224, -131, -159, -129, -122, -177, -229, -173, -91, -160, -196, -27, -194, -56, -47, -162, -99, -198, -74, -159, -37, -95, -49, -243, -91, -200, -220, -43, -223, -55, -126, -192, -187, -29, -65, -53, -207, -39, -226, -42, -200, -167, -69, -138, -223, -116, -45, -67, -59, -119, -226, -97, -215, -20, -84, -50, -221, -48, -94, -188, -104, -220, -125, -35, -249, -191, -89, -200, -230, -60, -243, -175, -227, -56, -57, -195, -173, -103, -7, -233, -222, -234, -74, -181, -254, -158, -232, -219, -207, -70, -152, -56, -34, -22, -92, -28, -213, -181, -229, -188, -241, -216, -107, -213, -17, -165, -153, -190, -12, -160, -167, -235, -139, -242, -161, -138, -144, -137, -101, -96, -208, -254, -152, -242, -20, -244, -14, -234, -170, -243, -167, -155, -204, -19, -113, -221, -184, -11, -156, -197, -171, -68, -177, -55, -54, -82, -193, -199, -220, -39, -39, -172, -37, -192, -158, -58, -180, -173, -37, -94, -161, -204, -250, -109, -224, -108, -75, -153, -119, -232, -94, -35, -45, -15, -90, -99, -98, -27, -43, -62, -66, -83, -234, -104, -20, -137, -162, -201, -54, -200, -39, -215, -149, -34, -69, -117, -142, -144, -14, -6, -121, -109, -41, -166, -125, -131, -10, -223, -159, -53, -29, -225, -137, -8, -74, -157, -145, -237, -102, -200, -181, -142, -159, -74, -177, -229, -192, -64, -118, -207, -70, -239, -60, -111, -149, -185, -243, -160, -153, -146, -214, -182, -116, -95, -191, -190, -253, -80, -171, -99, -25, -97, -242, -185, -172, -163, -158, -108, -228, -20, -59, -42, -4, -120, -154, -154, -49, -141, -58, -202, -32, -16, -129, -149, -112, -65, -83, -109, -146, -255, -209, -171, -96, -196, -100, -13, -103, -2, -121, -76, -23, -181, -118, -28, -45, -17, -183, -95, -158, -241, -42, -191, -2, -172, -84, -115, -237, -168, -224, -127, -168, -178, -42, -8, -118, -142, -22, -222, -145, -143, -42, -169, -69, -160, -197, -114, -177, -124, -210, -80, -110, -252, -16, -113, -168, -101, -228, -149, -13, -197, -20, -181, -119, -63, -190, -237, -206, -212, -203, -95, -100, -245, -9, -169, -150, -207, -28, -72, -76, -238, -153, -186, -234, -169, -44, -146, -14, -17, -40, -28, -214, -61, -209, -77, -125, -144, -59, -75, -100, -6, -171, -200, -252, -180, -114, -147, -131, -142, -219, -207, -124, -117, -138, -102, -31, -183, -249, -45, -200, -34, -74, -158, -96, -27, -236, -221, -172, -39, -40, -16, -46, -212, -217, -43, -136, -75, -190, -11, -217, -154, -219, -85, -15, -102, -188, -46, -29, -182, -92, -229, -217, -166, -131, -57, -194, -112, -22, -110, -151, -63, -127, -197, -19, -88, -241, -156, -163, -175, -168, -125, -73, -131, -211, -88, -233, -143, -135, -7, -70, -227, -236, -31, -138, -112, -88, -77, -224, -111, -187, -120, -174, -59, -62, -194, -147, -47, -94, -55, -222, -6, -180, -40, -138, -135, -129, -116, -23, -8, -123, -93, -236, -103, -125, -118, -216, -213, -195, -184, -69, -127, -49, -244, -187, -111, -182, -78, -158, -21, -134, -125, -27, -59, -165, -165, -195, -38, -25, -218, -47, -149, -56, -27, -252, -181, -146, -213, -139, -86, -142, -208, -213, -191, -196, -145, -46, -123, -223, -205, -144, -102, -75, -171, -161, -240, -81, -101, -23, -107, -64, -70, -0, -120, -98, -253, -46, -244, -210, -185, -74, -96, -138, -32, -32, -78, -177, -79, -201, -145, -28, -89, -248, -103, -5, -154, -88, -87, -255, -112, -195, -63, -183, -196, -184, -25, -193, -230, -14, -148, -160, -89, -245, -42, -122, -21, -121, -43, -100, -67, -189, -129, -157, -182, -233, -162, -80, -65, -250, -80, -178, -190, -143, -105, -130, -72, -131, -67, -47, -145, -216, -208, -235, -205, -251, -101, -227, -116, -145, -71, -183, -78, -201, -84, -4, -178, -247, -85, -244, -242, -165, -166, -176, -53, -16, -50, -126, -147, -118, -173, -37, -78, -125, -16, -28, -120, -117, -0, -237, -6, -71, -164, -85, -17, -249, -90, -195, -240, -175, -184, -227, -85, -94, -147, -138, -110, -197, -8, -2, -60, -182, -39, -139, -51, -55, -167, -172, -173, -167, -153, -179, -239, -62, -9, -1, -55, -99, -196, -40, -19, -124, -12, -104, -219, -159, -243, -74, -101, -251, -76, -161, -178, -115, -44, -230, -171, -212, -146, -88, -124, -44, -12, -108, -107, -21, -109, -163, -121, -50, -204, -140, -175, -216, -244, -138, -119, -232, -213, -221, -228, -33, -127, -150, -149, -172, -124, -64, -129, -15, -153, -253, -59, -166, -105, -167, -187, -215, -74, -53, -9, -22, -193, -184, -238, -182, -67, -102, -158, -24, -68, -130, -58, -195, -24, -207, -111, -149, -16, -240, -164, -170, -238, -224, -80, -88, -135, -12, -47, -209, -65, -57, -232, -2, -242, -215, -185, -53, -62, -87, -78, -130, -218, -136, -69, -243, -87, -181, -136, -104, -166, -44, -18, -148, -13, -99, -237, -148, -111, -28, -102, -176, -86, -79, -179, -72, -38, -109, -125, -100, -197, -203, -231, -159, -83, -44, -146, -171, -226, -27, -20, -137, -72, -39, -29, -85, -138, -10, -234, -249, -39, -81, -170, -125, -160, -94, -197, -198, -203, -67, -43, -145, -15, -18, -48, -98, -63, -195, -14, -34, -222, -35, -171, -39, -74, -201, -125, -212, -212, -103, -206, -251, -185, -121, -121, -89, -215, -63, -32, -163, -130, -75, -52, -145, -94, -101, -244, -158, -40, -3, -192, -7, -38, -107, -47, -113, -52, -172, -69, -8, -20, -20, -4, -205, -141, -126, -38, -101, -189, -71, -9, -64, -147, -62, -210, -241, -163, -198, -143, -204, -202, -80, -212, -241, -187, -4, -98, -240, -176, -168, -249, -197, -188, -254, -146, -73, -124, -185, -175, -57, -1, -184, -122, -148, -246, -76, -134, -154, -19, -21, -102, -222, -102, -59, -207, -33, -63, -49, -18, -240, -218, -11, -181, -150, -9, -72, -224, -134, -2, -143, -192, -3, -71, -58, -151, -62, -135, -29, -216, -154, -51, -63, -120, -153, -123, -72, -187, -187, -122, -206, -171, -84, -218, -97, -234, -228, -169, -203, -106, -172, -90, -42, -175, -162, -101, -71, -224, -236, -101, -185, -135, -153, -248, -0, -51, -116, -72, -238, -47, -194, -189, -218, -22, -151, -60, -1, -123, -230, -204, -230, -146, -38, -17, -66, -200, -118, -137, -169, -99, -239, -98, -234, -136, -91, -234, -187, -208, -51, -170, -255, -245, -103, -218, -11, -255, -22, -12, -123, -252, -217, -97, -142, -255, -115, -208, -200, -234, -90, -114, -77, -73, -212, -56, -209, -48, -35, -141, -0, -86, -55, -0, -75, -159, -218, -87, -159, -240, -100, -26, -237, -61, -124, -124, -61, -239, -77, -6, -218, -167, -120, -39, -241, -77, -96, -195, -125, -132, -80, -126, -218, -136, -126, -38, -40, -88, -126, -199, -73, -226, -225, -55, -32, -94, -179, -94, -78, -1, -100, -40, -168, -220, -80, -154, -41, -177, -93, -167, -53, -173, -37, -16, -54, -164, -55, -94, -253, -181, -37, -70, -152, -7, -126, -184, -102, -50, -22, -180, -51, -123, -221, -220, -87, -46, -118, -129, -223, -211, -41, -20, -129, -78, -37, -183, -243, -92, -21, -240, -17, -59, -55, -169, -67, -181, -98, -170, -231, -121, -94, -27, -244, -60, -247, -76, -106, -109, -206, -73, -64, -247, -94, -193, -70, -131, -121, -57, -223, -143, -41, -241, -203, -97, -155, -14, -23, -253, -184, -255, -119, -23, -26, -108, -83, -17, -184, -190, -127, -135, -7, -191, -126, -102, -129, -196, -233, -251, -254, -200, -138, -40, -186, -85, -137, -85, -100, -160, -83, -29, -159, -202, -53, -185, -54, -137, -203, -239, -71, -74, -119, -79, -10, -245, -181, -140, -186, -158, -135, -184, -103, -18, -224, -33, -103, -106, -118, -204, -10, -201, -234, -170, -147, -31, -99, -202, -168, -47, -186, -239, -121, -50, -62, -131, -39, -243, -15, -225, -146, -151, -154, -249, -169, -123, -26, -17, -229, -145, -221, -239, -90, -199, -153, -238, -230, -253, -185, -142, -44, -116, -126, -166, -166, -189, -41, -206, -176, -57, -176, -67, -208, -74, -60, -121, -197, -87, -138, -170, -232, -104, -154, -67, -48, -52, -50, -22, -49, -236, -165, -94, -96, -36, -4, -7, -225, -46, -213, -146, -104, -133, -213, -57, -207, -18, -178, -149, -105, -61, -63, -82, -166, -218, -150, -214, -14, -200, -237, -64, -180, -147, -159, -21, -183, -164, -28, -152, -210, -241, -42, -59, -118, -0, -116, -70, -18, diff --git a/gr-atsc/lib/qa_convolutional_interleaver.cc b/gr-atsc/lib/qa_convolutional_interleaver.cc deleted file mode 100644 index c7b8494f1e..0000000000 --- a/gr-atsc/lib/qa_convolutional_interleaver.cc +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cppunit/TestAssert.h> -#include "qa_convolutional_interleaver.h" - -void -qa_convolutional_interleaver::t0 () -{ - static int input[16] = { - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10, 11, 12, - 13, 14, 15, 16 - }; - - static int output[16] = { - 1, 0, 0, 0, - 5, 2, 0, 0, - 9, 6, 3, 0, - 13, 10, 7, 4 - }; - - // test interleaver - intl = new convolutional_interleaver<int>(true, 4, 1); - - for (int i = 0; i < 16; i++) - CPPUNIT_ASSERT_EQUAL (output[i], intl->transform (input[i])); -} - -void -qa_convolutional_interleaver::t1 () -{ - static int input[16] = { - 1, 0, 0, 0, - 5, 2, 0, 0, - 9, 6, 3, 0, - 13, 10, 7, 4 - }; - - static int output[16] = { - 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0, 0, - 1, 2, 3, 4 - }; - - // test deinterleaver - intl = new convolutional_interleaver<int>(false, 4, 1); - - for (int i = 0; i < 16; i++) - CPPUNIT_ASSERT_EQUAL (output[i], intl->transform (input[i])); -} - -void -qa_convolutional_interleaver::t2 () -{ - intl = new convolutional_interleaver<int>(true, 4, 1); - deintl = new convolutional_interleaver<int>(false, 4, 1); - - int icount = 6000; - int dcount = 6000; - - int end_to_end_delay = intl->end_to_end_delay (); - for (int i = 0; i < end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (0, deintl->transform (intl->transform (icount++))); - } - - for (int i = 0; i < 3 * end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (dcount++, deintl->transform (intl->transform (icount++))); - } -} - -void -qa_convolutional_interleaver::t3 () -{ - intl = new convolutional_interleaver<int>(true, 4, 2); - deintl = new convolutional_interleaver<int>(false, 4, 2); - - int icount = 6000; - int dcount = 6000; - - int end_to_end_delay = intl->end_to_end_delay (); - for (int i = 0; i < end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (0, deintl->transform (intl->transform (icount++))); - } - - for (int i = 0; i < 3 * end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (dcount++, deintl->transform (intl->transform (icount++))); - } -} - -void -qa_convolutional_interleaver::t4 () -{ - intl = new convolutional_interleaver<int>(true, 52, 4); - deintl = new convolutional_interleaver<int>(false, 52, 4); - - int icount = 6000; - int dcount = 6000; - - int end_to_end_delay = intl->end_to_end_delay (); - CPPUNIT_ASSERT_EQUAL (10608, end_to_end_delay); - - for (int i = 0; i < end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (0, deintl->transform (intl->transform (icount++))); - } - - for (int i = 0; i < 3 * end_to_end_delay; i++){ - CPPUNIT_ASSERT_EQUAL (dcount++, deintl->transform (intl->transform (icount++))); - } -} diff --git a/gr-atsc/lib/qa_convolutional_interleaver.h b/gr-atsc/lib/qa_convolutional_interleaver.h deleted file mode 100644 index 5fc73dd70c..0000000000 --- a/gr-atsc/lib/qa_convolutional_interleaver.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_CONVOLUTIONAL_INTERLEAVER_H_ -#define _QA_CONVOLUTIONAL_INTERLEAVER_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/convolutional_interleaver.h> - -class qa_convolutional_interleaver : public CppUnit::TestCase { - private: - convolutional_interleaver<int> *intl; - convolutional_interleaver<int> *deintl; - - CPPUNIT_TEST_SUITE (qa_convolutional_interleaver); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST (t2); - CPPUNIT_TEST (t3); - CPPUNIT_TEST (t4); - CPPUNIT_TEST_SUITE_END (); - - public: - - void setUp (){ - intl = 0; - deintl = 0; - } - - void tearDown (){ - delete intl; - intl = 0; - delete deintl; - deintl = 0; - } - - private: - - void t0 (); - void t1 (); - void t2 (); - void t3 (); - void t4 (); - -}; - - -#endif /* _QA_CONVOLUTIONAL_INTERLEAVER_H_ */ diff --git a/gr-atsc/lib/qa_interleaver_fifo.cc b/gr-atsc/lib/qa_interleaver_fifo.cc deleted file mode 100644 index 7ce98630ec..0000000000 --- a/gr-atsc/lib/qa_interleaver_fifo.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 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 <cppunit/TestAssert.h> -#include "qa_interleaver_fifo.h" - -void -qa_interleaver_fifo::t0 () -{ - fifo = new interleaver_fifo<int>(0); - - for (int i = 10; i < 20; i++) - CPPUNIT_ASSERT_EQUAL (i, fifo->stuff (i)); -} - -void -qa_interleaver_fifo::t1 () -{ - fifo = new interleaver_fifo<int>(1); - - CPPUNIT_ASSERT_EQUAL (0, fifo->stuff (2)); - - for (int i = 1; i < 10; i++) - CPPUNIT_ASSERT_EQUAL (i * 2, fifo->stuff ((i + 1) * 2)); -} - -void -qa_interleaver_fifo::t2 () -{ - fifo = new interleaver_fifo<int>(4); - - CPPUNIT_ASSERT_EQUAL (0, fifo->stuff (1)); - CPPUNIT_ASSERT_EQUAL (0, fifo->stuff (2)); - CPPUNIT_ASSERT_EQUAL (0, fifo->stuff (3)); - CPPUNIT_ASSERT_EQUAL (0, fifo->stuff (4)); - - for (int i = 5; i < 20; i++) - CPPUNIT_ASSERT_EQUAL (i - 4, fifo->stuff (i)); -} diff --git a/gr-atsc/lib/qa_interleaver_fifo.h b/gr-atsc/lib/qa_interleaver_fifo.h deleted file mode 100644 index 9fea65a748..0000000000 --- a/gr-atsc/lib/qa_interleaver_fifo.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_INTERLEAVER_FIFO_H_ -#define _QA_INTERLEAVER_FIFO_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -#include <gnuradio/atsc/interleaver_fifo.h> - -class qa_interleaver_fifo : public CppUnit::TestCase { - private: - interleaver_fifo<int> *fifo; - - public: - - void tearDown (){ - delete fifo; - fifo = 0; - } - - CPPUNIT_TEST_SUITE (qa_interleaver_fifo); - CPPUNIT_TEST (t0); - CPPUNIT_TEST (t1); - CPPUNIT_TEST (t2); - CPPUNIT_TEST_SUITE_END (); - - private: - - void t0 (); - void t1 (); - void t2 (); - -}; - - -#endif /* _QA_INTERLEAVER_FIFO_H_ */ diff --git a/gr-atsc/lib/test_atsci.cc b/gr-atsc/lib/test_atsci.cc deleted file mode 100644 index edbe24f0b6..0000000000 --- a/gr-atsc/lib/test_atsci.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006,2010,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gnuradio/unittests.h> -#include <cppunit/TextTestRunner.h> -#include <cppunit/XmlOutputter.h> -#include "qa_atsci.h" -#include <fstream> - -int -main (int argc, char **argv) -{ - CppUnit::TextTestRunner runner; - std::ofstream xmlfile(get_unittest_path("gr_atsc.xml").c_str()); - CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile); - - runner.addTest (qa_atsc::suite ()); - runner.setOutputter(xmlout); - - bool was_successful = runner.run ("", false); - - return was_successful ? 0 : 1; -} diff --git a/gr-atsc/python/atsc/CMakeLists.txt b/gr-atsc/python/atsc/CMakeLists.txt deleted file mode 100644 index a26df35424..0000000000 --- a/gr-atsc/python/atsc/CMakeLists.txt +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2011-2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Install python examples -######################################################################## -include(GrPython) - -GR_PYTHON_INSTALL( - FILES - __init__.py - atsc_utils.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio/atsc - COMPONENT "atsc_python" -) - -GR_PYTHON_INSTALL( - PROGRAMS - atsc_rx.py - DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc - COMPONENT "atsc_examples" -) - -install( - FILES README - DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc - COMPONENT "atsc_examples" -) - -######################################################################## -# Handle the unit tests -######################################################################## -if(ENABLE_TESTING) - - set(GR_TEST_TARGET_DEPS "") - set(GR_TEST_LIBRARY_DIRS "") - set(GR_TEST_PYTHON_DIRS - ${CMAKE_BINARY_DIR}/gnuradio-runtime/python - ) - - include(GrTest) - file(GLOB py_qa_test_files "qa_*.py") - foreach(py_qa_test_file ${py_qa_test_files}) - get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) - endforeach(py_qa_test_file) -endif(ENABLE_TESTING) diff --git a/gr-atsc/python/atsc/README b/gr-atsc/python/atsc/README deleted file mode 100644 index 38772c2f10..0000000000 --- a/gr-atsc/python/atsc/README +++ /dev/null @@ -1,19 +0,0 @@ -Decoding ATSC using 6.4MSps rate ---------------------------------- - -1) Verify signal, adjust antenna and find best gain setting using uhd_fft.py, -station frequency from the fcc video database, and sample rate to 6.4e6. - -2) Capture data - adjust gain (-g) frequency (-f) and which side -the daughterboard is on to fit your local setup: - -uhd_rx_cfile.py -s --samp-rate=6.4e6 -g 65 -f 503e6 atsc_data_6-4m_complex - -You probably still need fast disks to take the data, like a raid-0 set of -striped sata drives. Make sure there are no or very few Ou overruns. Saving -the raw usrp data in 'short' form halves the disk space/bus bandwidth that -the usual complex form uses. - -3) Run atsc_rx.py: - -./atsc_rx.py atsc_data_6-4m_complex outfile.ts
\ No newline at end of file diff --git a/gr-atsc/python/atsc/__init__.py b/gr-atsc/python/atsc/__init__.py deleted file mode 100644 index 155baa2547..0000000000 --- a/gr-atsc/python/atsc/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright 2013 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. -# - -# The presence of this file turns this directory into a Python package - -''' -Blocks and utilities for ATSC (Advanced Television Systems Committee) module. -''' -import os - -try: - from atsc_swig import * -except ImportError: - dirname, filename = os.path.split(os.path.abspath(__file__)) - __path__.append(os.path.join(dirname, "..", "..", "swig")) - from atsc_swig import * diff --git a/gr-atsc/python/atsc/atsc_rx.py b/gr-atsc/python/atsc/atsc_rx.py deleted file mode 100755 index 940eeac4bd..0000000000 --- a/gr-atsc/python/atsc/atsc_rx.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env /usr/bin/python -# -# Copyright 2004, 2013 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 2, 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., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This module starts the atsc processing chain taking the captured -# off-air signal created with: -# -# uhd_rx_cfile.py --samp-rate=6.4e6 -# -f <center of tv signal channel freq> -# -g <appropriate gain for best signal / noise> -# -s output shorts -# -# This python script converts from interleaved shorts to the complex data type, -# then multiplies the sample rate by 3, from 6.4e6 to 19.2e6 -# complex samples / sec, then lowpass filters with a cutoff of 3.2MHz -# and a transition band width of .5MHz. Center of the tv channels is -# now at 0 with edges at -3.2MHz and 3.2MHz. This puts the pilot at -# -3MHz + 309KHz. Next a root raised cosine filter is aplied to match the one -# in the transmitter and thus reduce ISI. The phased locked loop then locks to -# the pilot and outputs just the real part of the signal ( as information is -# not stored in the phase with atsc ), this is then feed to the bit lock -# loop, this looks for the bit sync marker put at the beginning of every segment -# field, this then adjusts the timing so the amplitude will be sampled at the -# correct sample ( sub-sample is used in this case ). -# -# Output is float. - -from gnuradio import gr, analog, atsc -from gnuradio import blocks -from gnuradio import filter -import sys, math, os - -def graph (args): - - print os.getpid() - - nargs = len(args) - if nargs == 2: - infile = args[0] - outfile = args[1] - else: - raise ValueError('usage: interp.py input_file output_file.ts\n') - - input_rate = 19.2e6 - IF_freq = 5.75e6 - - tb = gr.top_block() - - # Read from input file - srcf = blocks.file_source(gr.sizeof_short, infile) - - # Convert interleaved shorts (I,Q,I,Q) to complex - is2c = blocks.interleaved_short_to_complex() - - # 1/2 as wide because we're designing lp filter - symbol_rate = atsc.ATSC_SYMBOL_RATE/2. - NTAPS = 279 - tt = filter.firdes.root_raised_cosine (1.0, input_rate / 3, symbol_rate, .1152, NTAPS) - rrc = filter.fir_filter_ccf(1, tt) - - # Interpolate Filter our 6MHz wide signal centered at 0 - ilp_coeffs = filter.firdes.low_pass(1, input_rate, 3.2e6, .5e6, filter.firdes.WIN_HAMMING) - ilp = filter.interp_fir_filter_ccf(3, ilp_coeffs) - - # Move the center frequency to 5.75MHz ( this wont be needed soon ) - duc_coeffs = filter.firdes.low_pass ( 1, 19.2e6, 9e6, 1e6, filter.firdes.WIN_HAMMING ) - duc = filter.freq_xlating_fir_filter_ccf ( 1, duc_coeffs, -5.75e6, 19.2e6 ) - - # fpll input is float - c2f = blocks.complex_to_float() - - # Phase locked loop - fpll = atsc.fpll() - - # Clean fpll output - lp_coeffs2 = filter.firdes.low_pass (1.0, - input_rate, - 5.75e6, - 120e3, - filter.firdes.WIN_HAMMING); - lp_filter = filter.fir_filter_fff (1, lp_coeffs2) - - # Remove pilot ( at DC now ) - iir = filter.single_pole_iir_filter_ff(1e-5) - remove_dc = blocks.sub_ff() - - # Bit Timing Loop, Field Sync Checker and Equalizer - btl = atsc.bit_timing_loop() - fsc = atsc.fs_checker() - eq = atsc.equalizer() - fsd = atsc.field_sync_demux() - - # Viterbi - viterbi = atsc.viterbi_decoder() - deinter = atsc.deinterleaver() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - depad = atsc.depad() - - # Write to output file - outf = blocks.file_sink(gr.sizeof_char,outfile) - - # Connect it all together - tb.connect( srcf, is2c, rrc, ilp, duc, c2f, fpll, lp_filter) - tb.connect( lp_filter, iir ) - tb.connect( lp_filter, (remove_dc, 0) ) - tb.connect( iir, (remove_dc, 1) ) - tb.connect( remove_dc, btl ) - tb.connect( (btl, 0), (fsc, 0), (eq, 0), (fsd,0) ) - tb.connect( (btl, 1), (fsc, 1), (eq, 1), (fsd,1) ) - tb.connect( fsd, viterbi, deinter, rs_dec, derand, depad, outf ) - - tb.run() - -if __name__ == '__main__': - graph (sys.argv[1:]) - diff --git a/gr-atsc/python/atsc/atsc_utils.py b/gr-atsc/python/atsc/atsc_utils.py deleted file mode 100644 index fc2465bed2..0000000000 --- a/gr-atsc/python/atsc/atsc_utils.py +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright 2006 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. -# - -import random -import sys - -MPEG_SYNC_BYTE = 0x47 - -def make_fake_transport_stream_packet(npkts): - """ - Return a sequence of 8-bit ints that represents an MPEG Transport Stream packet. - - Args: - npkts: how many 188-byte packets to return - - FYI, each ATSC Data Frame contains two Data Fields, each of which contains - 312 data segments. Each transport stream packet maps to a data segment. - """ - r = [0] * (npkts * 188) - i = 0 - for j in range(npkts): - r[i+0] = MPEG_SYNC_BYTE - r[i+1] = random.randint(0, 127) # top bit (transport error bit) clear - i = i + 2 - for n in range(186): - r[i + n] = random.randint(0, 255) - i = i + 186 - - return r - - -def pad_stream(src, sizeof_total, sizeof_pad): - sizeof_valid = sizeof_total - sizeof_pad - assert sizeof_valid > 0 - assert (len(src) % sizeof_valid) == 0 - npkts = len(src) // sizeof_valid - dst = [0] * (npkts * sizeof_total) - for i in range(npkts): - src_s = i * sizeof_valid - dst_s = i * sizeof_total - dst[dst_s:dst_s + sizeof_valid] = src[src_s:src_s + sizeof_valid] - return dst - - -def depad_stream(src, sizeof_total, sizeof_pad): - sizeof_valid = sizeof_total - sizeof_pad - assert sizeof_valid > 0 - assert (len(src) % sizeof_total) == 0 - npkts = len(src) // sizeof_total - dst = [0] * (npkts * sizeof_valid) - for i in range(npkts): - src_s = i * sizeof_total - dst_s = i * sizeof_valid - dst[dst_s:dst_s + sizeof_valid] = src[src_s:src_s + sizeof_valid] - return dst - - diff --git a/gr-atsc/python/atsc/qa_atsc.py b/gr-atsc/python/atsc/qa_atsc.py deleted file mode 100755 index e6ea81a50e..0000000000 --- a/gr-atsc/python/atsc/qa_atsc.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2006,2007,2013 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. -# - -import sys - -from gnuradio import gr, gr_unittest, atsc, blocks -from gnuradio.atsc import atsc_utils - - -class memoize(object): - def __init__(self, thunk): - self.thunk = thunk - self.cached = False - self.value = None - - def __call__(self): - if self.cached: - return self.value - self.value = self.thunk() - self.cached = True - return self.value - - -""" -Make a fake transport stream that's big enough for our purposes. -We generate 8 full fields. This is relatively expensive. It -takes about 2 seconds to execute. -""" -make_transport_stream = \ - memoize(lambda : tuple(atsc_utils.make_fake_transport_stream_packet(8 * atsc.ATSC_DSEGS_PER_FIELD))) - - -def pad_transport_stream(src): - """ - An MPEG transport stream packet is 188 bytes long. Internally we use a packet - that is 256 bytes long to help with buffer alignment. This function adds the - appropriate trailing padding to convert each packet from 188 to 256 bytes. - """ - return atsc_utils.pad_stream(src, atsc.sizeof_atsc_mpeg_packet, atsc.sizeof_atsc_mpeg_packet_pad) - - -def depad_transport_stream(src): - """ - An MPEG transport stream packet is 188 bytes long. Internally we use a packet - that is 256 bytes long to help with buffer alignment. This function removes the - trailing padding to convert each packet from 256 back to 188 bytes. - """ - return atsc_utils.depad_stream(src, atsc.sizeof_atsc_mpeg_packet, atsc.sizeof_atsc_mpeg_packet_pad) - - -class vector_source_ts(gr.hier_block2): - """ - MPEG Transport stream source for testing. - """ - def __init__(self, ts): - """ - Pad tranport stream packets to 256 bytes and reformat appropriately. - - Args: - ts: MPEG transport stream. (sequence of ints in [0,255]; len(ts) % 188 == 0) - """ - - src = blocks.vector_source_b(pad_transport_stream(ts)) - s2v = blocks.stream_to_vector(gr.sizeof_char, atsc.sizeof_atsc_mpeg_packet) - - gr.hier_block2.__init__(self, "vector_source_ts", - gr.io_signature(0, 0, 0), - s2v.output_signature()) - self.connect(src, s2v, self) - - -class vector_sink_ts(gr.hier_block2): - """ - MPEG Transport stream sink for testing. - """ - def __init__(self): - """ - """ - - v2s = blocks.vector_to_stream(gr.sizeof_char, atsc.sizeof_atsc_mpeg_packet) - self.sink = blocks.vector_sink_b() - gr.hier_block2.__init__(self, "vector_sink_ts", - v2s.input_signature(), - gr.io_signature(0, 0, 0)) - self.connect(self, v2s, self.sink) - - def data(self): - """ - Extracts tranport stream from sink and returns it to python. - - Depads tranport stream packets from 256 back to 188 bytes. - @rtype: tuple of ints in [0,255]; len(result) % 188 == 0 - """ - return tuple(depad_transport_stream(self.sink.data())) - - - -class qa_atsc(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block() - - def tearDown(self): - self.tb = None - - - # The tests are run in alphabetical order - - def test_loopback_000(self): - """ - Loopback randomizer to derandomizer - """ - src_data = make_transport_stream() - expected_result = src_data - - src = vector_source_ts(src_data) - rand = atsc.randomizer() - derand = atsc.derandomizer() - dst = vector_sink_ts() - - self.tb.connect(src, rand) - self.tb.connect(rand, derand) - self.tb.connect(derand, dst) - self.tb.run() - - result_data = dst.data () - self.assertEqual (expected_result, result_data) - - def est_loopback_001(self): - """ - Loopback randomizer/rs_encoder to rs_decoder/derandomizer - """ - src_data = make_transport_stream() - expected_result = src_data - - src = vector_source_ts(src_data) - rand = atsc.randomizer() - rs_enc = atsc.rs_encoder() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - dst = vector_sink_ts() - self.tb.connect(src, rand, rs_enc, rs_dec, derand, dst) - self.tb.run () - result_data = dst.data () - self.assertEqual (expected_result, result_data) - - def est_loopback_002(self): - """ - Loopback randomizer/rs_encoder/interleaver to - deinterleaver/rs_decoder/derandomizer - """ - src_data = make_transport_stream() - interleaver_delay = 52 - expected_result = src_data[0:len(src_data)-(interleaver_delay*atsc.ATSC_MPEG_PKT_LENGTH)] - - src = vector_source_ts(src_data) - rand = atsc.randomizer() - rs_enc = atsc.rs_encoder() - inter = atsc.interleaver() - deinter = atsc.deinterleaver() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - dst = vector_sink_ts() - self.tb.connect(src, rand, rs_enc, inter, deinter, rs_dec, derand, dst) - self.tb.run () - result_data = dst.data () - result_data = result_data[(interleaver_delay*atsc.ATSC_MPEG_PKT_LENGTH):len(result_data)] - self.assertEqual (expected_result, result_data) - - - def est_loopback_003(self): - """ - Loopback randomizer/rs_encoder/interleaver/trellis_encoder - via ds_to_softds to - viterbi_decoder/deinterleaver/rs_decoder/derandomizer - """ - src_data = make_transport_stream() - interleaver_delay = 52 - viterbi_delay = 12 - expected_result = src_data[0:len(src_data)-((interleaver_delay+viterbi_delay)*atsc.ATSC_MPEG_PKT_LENGTH)] - - src = vector_source_ts(src_data) - rand = atsc.randomizer() - rs_enc = atsc.rs_encoder() - inter = atsc.interleaver() - trellis = atsc.trellis_encoder() - softds = atsc.ds_to_softds() - viterbi = atsc.viterbi_decoder() - deinter = atsc.deinterleaver() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - dst = vector_sink_ts() - self.tb.connect(src, rand, rs_enc, inter, trellis, softds, viterbi, deinter, rs_dec, derand, dst) - self.tb.run () - result_data = dst.data ()[((interleaver_delay+viterbi_delay)*atsc.ATSC_MPEG_PKT_LENGTH):len(dst.data())] - self.assertEqual (expected_result, result_data) - - -if __name__ == '__main__': - gr_unittest.main() - - - - - - diff --git a/gr-atsc/swig/CMakeLists.txt b/gr-atsc/swig/CMakeLists.txt deleted file mode 100644 index 8d02a00c23..0000000000 --- a/gr-atsc/swig/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup swig generation -######################################################################## -include(GrPython) -include(GrSwig) - -set(GR_SWIG_INCLUDE_DIRS - ${GR_ATSC_INCLUDE_DIRS} - ${GR_FILTER_INCLUDE_DIRS} - ${GR_BLOCKS_INCLUDE_DIRS} - ${GR_ANALOG_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${FFTW3F_INCLUDE_DIRS} -) - -if(ENABLE_GR_CTRLPORT) - list(APPEND GR_SWIG_FLAGS "-DGR_CTRLPORT") -endif(ENABLE_GR_CTRLPORT) - -set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/atsc_swig_doc.i) -set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/atsc) -set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc) -set(GR_SWIG_LIBRARIES gnuradio-atsc gnuradio-fft) - -GR_SWIG_MAKE(atsc_swig atsc_swig.i) - -GR_SWIG_INSTALL( - TARGETS atsc_swig - DESTINATION ${GR_PYTHON_DIR}/gnuradio/atsc - COMPONENT "atsc_python" -) - -install( - FILES - atsc_swig.i - ${CMAKE_CURRENT_BINARY_DIR}/atsc_swig_doc.i - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig - COMPONENT "atsc_swig" -) diff --git a/gr-atsc/swig/atsc_swig.i b/gr-atsc/swig/atsc_swig.i deleted file mode 100644 index 8505a18204..0000000000 --- a/gr-atsc/swig/atsc_swig.i +++ /dev/null @@ -1,301 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" - -//load generated python docstrings -%include "atsc_swig_doc.i" - -%{ -#include <gnuradio/atsc/randomizer.h> -#include <gnuradio/atsc/derandomizer.h> -#include <gnuradio/atsc/rs_encoder.h> -#include <gnuradio/atsc/rs_decoder.h> -#include <gnuradio/atsc/interleaver.h> -#include <gnuradio/atsc/deinterleaver.h> -#include <gnuradio/atsc/trellis_encoder.h> -#include <gnuradio/atsc/viterbi_decoder.h> -#include <gnuradio/atsc/ds_to_softds.h> -#include <gnuradio/atsc/field_sync_mux.h> -#include <gnuradio/atsc/field_sync_demux.h> -#include <gnuradio/atsc/equalizer.h> -#include <gnuradio/atsc/fs_checker.h> -#include <gnuradio/atsc/bit_timing_loop.h> -#include <gnuradio/atsc/fpll.h> -#include <gnuradio/atsc/depad.h> -#include <gnuradio/atsc/pad.h> -%} - -%include "gnuradio/atsc/consts.h" - -%constant int sizeof_atsc_mpeg_packet = sizeof(atsc_mpeg_packet); -%constant int sizeof_atsc_mpeg_packet_no_sync = sizeof(atsc_mpeg_packet_no_sync); -%constant int sizeof_atsc_mpeg_packet_rs_encoded = sizeof(atsc_mpeg_packet_rs_encoded); -%constant int sizeof_atsc_data_segment = sizeof(atsc_data_segment); -%constant int sizeof_atsc_soft_data_segment = sizeof(atsc_soft_data_segment); - -%constant int sizeof_atsc_mpeg_packet_pad = atsc_mpeg_packet::NPAD; -%constant int sizeof_atsc_mpeg_packet_no_sync_pad = atsc_mpeg_packet_no_sync::NPAD; -%constant int sizeof_atsc_mpeg_packet_rs_encoded_pad = atsc_mpeg_packet_rs_encoded::NPAD; -%constant int sizeof_atsc_data_segment_pad = atsc_data_segment::NPAD; -%constant int sizeof_atsc_soft_data_segment_pad = atsc_soft_data_segment::NPAD; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,randomizer); - -atsc_randomizer_sptr atsc_make_randomizer(); - -class atsc_randomizer : public gr::sync_block -{ - atsc_randomizer(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,derandomizer); - -atsc_derandomizer_sptr atsc_make_derandomizer(); - -class atsc_derandomizer : public gr::sync_block -{ - atsc_derandomizer(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,rs_encoder); - -atsc_rs_encoder_sptr atsc_make_rs_encoder(); - -class atsc_rs_encoder : public gr::sync_block -{ - atsc_rs_encoder(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,rs_decoder); - -atsc_rs_decoder_sptr atsc_make_rs_decoder(); - -class atsc_rs_decoder : public gr::sync_block -{ - atsc_rs_decoder(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,interleaver); - -atsc_interleaver_sptr atsc_make_interleaver(); - -class atsc_interleaver : public gr::sync_block -{ - atsc_interleaver(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,deinterleaver); - -atsc_deinterleaver_sptr atsc_make_deinterleaver(); - -class atsc_deinterleaver : public gr::sync_block -{ - atsc_deinterleaver(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,trellis_encoder); - -atsc_trellis_encoder_sptr atsc_make_trellis_encoder(); - -class atsc_trellis_encoder : public gr::sync_block -{ - atsc_trellis_encoder(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,viterbi_decoder); - -atsc_viterbi_decoder_sptr atsc_make_viterbi_decoder(); - -class atsc_viterbi_decoder : public gr::sync_block -{ - atsc_viterbi_decoder(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,ds_to_softds); - -atsc_ds_to_softds_sptr atsc_make_ds_to_softds(); - -class atsc_ds_to_softds : public gr::sync_block -{ - atsc_ds_to_softds(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,field_sync_mux); - -atsc_field_sync_mux_sptr atsc_make_field_sync_mux(); - -class atsc_field_sync_mux : public gr::sync_block -{ - atsc_field_sync_mux(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,field_sync_demux); - -atsc_field_sync_demux_sptr atsc_make_field_sync_demux(); - -class atsc_field_sync_demux : public gr::block -{ - atsc_field_sync_demux(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,equalizer); - -atsc_equalizer_sptr atsc_make_equalizer(); - -class atsc_equalizer : public gr::sync_block -{ - atsc_equalizer(); - -public: - void reset(); - std::vector<double> taps(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,fs_checker); - -atsc_fs_checker_sptr atsc_make_fs_checker(); - -class atsc_fs_checker : public gr::sync_block -{ - atsc_fs_checker(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,bit_timing_loop); - -atsc_bit_timing_loop_sptr atsc_make_bit_timing_loop(); - -class atsc_bit_timing_loop : public gr::block -{ - atsc_bit_timing_loop(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,fpll); - -atsc_fpll_sptr atsc_make_fpll(); - -class atsc_fpll : public gr::sync_block -{ - atsc_fpll(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,depad); - -atsc_depad_sptr atsc_make_depad(); - -class atsc_depad : public gr::sync_interpolator -{ - atsc_depad(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(atsc,pad); - -atsc_pad_sptr atsc_make_pad(); - -class atsc_pad : public gr::sync_decimator -{ - atsc_pad(); - -public: - void reset(); -}; - -// ---------------------------------------------------------------- diff --git a/gr-audio/grc/audio_sink.xml b/gr-audio/grc/audio_sink.xml index 727767b72e..9181055cd9 100644 --- a/gr-audio/grc/audio_sink.xml +++ b/gr-audio/grc/audio_sink.xml @@ -7,7 +7,7 @@ <block> <name>Audio Sink</name> <key>audio_sink</key> - <category>Audio</category> + <category>[Core]/Audio</category> <flags>throttle</flags> <import>from gnuradio import audio</import> <make>audio.sink($samp_rate, $device_name, $ok_to_block)</make> diff --git a/gr-audio/grc/audio_source.xml b/gr-audio/grc/audio_source.xml index aaa3225e8b..044b14466f 100644 --- a/gr-audio/grc/audio_source.xml +++ b/gr-audio/grc/audio_source.xml @@ -7,7 +7,7 @@ <block> <name>Audio Source</name> <key>audio_source</key> - <category>Audio</category> + <category>[Core]/Audio</category> <flags>throttle</flags> <import>from gnuradio import audio</import> <make>audio.source($samp_rate, $device_name, $ok_to_block)</make> diff --git a/gr-audio/lib/portaudio/portaudio_sink.cc b/gr-audio/lib/portaudio/portaudio_sink.cc index 4a0a969895..2397b65442 100644 --- a/gr-audio/lib/portaudio/portaudio_sink.cc +++ b/gr-audio/lib/portaudio/portaudio_sink.cc @@ -34,6 +34,9 @@ #include <unistd.h> #include <stdexcept> #include <string.h> +#ifdef _MSC_VER +#include <io.h> +#endif namespace gr { namespace audio { diff --git a/gr-audio/lib/portaudio/portaudio_source.cc b/gr-audio/lib/portaudio/portaudio_source.cc index efbe2b6fc7..1e1bbfacbb 100644 --- a/gr-audio/lib/portaudio/portaudio_source.cc +++ b/gr-audio/lib/portaudio/portaudio_source.cc @@ -34,6 +34,9 @@ #include <unistd.h> #include <stdexcept> #include <string.h> +#ifdef _MSC_VER +#include <io.h> +#endif namespace gr { namespace audio { diff --git a/gr-blocks/grc/blks2_error_rate.xml b/gr-blocks/grc/blks2_error_rate.xml index 8be018243f..c71739f914 100644 --- a/gr-blocks/grc/blks2_error_rate.xml +++ b/gr-blocks/grc/blks2_error_rate.xml @@ -8,7 +8,7 @@ <block> <name>Error Rate</name> <key>blks2_error_rate</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.error_rate( type=$type, diff --git a/gr-blocks/grc/blks2_selector.xml b/gr-blocks/grc/blks2_selector.xml index 580fdd9d8c..3442b2cdb8 100644 --- a/gr-blocks/grc/blks2_selector.xml +++ b/gr-blocks/grc/blks2_selector.xml @@ -8,7 +8,7 @@ <block> <name>Selector</name> <key>blks2_selector</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.selector( item_size=$type.size*$vlen, diff --git a/gr-blocks/grc/blks2_tcp_sink.xml b/gr-blocks/grc/blks2_tcp_sink.xml index 46b10a7790..2bff7e6d45 100644 --- a/gr-blocks/grc/blks2_tcp_sink.xml +++ b/gr-blocks/grc/blks2_tcp_sink.xml @@ -7,7 +7,7 @@ <block> <name>TCP Sink</name> <key>blks2_tcp_sink</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.tcp_sink( itemsize=$type.size*$vlen, diff --git a/gr-blocks/grc/blks2_tcp_source.xml b/gr-blocks/grc/blks2_tcp_source.xml index 6a59522f3f..f6cc41015f 100644 --- a/gr-blocks/grc/blks2_tcp_source.xml +++ b/gr-blocks/grc/blks2_tcp_source.xml @@ -7,7 +7,7 @@ <block> <name>TCP Source</name> <key>blks2_tcp_source</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.tcp_source( itemsize=$type.size*$vlen, diff --git a/gr-blocks/grc/blks2_valve.xml b/gr-blocks/grc/blks2_valve.xml index d879ff655f..c3f25163b2 100644 --- a/gr-blocks/grc/blks2_valve.xml +++ b/gr-blocks/grc/blks2_valve.xml @@ -8,7 +8,7 @@ <block> <name>Valve</name> <key>blks2_valve</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.valve(item_size=$type.size*$vlen, open=bool($open))</make> <callback>set_open(bool($open))</callback> diff --git a/gr-blocks/grc/blocks_block_tree.xml b/gr-blocks/grc/blocks_block_tree.xml index bfab41aeb6..a9441a9ffb 100644 --- a/gr-blocks/grc/blocks_block_tree.xml +++ b/gr-blocks/grc/blocks_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Audio</name> <block>blocks_wavfile_source</block> @@ -144,6 +144,8 @@ <block>blocks_null_sink</block> <block>blocks_copy</block> <block>blocks_nop</block> + <block>xmlrpc_server</block> + <block>xmlrpc_client</block> </cat> <cat> <name>Modulators</name> @@ -230,9 +232,4 @@ <name>Variables</name> <block>variable_tag_object</block> </cat> - <cat> - <name>Misc</name> - <block>xmlrpc_server</block> - <block>xmlrpc_client</block> - </cat> </cat> diff --git a/gr-blocks/lib/ConfigChecks.cmake b/gr-blocks/lib/ConfigChecks.cmake index 7f60aed403..1effaa8360 100644 --- a/gr-blocks/lib/ConfigChecks.cmake +++ b/gr-blocks/lib/ConfigChecks.cmake @@ -56,7 +56,7 @@ CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H) IF(HAVE_WINDOWS_H) ADD_DEFINITIONS(-DHAVE_WINDOWS_H -DUSING_WINSOCK) MESSAGE(STATUS "Adding windows libs to gr blocks libs...") - LIST(APPEND blocks_libs WS2_32.lib WSock32.lib) + LIST(APPEND blocks_libs ws2_32 wsock32) ENDIF(HAVE_WINDOWS_H) ######################################################################## diff --git a/gr-blocks/lib/udp_source_impl.cc b/gr-blocks/lib/udp_source_impl.cc index d1d3b45827..ea2f2b60a0 100644 --- a/gr-blocks/lib/udp_source_impl.cc +++ b/gr-blocks/lib/udp_source_impl.cc @@ -95,9 +95,6 @@ namespace gr { d_socket = new boost::asio::ip::udp::socket(d_io_service); d_socket->open(d_endpoint.protocol()); - boost::asio::socket_base::linger loption(true, 0); - d_socket->set_option(loption); - boost::asio::socket_base::reuse_address roption(true); d_socket->set_option(roption); diff --git a/gr-channels/grc/channels_block_tree.xml b/gr-channels/grc/channels_block_tree.xml index 383f4b199c..00886e8eed 100644 --- a/gr-channels/grc/channels_block_tree.xml +++ b/gr-channels/grc/channels_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Channel Models</name> <block>channels_channel_model</block> diff --git a/gr-channels/lib/fading_model_impl.cc b/gr-channels/lib/fading_model_impl.cc index 7eb9d0612c..721a43f8f6 100644 --- a/gr-channels/lib/fading_model_impl.cc +++ b/gr-channels/lib/fading_model_impl.cc @@ -22,17 +22,6 @@ #include "fading_model_impl.h" #include <gnuradio/io_signature.h> -#include <iostream> - -#include <boost/format.hpp> -#include <boost/random.hpp> - -#include <gnuradio/fxpt.h> -#include <sincostable.h> - - -// FASTSINCOS: 0 = slow native, 1 = gr::fxpt impl, 2 = sincostable.h -#define FASTSINCOS 2 namespace gr { diff --git a/gr-channels/lib/flat_fader_impl.cc b/gr-channels/lib/flat_fader_impl.cc index 0b4cab2337..729e5d52ae 100644 --- a/gr-channels/lib/flat_fader_impl.cc +++ b/gr-channels/lib/flat_fader_impl.cc @@ -48,7 +48,7 @@ namespace gr { d_table(8*1024), - scale_sin(sqrtf(2.0/d_N)), + scale_sin(sqrtf(1.0/d_N)), scale_los(sqrtf(d_K)/sqrtf(d_K+1)), scale_nlos(1/sqrtf(d_K+1)) { @@ -63,18 +63,18 @@ namespace gr { gr_complex flat_fader_impl::next_sample(){ gr_complex H(0,0); - for(int n=1; n<d_N; n++){ - float alpha_n = (2*M_PI*n - M_PI + d_theta)/(4*d_N); + for(int n=1; n<=d_N; n++){ + float alpha_n = (2*M_PI*n - M_PI + d_theta)/(4*d_N); #if FASTSINCOS == 1 - float s_i = scale_sin*gr::fxpt::cos(gr::fxpt::float_to_fixed(2*M_PI*d_fDTs*d_m*gr::fxpt::cos(gr::fxpt::float_to_fixed(alpha_n))+d_psi[n+1])); - float s_q = scale_sin*gr::fxpt::cos(gr::fxpt::float_to_fixed(2*M_PI*d_fDTs*d_m*gr::fxpt::sin(gr::fxpt::float_to_fixed(alpha_n))+d_phi[n+1])); + float s_i = scale_sin*gr::fxpt::cos(gr::fxpt::float_to_fixed(2*M_PI*d_fDTs*d_m*gr::fxpt::cos(gr::fxpt::float_to_fixed(alpha_n))+d_psi[n])); + float s_q = scale_sin*gr::fxpt::cos(gr::fxpt::float_to_fixed(2*M_PI*d_fDTs*d_m*gr::fxpt::sin(gr::fxpt::float_to_fixed(alpha_n))+d_phi[n])); #elif FASTSINCOS == 2 - float s_i = scale_sin*d_table.cos(2*M_PI*d_fDTs*d_m*d_table.cos(alpha_n)+d_psi[n+1]); - float s_q = scale_sin*d_table.cos(2*M_PI*d_fDTs*d_m*d_table.sin(alpha_n)+d_phi[n+1]); + float s_i = scale_sin*d_table.cos(2*M_PI*d_fDTs*d_m*d_table.cos(alpha_n)+d_psi[n]); + float s_q = scale_sin*d_table.cos(2*M_PI*d_fDTs*d_m*d_table.sin(alpha_n)+d_phi[n]); #else - float s_i = scale_sin*cos(2*M_PI*d_fDTs*d_m*cos(alpha_n)+d_psi[n+1]); - float s_q = scale_sin*cos(2*M_PI*d_fDTs*d_m*sin(alpha_n)+d_phi[n+1]); + float s_i = scale_sin*cos(2*M_PI*d_fDTs*d_m*cos(alpha_n)+d_psi[n]); + float s_q = scale_sin*cos(2*M_PI*d_fDTs*d_m*sin(alpha_n)+d_phi[n]); #endif H += gr_complex(s_i, s_q); diff --git a/gr-digital/grc/blks2_packet_decoder.xml b/gr-digital/grc/blks2_packet_decoder.xml index 3b66f0024f..fedb2e74f3 100644 --- a/gr-digital/grc/blks2_packet_decoder.xml +++ b/gr-digital/grc/blks2_packet_decoder.xml @@ -7,7 +7,7 @@ <block> <name>Packet Decoder</name> <key>blks2_packet_decoder</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <flags>deprecated</flags> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.packet_demod_$(type.fcn)(grc_blks2.packet_decoder( diff --git a/gr-digital/grc/blks2_packet_encoder.xml b/gr-digital/grc/blks2_packet_encoder.xml index 75cb5eabf1..d030f6ae22 100644 --- a/gr-digital/grc/blks2_packet_encoder.xml +++ b/gr-digital/grc/blks2_packet_encoder.xml @@ -7,7 +7,7 @@ <block> <name>Packet Encoder</name> <key>blks2_packet_encoder</key> - <category>Deprecated</category> + <category>[Core]/Deprecated</category> <flags>deprecated</flags> <import>from grc_gnuradio import blks2 as grc_blks2</import> <make>grc_blks2.packet_mod_$(type.fcn)(grc_blks2.packet_encoder( diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml index 6707a8e4db..9bdf6e993f 100644 --- a/gr-digital/grc/digital_block_tree.xml +++ b/gr-digital/grc/digital_block_tree.xml @@ -26,7 +26,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Coding</name> <block>digital_additive_scrambler_bb</block> diff --git a/gr-digital/grc/digital_burst_shaper.xml b/gr-digital/grc/digital_burst_shaper.xml index 5c0bc78d0a..95e1bcbc77 100644 --- a/gr-digital/grc/digital_burst_shaper.xml +++ b/gr-digital/grc/digital_burst_shaper.xml @@ -2,7 +2,7 @@ <block> <name>Burst Shaper</name> <key>digital_burst_shaper_xx</key> - <category>Packet Operators</category> + <category>[Core]/Packet Operators</category> <import>from gnuradio import digital</import> <make>digital.burst_shaper_$(type.fcn)($window, $pre_padding, $post_padding, $insert_phasing, $length_tag_name)</make> <param> diff --git a/gr-digital/include/gnuradio/digital/ofdm_equalizer_base.h b/gr-digital/include/gnuradio/digital/ofdm_equalizer_base.h index ca53382944..85443da8f2 100644 --- a/gr-digital/include/gnuradio/digital/ofdm_equalizer_base.h +++ b/gr-digital/include/gnuradio/digital/ofdm_equalizer_base.h @@ -30,7 +30,8 @@ namespace gr { namespace digital { - /* \brief Base class for implementation details of frequency-domain OFDM equalizers. + /*! + * \brief Base class for implementation details of frequency-domain OFDM equalizers. * \ingroup ofdm_blk * \ingroup equalizers_blk */ diff --git a/gr-digital/include/gnuradio/digital/ofdm_equalizer_simpledfe.h b/gr-digital/include/gnuradio/digital/ofdm_equalizer_simpledfe.h index d526f9f157..03a4c82b91 100644 --- a/gr-digital/include/gnuradio/digital/ofdm_equalizer_simpledfe.h +++ b/gr-digital/include/gnuradio/digital/ofdm_equalizer_simpledfe.h @@ -29,7 +29,8 @@ namespace gr { namespace digital { - /* \brief Simple decision feedback equalizer for OFDM. + /*! + * \brief Simple decision feedback equalizer for OFDM. * \ingroup ofdm_blk * \ingroup equalizers_blk * diff --git a/gr-digital/include/gnuradio/digital/ofdm_equalizer_static.h b/gr-digital/include/gnuradio/digital/ofdm_equalizer_static.h index 892025c2b0..ed3fe83f04 100644 --- a/gr-digital/include/gnuradio/digital/ofdm_equalizer_static.h +++ b/gr-digital/include/gnuradio/digital/ofdm_equalizer_static.h @@ -29,7 +29,8 @@ namespace gr { namespace digital { - /* \brief Very simple static equalizer for OFDM. + /*! + * \brief Very simple static equalizer for OFDM. * \ingroup ofdm_blk * \ingroup equalizers_blk * diff --git a/gr-dtv/grc/dtv_block_tree.xml b/gr-dtv/grc/dtv_block_tree.xml index fba33852c0..8dcbd18127 100644 --- a/gr-dtv/grc/dtv_block_tree.xml +++ b/gr-dtv/grc/dtv_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Digital Television</name> <cat> diff --git a/gr-dtv/lib/CMakeLists.txt b/gr-dtv/lib/CMakeLists.txt index 6ae308395d..fec48990a2 100644 --- a/gr-dtv/lib/CMakeLists.txt +++ b/gr-dtv/lib/CMakeLists.txt @@ -133,10 +133,25 @@ list(APPEND dtv_libs ) include (CheckCCompilerFlag) -CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED) +if (MSVC) + # 64-bit MSVC always supports SSE2 + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(SSE2_SUPPORTED true) + else () + CHECK_C_COMPILER_FLAG ("/arch:SSE2" SSE2_SUPPORTED) + endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +else () + CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED) +endif(MSVC) if(SSE2_SUPPORTED) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") + if (NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") + else () + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2") + endif () + endif () ADD_DEFINITIONS(-DDTV_SSE2) endif(SSE2_SUPPORTED) diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc index bf7613adae..9e45c81018 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc @@ -135,8 +135,9 @@ namespace gr { // First index of d_b is Bit interleaver number // Second index of d_b is the position inside Bit interleaver - unsigned char d_b[d_v][d_bsize]; - + // Linux: unsigned char d_b[d_v][d_bsize]; + __GR_VLA2D(unsigned char, d_b, d_v, d_bsize); + for (int bcount = 0; bcount < bmax; bcount++) { for (int w = 0; w < d_bsize; w++) { int c = in[(bcount * d_bsize) + w]; diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc index 0ab3003d50..d2bfb3d9d2 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc @@ -136,7 +136,8 @@ namespace gr { // First index of d_b is Bit interleaver number // Second index of d_b is the position inside the Bit interleaver - unsigned char d_b[d_v][d_bsize]; + // Linux: unsigned char d_b[d_v][d_bsize]; + __GR_VLA2D(unsigned char, d_b, d_v, d_bsize); for (int bcount = 0; bcount < bmax; bcount++) { for (int i = 0; i < d_bsize; i++) { diff --git a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc index abef1d0510..ee8dce0f15 100644 --- a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc @@ -47,7 +47,7 @@ namespace gr { int dvbt_ofdm_sym_acquisition_impl::peak_detect_process(const float * datain, const int datain_length, int * peak_pos, int * peak_max) { - unsigned int peak_index = 0; + uint16_t peak_index = 0; int peak_pos_length = 0; volk_32f_index_max_16u(&peak_index, &datain[0], datain_length); @@ -103,8 +103,8 @@ namespace gr { int low, size; // Array to store peak positions - int peak_pos[d_fft_length]; - float d_phi[d_fft_length]; + __GR_VLA(int, peak_pos, d_fft_length); + __GR_VLA(float, d_phi, d_fft_length); // Calculate norm low = lookup_stop - (d_cp_length + d_fft_length - 1); diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc b/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc index 6277350b42..7d67a0a81a 100644 --- a/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc +++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc @@ -245,13 +245,13 @@ namespace gr { int dvbt_reed_solomon::rs_decode(unsigned char *data, unsigned char *eras, const int no_eras) { - unsigned char sigma[2 * d_t + 1]; - unsigned char b[2 * d_t + 1]; - unsigned char T[2 * d_t + 1]; - unsigned char reg[2 * d_t + 1]; - unsigned char root[2 * d_t + 1]; - unsigned char loc[2 * d_t + 1]; - unsigned char omega[2 * d_t]; + __GR_VLA(unsigned char, sigma, 2 * d_t + 1); + __GR_VLA(unsigned char, b, 2 * d_t + 1); + __GR_VLA(unsigned char, T, 2 * d_t + 1); + __GR_VLA(unsigned char, reg, 2 * d_t + 1); + __GR_VLA(unsigned char, root, 2 * d_t + 1); + __GR_VLA(unsigned char, loc, 2 * d_t + 1); + __GR_VLA(unsigned char, omega, 2 * d_t); // Compute erasure locator polynomial memset(sigma, 0, 2 * d_t + 1); diff --git a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc index 8e22d8df5a..05554c55fa 100644 --- a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc @@ -71,25 +71,25 @@ namespace gr { }; #ifdef DTV_SSE2 - __m128i dvbt_viterbi_decoder_impl::d_metric0[4] __attribute__ ((aligned(16))); - __m128i dvbt_viterbi_decoder_impl::d_metric1[4] __attribute__ ((aligned(16))); - __m128i dvbt_viterbi_decoder_impl::d_path0[4] __attribute__ ((aligned(16))); - __m128i dvbt_viterbi_decoder_impl::d_path1[4] __attribute__ ((aligned(16))); + __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric0[4]; + __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric1[4]; + __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path0[4]; + __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path1[4]; #else - unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64] __attribute__ ((aligned(16))); - unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64] __attribute__ ((aligned(16))); - unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64] __attribute__ ((aligned(16))); - unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64] __attribute__ ((aligned(16))); + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64]; + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64]; + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64]; + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64]; #endif #ifdef DTV_SSE2 - branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2] __attribute__ ((aligned(16))); + __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2]; #else - branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2] __attribute__ ((aligned(16))); + __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2]; #endif - unsigned char dvbt_viterbi_decoder_impl::mmresult[64] __attribute__((aligned(16))); - unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64] __attribute__((aligned(16))); + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::mmresult[64]; + __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64]; #ifdef DTV_SSE2 void diff --git a/gr-fcd/AUTHORS b/gr-fcd/AUTHORS deleted file mode 100644 index 6673ab17dd..0000000000 --- a/gr-fcd/AUTHORS +++ /dev/null @@ -1,9 +0,0 @@ -This component was originally authored by: - -Alexandryu Csete <oz9aec@gmail.com> - -For convenience, it also includes the hidapi by signal11: -http://www.signal11.us/oss/hidapi/ - -as well as the FCD API code from Qthid by Howard Long, -Alexandru Csete and Mario Lorenz: http://qthid.sf.net/ diff --git a/gr-fcd/CMakeLists.txt b/gr-fcd/CMakeLists.txt deleted file mode 100644 index 76972ef6e0..0000000000 --- a/gr-fcd/CMakeLists.txt +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup dependencies -######################################################################## -include(GrBoost) -if(NOT WIN32 AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - include(FindUSB) -endif() - -######################################################################## -# Register component -######################################################################## -include(GrComponent) - -# FIXME make better conditionalization -if (LINUX) - GR_REGISTER_COMPONENT("gr-fcd" ENABLE_GR_FCD - Boost_FOUND - ENABLE_GNURADIO_RUNTIME - ENABLE_GR_BLOCKS - ENABLE_GR_AUDIO - LIBUSB_FOUND - ) -else() - GR_REGISTER_COMPONENT("gr-fcd" ENABLE_GR_FCD - Boost_FOUND - ENABLE_GNURADIO_RUNTIME - ENABLE_GR_AUDIO - ) -endif() - -GR_SET_GLOBAL(GR_FCD_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/lib - ${CMAKE_CURRENT_SOURCE_DIR}/include -) - -SET(GR_PKG_FCD_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/fcd) - -######################################################################## -# Begin conditional configuration -######################################################################## -if(ENABLE_GR_FCD) - -######################################################################## -# Setup CPack components -######################################################################## -include(GrPackage) -CPACK_SET(CPACK_COMPONENT_GROUP_FCD_DESCRIPTION "GNU Radio FCD Blocks") - -CPACK_COMPONENT("fcd_runtime" - GROUP "FCD" - DISPLAY_NAME "Runtime" - DESCRIPTION "Runtime" - DEPENDS "runtime_runtime;audio_runtime" -) - -CPACK_COMPONENT("fcd_devel" - GROUP "FCD" - DISPLAY_NAME "Development" - DESCRIPTION "C++ headers, package config, import libraries" - DEPENDS "runtime_devel;audio_devel" -) - -CPACK_COMPONENT("fcd_python" - GROUP "FCD" - DISPLAY_NAME "Python" - DESCRIPTION "Python modules for runtime; GRC xml files" - DEPENDS "runtime_python;fcd_runtime" -) - -CPACK_COMPONENT("fcd_examples" - GROUP "FCD" - DISPLAY_NAME "Examples" - DESCRIPTION "Example programs" - DEPENDS "fcd_runtime" -) - -CPACK_COMPONENT("fcd_swig" - GROUP "FCD" - DISPLAY_NAME "SWIG" - DESCRIPTION "SWIG development .i files" - DEPENDS "runtime_swig;fcd_python;fcd_devel" -) - -######################################################################## -# Add subdirectories -######################################################################## -add_subdirectory(include/gnuradio/fcd) -add_subdirectory(lib) -if(ENABLE_PYTHON) - add_subdirectory(swig) - add_subdirectory(python/fcd) - add_subdirectory(grc) - add_subdirectory(examples/grc) -endif(ENABLE_PYTHON) -add_subdirectory(doc) - -if(ENABLE_GR_ANALOG) - add_subdirectory(examples/c++) -endif(ENABLE_GR_ANALOG) - -######################################################################## -# Create Pkg Config File -######################################################################## -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-fcd.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.pc -@ONLY) - -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.pc - DESTINATION ${GR_LIBRARY_DIR}/pkgconfig - COMPONENT "fcd_devel" -) - -endif(ENABLE_GR_FCD) diff --git a/gr-fcd/doc/CMakeLists.txt b/gr-fcd/doc/CMakeLists.txt deleted file mode 100644 index 6a4b7962da..0000000000 --- a/gr-fcd/doc/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -install( - FILES README.fcd - DESTINATION ${GR_PKG_DOC_DIR} -) diff --git a/gr-fcd/doc/README.fcd b/gr-fcd/doc/README.fcd deleted file mode 100644 index c6ee02fff0..0000000000 --- a/gr-fcd/doc/README.fcd +++ /dev/null @@ -1,13 +0,0 @@ -This is the gr-fcd package. It contains a source block for the -FunCube Dongle hardware. - -The Python namespace is in gnuradio.fcd, which would be normally -imported as: - - from gnuradio import fcd - -See the Doxygen documentation for details about the blocks available -in this package. A quick listing of the details can be found in Python -after importing by using: - - help(fcd) diff --git a/gr-fcd/doc/fcd.dox b/gr-fcd/doc/fcd.dox deleted file mode 100644 index 6f57ef9fb5..0000000000 --- a/gr-fcd/doc/fcd.dox +++ /dev/null @@ -1,29 +0,0 @@ -/*! \page page_fcd FunCube Dongle Source - -\section fcd_introduction Introduction - -This is the gr-fcd package. It contains a source block for the -FunCube Dongle hardware. - -The Python namespace is in gnuradio.fcd, which would be normally -imported as: - -\code - from gnuradio import fcd -\endcode - -See the Doxygen documentation for details about the blocks available -in this package. A quick listing of the details can be found in Python -after importing by using: - -\code - help(fcd) -\endcode - -\section fcd_dependencies Dependencies - -The FCD blocks require the following dependencies. - -\li libusb-1.0 (version >= 1.0) - -*/ diff --git a/gr-fcd/examples/c++/CMakeLists.txt b/gr-fcd/examples/c++/CMakeLists.txt deleted file mode 100644 index 346e95db3f..0000000000 --- a/gr-fcd/examples/c++/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -include_directories( - ${GR_FCD_INCLUDE_DIRS} - ${GR_FILTER_INCLUDE_DIRS} - ${GR_ANALOG_INCLUDE_DIRS} - ${GR_AUDIO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -add_executable(fcd_nfm_rx fcd_nfm_rx.cc) -target_link_libraries(fcd_nfm_rx - gnuradio-fcd gnuradio-filter gnuradio-analog gnuradio-audio) - -INSTALL(TARGETS - fcd_nfm_rx - DESTINATION ${GR_PKG_FCD_EXAMPLES_DIR} - COMPONENT "fcd_examples" -) diff --git a/gr-fcd/examples/c++/fcd_nfm_rx.cc b/gr-fcd/examples/c++/fcd_nfm_rx.cc deleted file mode 100644 index 1c99a10d8c..0000000000 --- a/gr-fcd/examples/c++/fcd_nfm_rx.cc +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2011 Free Software Foundation, Inc. - * - * 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. - */ - -/* - * Simple GNU Radio C++ example for using the Funcube Dongle. - * - * Construct a simple narrow band FM receiver using the gr-fcd - * block as source. - * - * This example uses "hw:1" as FCD source device and the default - * audio device for output. - * - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -// Include header files for each block used in flowgraph -#include <gnuradio/top_block.h> -#include <gnuradio/filter/firdes.h> -#include <gnuradio/filter/fir_filter_ccf.h> -#include <gnuradio/analog/quadrature_demod_cf.h> -#include <gnuradio/audio/sink.h> -#include <gnuradio/fcd/source_c.h> - -// other includes -#include <iostream> -#include <boost/program_options.hpp> - -using namespace gr; -namespace po = boost::program_options; - -int main(int argc, char **argv) -{ - int rate = 48000; // Audio card sample rate - float pi = 3.141592654; - - - //variables to be set by po - std::string device; - int freq; - float gain; - - //setup the program options - po::options_description desc("Command line options"); - desc.add_options() - ("help", "This help message") - ("device", po::value<std::string>(&device)->default_value("hw:1"), "Audio input device") - ("freq", po::value<int>(&freq)->default_value(145500), "RF frequency in kHz") - ("gain", po::value<float>(&gain)->default_value(20.0), "LNA gain in dB") - ; - po::variables_map vm; - po::store(po::parse_command_line(argc, argv, desc), vm); - po::notify(vm); - - //print the help message - if (vm.count("help")){ - std::cout << "Narrow band FM receiver example" << std::endl << desc << std::endl; - return ~0; - } - - - // Construct a top block that will contain flowgraph blocks. - top_block_sptr tb = make_top_block("fcd_nfm_rx"); - - // FCD source - gr::fcd::source_c::sptr fcd = gr::fcd::source_c::make(device); - fcd->set_freq_khz(freq); - fcd->set_lna_gain(gain); - - // Low pass filter - std::vector<float> taps = filter::firdes::low_pass(1.0, 96000, 5000.0, 1000.0); - filter::fir_filter_ccf::sptr filter = filter::fir_filter_ccf::make (2, taps); - - // FM demodulator - // gain = sample_rate / (2*pi*max_dev) - analog::quadrature_demod_cf::sptr demod = \ - analog::quadrature_demod_cf::make(rate/(2.0*pi*5000.0)); - - // Audio sink - audio::sink::sptr sink = audio::sink::make(rate); - - // Connect blocks - tb->connect(fcd, 0, filter, 0); - tb->connect(filter, 0, demod, 0); - tb->connect(demod, 0, sink, 0); - - // Tell GNU Radio runtime to start flowgraph threads; the foreground thread - // will block until either flowgraph exits (this example doesn't) or the - // application receives SIGINT (e.g., user hits CTRL-C). - // - // Real applications may use tb->start() which returns, allowing the foreground - // thread to proceed, then later use tb->stop(), followed by tb->wait(), to cleanup - // GNU Radio before exiting. - tb->run(); - - // Exit normally. - return 0; -} diff --git a/gr-fcd/examples/grc/CMakeLists.txt b/gr-fcd/examples/grc/CMakeLists.txt deleted file mode 100644 index 5e883e3754..0000000000 --- a/gr-fcd/examples/grc/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -INSTALL(FILES - fcd_apt_rx.grc - fcd_fft.grc - fcd_nfm_rx.grc - DESTINATION ${GR_PKG_FCD_EXAMPLES_DIR} - COMPONENT "fcd_examples" -)
\ No newline at end of file diff --git a/gr-fcd/examples/grc/fcd_apt_rx.grc b/gr-fcd/examples/grc/fcd_apt_rx.grc deleted file mode 100644 index f68d235f3e..0000000000 --- a/gr-fcd/examples/grc/fcd_apt_rx.grc +++ /dev/null @@ -1,1080 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Mon Jul 14 15:02:48 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>fcd_apt_rx</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>NOAA APT Receiver</value> - </param> - <param> - <key>author</key> - <value>Alexandru Csete OZ9AEC</value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>1280, 1024</value> - </param> - <param> - <key>generate_options</key> - <value>qt_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>wav_file</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>prefix + datetime.now().strftime("%Y.%m.%d.%H.%M.%S") + ".wav"</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(803, 441)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>prefix</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>"FCD_APT_REC-"</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(666, 442)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>samp_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>96000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(190, 11)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_dev</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>17000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(282, 11)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>fcd_source_c</key> - <param> - <key>id</key> - <value>fcd_source_c_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>device_name</key> - <value>hw:0</value> - </param> - <param> - <key>freq</key> - <value>sat_freq</value> - </param> - <param> - <key>lna</key> - <value>fcd_lna_gain</value> - </param> - <param> - <key>mixer</key> - <value>+12</value> - </param> - <param> - <key>ppm</key> - <value>-120</value> - </param> - <param> - <key>dci</key> - <value>0.0</value> - </param> - <param> - <key>dcq</key> - <value>0.0</value> - </param> - <param> - <key>iq_phase</key> - <value>0.0</value> - </param> - <param> - <key>iq_gain</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(65, 134)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_fm_demod_cf</key> - <param> - <key>id</key> - <value>analog_fm_demod_cf_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>chan_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>audio_decim</key> - <value>2</value> - </param> - <param> - <key>deviation</key> - <value>max_dev</value> - </param> - <param> - <key>audio_pass</key> - <value>5000</value> - </param> - <param> - <key>audio_stop</key> - <value>7000</value> - </param> - <param> - <key>gain</key> - <value>1.0</value> - </param> - <param> - <key>tau</key> - <value>75e-6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(602, 150)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>rational_resampler_xxx</key> - <param> - <key>id</key> - <value>rational_resampler_xxx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fff</value> - </param> - <param> - <key>interp</key> - <value>11025</value> - </param> - <param> - <key>decim</key> - <value>48000</value> - </param> - <param> - <key>taps</key> - <value>[]</value> - </param> - <param> - <key>fbw</key> - <value>0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(588, 342)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>audio_sink</key> - <param> - <key>id</key> - <value>audio_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>samp_rate</key> - <value>48000</value> - </param> - <param> - <key>device_name</key> - <value></value> - </param> - <param> - <key>ok_to_block</key> - <value>True</value> - </param> - <param> - <key>num_inputs</key> - <value>1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(831, 198)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>from datetime import datetime</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(549, 442)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_wavfile_sink</key> - <param> - <key>id</key> - <value>wavfile_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>wav_file</value> - </param> - <param> - <key>nchan</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>11025</value> - </param> - <param> - <key>bits_per_sample</key> - <value>16</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(842, 350)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>low_pass_filter</key> - <param> - <key>id</key> - <value>low_pass_filter</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> - </param> - <param> - <key>interp</key> - <value>1</value> - </param> - <param> - <key>gain</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>cutoff_freq</key> - <value>25000</value> - </param> - <param> - <key>width</key> - <value>5000</value> - </param> - <param> - <key>win</key> - <value>firdes.WIN_HAMMING</value> - </param> - <param> - <key>beta</key> - <value>6.76</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(403, 150)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_chooser</key> - <param> - <key>id</key> - <value>sat_freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Satellite</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>num_opts</key> - <value>0</value> - </param> - <param> - <key>value</key> - <value>137500000</value> - </param> - <param> - <key>options</key> - <value>[137500000,137620000,137912500,137100000]</value> - </param> - <param> - <key>labels</key> - <value>["NOAA-15","NOAA-17","NOAA-18","NOAA-19"]</value> - </param> - <param> - <key>option0</key> - <value>0</value> - </param> - <param> - <key>label0</key> - <value></value> - </param> - <param> - <key>option1</key> - <value>1</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>option2</key> - <value>2</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>option3</key> - <value>3</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>option4</key> - <value>4</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>widget</key> - <value>combo_box</value> - </param> - <param> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - </param> - <param> - <key>gui_hint</key> - <value>1,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(57, 360)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_label</key> - <param> - <key>id</key> - <value>rec_info</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Recording to</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>value</key> - <value>wav_file</value> - </param> - <param> - <key>formatter</key> - <value>None</value> - </param> - <param> - <key>gui_hint</key> - <value>1,1,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(761, 20)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>qtgui_freq_sink_x</key> - <param> - <key>id</key> - <value>qtgui_freq_sink_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>name</key> - <value>""</value> - </param> - <param> - <key>fftsize</key> - <value>512</value> - </param> - <param> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - </param> - <param> - <key>fc</key> - <value>sat_freq</value> - </param> - <param> - <key>bw</key> - <value>samp_rate</value> - </param> - <param> - <key>grid</key> - <value>False</value> - </param> - <param> - <key>autoscale</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>1.0</value> - </param> - <param> - <key>ymin</key> - <value>-140</value> - </param> - <param> - <key>ymax</key> - <value>10</value> - </param> - <param> - <key>nconnections</key> - <value>1</value> - </param> - <param> - <key>update_time</key> - <value>0.10</value> - </param> - <param> - <key>gui_hint</key> - <value>0,0,1,2</value> - </param> - <param> - <key>showports</key> - <value>True</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>width1</key> - <value>1</value> - </param> - <param> - <key>color1</key> - <value>"blue"</value> - </param> - <param> - <key>alpha1</key> - <value>1.0</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>width2</key> - <value>1</value> - </param> - <param> - <key>color2</key> - <value>"red"</value> - </param> - <param> - <key>alpha2</key> - <value>1.0</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>width3</key> - <value>1</value> - </param> - <param> - <key>color3</key> - <value>"green"</value> - </param> - <param> - <key>alpha3</key> - <value>1.0</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>width4</key> - <value>1</value> - </param> - <param> - <key>color4</key> - <value>"black"</value> - </param> - <param> - <key>alpha4</key> - <value>1.0</value> - </param> - <param> - <key>label5</key> - <value></value> - </param> - <param> - <key>width5</key> - <value>1</value> - </param> - <param> - <key>color5</key> - <value>"cyan"</value> - </param> - <param> - <key>alpha5</key> - <value>1.0</value> - </param> - <param> - <key>label6</key> - <value></value> - </param> - <param> - <key>width6</key> - <value>1</value> - </param> - <param> - <key>color6</key> - <value>"magenta"</value> - </param> - <param> - <key>alpha6</key> - <value>1.0</value> - </param> - <param> - <key>label7</key> - <value></value> - </param> - <param> - <key>width7</key> - <value>1</value> - </param> - <param> - <key>color7</key> - <value>"yellow"</value> - </param> - <param> - <key>alpha7</key> - <value>1.0</value> - </param> - <param> - <key>label8</key> - <value></value> - </param> - <param> - <key>width8</key> - <value>1</value> - </param> - <param> - <key>color8</key> - <value>"dark red"</value> - </param> - <param> - <key>alpha8</key> - <value>1.0</value> - </param> - <param> - <key>label9</key> - <value></value> - </param> - <param> - <key>width9</key> - <value>1</value> - </param> - <param> - <key>color9</key> - <value>"dark green"</value> - </param> - <param> - <key>alpha9</key> - <value>1.0</value> - </param> - <param> - <key>label10</key> - <value></value> - </param> - <param> - <key>width10</key> - <value>1</value> - </param> - <param> - <key>color10</key> - <value>"dark blue"</value> - </param> - <param> - <key>alpha10</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(399, 50)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_chooser</key> - <param> - <key>id</key> - <value>fcd_lna_gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>LNA Gain (dB)</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>num_opts</key> - <value>0</value> - </param> - <param> - <key>value</key> - <value>20</value> - </param> - <param> - <key>options</key> - <value>[30.0, 25.0, 20.0, 17.5, 15.0, 12.5, 10.0, 7.5, 5.0, 2.5, 0.0, -2.5, -5.0]</value> - </param> - <param> - <key>labels</key> - <value>[]</value> - </param> - <param> - <key>option0</key> - <value>0</value> - </param> - <param> - <key>label0</key> - <value></value> - </param> - <param> - <key>option1</key> - <value>1</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>option2</key> - <value>2</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>option3</key> - <value>3</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>option4</key> - <value>4</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>widget</key> - <value>combo_box</value> - </param> - <param> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - </param> - <param> - <key>gui_hint</key> - <value>2,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(247, 363)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>fcd_source_c_0</source_block_id> - <sink_block_id>qtgui_freq_sink_x_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_fm_demod_cf_0</source_block_id> - <sink_block_id>rational_resampler_xxx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_fm_demod_cf_0</source_block_id> - <sink_block_id>audio_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>low_pass_filter</source_block_id> - <sink_block_id>analog_fm_demod_cf_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>fcd_source_c_0</source_block_id> - <sink_block_id>low_pass_filter</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>rational_resampler_xxx_0</source_block_id> - <sink_block_id>wavfile_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-fcd/examples/grc/fcd_fft.grc b/gr-fcd/examples/grc/fcd_fft.grc deleted file mode 100644 index 5a91fca4f4..0000000000 --- a/gr-fcd/examples/grc/fcd_fft.grc +++ /dev/null @@ -1,564 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Mon Jul 14 14:53:06 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>fcd_fft</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>Funcube Dongle FFT scope</value> - </param> - <param> - <key>author</key> - <value>Alexandru Csete OZ9AEC</value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>1280, 1024</value> - </param> - <param> - <key>generate_options</key> - <value>qt_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>samp_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>96000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(201, 11)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_entry</key> - <param> - <key>id</key> - <value>fcd_freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>FCD Freq</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>value</key> - <value>145.5e6</value> - </param> - <param> - <key>gui_hint</key> - <value>1,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(299, 12)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_chooser</key> - <param> - <key>id</key> - <value>fcd_lna_gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>LNA Gain (dB)</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>num_opts</key> - <value>0</value> - </param> - <param> - <key>value</key> - <value>20</value> - </param> - <param> - <key>options</key> - <value>[30.0, 25.0, 20.0, 17.5, 15.0, 12.5, 10.0, 7.5, 5.0, 2.5, 0.0, -2.5, -5.0]</value> - </param> - <param> - <key>labels</key> - <value>[]</value> - </param> - <param> - <key>option0</key> - <value>0</value> - </param> - <param> - <key>label0</key> - <value></value> - </param> - <param> - <key>option1</key> - <value>1</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>option2</key> - <value>2</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>option3</key> - <value>3</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>option4</key> - <value>4</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>widget</key> - <value>combo_box</value> - </param> - <param> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - </param> - <param> - <key>gui_hint</key> - <value>2,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(439, 11)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>fcd_source_c</key> - <param> - <key>id</key> - <value>fcd_source_c_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>device_name</key> - <value>hw:0</value> - </param> - <param> - <key>freq</key> - <value>fcd_freq</value> - </param> - <param> - <key>lna</key> - <value>fcd_lna_gain</value> - </param> - <param> - <key>mixer</key> - <value>+12</value> - </param> - <param> - <key>ppm</key> - <value>-120</value> - </param> - <param> - <key>dci</key> - <value>0.0</value> - </param> - <param> - <key>dcq</key> - <value>0.0</value> - </param> - <param> - <key>iq_phase</key> - <value>0.0</value> - </param> - <param> - <key>iq_gain</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(13, 134)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>qtgui_freq_sink_x</key> - <param> - <key>id</key> - <value>qtgui_freq_sink_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>name</key> - <value>""</value> - </param> - <param> - <key>fftsize</key> - <value>512</value> - </param> - <param> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - </param> - <param> - <key>fc</key> - <value>fcd_freq</value> - </param> - <param> - <key>bw</key> - <value>samp_rate</value> - </param> - <param> - <key>grid</key> - <value>False</value> - </param> - <param> - <key>autoscale</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>1.0</value> - </param> - <param> - <key>ymin</key> - <value>-140</value> - </param> - <param> - <key>ymax</key> - <value>10</value> - </param> - <param> - <key>nconnections</key> - <value>1</value> - </param> - <param> - <key>update_time</key> - <value>0.05</value> - </param> - <param> - <key>gui_hint</key> - <value>0,0,1,2</value> - </param> - <param> - <key>showports</key> - <value>True</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>width1</key> - <value>1</value> - </param> - <param> - <key>color1</key> - <value>"blue"</value> - </param> - <param> - <key>alpha1</key> - <value>1.0</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>width2</key> - <value>1</value> - </param> - <param> - <key>color2</key> - <value>"red"</value> - </param> - <param> - <key>alpha2</key> - <value>1.0</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>width3</key> - <value>1</value> - </param> - <param> - <key>color3</key> - <value>"green"</value> - </param> - <param> - <key>alpha3</key> - <value>1.0</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>width4</key> - <value>1</value> - </param> - <param> - <key>color4</key> - <value>"black"</value> - </param> - <param> - <key>alpha4</key> - <value>1.0</value> - </param> - <param> - <key>label5</key> - <value></value> - </param> - <param> - <key>width5</key> - <value>1</value> - </param> - <param> - <key>color5</key> - <value>"cyan"</value> - </param> - <param> - <key>alpha5</key> - <value>1.0</value> - </param> - <param> - <key>label6</key> - <value></value> - </param> - <param> - <key>width6</key> - <value>1</value> - </param> - <param> - <key>color6</key> - <value>"magenta"</value> - </param> - <param> - <key>alpha6</key> - <value>1.0</value> - </param> - <param> - <key>label7</key> - <value></value> - </param> - <param> - <key>width7</key> - <value>1</value> - </param> - <param> - <key>color7</key> - <value>"yellow"</value> - </param> - <param> - <key>alpha7</key> - <value>1.0</value> - </param> - <param> - <key>label8</key> - <value></value> - </param> - <param> - <key>width8</key> - <value>1</value> - </param> - <param> - <key>color8</key> - <value>"dark red"</value> - </param> - <param> - <key>alpha8</key> - <value>1.0</value> - </param> - <param> - <key>label9</key> - <value></value> - </param> - <param> - <key>width9</key> - <value>1</value> - </param> - <param> - <key>color9</key> - <value>"dark green"</value> - </param> - <param> - <key>alpha9</key> - <value>1.0</value> - </param> - <param> - <key>label10</key> - <value></value> - </param> - <param> - <key>width10</key> - <value>1</value> - </param> - <param> - <key>color10</key> - <value>"dark blue"</value> - </param> - <param> - <key>alpha10</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(282, 182)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>fcd_source_c_1</source_block_id> - <sink_block_id>qtgui_freq_sink_x_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-fcd/examples/grc/fcd_nfm_rx.grc b/gr-fcd/examples/grc/fcd_nfm_rx.grc deleted file mode 100644 index af56c4f28e..0000000000 --- a/gr-fcd/examples/grc/fcd_nfm_rx.grc +++ /dev/null @@ -1,1399 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Mon Jul 14 15:02:45 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>fcd_nfm_rx</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>FCD FM Receiver</value> - </param> - <param> - <key>author</key> - <value>OZ9AEC</value> - </param> - <param> - <key>description</key> - <value>Simple FM receiver using the Funcube Dongle</value> - </param> - <param> - <key>window_size</key> - <value>1280, 1024</value> - </param> - <param> - <key>generate_options</key> - <value>qt_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>xlate_filter_taps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(428, 294)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>samp_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>96000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(182, 11)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>low_pass_filter</key> - <param> - <key>id</key> - <value>low_pass_filter</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> - </param> - <param> - <key>interp</key> - <value>1</value> - </param> - <param> - <key>gain</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>cutoff_freq</key> - <value>width/2</value> - </param> - <param> - <key>width</key> - <value>trans</value> - </param> - <param> - <key>win</key> - <value>firdes.WIN_HAMMING</value> - </param> - <param> - <key>beta</key> - <value>6.76</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(742, 266)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>fcd_source_c</key> - <param> - <key>id</key> - <value>fcd_source_c_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>device_name</key> - <value>hw:0</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>lna</key> - <value>rf_gain</value> - </param> - <param> - <key>mixer</key> - <value>+12</value> - </param> - <param> - <key>ppm</key> - <value>-120</value> - </param> - <param> - <key>dci</key> - <value>0.0</value> - </param> - <param> - <key>dcq</key> - <value>0.0</value> - </param> - <param> - <key>iq_phase</key> - <value>0.0</value> - </param> - <param> - <key>iq_gain</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(165, 157)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>freq_xlating_fir_filter_xxx</key> - <param> - <key>id</key> - <value>freq_xlating_fir_filter_xxx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>ccc</value> - </param> - <param> - <key>decim</key> - <value>1</value> - </param> - <param> - <key>taps</key> - <value>xlate_filter_taps</value> - </param> - <param> - <key>center_freq</key> - <value>-(offset_coarse+offset_fine)</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(422, 173)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>qtgui_freq_sink_x</key> - <param> - <key>id</key> - <value>qtgui_freq_sink_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>name</key> - <value>""</value> - </param> - <param> - <key>fftsize</key> - <value>512</value> - </param> - <param> - <key>wintype</key> - <value>firdes.WIN_BLACKMAN_hARRIS</value> - </param> - <param> - <key>fc</key> - <value>rx_freq*display_selector</value> - </param> - <param> - <key>bw</key> - <value>samp_rate</value> - </param> - <param> - <key>grid</key> - <value>False</value> - </param> - <param> - <key>autoscale</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>1.0</value> - </param> - <param> - <key>ymin</key> - <value>-140</value> - </param> - <param> - <key>ymax</key> - <value>10</value> - </param> - <param> - <key>nconnections</key> - <value>1</value> - </param> - <param> - <key>update_time</key> - <value>0.05</value> - </param> - <param> - <key>gui_hint</key> - <value>0,0,5,4</value> - </param> - <param> - <key>showports</key> - <value>True</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>width1</key> - <value>1</value> - </param> - <param> - <key>color1</key> - <value>"blue"</value> - </param> - <param> - <key>alpha1</key> - <value>1.0</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>width2</key> - <value>1</value> - </param> - <param> - <key>color2</key> - <value>"red"</value> - </param> - <param> - <key>alpha2</key> - <value>1.0</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>width3</key> - <value>1</value> - </param> - <param> - <key>color3</key> - <value>"green"</value> - </param> - <param> - <key>alpha3</key> - <value>1.0</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>width4</key> - <value>1</value> - </param> - <param> - <key>color4</key> - <value>"black"</value> - </param> - <param> - <key>alpha4</key> - <value>1.0</value> - </param> - <param> - <key>label5</key> - <value></value> - </param> - <param> - <key>width5</key> - <value>1</value> - </param> - <param> - <key>color5</key> - <value>"cyan"</value> - </param> - <param> - <key>alpha5</key> - <value>1.0</value> - </param> - <param> - <key>label6</key> - <value></value> - </param> - <param> - <key>width6</key> - <value>1</value> - </param> - <param> - <key>color6</key> - <value>"magenta"</value> - </param> - <param> - <key>alpha6</key> - <value>1.0</value> - </param> - <param> - <key>label7</key> - <value></value> - </param> - <param> - <key>width7</key> - <value>1</value> - </param> - <param> - <key>color7</key> - <value>"yellow"</value> - </param> - <param> - <key>alpha7</key> - <value>1.0</value> - </param> - <param> - <key>label8</key> - <value></value> - </param> - <param> - <key>width8</key> - <value>1</value> - </param> - <param> - <key>color8</key> - <value>"dark red"</value> - </param> - <param> - <key>alpha8</key> - <value>1.0</value> - </param> - <param> - <key>label9</key> - <value></value> - </param> - <param> - <key>width9</key> - <value>1</value> - </param> - <param> - <key>color9</key> - <value>"dark green"</value> - </param> - <param> - <key>alpha9</key> - <value>1.0</value> - </param> - <param> - <key>label10</key> - <value></value> - </param> - <param> - <key>width10</key> - <value>1</value> - </param> - <param> - <key>color10</key> - <value>"dark blue"</value> - </param> - <param> - <key>alpha10</key> - <value>1.0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(732, 165)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_entry</key> - <param> - <key>id</key> - <value>freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>FCD Freq</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>value</key> - <value>144.47e6</value> - </param> - <param> - <key>gui_hint</key> - <value>5,1,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(282, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_label</key> - <param> - <key>id</key> - <value>rx_freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Receive</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>value</key> - <value>freq+(offset_coarse+offset_fine)</value> - </param> - <param> - <key>formatter</key> - <value>None</value> - </param> - <param> - <key>gui_hint</key> - <value>4,3,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(430, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_simple_squelch_cc</key> - <param> - <key>id</key> - <value>analog_simple_squelch_cc_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>threshold</key> - <value>sql_lev</value> - </param> - <param> - <key>alpha</key> - <value>1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(199, 498)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_nbfm_rx</key> - <param> - <key>id</key> - <value>analog_nbfm_rx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>audio_rate</key> - <value>48000</value> - </param> - <param> - <key>quad_rate</key> - <value>96000</value> - </param> - <param> - <key>tau</key> - <value>75e-6</value> - </param> - <param> - <key>max_dev</key> - <value>5e3</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(391, 482)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_multiply_const_vxx</key> - <param> - <key>id</key> - <value>blocks_multiply_const_vxx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>const</key> - <value>af_gain</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(580, 506)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>audio_sink</key> - <param> - <key>id</key> - <value>audio_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>samp_rate</key> - <value>48000</value> - </param> - <param> - <key>device_name</key> - <value></value> - </param> - <param> - <key>ok_to_block</key> - <value>True</value> - </param> - <param> - <key>num_inputs</key> - <value>2</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(757, 510)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>offset_coarse</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Coarse Tune</value> - </param> - <param> - <key>value</key> - <value>0</value> - </param> - <param> - <key>start</key> - <value>-48000</value> - </param> - <param> - <key>stop</key> - <value>48000</value> - </param> - <param> - <key>step</key> - <value>100</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>6,2,1,2</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(11, 123)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>offset_fine</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Fine Tune</value> - </param> - <param> - <key>value</key> - <value>0</value> - </param> - <param> - <key>start</key> - <value>-1000</value> - </param> - <param> - <key>stop</key> - <value>1000</value> - </param> - <param> - <key>step</key> - <value>1</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>6,0,1,2</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(11, 250)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>width</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Filter</value> - </param> - <param> - <key>value</key> - <value>10000</value> - </param> - <param> - <key>start</key> - <value>2000</value> - </param> - <param> - <key>stop</key> - <value>40000</value> - </param> - <param> - <key>step</key> - <value>100</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>7,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(11, 377)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>trans</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Trans</value> - </param> - <param> - <key>value</key> - <value>1500</value> - </param> - <param> - <key>start</key> - <value>500</value> - </param> - <param> - <key>stop</key> - <value>5000</value> - </param> - <param> - <key>step</key> - <value>1</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>8,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 504)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>rf_gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>RF</value> - </param> - <param> - <key>value</key> - <value>20</value> - </param> - <param> - <key>start</key> - <value>-5</value> - </param> - <param> - <key>stop</key> - <value>30</value> - </param> - <param> - <key>step</key> - <value>1</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>7,1,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 632)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>af_gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>VOL</value> - </param> - <param> - <key>value</key> - <value>1</value> - </param> - <param> - <key>start</key> - <value>0</value> - </param> - <param> - <key>stop</key> - <value>5</value> - </param> - <param> - <key>step</key> - <value>0.1</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>8,1,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(124, 632)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_range</key> - <param> - <key>id</key> - <value>sql_lev</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>SQL</value> - </param> - <param> - <key>value</key> - <value>-100</value> - </param> - <param> - <key>start</key> - <value>-100</value> - </param> - <param> - <key>stop</key> - <value>0</value> - </param> - <param> - <key>step</key> - <value>1</value> - </param> - <param> - <key>widget</key> - <value>counter</value> - </param> - <param> - <key>orient</key> - <value>Qt.Horizontal</value> - </param> - <param> - <key>min_len</key> - <value>200</value> - </param> - <param> - <key>gui_hint</key> - <value>7,2,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(232, 632)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_qtgui_chooser</key> - <param> - <key>id</key> - <value>display_selector</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Spectrum</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>num_opts</key> - <value>0</value> - </param> - <param> - <key>value</key> - <value>0</value> - </param> - <param> - <key>options</key> - <value>[0,1]</value> - </param> - <param> - <key>labels</key> - <value>['Baseband','RF']</value> - </param> - <param> - <key>option0</key> - <value>0</value> - </param> - <param> - <key>label0</key> - <value></value> - </param> - <param> - <key>option1</key> - <value>1</value> - </param> - <param> - <key>label1</key> - <value></value> - </param> - <param> - <key>option2</key> - <value>2</value> - </param> - <param> - <key>label2</key> - <value></value> - </param> - <param> - <key>option3</key> - <value>3</value> - </param> - <param> - <key>label3</key> - <value></value> - </param> - <param> - <key>option4</key> - <value>4</value> - </param> - <param> - <key>label4</key> - <value></value> - </param> - <param> - <key>widget</key> - <value>combo_box</value> - </param> - <param> - <key>orient</key> - <value>Qt.QVBoxLayout</value> - </param> - <param> - <key>gui_hint</key> - <value>5,0,1,1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(356, 632)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>blocks_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>blocks_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>fcd_source_c_1</source_block_id> - <sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> - <sink_block_id>low_pass_filter</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>low_pass_filter</source_block_id> - <sink_block_id>analog_simple_squelch_cc_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_simple_squelch_cc_0</source_block_id> - <sink_block_id>analog_nbfm_rx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_nbfm_rx_0</source_block_id> - <sink_block_id>blocks_multiply_const_vxx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> - <sink_block_id>qtgui_freq_sink_x_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-fcd/gnuradio-fcd.pc.in b/gr-fcd/gnuradio-fcd.pc.in deleted file mode 100644 index a8c8282e27..0000000000 --- a/gr-fcd/gnuradio-fcd.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-fcd -Description: Funcube Dongle source block for GNU Radio -Requires: gnuradio-runtime gnuradio-audio -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-fcd -Cflags: -I${includedir} diff --git a/gr-fcd/grc/CMakeLists.txt b/gr-fcd/grc/CMakeLists.txt deleted file mode 100644 index d1eb00e322..0000000000 --- a/gr-fcd/grc/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -install(FILES - fcd_source_c.xml - DESTINATION ${GRC_BLOCKS_DIR} - COMPONENT "fcd_python" -) diff --git a/gr-fcd/grc/fcd_source_c.xml b/gr-fcd/grc/fcd_source_c.xml deleted file mode 100644 index 01ea26d81c..0000000000 --- a/gr-fcd/grc/fcd_source_c.xml +++ /dev/null @@ -1,117 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>Funcube Dongle Source</name> - <key>fcd_source_c</key> - <category>FCD</category> - <flags>throttle</flags> - <import>from gnuradio import fcd</import> - <make>fcd.source_c($device_name) -#if $lna() != 20.0 -self.$(id).set_lna_gain($lna) -#end if -#if $mixer() != +12.0 -self.$(id).set_mixer_gain($mixer) -#end if -#if $ppm() != -120 -self.$(id).set_freq_corr($ppm) -#end if -#if ($dci() != 0.0) or ($dcq() != 0.0) -self.$(id).set_dc_corr($dci,$dcq) -#end if -#if ($iq_phase() != 0.0) or ($iq_gain() != 1.0) -self.$(id).set_iq_corr($iq_gain,$iq_phase) -#end if -self.$(id).set_freq($freq) - </make> - <callback>set_freq($freq)</callback> - <callback>set_lna_gain($lna)</callback> - <callback>set_mixer_gain($mixer)</callback> - <callback>set_freq_corr($ppm)</callback> - <callback>set_dc_corr($dci,$dcq)</callback> - <callback>set_iq_corr($iq_gain,$iq_phase)</callback> - <param> - <name>Device Name</name> - <key>device_name</key> - <value>hw:1</value> - <type>string</type> - <hide>#if $device_name() then 'none' else 'part'#</hide> - </param> - <param> - <name>Frequency (Hz)</name> - <key>freq</key> - <value>145500000</value> - <type>real</type> - </param> - <param> - <name>LNA Gain (dB)</name> - <key>lna</key> - <value>20.0</value> - <type>real</type> - </param> - <param> - <name>Mixer Gain (dB)</name> - <key>mixer</key> - <value>+12</value> - <type>real</type> - </param> - <param> - <name>Frequency corr. (ppm)</name> - <key>ppm</key> - <value>-120</value> - <type>int</type> - </param> - <param> - <name>DC I offset</name> - <key>dci</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>DC Q offset</name> - <key>dcq</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>IQ phase balance</name> - <key>iq_phase</key> - <value>0.0</value> - <type>real</type> - </param> - <param> - <name>IQ gain balance</name> - <key>iq_gain</key> - <value>1.0</value> - <type>real</type> - </param> - <check>($freq >= 50e6) and ($freq <= 2e9)</check> - <check>($dci >= -1.0) and ($dci <= 1.0)</check> - <check>($dcq >= -1.0) and ($dcq <= 1.0)</check> - <check>($iq_phase >= -1.0) and ($iq_phase <= 1.0)</check> - <check>($iq_gain >= -1.0) and ($iq_gain <= 1.0)</check> - <source> - <name>out</name> - <type>complex</type> - </source> - <doc> -This block wraps the Funcube Dongle USB audio input and the USB HID control interface \ -into one convenient GNU Radio source block. - -The sample rate is fixed at 96 ksps. - -To find the device name on Linux type: - cat /proc/asound/cards - -The LNA gain is a set of discrete values between -5 to 30 dB with 2.5 dB step, but you can \ -use any float value and it will be rounded to the nearest valid value. - -The Mixer gain can be set either to +4 or +12 dB, but you can use any float value \ -and it will be rounded to the nearest valid value. - -The FCD block can autmatically apply frequency correction: - - For FCD v1.0 you can leave at -120 ppm - - For FCD v1.1 with serial number 810 or greater use -12 ppm - -The DC offset and IQ balance parameters can have range -1.0 to 1.0. - </doc> -</block> diff --git a/gr-fcd/include/gnuradio/fcd/CMakeLists.txt b/gr-fcd/include/gnuradio/fcd/CMakeLists.txt deleted file mode 100644 index c4dde9134c..0000000000 --- a/gr-fcd/include/gnuradio/fcd/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Install header files -######################################################################## -install(FILES - api.h - source_c.h - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/fcd - COMPONENT "fcd_devel" -) diff --git a/gr-fcd/include/gnuradio/fcd/api.h b/gr-fcd/include/gnuradio/fcd/api.h deleted file mode 100644 index 83afbbd694..0000000000 --- a/gr-fcd/include/gnuradio/fcd/api.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_FCD_API_H -#define INCLUDED_FCD_API_H - -#include <gnuradio/attributes.h> - -#ifdef gnuradio_fcd_EXPORTS -# define FCD_API __GR_ATTR_EXPORT -#else -# define FCD_API __GR_ATTR_IMPORT -#endif - -#endif /* INCLUDED_FCD_API_H */ diff --git a/gr-fcd/include/gnuradio/fcd/source_c.h b/gr-fcd/include/gnuradio/fcd/source_c.h deleted file mode 100644 index 2c68b9b6a6..0000000000 --- a/gr-fcd/include/gnuradio/fcd/source_c.h +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011-2013 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_FCD_SOURCE_C_H -#define INCLUDED_FCD_SOURCE_C_H - -#include <gnuradio/fcd/api.h> -#include <gnuradio/hier_block2.h> - -namespace gr { - namespace fcd { - - /*! - * \brief Funcube Dongle source block. - * \ingroup fcd_blk - * - * \details - * This class provides a Funcube Dongle soure block by wrapping - * the USB audio interface and the USB HID control interface of - * the Funcube Dongle into one convenient source block. - * - * The Funcube Dongle needs to have firmware 18f or later for the - * control interface to work properly. As of early 2011, FCDs - * still come with firmware 18b. You can use qthid 2.2 (not 3) to - * upgrade the firmware: http://qthid.sf.net - */ - class FCD_API source_c : virtual public gr::hier_block2 - { - public: - // gr::fcd::source_c::sptr - typedef boost::shared_ptr<source_c> sptr; - - /*! - * \brief Return a shared_ptr to a new instance of fcd_source_c. - * - * \details - * This is effectively the public constructor. To avoid accidental - * use of raw pointers, fcd_source_c's constructor is private. - * fcd_make_source_c is the public interface for creating new - * instances. - */ - static sptr make(const std::string device_name = ""); - - /*! \brief Set frequency with Hz resolution. - * \param freq The frequency in Hz - * - * Set the frequency of the Funcube Dongle with 1 Hz resolution applying - * the frequency correction set by set_freq_corr(). - * - * \see set_freq_khz() - */ - virtual void set_freq(int freq) = 0; - - /*! \brief Set frequency with Hz resolution. - * \param freq The frequency in Hz - * - * This is a convenience function that uses float parameter in - * order to allow using engineering notation in GRC. - * - * \see set_freq_khz() - */ - virtual void set_freq(float freq) = 0; - - /*! \brief Set frequency with kHz resolution. - * \param freq The frequency in kHz - * - * Sets the frequency of the Funcube Dongle with 1 kHz - * resolution applying the frequency correction set by - * set_freq_corr(). - * - * \see set_freq() - */ - virtual void set_freq_khz(int freq) = 0; - - /*! \brief Set LNA gain. - * \param gain The new gain in dB. - * - * Set the LNA gain in the FCD. Valid range is -5 to - * 30. Although the LNA gain in the FCD takes enumerated values - * corresponding to 2.5 dB steps, you can can call this method - * with any float value and it will be rounded to the nearest - * valid value. - * - * By default the LNA gain is set to 20 dB and this is a good value for - * most cases. In noisy areas you may try to reduce the gain. - */ - virtual void set_lna_gain(float gain) = 0; - - /*! \brief Set mixer gain. - * \param gain The new gain in dB. - * - * Set the mixer gain in the FCD. Valid values are +4 and +12 dB. - * - * By default the mixer gain is set to +12 dB and this is a good - * value for most cases. In noisy areas you may try to reduce - * the gain. - */ - virtual void set_mixer_gain(float gain) = 0; - - /*! \brief Set new frequency correction. - * \param ppm The new frequency correction in parts per million - * - * Version 1.1 FCDs (S/N 810 or later) need a correction of -12 - * ppm. Earlier FCDs need roughly -120 ppm (default for - * gr-fcd). - * - * Ref: http://www.funcubedongle.com/?p=617 - */ - virtual void set_freq_corr(int ppm) = 0; - - /*! \brief Set DC offset correction. - * \param _dci DC correction for I component (-1.0 to 1.0) - * \param _dcq DC correction for Q component (-1.0 to 1.0) - * - * Set DC offset correction in the device. Default is 0.0. - */ - virtual void set_dc_corr(double _dci, double _dcq) = 0; - - /*! \brief Set IQ phase and gain balance. - * \param _gain The gain correction (-1.0 to 1.0) - * \param _phase The phase correction (-1.0 to 1.0) - * - * Set IQ phase and gain balance in the device. The default values - * are 0.0 for phase and 1.0 for gain. - */ - virtual void set_iq_corr(double _gain, double _phase) = 0; - }; - - } /* namespace fcd */ -} /* namespace gr */ - -#endif /* INCLUDED_FCD_SOURCE_C_H */ diff --git a/gr-fcd/lib/CMakeLists.txt b/gr-fcd/lib/CMakeLists.txt deleted file mode 100644 index cc896792a1..0000000000 --- a/gr-fcd/lib/CMakeLists.txt +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright 2012-2013 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. - -GR_INCLUDE_SUBDIRECTORY(hid) -GR_INCLUDE_SUBDIRECTORY(fcd) - -######################################################################## -# Setup the include and linker paths -######################################################################## -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/hid - ${CMAKE_CURRENT_SOURCE_DIR}/fcd - ${GR_FCD_INCLUDE_DIRS} - ${GR_AUDIO_INCLUDE_DIRS} - ${GR_BLOCKS_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${LIBUSB_INCLUDE_DIR} -) - -link_directories( - ${Boost_LIBRARY_DIRS} - ${LIBUSB_LIBRARY_DIRS} -) - -if(ENABLE_GR_CTRLPORT) - ADD_DEFINITIONS(-DGR_CTRLPORT) -endif(ENABLE_GR_CTRLPORT) - -include_directories(${LOG4CPP_INCLUDE_DIRS}) -link_directories(${LOG4CPP_LIBRARY_DIRS}) - -######################################################################## -# Setup library -######################################################################## -list(APPEND gr_fcd_sources - source_c_impl.cc -) - -list(APPEND fcd_libs - gnuradio-runtime - gnuradio-blocks - gnuradio-audio - ${Boost_LIBRARIES} -) - -if (WIN32) - list(APPEND fcd_libs setupapi) - - #Add Windows DLL resource file if using MSVC - if(MSVC) - include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-fcd.rc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.rc - @ONLY) - - list(APPEND gr_fcd_sources ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.rc) - endif(MSVC) -endif() - -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - FIND_LIBRARY(IOKIT_LIBRARY IOKit) - list(APPEND fcd_libs ${IOKIT_LIBRARY}) -elseif (NOT WIN32) - list(APPEND fcd_libs - ${LIBUSB_LIBRARIES} - ) -endif() - - -add_library(gnuradio-fcd SHARED ${gr_fcd_sources}) -if (LINUX) - list(APPEND fcd_libs rt) -endif() -target_link_libraries(gnuradio-fcd ${fcd_libs} ${LOG4CPP_LIBRARIES}) - - -GR_LIBRARY_FOO(gnuradio-fcd RUNTIME_COMPONENT "fcd_runtime" DEVEL_COMPONENT "fcd_devel") diff --git a/gr-fcd/lib/fcd/CMakeLists.txt b/gr-fcd/lib/fcd/CMakeLists.txt deleted file mode 100644 index 416a7507e8..0000000000 --- a/gr-fcd/lib/fcd/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# This file included, use CMake directory variables -######################################################################## - -include_directories(APPEND ${USB_INCLUDES}) - -set(fcd_sources ${CMAKE_CURRENT_SOURCE_DIR}/fcd.c) - - -######################################################################## -# Append gnuradio-fcd library sources -######################################################################## -list(APPEND gr_fcd_sources ${fcd_sources}) diff --git a/gr-fcd/lib/fcd/COPYRIGHT b/gr-fcd/lib/fcd/COPYRIGHT deleted file mode 100644 index f176590e9d..0000000000 --- a/gr-fcd/lib/fcd/COPYRIGHT +++ /dev/null @@ -1,23 +0,0 @@ -For convenience, GNU Radio includes the contents of this directory -in its distribution, but they are not considered part of GNU Radio. - -These files are licensed and redistributed using the terms of the -GPLv3. -------------------------------------------------------------------- -Copyright (C) 2010 Howard Long, G6LVB -CopyRight (C) 2011 Alexandru Csete, OZ9AEC - Mario Lorenz, DL5MLO - -Qthid 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. - -Qthid 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 Qthid. If not, see <http://www.gnu.org/licenses/>. - diff --git a/gr-fcd/lib/fcd/fcd.c b/gr-fcd/lib/fcd/fcd.c deleted file mode 100644 index 693f5fb81c..0000000000 --- a/gr-fcd/lib/fcd/fcd.c +++ /dev/null @@ -1,895 +0,0 @@ -/*************************************************************************** - * This file is part of Qthid. - * - * Copyright (C) 2010 Howard Long, G6LVB - * CopyRight (C) 2011 Alexandru Csete, OZ9AEC - * Mario Lorenz, DL5MLO - * - * Qthid 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. - * - * Qthid 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 Qthid. If not, see <http://www.gnu.org/licenses/>. - * - ***************************************************************************/ - -#define FCD -#include <string.h> -#ifdef WIN32 - #include <malloc.h> -#else - #include <stdlib.h> -#endif -#include "hidapi.h" -#include "fcd.h" -#include "fcdhidcmd.h" -#include <stdio.h> - - -#define FALSE 0 -#define TRUE 1 -typedef int BOOL; - - -const unsigned short _usVID=0x04D8; /*!< USB vendor ID. */ -const unsigned short _usPID=0xFB56; /*!< USB product ID. */ - - - -/** \brief Open FCD device. - * \return Pointer to the FCD HID device or NULL if none found - * - * This function looks for FCD devices connected to the computer and - * opens the first one found. - */ -static hid_device *fcdOpen(void) -{ - struct hid_device_info *phdi=NULL; - hid_device *phd=NULL; - char *pszPath=NULL; - - phdi=hid_enumerate(_usVID,_usPID); - if (phdi==NULL) - { - return NULL; // No FCD device found - } - - pszPath=strdup(phdi->path); - if(pszPath != NULL) { - phd = hid_open_path(pszPath); - - free(pszPath); - } else { - phd = NULL; - } - - hid_free_enumeration(phdi); - - return phd; -} - - -/** \brief Close FCD HID device. */ -static void fcdClose(hid_device *phd) -{ - hid_close(phd); -} - - -/** \brief Get FCD mode. - * \return The current FCD mode. - * \sa FCD_MODE_ENUM - */ -EXTERN FCD_MODE_ENUM fcdGetMode(void) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - FCD_MODE_ENUM fcd_mode = FCD_MODE_NONE; - - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - /* Send a BL Query Command */ - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_QUERY; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - fcdClose(phd); - phd = NULL; - - /* first check status bytes then check which mode */ - if (aucBufIn[0]==FCD_CMD_BL_QUERY && aucBufIn[1]==1) { - - /* In bootloader mode we have the string "FCDBL" starting at acBufIn[2] **/ - if (strncmp((char *)(aucBufIn+2), "FCDBL", 5) == 0) { - fcd_mode = FCD_MODE_BL; - } - /* In application mode we have "FCDAPP_18.06" where the number is the FW version */ - else if (strncmp((char *)(aucBufIn+2), "FCDAPP", 6) == 0) { - fcd_mode = FCD_MODE_APP; - } - /* either no FCD or firmware less than 18f */ - else { - fcd_mode = FCD_MODE_NONE; - } - } - - return fcd_mode; -} - - -/** \brief Get FCD firmware version as string. - * \param str The returned vesion number as a 0 terminated string (must be pre-allocated) - * \return The current FCD mode. - * \sa FCD_MODE_ENUM - */ -EXTERN FCD_MODE_ENUM fcdGetFwVerStr(char *str) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - FCD_MODE_ENUM fcd_mode = FCD_MODE_NONE; - - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - /* Send a BL Query Command */ - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_QUERY; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - fcdClose(phd); - phd = NULL; - - /* first check status bytes then check which mode */ - if (aucBufIn[0]==FCD_CMD_BL_QUERY && aucBufIn[1]==1) { - - /* In bootloader mode we have the string "FCDBL" starting at acBufIn[2] **/ - if (strncmp((char *)(aucBufIn+2), "FCDBL", 5) == 0) { - fcd_mode = FCD_MODE_BL; - } - /* In application mode we have "FCDAPP_18.06" where the number is the FW version */ - else if (strncmp((char *)(aucBufIn+2), "FCDAPP", 6) == 0) { - strncpy(str, (char *)(aucBufIn+9), 5); - str[5] = 0; - fcd_mode = FCD_MODE_APP; - } - /* either no FCD or firmware less than 18f */ - else { - fcd_mode = FCD_MODE_NONE; - } - } - - return fcd_mode; -} - - -/** \brief Get hardware and firmware dependent FCD capabilities. - * \param fcd_caps Pointer to an FCD_CAPS_STRUCT - * \return The current FCD mode. - * - * This function queries the FCD and extracts the hardware and firmware dependent - * capabilities. Currently these capabilities are: - * - Bias T (available since S/N TBD) - * - Cellular block (the certified version of the FCD) - * When the FCD is in application mode, the string returned by the query command is - * (starting at index 2): - * FCDAPP 18.08 Brd 1.0 No blk - * 1.0 means no bias tee, 1.1 means there is a bias tee - * 'No blk' means it is not cellular blocked. - * - * Ref: http://uk.groups.yahoo.com/group/FCDevelopment/message/303 - */ -EXTERN FCD_MODE_ENUM fcdGetCaps(FCD_CAPS_STRUCT *fcd_caps) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - FCD_MODE_ENUM fcd_mode = FCD_MODE_NONE; - - /* clear output buffer */ - fcd_caps->hasBiasT = 0; - fcd_caps->hasCellBlock = 0; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - /* Send a BL Query Command */ - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_QUERY; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - fcdClose(phd); - phd = NULL; - - /* first check status bytes then check which mode */ - if (aucBufIn[0]==FCD_CMD_BL_QUERY && aucBufIn[1]==1) { - - /* In bootloader mode we have the string "FCDBL" starting at acBufIn[2] **/ - if (strncmp((char *)(aucBufIn+2), "FCDBL", 5) == 0) { - fcd_mode = FCD_MODE_BL; - } - /* In application mode we have "FCDAPP 18.08 Brd 1.0 No blk" (see API doc) */ - else if (strncmp((char *)(aucBufIn+2), "FCDAPP", 6) == 0) { - - /* Bias T */ - fcd_caps->hasBiasT = (aucBufIn[21] == '1') ? 1 : 0; - - /* cellular block */ - if (strncmp((char *)(aucBufIn+23), "No blk", 6) == 0) { - fcd_caps->hasCellBlock = 0; - } else { - fcd_caps->hasCellBlock = 1; - } - - fcd_mode = FCD_MODE_APP; - } - /* either no FCD or firmware less than 18f */ - else { - fcd_mode = FCD_MODE_NONE; - } - } - - return fcd_mode; -} - - -/** \brief Get hardware and firmware dependent FCD capabilities as string. - * \param caps_str Pointer to a pre-allocated string buffer where the info will be copied. - * \return The current FCD mode. - * - * This function queries the FCD and copies the returned string into the caps_str parameter. - * THe return buffer must be at least 28 characters. - * When the FCD is in application mode, the string returned by the query command is - * (starting at index 2): - * FCDAPP 18.08 Brd 1.0 No blk - * 1.0 means no bias tee, 1.1 means there is a bias tee - * 'No blk' means it is not cellular blocked. - * - * Ref: http://uk.groups.yahoo.com/group/FCDevelopment/message/303 - */ -EXTERN FCD_MODE_ENUM fcdGetCapsStr(char *caps_str) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - FCD_MODE_ENUM fcd_mode = FCD_MODE_NONE; - - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - /* Send a BL Query Command */ - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_QUERY; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - fcdClose(phd); - phd = NULL; - - /* first check status bytes then check which mode */ - if (aucBufIn[0]==FCD_CMD_BL_QUERY && aucBufIn[1]==1) { - - /* In bootloader mode we have the string "FCDBL" starting at acBufIn[2] **/ - if (strncmp((char *)(aucBufIn+2), "FCDBL", 5) == 0) { - fcd_mode = FCD_MODE_BL; - } - /* In application mode we have "FCDAPP 18.08 Brd 1.0 No blk" (see API doc) */ - else if (strncmp((char *)(aucBufIn+2), "FCDAPP", 6) == 0) { - - strncpy(caps_str, (char *)(aucBufIn+2), 27); - caps_str[27] = 0; - - fcd_mode = FCD_MODE_APP; - } - /* either no FCD or firmware less than 18f */ - else { - fcd_mode = FCD_MODE_NONE; - } - } - - return fcd_mode; -} - - - -/** \brief Reset FCD to bootloader mode. - * \return FCD_MODE_NONE - * - * This function is used to switch the FCD into bootloader mode in which - * various firmware operations can be performed. - */ -EXTERN FCD_MODE_ENUM fcdAppReset(void) -{ - hid_device *phd=NULL; - //unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - // Send an App reset command - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_APP_RESET; - hid_write(phd, aucBufOut, 65); - - /** FIXME: hid_read() will occasionally hang due to a pthread_cond_wait() never returning. - It seems that the read_callback() in hid-libusb.c will never receive any - data during the reconfiguration. Since the same logic works in the native - windows application, it could be a libusb thing. Anyhow, since the value - returned by this function is not used, we may as well just skip the hid_read() - and return FME_NONE. - Correct switch from APP to BL mode can be observed in /var/log/messages (linux) - (when in bootloader mode the device version includes 'BL') - */ - /* - memset(aucBufIn,0xCC,65); // Clear out the response buffer - hid_read(phd,aucBufIn,65); - - if (aucBufIn[0]==FCDCMDAPPRESET && aucBufIn[1]==1) - { - FCDClose(phd); - phd=NULL; - return FME_APP; - } - FCDClose(phd); - phd=NULL; - return FME_BL; - */ - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_NONE; - -} - - -/** \brief Set FCD frequency with kHz resolution. - * \param nFreq The new frequency in kHz. - * \return The FCD mode. - * - * This function sets the frequency of the FCD with 1 kHz resolution. The parameter - * nFreq must already contain any necessary frequency correction. - * - * \sa fcdAppSetFreq - */ -EXTERN FCD_MODE_ENUM fcdAppSetFreqkHz(int nFreq) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - // Send an App reset command - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_APP_SET_FREQ_KHZ; - aucBufOut[2] = (unsigned char)nFreq; - aucBufOut[3] = (unsigned char)(nFreq>>8); - aucBufOut[4] = (unsigned char)(nFreq>>16); - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]==FCD_CMD_APP_SET_FREQ_KHZ && aucBufIn[1]==1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; -} - - -/** \brief Set FCD frequency with Hz resolution. - * \param nFreq The new frequency in Hz. - * \return The FCD mode. - * - * This function sets the frequency of the FCD with 1 Hz resolution. The parameter - * nFreq must already contain any necessary frequency correction. - * - * \sa fcdAppSetFreq - */ -EXTERN FCD_MODE_ENUM fcdAppSetFreq(int nFreq) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - // Send an App reset command - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_APP_SET_FREQ_HZ; - aucBufOut[2] = (unsigned char)nFreq; - aucBufOut[3] = (unsigned char)(nFreq>>8); - aucBufOut[4] = (unsigned char)(nFreq>>16); - aucBufOut[5] = (unsigned char)(nFreq>>24); - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]==FCD_CMD_APP_SET_FREQ_HZ && aucBufIn[1]==1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; -} - - - -/** \brief Reset FCD to application mode. - * \return FCD_MODE_NONE - * - * This function is used to switch the FCD from bootloader mode - * into application mode. - */ -EXTERN FCD_MODE_ENUM fcdBlReset(void) -{ - hid_device *phd=NULL; -// unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - // Send an BL reset command - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_RESET; - hid_write(phd, aucBufOut, 65); - - /** FIXME: hid_read() will hang due to a pthread_cond_wait() never returning. - It seems that the read_callback() in hid-libusb.c will never receive any - data during the reconfiguration. Since the same logic works in the native - windows application, it could be a libusb thing. Anyhow, since the value - returned by this function is not used, we may as well jsut skip the hid_read() - and return FME_NONE. - Correct switch from BL to APP mode can be observed in /var/log/messages (linux) - (when in bootloader mode the device version includes 'BL') - */ - /* - memset(aucBufIn,0xCC,65); // Clear out the response buffer - hid_read(phd,aucBufIn,65); - - if (aucBufIn[0]==FCDCMDBLRESET && aucBufIn[1]==1) - { - FCDClose(phd); - phd=NULL; - return FME_BL; - } - FCDClose(phd); - phd=NULL; - return FME_APP; - */ - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_NONE; - -} - - -/** \brief Erase firmware from FCD. - * \return The FCD mode - * - * This function deletes the firmware from the FCD. This is required - * before writing new firmware into the FCD. - * - * \sa fcdBlWriteFirmware - */ -EXTERN FCD_MODE_ENUM fcdBlErase(void) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - // Send an App reset command - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_ERASE; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]==FCD_CMD_BL_ERASE && aucBufIn[1]==1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; - } - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; -} - - -/** \brief Write new firmware into the FCD. - * \param pc Pointer to the new firmware data - * \param n64size The number of bytes in the data - * \return The FCD mode - * - * This function is used to upload new firmware into the FCD flash. - * - * \sa fcdBlErase - */ -EXTERN FCD_MODE_ENUM fcdBlWriteFirmware(char *pc, int64_t n64Size) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - uint32_t u32AddrStart; - uint32_t u32AddrEnd; - uint32_t u32Addr; - BOOL bFinished=FALSE; - - phd = fcdOpen(); - - if (phd==NULL) - { - return FCD_MODE_NONE; - } - - // Get the valid flash address range - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_GET_BYTE_ADDR_RANGE; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_GET_BYTE_ADDR_RANGE || aucBufIn[1]!=1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - u32AddrStart= - aucBufIn[2]+ - (((uint32_t)aucBufIn[3])<<8)+ - (((uint32_t)aucBufIn[4])<<16)+ - (((uint32_t)aucBufIn[5])<<24); - u32AddrEnd= - aucBufIn[6]+ - (((uint32_t)aucBufIn[7])<<8)+ - (((uint32_t)aucBufIn[8])<<16)+ - (((uint32_t)aucBufIn[9])<<24); - - // Set start address for flash - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_SET_BYTE_ADDR; - aucBufOut[2] = ((unsigned char)u32AddrStart); - aucBufOut[3] = ((unsigned char)(u32AddrStart>>8)); - aucBufOut[4] = ((unsigned char)(u32AddrStart>>16)); - aucBufOut[5] = ((unsigned char)(u32AddrStart>>24)); - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_SET_BYTE_ADDR || aucBufIn[1]!=1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - // Write blocks - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_WRITE_FLASH_BLOCK; - for (u32Addr=u32AddrStart; u32Addr+47<u32AddrEnd && u32Addr+47<n64Size && !bFinished; u32Addr+=48) - { - memcpy(&aucBufOut[3], &pc[u32Addr], 48); - - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_WRITE_FLASH_BLOCK || aucBufIn[1]!=1) - { - bFinished = TRUE; - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - } - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; -} - - -/** \brief Verify firmware in FCd flash. - * \param pc Pointer to firmware data to verify against. - * \param n64Size Size of the data in pc. - * \return The FCD_MODE_BL if verification was succesful. - * - * This function verifies the firmware currently in the FCd flash against the firmware - * image pointed to by pc. The function return FCD_MODE_BL if the verification is OK and - * FCD_MODE_APP otherwise. - */ -EXTERN FCD_MODE_ENUM fcdBlVerifyFirmware(char *pc, int64_t n64Size) -{ - hid_device *phd=NULL; - unsigned char aucBufIn[65]; - unsigned char aucBufOut[65]; - uint32_t u32AddrStart; - uint32_t u32AddrEnd; - uint32_t u32Addr; - BOOL bFinished=FALSE; - - phd = fcdOpen(); - - if (phd==NULL) - { - return FCD_MODE_NONE; - } - - // Get the valid flash address range - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_GET_BYTE_ADDR_RANGE; - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_GET_BYTE_ADDR_RANGE || aucBufIn[1]!=1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - u32AddrStart= - aucBufIn[2]+ - (((uint32_t)aucBufIn[3])<<8)+ - (((uint32_t)aucBufIn[4])<<16)+ - (((uint32_t)aucBufIn[5])<<24); - - u32AddrEnd= - aucBufIn[6]+ - (((uint32_t)aucBufIn[7])<<8)+ - (((uint32_t)aucBufIn[8])<<16)+ - (((uint32_t)aucBufIn[9])<<24); - - // Set start address for flash - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_SET_BYTE_ADDR; - aucBufOut[2] = ((unsigned char)u32AddrStart); - aucBufOut[3] = ((unsigned char)(u32AddrStart>>8)); - aucBufOut[4] = ((unsigned char)(u32AddrStart>>16)); - aucBufOut[5] = ((unsigned char)(u32AddrStart>>24)); - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_SET_BYTE_ADDR || aucBufIn[1]!=1) - { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - // Read blocks - aucBufOut[0] = 0; // Report ID, ignored - aucBufOut[1] = FCD_CMD_BL_READ_FLASH_BLOCK; - for (u32Addr=u32AddrStart; u32Addr+47<u32AddrEnd && u32Addr+47<n64Size && !bFinished; u32Addr+=48) - { - hid_write(phd, aucBufOut, 65); - memset(aucBufIn, 0xCC, 65); // Clear out the response buffer - hid_read(phd, aucBufIn, 65); - - if (aucBufIn[0]!=FCD_CMD_BL_READ_FLASH_BLOCK || aucBufIn[1]!=1) - { - bFinished = TRUE; - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - if (memcmp(&aucBufIn[2],&pc[u32Addr],48)!=0) - { - bFinished = TRUE; - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - } - - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; -} - - - -/** \brief Write FCD parameter (e.g. gain or filter) - * \param u8Cmd The command byte / parameter ID, see FCD_CMD_APP_SET_* - * \param pu8Data The parameter value to be written - * \param u8len Length of pu8Data in bytes - * \return One of FCD_MODE_NONE, FCD_MODE_APP or FCD_MODE_BL (see description) - * - * This function can be used to set the value of a parameter in the FCD for which there is no - * high level API call. It gives access to the low level API of the FCD and the caller is expected - * to be aware of the various FCD commands, since they are required to be supplied as parameter - * to this function. - * - * The return value can be used to determine the success or failure of the command execution: - * - FCD_MODE_APP : Reply from FCD was as expected (nominal case). - * - FCD_MODE_BL : Reply from FCD was not as expected. - * - FCD_MODE_NONE : No FCD was found - */ -EXTERN FCD_MODE_ENUM fcdAppSetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len) -{ - hid_device *phd=NULL; - unsigned char aucBufOut[65]; - unsigned char aucBufIn[65]; - - - phd = fcdOpen(); - - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - aucBufOut[0]=0; // Report ID, ignored - aucBufOut[1]=u8Cmd; - memcpy(aucBufOut+2, pu8Data,u8len); - hid_write(phd,aucBufOut,65); - - /* we must read after each write in order to empty FCD/HID buffer */ - memset(aucBufIn,0xCC,65); // Clear out the response buffer - hid_read(phd,aucBufIn,65); - - /* Check the response, if OK return FCD_MODE_APP */ - if (aucBufIn[0]==u8Cmd && aucBufIn[1]==1) { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - /* Response did not contain the expected bytes */ - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; - -} - - -/** \brief Read FCD parameter (e.g. gain or filter) - * \param u8Cmd The command byte / parameter ID, see FCD_CMD_APP_GET_* - * \param pu8Data TPointer to buffer where the parameter value(s) will be written - * \param u8len Length of pu8Data in bytes - * \return One of FCD_MODE_NONE, FCD_MODE_APP or FCD_MODE_BL (see description) - * - * This function can be used to read the value of a parameter in the FCD for which there is no - * high level API call. It gives access to the low level API of the FCD and the caller is expected - * to be aware of the various FCD commands, since they are required to be supplied as parameter - * to this function. - * - * The return value can be used to determine the success or failure of the command execution: - * - FCD_MODE_APP : Reply from FCD was as expected (nominal case). - * - FCD_MODE_BL : Reply from FCD was not as expected. - * - FCD_MODE_NONE : No FCD was found - */ -EXTERN FCD_MODE_ENUM fcdAppGetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len) -{ - hid_device *phd=NULL; - unsigned char aucBufOut[65]; - unsigned char aucBufIn[65]; - - phd = fcdOpen(); - if (phd == NULL) - { - return FCD_MODE_NONE; - } - - aucBufOut[0]=0; // Report ID, ignored - aucBufOut[1]=u8Cmd; - hid_write(phd,aucBufOut,65); - - memset(aucBufIn,0xCC,65); // Clear out the response buffer - hid_read(phd,aucBufIn,65); - /* Copy return data to output buffer (even if cmd exec failed) */ - memcpy(pu8Data,aucBufIn+2,u8len); - - /* Check status bytes in returned data */ - if (aucBufIn[0]==u8Cmd && aucBufIn[1]==1) { - fcdClose(phd); - phd = NULL; - - return FCD_MODE_APP; - } - - /* Response did not contain the expected bytes */ - fcdClose(phd); - phd = NULL; - - return FCD_MODE_BL; -} - diff --git a/gr-fcd/lib/fcd/fcd.h b/gr-fcd/lib/fcd/fcd.h deleted file mode 100644 index d089c2044f..0000000000 --- a/gr-fcd/lib/fcd/fcd.h +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * This file is part of Qthid. - * - * Copyright (C) 2010 Howard Long, G6LVB - * CopyRight (C) 2011 Alexandru Csete, OZ9AEC - * Mario Lorenz, DL5MLO - * - * Qthid 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. - * - * Qthid 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 Qthid. If not, see <http://www.gnu.org/licenses/>. - * - ***************************************************************************/ - -#ifndef FCD_H -#define FCD_H 1 - -#include <gnuradio/fcd/api.h> - -#ifdef FCD -#define EXTERN -#define ASSIGN (x) =x -#else -#define EXTERN extern -#define ASSIGN(x) -#endif - -#include <inttypes.h> - -/** \brief FCD mode enumeration. */ -typedef enum { - FCD_MODE_NONE, /*!< No FCD detected. */ - FCD_MODE_BL, /*!< FCD present in bootloader mode. */ - FCD_MODE_APP /*!< FCD present in aplpication mode. */ -} FCD_MODE_ENUM; // The current mode of the FCD: none inserted, in bootloader mode or in normal application mode - -/** \brief FCD capabilities that depend on both hardware and firmware. */ -typedef struct { - unsigned char hasBiasT; /*!< Whether FCD has hardware bias tee (1=yes, 0=no) */ - unsigned char hasCellBlock; /*!< Whether FCD has cellular blocking. */ -} FCD_CAPS_STRUCT; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Application functions */ -EXTERN FCD_API FCD_MODE_ENUM fcdGetMode(void); -EXTERN FCD_API FCD_MODE_ENUM fcdGetFwVerStr(char *str); -EXTERN FCD_API FCD_MODE_ENUM fcdGetCaps(FCD_CAPS_STRUCT *fcd_caps); -EXTERN FCD_API FCD_MODE_ENUM fcdGetCapsStr(char *caps_str); -EXTERN FCD_API FCD_MODE_ENUM fcdAppReset(void); -EXTERN FCD_API FCD_MODE_ENUM fcdAppSetFreqkHz(int nFreq); -EXTERN FCD_API FCD_MODE_ENUM fcdAppSetFreq(int nFreq); - -EXTERN FCD_API FCD_MODE_ENUM fcdAppSetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len); -EXTERN FCD_API FCD_MODE_ENUM fcdAppGetParam(uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len); - - -/* Bootloader functions */ -EXTERN FCD_API FCD_MODE_ENUM fcdBlReset(void); -EXTERN FCD_API FCD_MODE_ENUM fcdBlErase(void); -EXTERN FCD_API FCD_MODE_ENUM fcdBlWriteFirmware(char *pc, int64_t n64Size); -EXTERN FCD_API FCD_MODE_ENUM fcdBlVerifyFirmware(char *pc, int64_t n64Size); - - -#ifdef __cplusplus -} -#endif - -#endif // FCD_H diff --git a/gr-fcd/lib/fcd/fcdhidcmd.h b/gr-fcd/lib/fcd/fcdhidcmd.h deleted file mode 100644 index 1741ede303..0000000000 --- a/gr-fcd/lib/fcd/fcdhidcmd.h +++ /dev/null @@ -1,305 +0,0 @@ -/*************************************************************************** - * This file is part of Qthid. - * - * Copyright (C) 2010 Howard Long, G6LVB - * CopyRight (C) 2011 Alexandru Csete, OZ9AEC - * Mario Lorenz, DL5MLO - * - * Qthid 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. - * - * Qthid 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 Qthid. If not, see <http://www.gnu.org/licenses/>. - * - ***************************************************************************/ -#ifndef FCDHIDCMD_H -#define FCD_HID_CMD_H 1 - - -/* Commands applicable in bootloader mode */ -#define FCD_CMD_BL_QUERY 1 /*!< Returns string with "FCDAPP version". */ -#define FCD_CMD_BL_RESET 8 /*!< Reset to application mode. */ -#define FCD_CMD_BL_ERASE 24 /*!< Erase firmware from FCD flash. */ -#define FCD_CMD_BL_SET_BYTE_ADDR 25 /*!< TBD */ -#define FCD_CMD_BL_GET_BYTE_ADDR_RANGE 26 /*!< Get address range. */ -#define FCD_CMD_BL_WRITE_FLASH_BLOCK 27 /*!< Write flash block. */ -#define FCD_CMD_BL_READ_FLASH_BLOCK 28 /*!< Read flash block. */ - -/* Commands applicable in application mode */ -#define FCD_CMD_APP_SET_FREQ_KHZ 100 /*!< Send with 3 byte unsigned little endian frequency in kHz. */ -#define FCD_CMD_APP_SET_FREQ_HZ 101 /*!< Send with 4 byte unsigned little endian frequency in Hz, returns with actual frequency set in Hz */ -#define FCD_CMD_APP_GET_FREQ_HZ 102 /*!< Returns 4 byte unsigned little endian frequency in Hz. */ - -#define FCD_CMD_APP_GET_IF_RSSI 104 /*!< Supposed to return 1 byte unsigned IF RSSI (-35dBm=0, -10dBm=70) but it is not functional. */ -#define FCD_CMD_APP_GET_PLL_LOCK 105 /*!< Returns 1 bit, true if locked. */ - -#define FCD_CMD_APP_SET_DC_CORR 106 /*!< Send with 2 byte unsigned I DC correction followed by 2 byte unsigned Q DC correction. 32768 is the default centre value. */ -#define FCD_CMD_APP_GET_DC_CORR 107 /*!< Returns 2 byte unsigned I DC correction followed by 2 byte unsigned Q DC correction. 32768 is the default centre value. */ -#define FCD_CMD_APP_SET_IQ_CORR 108 /*!< Send with 2 byte signed phase correction followed by 2 byte unsigned gain correction. 0 is the default centre value for phase correction, 32768 is the default centre value for gain. */ -#define FCD_CMD_APP_GET_IQ_CORR 109 /*!< Returns 2 byte signed phase correction followed by 2 byte unsigned gain correction. 0 is the default centre value for phase correction, 32768 is the default centre value for gain. */ - -#define FCD_CMD_APP_SET_LNA_GAIN 110 /*!< Send a 1 byte value, see enums for reference. */ -#define FCD_CMD_APP_SET_LNA_ENHANCE 111 -#define FCD_CMD_APP_SET_BAND 112 -#define FCD_CMD_APP_SET_RF_FILTER 113 -#define FCD_CMD_APP_SET_MIXER_GAIN 114 -#define FCD_CMD_APP_SET_BIAS_CURRENT 115 -#define FCD_CMD_APP_SET_MIXER_FILTER 116 -#define FCD_CMD_APP_SET_IF_GAIN1 117 -#define FCD_CMD_APP_SET_IF_GAIN_MODE 118 -#define FCD_CMD_APP_SET_IF_RC_FILTER 119 -#define FCD_CMD_APP_SET_IF_GAIN2 120 -#define FCD_CMD_APP_SET_IF_GAIN3 121 -#define FCD_CMD_APP_SET_IF_FILTER 122 -#define FCD_CMD_APP_SET_IF_GAIN4 123 -#define FCD_CMD_APP_SET_IF_GAIN5 124 -#define FCD_CMD_APP_SET_IF_GAIN6 125 -#define FCD_CMD_APP_SET_BIAS_TEE 126 /*!< Bias T for ext LNA. Send with one byte: 1=ON, 0=OFF. */ - -#define FCD_CMD_APP_GET_LNA_GAIN 150 // Retrieve a 1 byte value, see enums for reference -#define FCD_CMD_APP_GET_LNA_ENHANCE 151 -#define FCD_CMD_APP_GET_BAND 152 -#define FCD_CMD_APP_GET_RF_FILTER 153 -#define FCD_CMD_APP_GET_MIXER_GAIN 154 -#define FCD_CMD_APP_GET_BIAS_CURRENT 155 -#define FCD_CMD_APP_GET_MIXER_FILTER 156 -#define FCD_CMD_APP_GET_IF_GAIN1 157 -#define FCD_CMD_APP_GET_IF_GAIN_MODE 158 -#define FCD_CMD_APP_GET_IF_RC_FILTER 159 -#define FCD_CMD_APP_GET_IF_GAIN2 160 -#define FCD_CMD_APP_GET_IF_GAIN3 161 -#define FCD_CMD_APP_GET_IF_FILTER 162 -#define FCD_CMD_APP_GET_IF_GAIN4 163 -#define FCD_CMD_APP_GET_IF_GAIN5 164 -#define FCD_CMD_APP_GET_IF_GAIN6 165 -#define FCD_CMD_APP_GET_BIAS_TEE 166 /*!< Bias T. 1=ON, 0=OFF. */ - -#define FCD_CMD_APP_SEND_I2C_BYTE 200 -#define FCD_CMD_APP_RECV_I2C_BYTE 201 - -#define FCD_CMD_APP_RESET 255 // Reset to bootloader - - -typedef enum -{ - TLGE_N5_0DB=0, - TLGE_N2_5DB=1, - TLGE_P0_0DB=4, - TLGE_P2_5DB=5, - TLGE_P5_0DB=6, - TLGE_P7_5DB=7, - TLGE_P10_0DB=8, - TLGE_P12_5DB=9, - TLGE_P15_0DB=10, - TLGE_P17_5DB=11, - TLGE_P20_0DB=12, - TLGE_P25_0DB=13, - TLGE_P30_0DB=14 -} TUNER_LNA_GAIN_ENUM; - -typedef enum -{ - TLEE_OFF=0, - TLEE_0=1, - TLEE_1=3, - TLEE_2=5, - TLEE_3=7 -} TUNER_LNA_ENHANCE_ENUM; - -typedef enum -{ - TBE_VHF2, - TBE_VHF3, - TBE_UHF, - TBE_LBAND -} TUNER_BAND_ENUM; - -typedef enum -{ - // Band 0, VHF II - TRFE_LPF268MHZ=0, - TRFE_LPF299MHZ=8, - // Band 1, VHF III - TRFE_LPF509MHZ=0, - TRFE_LPF656MHZ=8, - // Band 2, UHF - TRFE_BPF360MHZ=0, - TRFE_BPF380MHZ=1, - TRFE_BPF405MHZ=2, - TRFE_BPF425MHZ=3, - TRFE_BPF450MHZ=4, - TRFE_BPF475MHZ=5, - TRFE_BPF505MHZ=6, - TRFE_BPF540MHZ=7, - TRFE_BPF575MHZ=8, - TRFE_BPF615MHZ=9, - TRFE_BPF670MHZ=10, - TRFE_BPF720MHZ=11, - TRFE_BPF760MHZ=12, - TRFE_BPF840MHZ=13, - TRFE_BPF890MHZ=14, - TRFE_BPF970MHZ=15, - // Band 2, L band - TRFE_BPF1300MHZ=0, - TRFE_BPF1320MHZ=1, - TRFE_BPF1360MHZ=2, - TRFE_BPF1410MHZ=3, - TRFE_BPF1445MHZ=4, - TRFE_BPF1460MHZ=5, - TRFE_BPF1490MHZ=6, - TRFE_BPF1530MHZ=7, - TRFE_BPF1560MHZ=8, - TRFE_BPF1590MHZ=9, - TRFE_BPF1640MHZ=10, - TRFE_BPF1660MHZ=11, - TRFE_BPF1680MHZ=12, - TRFE_BPF1700MHZ=13, - TRFE_BPF1720MHZ=14, - TRFE_BPF1750MHZ=15 -} TUNER_RF_FILTER_ENUM; - -typedef enum -{ - TMGE_P4_0DB=0, - TMGE_P12_0DB=1 -} TUNER_MIXER_GAIN_ENUM; - -typedef enum -{ - TBCE_LBAND=0, - TBCE_1=1, - TBCE_2=2, - TBCE_VUBAND=3 -} TUNER_BIAS_CURRENT_ENUM; - -typedef enum -{ - TMFE_27_0MHZ=0, - TMFE_4_6MHZ=8, - TMFE_4_2MHZ=9, - TMFE_3_8MHZ=10, - TMFE_3_4MHZ=11, - TMFE_3_0MHZ=12, - TMFE_2_7MHZ=13, - TMFE_2_3MHZ=14, - TMFE_1_9MHZ=15 -} TUNER_MIXER_FILTER_ENUM; - -typedef enum -{ - TIG1E_N3_0DB=0, - TIG1E_P6_0DB=1 -} TUNER_IF_GAIN1_ENUM; - -typedef enum -{ - TIGME_LINEARITY=0, - TIGME_SENSITIVITY=1 -} TUNER_IF_GAIN_MODE_ENUM; - -typedef enum -{ - TIRFE_21_4MHZ=0, - TIRFE_21_0MHZ=1, - TIRFE_17_6MHZ=2, - TIRFE_14_7MHZ=3, - TIRFE_12_4MHZ=4, - TIRFE_10_6MHZ=5, - TIRFE_9_0MHZ=6, - TIRFE_7_7MHZ=7, - TIRFE_6_4MHZ=8, - TIRFE_5_3MHZ=9, - TIRFE_4_4MHZ=10, - TIRFE_3_4MHZ=11, - TIRFE_2_6MHZ=12, - TIRFE_1_8MHZ=13, - TIRFE_1_2MHZ=14, - TIRFE_1_0MHZ=15 -} TUNER_IF_RC_FILTER_ENUM; - -typedef enum -{ - TIG2E_P0_0DB=0, - TIG2E_P3_0DB=1, - TIG2E_P6_0DB=2, - TIG2E_P9_0DB=3 -} TUNER_IF_GAIN2_ENUM; - -typedef enum -{ - TIG3E_P0_0DB=0, - TIG3E_P3_0DB=1, - TIG3E_P6_0DB=2, - TIG3E_P9_0DB=3 -} TUNER_IF_GAIN3_ENUM; - -typedef enum -{ - TIG4E_P0_0DB=0, - TIG4E_P1_0DB=1, - TIG4E_P2_0DB=2 -} TUNER_IF_GAIN4_ENUM; - -typedef enum -{ - TIFE_5_50MHZ=0, - TIFE_5_30MHZ=1, - TIFE_5_00MHZ=2, - TIFE_4_80MHZ=3, - TIFE_4_60MHZ=4, - TIFE_4_40MHZ=5, - TIFE_4_30MHZ=6, - TIFE_4_10MHZ=7, - TIFE_3_90MHZ=8, - TIFE_3_80MHZ=9, - TIFE_3_70MHZ=10, - TIFE_3_60MHZ=11, - TIFE_3_40MHZ=12, - TIFE_3_30MHZ=13, - TIFE_3_20MHZ=14, - TIFE_3_10MHZ=15, - TIFE_3_00MHZ=16, - TIFE_2_95MHZ=17, - TIFE_2_90MHZ=18, - TIFE_2_80MHZ=19, - TIFE_2_75MHZ=20, - TIFE_2_70MHZ=21, - TIFE_2_60MHZ=22, - TIFE_2_55MHZ=23, - TIFE_2_50MHZ=24, - TIFE_2_45MHZ=25, - TIFE_2_40MHZ=26, - TIFE_2_30MHZ=27, - TIFE_2_28MHZ=28, - TIFE_2_24MHZ=29, - TIFE_2_20MHZ=30, - TIFE_2_15MHZ=31 -} TUNER_IF_FILTER_ENUM; - -typedef enum -{ - TIG5E_P3_0DB=0, - TIG5E_P6_0DB=1, - TIG5E_P9_0DB=2, - TIG5E_P12_0DB=3, - TIG5E_P15_0DB=4 -} TUNER_IF_GAIN5_ENUM; - -typedef enum -{ - TIG6E_P3_0DB=0, - TIG6E_P6_0DB=1, - TIG6E_P9_0DB=2, - TIG6E_P12_0DB=3, - TIG6E_P15_0DB=4 -} TUNER_IF_GAIN6_ENUM; - - -#endif // FCDHIDCMD_H diff --git a/gr-fcd/lib/gnuradio-fcd.rc.in b/gr-fcd/lib/gnuradio-fcd.rc.in deleted file mode 100644 index 01c502c4dd..0000000000 --- a/gr-fcd/lib/gnuradio-fcd.rc.in +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2013 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 <afxres.h> - -VS_VERSION_INFO VERSIONINFO - FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - FILEFLAGSMASK 0x3fL -#ifndef NDEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_DRV_INSTALLABLE - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "gnuradio-fcd" - VALUE "FileVersion", "@VERSION@" - VALUE "InternalName", "gnuradio-fcd.dll" - VALUE "LegalCopyright", "Licensed under GPLv3 or any later version" - VALUE "OriginalFilename", "gnuradio-fcd.dll" - VALUE "ProductName", "gnuradio-fcd" - VALUE "ProductVersion", "@VERSION@" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END - END diff --git a/gr-fcd/lib/hid/CMakeLists.txt b/gr-fcd/lib/hid/CMakeLists.txt deleted file mode 100644 index db335cc930..0000000000 --- a/gr-fcd/lib/hid/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# This file included, use CMake directory variables -######################################################################## - -include_directories(APPEND ${USB_INCLUDES}) - -set(hid_sources) - -if(WIN32) - list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hidwin.c) -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hidmac.c) -else() - list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hid-libusb.c) -endif() - -######################################################################## -# Append gnuradio-fcd library sources -######################################################################## -list(APPEND gr_fcd_sources ${hid_sources}) diff --git a/gr-fcd/lib/hid/COPYRIGHT b/gr-fcd/lib/hid/COPYRIGHT deleted file mode 100644 index e50305d7c3..0000000000 --- a/gr-fcd/lib/hid/COPYRIGHT +++ /dev/null @@ -1,25 +0,0 @@ -For convenience, GNU Radio includes the contents of this directory -in its distribution, but they are not considered part of GNU Radio. - -These files are licensed and redistributed using the terms of the -GPLv3. -------------------------------------------------------------------- -HIDAPI - Multi-Platform library for -communication with HID devices. - -Alan Ott -Signal 11 Software - -8/22/2009 - -Copyright 2009, All Rights Reserved. - -At the discretion of the user of this library, -this software may be licensed under the terms of the -GNU Public License v3, a BSD-Style license, or the -original HIDAPI license as outlined in the LICENSE.txt, -LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt -files located at the root of the source distribution. -These files may also be found in the public source -code repository located at: - http://github.com/signal11/hidapi . diff --git a/gr-fcd/lib/hid/hid-libusb.c b/gr-fcd/lib/hid/hid-libusb.c deleted file mode 100644 index 097f87215d..0000000000 --- a/gr-fcd/lib/hid/hid-libusb.c +++ /dev/null @@ -1,1427 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 8/22/2009 - Linux Version - 6/2/2010 - Libusb Version - 8/13/2010 - FreeBSD Version - 11/1/2011 - - Copyright 2009, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */ - -/* C */ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <ctype.h> -#include <locale.h> -#include <errno.h> - -/* Unix */ -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/ioctl.h> -#include <sys/utsname.h> -#include <fcntl.h> -#include <pthread.h> -#include <wchar.h> - -/* GNU / LibUSB */ -#include "libusb.h" -#include "iconv.h" - -#include "hidapi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef DEBUG_PRINTF -#define LOG(...) fprintf(stderr, __VA_ARGS__) -#else -#define LOG(...) do {} while (0) -#endif - -#ifndef __FreeBSD__ -#define DETACH_KERNEL_DRIVER -#endif - -/* Uncomment to enable the retrieval of Usage and Usage Page in -hid_enumerate(). Warning, on platforms different from FreeBSD -this is very invasive as it requires the detach -and re-attach of the kernel driver. See comments inside hid_enumerate(). -libusb HIDAPI programs are encouraged to use the interface number -instead to differentiate between interfaces on a composite HID device. */ -/*#define INVASIVE_GET_USAGE*/ - -/* Linked List of input reports received from the device. */ -struct input_report { - uint8_t *data; - size_t len; - struct input_report *next; -}; - - -struct hid_device_ { - /* Handle to the actual device. */ - libusb_device_handle *device_handle; - - /* Endpoint information */ - int input_endpoint; - int output_endpoint; - int input_ep_max_packet_size; - - /* The interface number of the HID */ - int interface; - - /* Indexes of Strings */ - int manufacturer_index; - int product_index; - int serial_index; - - /* Whether blocking reads are used */ - int blocking; /* boolean */ - - /* Read thread objects */ - pthread_t thread; - pthread_mutex_t mutex; /* Protects input_reports */ - pthread_cond_t condition; - pthread_barrier_t barrier; /* Ensures correct startup sequence */ - int shutdown_thread; - int cancelled; - struct libusb_transfer *transfer; - - /* List of received input reports. */ - struct input_report *input_reports; -}; - -static libusb_context *usb_context = NULL; - -uint16_t get_usb_code_for_current_locale(void); -static int return_data(hid_device *dev, unsigned char *data, size_t length); - -static hid_device *new_hid_device(void) -{ - hid_device *dev = calloc(1, sizeof(hid_device)); - dev->blocking = 1; - - pthread_mutex_init(&dev->mutex, NULL); - pthread_cond_init(&dev->condition, NULL); - pthread_barrier_init(&dev->barrier, NULL, 2); - - return dev; -} - -static void free_hid_device(hid_device *dev) -{ - /* Clean up the thread objects */ - pthread_barrier_destroy(&dev->barrier); - pthread_cond_destroy(&dev->condition); - pthread_mutex_destroy(&dev->mutex); - - /* Free the device itself */ - free(dev); -} - -#if 0 -/*TODO: Implement this funciton on hidapi/libusb.. */ -static void register_error(hid_device *device, const char *op) -{ - -} -#endif - -#ifdef INVASIVE_GET_USAGE -/* Get bytes from a HID Report Descriptor. - Only call with a num_bytes of 0, 1, 2, or 4. */ -static uint32_t get_bytes(uint8_t *rpt, size_t len, size_t num_bytes, size_t cur) -{ - /* Return if there aren't enough bytes. */ - if (cur + num_bytes >= len) - return 0; - - if (num_bytes == 0) - return 0; - else if (num_bytes == 1) { - return rpt[cur+1]; - } - else if (num_bytes == 2) { - return (rpt[cur+2] * 256 + rpt[cur+1]); - } - else if (num_bytes == 4) { - return (rpt[cur+4] * 0x01000000 + - rpt[cur+3] * 0x00010000 + - rpt[cur+2] * 0x00000100 + - rpt[cur+1] * 0x00000001); - } - else - return 0; -} - -/* Retrieves the device's Usage Page and Usage from the report - descriptor. The algorithm is simple, as it just returns the first - Usage and Usage Page that it finds in the descriptor. - The return value is 0 on success and -1 on failure. */ -static int get_usage(uint8_t *report_descriptor, size_t size, - unsigned short *usage_page, unsigned short *usage) -{ - unsigned int i = 0; - int size_code; - int data_len, key_size; - int usage_found = 0, usage_page_found = 0; - - while (i < size) { - int key = report_descriptor[i]; - int key_cmd = key & 0xfc; - - //printf("key: %02hhx\n", key); - - if ((key & 0xf0) == 0xf0) { - /* This is a Long Item. The next byte contains the - length of the data section (value) for this key. - See the HID specification, version 1.11, section - 6.2.2.3, titled "Long Items." */ - if (i+1 < size) - data_len = report_descriptor[i+1]; - else - data_len = 0; /* malformed report */ - key_size = 3; - } - else { - /* This is a Short Item. The bottom two bits of the - key contain the size code for the data section - (value) for this key. Refer to the HID - specification, version 1.11, section 6.2.2.2, - titled "Short Items." */ - size_code = key & 0x3; - switch (size_code) { - case 0: - case 1: - case 2: - data_len = size_code; - break; - case 3: - data_len = 4; - break; - default: - /* Can't ever happen since size_code is & 0x3 */ - data_len = 0; - break; - }; - key_size = 1; - } - - if (key_cmd == 0x4) { - *usage_page = get_bytes(report_descriptor, size, data_len, i); - usage_page_found = 1; - //printf("Usage Page: %x\n", (uint32_t)*usage_page); - } - if (key_cmd == 0x8) { - *usage = get_bytes(report_descriptor, size, data_len, i); - usage_found = 1; - //printf("Usage: %x\n", (uint32_t)*usage); - } - - if (usage_page_found && usage_found) - return 0; /* success */ - - /* Skip over this key and it's associated data */ - i += data_len + key_size; - } - - return -1; /* failure */ -} -#endif /* INVASIVE_GET_USAGE */ - -#ifdef __FreeBSD__ -/* The FreeBSD version of libusb doesn't have this funciton. In mainline - libusb, it's inlined in libusb.h. This function will bear a striking - resemblence to that one, because there's about one way to code it. - - Note that the data parameter is Unicode in UTF-16LE encoding. - Return value is the number of bytes in data, or LIBUSB_ERROR_*. - */ -static inline int libusb_get_string_descriptor(libusb_device_handle *dev, - uint8_t descriptor_index, uint16_t lang_id, - unsigned char *data, int length) -{ - return libusb_control_transfer(dev, - LIBUSB_ENDPOINT_IN | 0x0, /* Endpoint 0 IN */ - LIBUSB_REQUEST_GET_DESCRIPTOR, - (LIBUSB_DT_STRING << 8) | descriptor_index, - lang_id, data, (uint16_t) length, 1000); -} - -#endif - - -/* Get the first language the device says it reports. This comes from - USB string #0. */ -static uint16_t get_first_language(libusb_device_handle *dev) -{ - uint16_t buf[32]; - int len; - - /* Get the string from libusb. */ - len = libusb_get_string_descriptor(dev, - 0x0, /* String ID */ - 0x0, /* Language */ - (unsigned char*)buf, - sizeof(buf)); - if (len < 4) - return 0x0; - - return buf[1]; /* First two bytes are len and descriptor type. */ -} - -static int is_language_supported(libusb_device_handle *dev, uint16_t lang) -{ - uint16_t buf[32]; - int len; - int i; - - /* Get the string from libusb. */ - len = libusb_get_string_descriptor(dev, - 0x0, /* String ID */ - 0x0, /* Language */ - (unsigned char*)buf, - sizeof(buf)); - if (len < 4) - return 0x0; - - - len /= 2; /* language IDs are two-bytes each. */ - /* Start at index 1 because there are two bytes of protocol data. */ - for (i = 1; i < len; i++) { - if (buf[i] == lang) - return 1; - } - - return 0; -} - - -/* This function returns a newly allocated wide string containing the USB - device string numbered by the index. The returned string must be freed - by using free(). */ -static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx) -{ - char buf[512]; - int len; - wchar_t *str = NULL; - wchar_t wbuf[256]; - - /* iconv variables */ - iconv_t ic; - size_t inbytes; - size_t outbytes; - size_t res; -#ifdef __FreeBSD__ - const char *inptr; -#else - char *inptr; -#endif - char *outptr; - - /* Determine which language to use. */ - uint16_t lang; - lang = get_usb_code_for_current_locale(); - if (!is_language_supported(dev, lang)) - lang = get_first_language(dev); - - /* Get the string from libusb. */ - len = libusb_get_string_descriptor(dev, - idx, - lang, - (unsigned char*)buf, - sizeof(buf)); - if (len < 0) - return NULL; - - /* buf does not need to be explicitly NULL-terminated because - it is only passed into iconv() which does not need it. */ - - /* Initialize iconv. */ - ic = iconv_open("WCHAR_T", "UTF-16LE"); - if (ic == (iconv_t)-1) { - LOG("iconv_open() failed\n"); - return NULL; - } - - /* Convert to native wchar_t (UTF-32 on glibc/BSD systems). - Skip the first character (2-bytes). */ - inptr = buf+2; - inbytes = len-2; - outptr = (char*) wbuf; - outbytes = sizeof(wbuf); - res = iconv(ic, &inptr, &inbytes, &outptr, &outbytes); - if (res == (size_t)-1) { - LOG("iconv() failed\n"); - goto err; - } - - /* Write the terminating NULL. */ - wbuf[sizeof(wbuf)/sizeof(wbuf[0])-1] = 0x00000000; - if (outbytes >= sizeof(wbuf[0])) - *((wchar_t*)outptr) = 0x00000000; - - /* Allocate and copy the string. */ - str = wcsdup(wbuf); - -err: - iconv_close(ic); - - return str; -} - -static char *make_path(libusb_device *dev, int interface_number) -{ - char str[64]; - snprintf(str, sizeof(str), "%04x:%04x:%02x", - libusb_get_bus_number(dev), - libusb_get_device_address(dev), - interface_number); - str[sizeof(str)-1] = '\0'; - - return strdup(str); -} - - -int HID_API_EXPORT hid_init(void) -{ - if (!usb_context) { - const char *locale; - - /* Init Libusb */ - if (libusb_init(&usb_context)) - return -1; - - /* Set the locale if it's not set. */ - locale = setlocale(LC_CTYPE, NULL); - if (!locale) - setlocale(LC_CTYPE, ""); - } - - return 0; -} - -int HID_API_EXPORT hid_exit(void) -{ - if (usb_context) { - libusb_exit(usb_context); - usb_context = NULL; - } - - return 0; -} - -struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, unsigned short product_id) -{ - libusb_device **devs; - libusb_device *dev; - libusb_device_handle *handle; - ssize_t num_devs; - int i = 0; - - struct hid_device_info *root = NULL; /* return object */ - struct hid_device_info *cur_dev = NULL; - - if(hid_init() < 0) - return NULL; - - num_devs = libusb_get_device_list(usb_context, &devs); - if (num_devs < 0) - return NULL; - while ((dev = devs[i++]) != NULL) { - struct libusb_device_descriptor desc; - struct libusb_config_descriptor *conf_desc = NULL; - int j, k; - int interface_num = 0; - - int res = libusb_get_device_descriptor(dev, &desc); - unsigned short dev_vid = desc.idVendor; - unsigned short dev_pid = desc.idProduct; - - res = libusb_get_active_config_descriptor(dev, &conf_desc); - if (res < 0) - libusb_get_config_descriptor(dev, 0, &conf_desc); - if (conf_desc) { - for (j = 0; j < conf_desc->bNumInterfaces; j++) { - const struct libusb_interface *intf = &conf_desc->interface[j]; - for (k = 0; k < intf->num_altsetting; k++) { - const struct libusb_interface_descriptor *intf_desc; - intf_desc = &intf->altsetting[k]; - if (intf_desc->bInterfaceClass == LIBUSB_CLASS_HID) { - interface_num = intf_desc->bInterfaceNumber; - - /* Check the VID/PID against the arguments */ - if ((vendor_id == 0x0 || vendor_id == dev_vid) && - (product_id == 0x0 || product_id == dev_pid)) { - struct hid_device_info *tmp; - - /* VID/PID match. Create the record. */ - tmp = calloc(1, sizeof(struct hid_device_info)); - if (cur_dev) { - cur_dev->next = tmp; - } - else { - root = tmp; - } - cur_dev = tmp; - - /* Fill out the record */ - cur_dev->next = NULL; - cur_dev->path = make_path(dev, interface_num); - - res = libusb_open(dev, &handle); - - if (res >= 0) { - /* Serial Number */ - if (desc.iSerialNumber > 0) - cur_dev->serial_number = - get_usb_string(handle, desc.iSerialNumber); - - /* Manufacturer and Product strings */ - if (desc.iManufacturer > 0) - cur_dev->manufacturer_string = - get_usb_string(handle, desc.iManufacturer); - if (desc.iProduct > 0) - cur_dev->product_string = - get_usb_string(handle, desc.iProduct); - -#ifdef INVASIVE_GET_USAGE -{ - /* - This section is removed because it is too - invasive on the system. Getting a Usage Page - and Usage requires parsing the HID Report - descriptor. Getting a HID Report descriptor - involves claiming the interface. Claiming the - interface involves detaching the kernel driver. - Detaching the kernel driver is hard on the system - because it will unclaim interfaces (if another - app has them claimed) and the re-attachment of - the driver will sometimes change /dev entry names. - It is for these reasons that this section is - #if 0. For composite devices, use the interface - field in the hid_device_info struct to distinguish - between interfaces. */ - unsigned char data[256]; -#ifdef DETACH_KERNEL_DRIVER - int detached = 0; - /* Usage Page and Usage */ - res = libusb_kernel_driver_active(handle, interface_num); - if (res == 1) { - res = libusb_detach_kernel_driver(handle, interface_num); - if (res < 0) - LOG("Couldn't detach kernel driver, even though a kernel driver was attached."); - else - detached = 1; - } -#endif - res = libusb_claim_interface(handle, interface_num); - if (res >= 0) { - /* Get the HID Report Descriptor. */ - res = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_RECIPIENT_INTERFACE, LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_REPORT << 8)|interface_num, 0, data, sizeof(data), 5000); - if (res >= 0) { - unsigned short page=0, usage=0; - /* Parse the usage and usage page - out of the report descriptor. */ - get_usage(data, res, &page, &usage); - cur_dev->usage_page = page; - cur_dev->usage = usage; - } - else - LOG("libusb_control_transfer() for getting the HID report failed with %d\n", res); - - /* Release the interface */ - res = libusb_release_interface(handle, interface_num); - if (res < 0) - LOG("Can't release the interface.\n"); - } - else - LOG("Can't claim interface %d\n", res); -#ifdef DETACH_KERNEL_DRIVER - /* Re-attach kernel driver if necessary. */ - if (detached) { - res = libusb_attach_kernel_driver(handle, interface_num); - if (res < 0) - LOG("Couldn't re-attach kernel driver.\n"); - } -#endif -} -#endif /* INVASIVE_GET_USAGE */ - - libusb_close(handle); - } - /* VID/PID */ - cur_dev->vendor_id = dev_vid; - cur_dev->product_id = dev_pid; - - /* Release Number */ - cur_dev->release_number = desc.bcdDevice; - - /* Interface Number */ - cur_dev->interface_number = interface_num; - } - } - } /* altsettings */ - } /* interfaces */ - libusb_free_config_descriptor(conf_desc); - } - } - - libusb_free_device_list(devs, 1); - - return root; -} - -void HID_API_EXPORT hid_free_enumeration(struct hid_device_info *devs) -{ - struct hid_device_info *d = devs; - while (d) { - struct hid_device_info *next = d->next; - free(d->path); - free(d->serial_number); - free(d->manufacturer_string); - free(d->product_string); - free(d); - d = next; - } -} - -hid_device * hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number) -{ - struct hid_device_info *devs, *cur_dev; - const char *path_to_open = NULL; - hid_device *handle = NULL; - - devs = hid_enumerate(vendor_id, product_id); - cur_dev = devs; - while (cur_dev) { - if (cur_dev->vendor_id == vendor_id && - cur_dev->product_id == product_id) { - if (serial_number) { - if (wcscmp(serial_number, cur_dev->serial_number) == 0) { - path_to_open = cur_dev->path; - break; - } - } - else { - path_to_open = cur_dev->path; - break; - } - } - cur_dev = cur_dev->next; - } - - if (path_to_open) { - /* Open the device */ - handle = hid_open_path(path_to_open); - } - - hid_free_enumeration(devs); - - return handle; -} - -static void read_callback(struct libusb_transfer *transfer) -{ - hid_device *dev = transfer->user_data; - int res; - - if (transfer->status == LIBUSB_TRANSFER_COMPLETED) { - - struct input_report *rpt = malloc(sizeof(*rpt)); - rpt->data = malloc(transfer->actual_length); - memcpy(rpt->data, transfer->buffer, transfer->actual_length); - rpt->len = transfer->actual_length; - rpt->next = NULL; - - pthread_mutex_lock(&dev->mutex); - - /* Attach the new report object to the end of the list. */ - if (dev->input_reports == NULL) { - /* The list is empty. Put it at the root. */ - dev->input_reports = rpt; - pthread_cond_signal(&dev->condition); - } - else { - /* Find the end of the list and attach. */ - struct input_report *cur = dev->input_reports; - int num_queued = 0; - while (cur->next != NULL) { - cur = cur->next; - num_queued++; - } - cur->next = rpt; - - /* Pop one off if we've reached 30 in the queue. This - way we don't grow forever if the user never reads - anything from the device. */ - if (num_queued > 30) { - return_data(dev, NULL, 0); - } - } - pthread_mutex_unlock(&dev->mutex); - } - else if (transfer->status == LIBUSB_TRANSFER_CANCELLED) { - dev->shutdown_thread = 1; - dev->cancelled = 1; - return; - } - else if (transfer->status == LIBUSB_TRANSFER_NO_DEVICE) { - dev->shutdown_thread = 1; - dev->cancelled = 1; - return; - } - else if (transfer->status == LIBUSB_TRANSFER_TIMED_OUT) { - //LOG("Timeout (normal)\n"); - } - else { - LOG("Unknown transfer code: %d\n", transfer->status); - } - - /* Re-submit the transfer object. */ - res = libusb_submit_transfer(transfer); - if (res != 0) { - LOG("Unable to submit URB. libusb error code: %d\n", res); - dev->shutdown_thread = 1; - dev->cancelled = 1; - } -} - - -static void *read_thread(void *param) -{ - hid_device *dev = param; - unsigned char *buf; - const size_t length = dev->input_ep_max_packet_size; - - /* Set up the transfer object. */ - buf = malloc(length); - dev->transfer = libusb_alloc_transfer(0); - libusb_fill_interrupt_transfer(dev->transfer, - dev->device_handle, - dev->input_endpoint, - buf, - length, - read_callback, - dev, - 5000/*timeout*/); - - /* Make the first submission. Further submissions are made - from inside read_callback() */ - libusb_submit_transfer(dev->transfer); - - /* Notify the main thread that the read thread is up and running. */ - pthread_barrier_wait(&dev->barrier); - - /* Handle all the events. */ - while (!dev->shutdown_thread) { - int res; - res = libusb_handle_events(usb_context); - if (res < 0) { - /* There was an error. */ - LOG("read_thread(): libusb reports error # %d\n", res); - - /* Break out of this loop only on fatal error.*/ - if (res != LIBUSB_ERROR_BUSY && - res != LIBUSB_ERROR_TIMEOUT && - res != LIBUSB_ERROR_OVERFLOW && - res != LIBUSB_ERROR_INTERRUPTED) { - break; - } - } - } - - /* Cancel any transfer that may be pending. This call will fail - if no transfers are pending, but that's OK. */ - libusb_cancel_transfer(dev->transfer); - - while (!dev->cancelled) - libusb_handle_events_completed(usb_context, &dev->cancelled); - - /* Now that the read thread is stopping, Wake any threads which are - waiting on data (in hid_read_timeout()). Do this under a mutex to - make sure that a thread which is about to go to sleep waiting on - the condition acutally will go to sleep before the condition is - signaled. */ - pthread_mutex_lock(&dev->mutex); - pthread_cond_broadcast(&dev->condition); - pthread_mutex_unlock(&dev->mutex); - - /* The dev->transfer->buffer and dev->transfer objects are cleaned up - in hid_close(). They are not cleaned up here because this thread - could end either due to a disconnect or due to a user - call to hid_close(). In both cases the objects can be safely - cleaned up after the call to pthread_join() (in hid_close()), but - since hid_close() calls libusb_cancel_transfer(), on these objects, - they can not be cleaned up here. */ - - return NULL; -} - - -hid_device * HID_API_EXPORT hid_open_path(const char *path) -{ - hid_device *dev = NULL; - - libusb_device **devs; - libusb_device *usb_dev; - int res; - int d = 0; - int good_open = 0; - - dev = new_hid_device(); - - if(hid_init() < 0) - return NULL; - - libusb_get_device_list(usb_context, &devs); - while ((usb_dev = devs[d++]) != NULL) { - struct libusb_device_descriptor desc; - struct libusb_config_descriptor *conf_desc = NULL; - int i,j,k; - libusb_get_device_descriptor(usb_dev, &desc); - - if (libusb_get_active_config_descriptor(usb_dev, &conf_desc) < 0) - continue; - for (j = 0; j < conf_desc->bNumInterfaces; j++) { - const struct libusb_interface *intf = &conf_desc->interface[j]; - for (k = 0; k < intf->num_altsetting; k++) { - const struct libusb_interface_descriptor *intf_desc; - intf_desc = &intf->altsetting[k]; - if (intf_desc->bInterfaceClass == LIBUSB_CLASS_HID) { - char *dev_path = make_path(usb_dev, intf_desc->bInterfaceNumber); - if (!strcmp(dev_path, path)) { - /* Matched Paths. Open this device */ - - /* OPEN HERE */ - res = libusb_open(usb_dev, &dev->device_handle); - if (res < 0) { - LOG("can't open device\n"); - free(dev_path); - break; - } - good_open = 1; -#ifdef DETACH_KERNEL_DRIVER - /* Detach the kernel driver, but only if the - device is managed by the kernel */ - if (libusb_kernel_driver_active(dev->device_handle, intf_desc->bInterfaceNumber) == 1) { - res = libusb_detach_kernel_driver(dev->device_handle, intf_desc->bInterfaceNumber); - if (res < 0) { - libusb_close(dev->device_handle); - LOG("Unable to detach Kernel Driver\n"); - free(dev_path); - good_open = 0; - break; - } - } -#endif - res = libusb_claim_interface(dev->device_handle, intf_desc->bInterfaceNumber); - if (res < 0) { - LOG("can't claim interface %d: %d\n", intf_desc->bInterfaceNumber, res); - free(dev_path); - libusb_close(dev->device_handle); - good_open = 0; - break; - } - - /* Store off the string descriptor indexes */ - dev->manufacturer_index = desc.iManufacturer; - dev->product_index = desc.iProduct; - dev->serial_index = desc.iSerialNumber; - - /* Store off the interface number */ - dev->interface = intf_desc->bInterfaceNumber; - - /* Find the INPUT and OUTPUT endpoints. An - OUTPUT endpoint is not required. */ - for (i = 0; i < intf_desc->bNumEndpoints; i++) { - const struct libusb_endpoint_descriptor *ep - = &intf_desc->endpoint[i]; - - /* Determine the type and direction of this - endpoint. */ - int is_interrupt = - (ep->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) - == LIBUSB_TRANSFER_TYPE_INTERRUPT; - int is_output = - (ep->bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK) - == LIBUSB_ENDPOINT_OUT; - int is_input = - (ep->bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK) - == LIBUSB_ENDPOINT_IN; - - /* Decide whether to use it for intput or output. */ - if (dev->input_endpoint == 0 && - is_interrupt && is_input) { - /* Use this endpoint for INPUT */ - dev->input_endpoint = ep->bEndpointAddress; - dev->input_ep_max_packet_size = ep->wMaxPacketSize; - } - if (dev->output_endpoint == 0 && - is_interrupt && is_output) { - /* Use this endpoint for OUTPUT */ - dev->output_endpoint = ep->bEndpointAddress; - } - } - - pthread_create(&dev->thread, NULL, read_thread, dev); - - /* Wait here for the read thread to be initialized. */ - pthread_barrier_wait(&dev->barrier); - - } - free(dev_path); - } - } - } - libusb_free_config_descriptor(conf_desc); - - } - - libusb_free_device_list(devs, 1); - - /* If we have a good handle, return it. */ - if (good_open) { - return dev; - } - else { - /* Unable to open any devices. */ - free_hid_device(dev); - return NULL; - } -} - - -int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length) -{ - int res; - int report_number = data[0]; - int skipped_report_id = 0; - - if (report_number == 0x0) { - data++; - length--; - skipped_report_id = 1; - } - - - if (dev->output_endpoint <= 0) { - /* No interrput out endpoint. Use the Control Endpoint */ - res = libusb_control_transfer(dev->device_handle, - LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE|LIBUSB_ENDPOINT_OUT, - 0x09/*HID Set_Report*/, - (2/*HID output*/ << 8) | report_number, - dev->interface, - (unsigned char *)data, length, - 1000/*timeout millis*/); - - if (res < 0) - return -1; - - if (skipped_report_id) - length++; - - return length; - } - else { - /* Use the interrupt out endpoint */ - int actual_length; - res = libusb_interrupt_transfer(dev->device_handle, - dev->output_endpoint, - (unsigned char*)data, - length, - &actual_length, 1000); - - if (res < 0) - return -1; - - if (skipped_report_id) - actual_length++; - - return actual_length; - } -} - -/* Helper function, to simplify hid_read(). - This should be called with dev->mutex locked. */ -static int return_data(hid_device *dev, unsigned char *data, size_t length) -{ - /* Copy the data out of the linked list item (rpt) into the - return buffer (data), and delete the liked list item. */ - struct input_report *rpt = dev->input_reports; - size_t len = (length < rpt->len)? length: rpt->len; - if (len > 0) - memcpy(data, rpt->data, len); - dev->input_reports = rpt->next; - free(rpt->data); - free(rpt); - return len; -} - -static void cleanup_mutex(void *param) -{ - hid_device *dev = param; - pthread_mutex_unlock(&dev->mutex); -} - - -int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds) -{ - int bytes_read = -1; - -#if 0 - int transferred; - int res = libusb_interrupt_transfer(dev->device_handle, dev->input_endpoint, data, length, &transferred, 5000); - LOG("transferred: %d\n", transferred); - return transferred; -#endif - - pthread_mutex_lock(&dev->mutex); - pthread_cleanup_push(&cleanup_mutex, dev); - - /* There's an input report queued up. Return it. */ - if (dev->input_reports) { - /* Return the first one */ - bytes_read = return_data(dev, data, length); - goto ret; - } - - if (dev->shutdown_thread) { - /* This means the device has been disconnected. - An error code of -1 should be returned. */ - bytes_read = -1; - goto ret; - } - - if (milliseconds == -1) { - /* Blocking */ - while (!dev->input_reports && !dev->shutdown_thread) { - pthread_cond_wait(&dev->condition, &dev->mutex); - } - if (dev->input_reports) { - bytes_read = return_data(dev, data, length); - } - } - else if (milliseconds > 0) { - /* Non-blocking, but called with timeout. */ - int res; - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_sec += milliseconds / 1000; - ts.tv_nsec += (milliseconds % 1000) * 1000000; - if (ts.tv_nsec >= 1000000000L) { - ts.tv_sec++; - ts.tv_nsec -= 1000000000L; - } - - while (!dev->input_reports && !dev->shutdown_thread) { - res = pthread_cond_timedwait(&dev->condition, &dev->mutex, &ts); - if (res == 0) { - if (dev->input_reports) { - bytes_read = return_data(dev, data, length); - break; - } - - /* If we're here, there was a spurious wake up - or the read thread was shutdown. Run the - loop again (ie: don't break). */ - } - else if (res == ETIMEDOUT) { - /* Timed out. */ - bytes_read = 0; - break; - } - else { - /* Error. */ - bytes_read = -1; - break; - } - } - } - else { - /* Purely non-blocking */ - bytes_read = 0; - } - -ret: - pthread_mutex_unlock(&dev->mutex); - pthread_cleanup_pop(0); - - return bytes_read; -} - -int HID_API_EXPORT hid_read(hid_device *dev, unsigned char *data, size_t length) -{ - return hid_read_timeout(dev, data, length, dev->blocking ? -1 : 0); -} - -int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock) -{ - dev->blocking = !nonblock; - - return 0; -} - - -int HID_API_EXPORT hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length) -{ - int res = -1; - int skipped_report_id = 0; - int report_number = data[0]; - - if (report_number == 0x0) { - data++; - length--; - skipped_report_id = 1; - } - - res = libusb_control_transfer(dev->device_handle, - LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE|LIBUSB_ENDPOINT_OUT, - 0x09/*HID set_report*/, - (3/*HID feature*/ << 8) | report_number, - dev->interface, - (unsigned char *)data, length, - 1000/*timeout millis*/); - - if (res < 0) - return -1; - - /* Account for the report ID */ - if (skipped_report_id) - length++; - - return length; -} - -int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length) -{ - int res = -1; - int skipped_report_id = 0; - int report_number = data[0]; - - if (report_number == 0x0) { - /* Offset the return buffer by 1, so that the report ID - will remain in byte 0. */ - data++; - length--; - skipped_report_id = 1; - } - res = libusb_control_transfer(dev->device_handle, - LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE|LIBUSB_ENDPOINT_IN, - 0x01/*HID get_report*/, - (3/*HID feature*/ << 8) | report_number, - dev->interface, - (unsigned char *)data, length, - 1000/*timeout millis*/); - - if (res < 0) - return -1; - - if (skipped_report_id) - res++; - - return res; -} - - -void HID_API_EXPORT hid_close(hid_device *dev) -{ - if (!dev) - return; - - /* Cause read_thread() to stop. */ - dev->shutdown_thread = 1; - libusb_cancel_transfer(dev->transfer); - - /* Wait for read_thread() to end. */ - pthread_join(dev->thread, NULL); - - /* Clean up the Transfer objects allocated in read_thread(). */ - free(dev->transfer->buffer); - libusb_free_transfer(dev->transfer); - - /* release the interface */ - libusb_release_interface(dev->device_handle, dev->interface); - - /* Close the handle */ - libusb_close(dev->device_handle); - - /* Clear out the queue of received reports. */ - pthread_mutex_lock(&dev->mutex); - while (dev->input_reports) { - return_data(dev, NULL, 0); - } - pthread_mutex_unlock(&dev->mutex); - - free_hid_device(dev); -} - - -int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return hid_get_indexed_string(dev, dev->manufacturer_index, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return hid_get_indexed_string(dev, dev->product_index, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return hid_get_indexed_string(dev, dev->serial_index, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen) -{ - wchar_t *str; - - str = get_usb_string(dev->device_handle, string_index); - if (str) { - wcsncpy(string, str, maxlen); - string[maxlen-1] = L'\0'; - free(str); - return 0; - } - else - return -1; -} - - -HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev) -{ - return NULL; -} - - -struct lang_map_entry { - const char *name; - const char *string_code; - uint16_t usb_code; -}; - -#define LANG(name,code,usb_code) { name, code, usb_code } -static struct lang_map_entry lang_map[] = { - LANG("Afrikaans", "af", 0x0436), - LANG("Albanian", "sq", 0x041C), - LANG("Arabic - United Arab Emirates", "ar_ae", 0x3801), - LANG("Arabic - Bahrain", "ar_bh", 0x3C01), - LANG("Arabic - Algeria", "ar_dz", 0x1401), - LANG("Arabic - Egypt", "ar_eg", 0x0C01), - LANG("Arabic - Iraq", "ar_iq", 0x0801), - LANG("Arabic - Jordan", "ar_jo", 0x2C01), - LANG("Arabic - Kuwait", "ar_kw", 0x3401), - LANG("Arabic - Lebanon", "ar_lb", 0x3001), - LANG("Arabic - Libya", "ar_ly", 0x1001), - LANG("Arabic - Morocco", "ar_ma", 0x1801), - LANG("Arabic - Oman", "ar_om", 0x2001), - LANG("Arabic - Qatar", "ar_qa", 0x4001), - LANG("Arabic - Saudi Arabia", "ar_sa", 0x0401), - LANG("Arabic - Syria", "ar_sy", 0x2801), - LANG("Arabic - Tunisia", "ar_tn", 0x1C01), - LANG("Arabic - Yemen", "ar_ye", 0x2401), - LANG("Armenian", "hy", 0x042B), - LANG("Azeri - Latin", "az_az", 0x042C), - LANG("Azeri - Cyrillic", "az_az", 0x082C), - LANG("Basque", "eu", 0x042D), - LANG("Belarusian", "be", 0x0423), - LANG("Bulgarian", "bg", 0x0402), - LANG("Catalan", "ca", 0x0403), - LANG("Chinese - China", "zh_cn", 0x0804), - LANG("Chinese - Hong Kong SAR", "zh_hk", 0x0C04), - LANG("Chinese - Macau SAR", "zh_mo", 0x1404), - LANG("Chinese - Singapore", "zh_sg", 0x1004), - LANG("Chinese - Taiwan", "zh_tw", 0x0404), - LANG("Croatian", "hr", 0x041A), - LANG("Czech", "cs", 0x0405), - LANG("Danish", "da", 0x0406), - LANG("Dutch - Netherlands", "nl_nl", 0x0413), - LANG("Dutch - Belgium", "nl_be", 0x0813), - LANG("English - Australia", "en_au", 0x0C09), - LANG("English - Belize", "en_bz", 0x2809), - LANG("English - Canada", "en_ca", 0x1009), - LANG("English - Caribbean", "en_cb", 0x2409), - LANG("English - Ireland", "en_ie", 0x1809), - LANG("English - Jamaica", "en_jm", 0x2009), - LANG("English - New Zealand", "en_nz", 0x1409), - LANG("English - Phillippines", "en_ph", 0x3409), - LANG("English - Southern Africa", "en_za", 0x1C09), - LANG("English - Trinidad", "en_tt", 0x2C09), - LANG("English - Great Britain", "en_gb", 0x0809), - LANG("English - United States", "en_us", 0x0409), - LANG("Estonian", "et", 0x0425), - LANG("Farsi", "fa", 0x0429), - LANG("Finnish", "fi", 0x040B), - LANG("Faroese", "fo", 0x0438), - LANG("French - France", "fr_fr", 0x040C), - LANG("French - Belgium", "fr_be", 0x080C), - LANG("French - Canada", "fr_ca", 0x0C0C), - LANG("French - Luxembourg", "fr_lu", 0x140C), - LANG("French - Switzerland", "fr_ch", 0x100C), - LANG("Gaelic - Ireland", "gd_ie", 0x083C), - LANG("Gaelic - Scotland", "gd", 0x043C), - LANG("German - Germany", "de_de", 0x0407), - LANG("German - Austria", "de_at", 0x0C07), - LANG("German - Liechtenstein", "de_li", 0x1407), - LANG("German - Luxembourg", "de_lu", 0x1007), - LANG("German - Switzerland", "de_ch", 0x0807), - LANG("Greek", "el", 0x0408), - LANG("Hebrew", "he", 0x040D), - LANG("Hindi", "hi", 0x0439), - LANG("Hungarian", "hu", 0x040E), - LANG("Icelandic", "is", 0x040F), - LANG("Indonesian", "id", 0x0421), - LANG("Italian - Italy", "it_it", 0x0410), - LANG("Italian - Switzerland", "it_ch", 0x0810), - LANG("Japanese", "ja", 0x0411), - LANG("Korean", "ko", 0x0412), - LANG("Latvian", "lv", 0x0426), - LANG("Lithuanian", "lt", 0x0427), - LANG("F.Y.R.O. Macedonia", "mk", 0x042F), - LANG("Malay - Malaysia", "ms_my", 0x043E), - LANG("Malay – Brunei", "ms_bn", 0x083E), - LANG("Maltese", "mt", 0x043A), - LANG("Marathi", "mr", 0x044E), - LANG("Norwegian - Bokml", "no_no", 0x0414), - LANG("Norwegian - Nynorsk", "no_no", 0x0814), - LANG("Polish", "pl", 0x0415), - LANG("Portuguese - Portugal", "pt_pt", 0x0816), - LANG("Portuguese - Brazil", "pt_br", 0x0416), - LANG("Raeto-Romance", "rm", 0x0417), - LANG("Romanian - Romania", "ro", 0x0418), - LANG("Romanian - Republic of Moldova", "ro_mo", 0x0818), - LANG("Russian", "ru", 0x0419), - LANG("Russian - Republic of Moldova", "ru_mo", 0x0819), - LANG("Sanskrit", "sa", 0x044F), - LANG("Serbian - Cyrillic", "sr_sp", 0x0C1A), - LANG("Serbian - Latin", "sr_sp", 0x081A), - LANG("Setsuana", "tn", 0x0432), - LANG("Slovenian", "sl", 0x0424), - LANG("Slovak", "sk", 0x041B), - LANG("Sorbian", "sb", 0x042E), - LANG("Spanish - Spain (Traditional)", "es_es", 0x040A), - LANG("Spanish - Argentina", "es_ar", 0x2C0A), - LANG("Spanish - Bolivia", "es_bo", 0x400A), - LANG("Spanish - Chile", "es_cl", 0x340A), - LANG("Spanish - Colombia", "es_co", 0x240A), - LANG("Spanish - Costa Rica", "es_cr", 0x140A), - LANG("Spanish - Dominican Republic", "es_do", 0x1C0A), - LANG("Spanish - Ecuador", "es_ec", 0x300A), - LANG("Spanish - Guatemala", "es_gt", 0x100A), - LANG("Spanish - Honduras", "es_hn", 0x480A), - LANG("Spanish - Mexico", "es_mx", 0x080A), - LANG("Spanish - Nicaragua", "es_ni", 0x4C0A), - LANG("Spanish - Panama", "es_pa", 0x180A), - LANG("Spanish - Peru", "es_pe", 0x280A), - LANG("Spanish - Puerto Rico", "es_pr", 0x500A), - LANG("Spanish - Paraguay", "es_py", 0x3C0A), - LANG("Spanish - El Salvador", "es_sv", 0x440A), - LANG("Spanish - Uruguay", "es_uy", 0x380A), - LANG("Spanish - Venezuela", "es_ve", 0x200A), - LANG("Southern Sotho", "st", 0x0430), - LANG("Swahili", "sw", 0x0441), - LANG("Swedish - Sweden", "sv_se", 0x041D), - LANG("Swedish - Finland", "sv_fi", 0x081D), - LANG("Tamil", "ta", 0x0449), - LANG("Tatar", "tt", 0X0444), - LANG("Thai", "th", 0x041E), - LANG("Turkish", "tr", 0x041F), - LANG("Tsonga", "ts", 0x0431), - LANG("Ukrainian", "uk", 0x0422), - LANG("Urdu", "ur", 0x0420), - LANG("Uzbek - Cyrillic", "uz_uz", 0x0843), - LANG("Uzbek – Latin", "uz_uz", 0x0443), - LANG("Vietnamese", "vi", 0x042A), - LANG("Xhosa", "xh", 0x0434), - LANG("Yiddish", "yi", 0x043D), - LANG("Zulu", "zu", 0x0435), - LANG(NULL, NULL, 0x0), -}; - -uint16_t get_usb_code_for_current_locale(void) -{ - char *locale; - char search_string[64]; - char *ptr; - struct lang_map_entry *lang; - - /* Get the current locale. */ - locale = setlocale(0, NULL); - if (!locale) - return 0x0; - - /* Make a copy of the current locale string. */ - strncpy(search_string, locale, sizeof(search_string)); - search_string[sizeof(search_string)-1] = '\0'; - - /* Chop off the encoding part, and make it lower case. */ - ptr = search_string; - while (*ptr) { - *ptr = tolower(*ptr); - if (*ptr == '.') { - *ptr = '\0'; - break; - } - ptr++; - } - - /* Find the entry which matches the string code of our locale. */ - lang = lang_map; - while (lang->string_code) { - if (!strcmp(lang->string_code, search_string)) { - return lang->usb_code; - } - lang++; - } - - /* There was no match. Find with just the language only. */ - /* Chop off the variant. Chop it off at the '_'. */ - ptr = search_string; - while (*ptr) { - *ptr = tolower(*ptr); - if (*ptr == '_') { - *ptr = '\0'; - break; - } - ptr++; - } - -#if 0 /* TODO: Do we need this? */ - /* Find the entry which matches the string code of our language. */ - lang = lang_map; - while (lang->string_code) { - if (!strcmp(lang->string_code, search_string)) { - return lang->usb_code; - } - lang++; - } -#endif - - /* Found nothing. */ - return 0x0; -} - -#ifdef __cplusplus -} -#endif diff --git a/gr-fcd/lib/hid/hidapi.h b/gr-fcd/lib/hid/hidapi.h deleted file mode 100644 index 8e55c84742..0000000000 --- a/gr-fcd/lib/hid/hidapi.h +++ /dev/null @@ -1,383 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 8/22/2009 - - Copyright 2009, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -/** @file - * @defgroup API hidapi API - */ - -#ifndef HIDAPI_H__ -#define HIDAPI_H__ - -#include <wchar.h> - -#ifdef _WIN32 - #define HID_API_EXPORT __declspec(dllexport) - #define HID_API_CALL -#else - #define HID_API_EXPORT /**< API export macro */ - #define HID_API_CALL /**< API call macro */ -#endif - -#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/ - -#ifdef __cplusplus -extern "C" { -#endif - struct hid_device_; - typedef struct hid_device_ hid_device; /**< opaque hidapi structure */ - - /** hidapi info structure */ - struct hid_device_info { - /** Platform-specific device path */ - char *path; - /** Device Vendor ID */ - unsigned short vendor_id; - /** Device Product ID */ - unsigned short product_id; - /** Serial Number */ - wchar_t *serial_number; - /** Device Release Number in binary-coded decimal, - also known as Device Version Number */ - unsigned short release_number; - /** Manufacturer String */ - wchar_t *manufacturer_string; - /** Product string */ - wchar_t *product_string; - /** Usage Page for this Device/Interface - (Windows/Mac only). */ - unsigned short usage_page; - /** Usage for this Device/Interface - (Windows/Mac only).*/ - unsigned short usage; - /** The USB interface which this logical device - represents. Valid on both Linux implementations - in all cases, and valid on the Windows implementation - only if the device contains more than one interface. */ - int interface_number; - - /** Pointer to the next device */ - struct hid_device_info *next; - }; - - - /** @brief Initialize the HIDAPI library. - - This function initializes the HIDAPI library. Calling it is not - strictly necessary, as it will be called automatically by - hid_enumerate() and any of the hid_open_*() functions if it is - needed. This function should be called at the beginning of - execution however, if there is a chance of HIDAPI handles - being opened by different threads simultaneously. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_init(void); - - /** @brief Finalize the HIDAPI library. - - This function frees all of the static data associated with - HIDAPI. It should be called at the end of execution to avoid - memory leaks. - - @ingroup API - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_exit(void); - - /** @brief Enumerate the HID Devices. - - This function returns a linked list of all the HID devices - attached to the system which match vendor_id and product_id. - If @p vendor_id and @p product_id are both set to 0, then - all HID devices will be returned. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the types of device - to open. - @param product_id The Product ID (PID) of the types of - device to open. - - @returns - This function returns a pointer to a linked list of type - struct #hid_device, containing information about the HID devices - attached to the system, or NULL in the case of failure. Free - this linked list by calling hid_free_enumeration(). - */ - struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id); - - /** @brief Free an enumeration Linked List - - This function frees a linked list created by hid_enumerate(). - - @ingroup API - @param devs Pointer to a list of struct_device returned from - hid_enumerate(). - */ - void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs); - - /** @brief Open a HID device using a Vendor ID (VID), Product ID - (PID) and optionally a serial number. - - If @p serial_number is NULL, the first device with the - specified VID and PID is opened. - - @ingroup API - @param vendor_id The Vendor ID (VID) of the device to open. - @param product_id The Product ID (PID) of the device to open. - @param serial_number The Serial Number of the device to open - (Optionally NULL). - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number); - - /** @brief Open a HID device by its path name. - - The path name be determined by calling hid_enumerate(), or a - platform-specific path name can be used (eg: /dev/hidraw0 on - Linux). - - @ingroup API - @param path The path name of the device to open - - @returns - This function returns a pointer to a #hid_device object on - success or NULL on failure. - */ - HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path); - - /** @brief Write an Output report to a HID device. - - The first byte of @p data[] must contain the Report ID. For - devices which only support a single report, this must be set - to 0x0. The remaining bytes contain the report data. Since - the Report ID is mandatory, calls to hid_write() will always - contain one more byte than the report contains. For example, - if a hid report is 16 bytes long, 17 bytes must be passed to - hid_write(), the Report ID (or 0x0, for devices with a - single report), followed by the report data (16 bytes). In - this example, the length passed in would be 17. - - hid_write() will send the data on the first OUT endpoint, if - one exists. If it does not, it will send the data through - the Control Endpoint (Endpoint 0). - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length); - - /** @brief Read an Input report from a HID device with timeout. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param dev A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - @param milliseconds timeout in milliseconds or -1 for blocking wait. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds); - - /** @brief Read an Input report from a HID device. - - Input reports are returned - to the host through the INTERRUPT IN endpoint. The first byte will - contain the Report number if the device uses numbered reports. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into. - @param length The number of bytes to read. For devices with - multiple reports, make sure to read an extra byte for - the report number. - - @returns - This function returns the actual number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length); - - /** @brief Set the device handle to be non-blocking. - - In non-blocking mode calls to hid_read() will return - immediately with a value of 0 if there is no data to be - read. In blocking mode, hid_read() will wait (block) until - there is data to read before returning. - - Nonblocking can be turned on and off at any time. - - @ingroup API - @param device A device handle returned from hid_open(). - @param nonblock enable or not the nonblocking reads - - 1 to enable nonblocking - - 0 to disable nonblocking. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *device, int nonblock); - - /** @brief Send a Feature report to the device. - - Feature reports are sent over the Control endpoint as a - Set_Report transfer. The first byte of @p data[] must - contain the Report ID. For devices which only support a - single report, this must be set to 0x0. The remaining bytes - contain the report data. Since the Report ID is mandatory, - calls to hid_send_feature_report() will always contain one - more byte than the report contains. For example, if a hid - report is 16 bytes long, 17 bytes must be passed to - hid_send_feature_report(): the Report ID (or 0x0, for - devices which do not use numbered reports), followed by the - report data (16 bytes). In this example, the length passed - in would be 17. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data The data to send, including the report number as - the first byte. - @param length The length in bytes of the data to send, including - the report number. - - @returns - This function returns the actual number of bytes written and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *device, const unsigned char *data, size_t length); - - /** @brief Get a feature report from a HID device. - - Make sure to set the first byte of @p data[] to the Report - ID of the report to be read. Make sure to allow space for - this extra byte in @p data[]. - - @ingroup API - @param device A device handle returned from hid_open(). - @param data A buffer to put the read data into, including - the Report ID. Set the first byte of @p data[] to the - Report ID of the report to be read. - @param length The number of bytes to read, including an - extra byte for the report ID. The buffer can be longer - than the actual report. - - @returns - This function returns the number of bytes read and - -1 on error. - */ - int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length); - - /** @brief Close a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - */ - void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device); - - /** @brief Get The Manufacturer String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Product String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_product_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get The Serial Number String from a HID device. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *device, wchar_t *string, size_t maxlen); - - /** @brief Get a string from a HID device, based on its string index. - - @ingroup API - @param device A device handle returned from hid_open(). - @param string_index The index of the string to get. - @param string A wide string buffer to put the data into. - @param maxlen The length of the buffer in multiples of wchar_t. - - @returns - This function returns 0 on success and -1 on error. - */ - int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *device, int string_index, wchar_t *string, size_t maxlen); - - /** @brief Get a string describing the last error which occurred. - - @ingroup API - @param device A device handle returned from hid_open(). - - @returns - This function returns a string containing the last error - which occurred or NULL if none has occurred. - */ - HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/gr-fcd/lib/hid/hidmac.c b/gr-fcd/lib/hid/hidmac.c deleted file mode 100644 index d8c69a8e52..0000000000 --- a/gr-fcd/lib/hid/hidmac.c +++ /dev/null @@ -1,1122 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 2010-07-03 - - Copyright 2010, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -/* See Apple Technical Note TN2187 for details on IOHidManager. */ - -#include <IOKit/hid/IOHIDManager.h> -#include <IOKit/hid/IOHIDKeys.h> -#include <CoreFoundation/CoreFoundation.h> -#include <wchar.h> -#include <locale.h> -#include <pthread.h> -#include <sys/time.h> -#include <unistd.h> - -#include "hidapi.h" - -/* Barrier implementation because Mac OSX doesn't have pthread_barrier. - It also doesn't have clock_gettime(). So much for POSIX and SUSv2. - This implementation came from Brent Priddy and was posted on - StackOverflow. It is used with his permission. */ -typedef int pthread_barrierattr_t; -typedef struct pthread_barrier { - pthread_mutex_t mutex; - pthread_cond_t cond; - int count; - int trip_count; -} pthread_barrier_t; - -static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count) -{ - if(count == 0) { - errno = EINVAL; - return -1; - } - - if(pthread_mutex_init(&barrier->mutex, 0) < 0) { - return -1; - } - if(pthread_cond_init(&barrier->cond, 0) < 0) { - pthread_mutex_destroy(&barrier->mutex); - return -1; - } - barrier->trip_count = count; - barrier->count = 0; - - return 0; -} - -static int pthread_barrier_destroy(pthread_barrier_t *barrier) -{ - pthread_cond_destroy(&barrier->cond); - pthread_mutex_destroy(&barrier->mutex); - return 0; -} - -static int pthread_barrier_wait(pthread_barrier_t *barrier) -{ - pthread_mutex_lock(&barrier->mutex); - ++(barrier->count); - if(barrier->count >= barrier->trip_count) - { - barrier->count = 0; - pthread_cond_broadcast(&barrier->cond); - pthread_mutex_unlock(&barrier->mutex); - return 1; - } - else - { - pthread_cond_wait(&barrier->cond, &(barrier->mutex)); - pthread_mutex_unlock(&barrier->mutex); - return 0; - } -} - -static int return_data(hid_device *dev, unsigned char *data, size_t length); - -/* Linked List of input reports received from the device. */ -struct input_report { - uint8_t *data; - size_t len; - struct input_report *next; -}; - -struct hid_device_ { - IOHIDDeviceRef device_handle; - int blocking; - int uses_numbered_reports; - int disconnected; - CFStringRef run_loop_mode; - CFRunLoopRef run_loop; - CFRunLoopSourceRef source; - uint8_t *input_report_buf; - CFIndex max_input_report_len; - struct input_report *input_reports; - - pthread_t thread; - pthread_mutex_t mutex; /* Protects input_reports */ - pthread_cond_t condition; - pthread_barrier_t barrier; /* Ensures correct startup sequence */ - pthread_barrier_t shutdown_barrier; /* Ensures correct shutdown sequence */ - int shutdown_thread; - - hid_device *next; -}; - -/* Static list of all the devices open. This way when a device gets - disconnected, its hid_device structure can be marked as disconnected - from hid_device_removal_callback(). */ -static hid_device *device_list = NULL; -static pthread_mutex_t device_list_mutex = PTHREAD_MUTEX_INITIALIZER; - -static hid_device *new_hid_device(void) -{ - hid_device *dev = calloc(1, sizeof(hid_device)); - dev->device_handle = NULL; - dev->blocking = 1; - dev->uses_numbered_reports = 0; - dev->disconnected = 0; - dev->run_loop_mode = NULL; - dev->run_loop = NULL; - dev->source = NULL; - dev->input_report_buf = NULL; - dev->input_reports = NULL; - dev->shutdown_thread = 0; - dev->next = NULL; - - /* Thread objects */ - pthread_mutex_init(&dev->mutex, NULL); - pthread_cond_init(&dev->condition, NULL); - pthread_barrier_init(&dev->barrier, NULL, 2); - pthread_barrier_init(&dev->shutdown_barrier, NULL, 2); - - /* Add the new record to the device_list. */ - pthread_mutex_lock(&device_list_mutex); - if (!device_list) - device_list = dev; - else { - hid_device *d = device_list; - while (d) { - if (!d->next) { - d->next = dev; - break; - } - d = d->next; - } - } - pthread_mutex_unlock(&device_list_mutex); - - return dev; -} - -static void free_hid_device(hid_device *dev) -{ - if (!dev) - return; - - /* Delete any input reports still left over. */ - struct input_report *rpt = dev->input_reports; - while (rpt) { - struct input_report *next = rpt->next; - free(rpt->data); - free(rpt); - rpt = next; - } - - /* Free the string and the report buffer. The check for NULL - is necessary here as CFRelease() doesn't handle NULL like - free() and others do. */ - if (dev->run_loop_mode) - CFRelease(dev->run_loop_mode); - if (dev->source) - CFRelease(dev->source); - free(dev->input_report_buf); - - /* Clean up the thread objects */ - pthread_barrier_destroy(&dev->shutdown_barrier); - pthread_barrier_destroy(&dev->barrier); - pthread_cond_destroy(&dev->condition); - pthread_mutex_destroy(&dev->mutex); - - /* Remove it from the device list. */ - pthread_mutex_lock(&device_list_mutex); - hid_device *d = device_list; - if (d == dev) { - device_list = d->next; - } - else { - while (d) { - if (d->next == dev) { - d->next = d->next->next; - break; - } - - d = d->next; - } - } - pthread_mutex_unlock(&device_list_mutex); - - /* Free the structure itself. */ - free(dev); -} - -static IOHIDManagerRef hid_mgr = 0x0; - - -#if 0 -static void register_error(hid_device *device, const char *op) -{ - -} -#endif - - -static int32_t get_int_property(IOHIDDeviceRef device, CFStringRef key) -{ - CFTypeRef ref; - int32_t value; - - ref = IOHIDDeviceGetProperty(device, key); - if (ref) { - if (CFGetTypeID(ref) == CFNumberGetTypeID()) { - CFNumberGetValue((CFNumberRef) ref, kCFNumberSInt32Type, &value); - return value; - } - } - return 0; -} - -static unsigned short get_vendor_id(IOHIDDeviceRef device) -{ - return get_int_property(device, CFSTR(kIOHIDVendorIDKey)); -} - -static unsigned short get_product_id(IOHIDDeviceRef device) -{ - return get_int_property(device, CFSTR(kIOHIDProductIDKey)); -} - - -static int32_t get_max_report_length(IOHIDDeviceRef device) -{ - return get_int_property(device, CFSTR(kIOHIDMaxInputReportSizeKey)); -} - -static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t *buf, size_t len) -{ - CFStringRef str = IOHIDDeviceGetProperty(device, prop); - - buf[0] = 0x0000; - - if (str) { - CFRange range; - range.location = 0; - range.length = len; - CFIndex used_buf_len; - CFStringGetBytes(str, - range, - kCFStringEncodingUTF32LE, - (char)'?', - FALSE, - (UInt8*)buf, - len, - &used_buf_len); - buf[len-1] = 0x00000000; - return used_buf_len; - } - else - return 0; - -} - -static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, char *buf, size_t len) -{ - CFStringRef str = IOHIDDeviceGetProperty(device, prop); - - buf[0] = 0x0000; - - if (str) { - CFRange range; - range.location = 0; - range.length = len; - CFIndex used_buf_len; - CFStringGetBytes(str, - range, - kCFStringEncodingUTF8, - (char)'?', - FALSE, - (UInt8*)buf, - len, - &used_buf_len); - buf[len-1] = 0x00000000; - return used_buf_len; - } - else - return 0; - -} - - -static int get_serial_number(IOHIDDeviceRef device, wchar_t *buf, size_t len) -{ - return get_string_property(device, CFSTR(kIOHIDSerialNumberKey), buf, len); -} - -static int get_manufacturer_string(IOHIDDeviceRef device, wchar_t *buf, size_t len) -{ - return get_string_property(device, CFSTR(kIOHIDManufacturerKey), buf, len); -} - -static int get_product_string(IOHIDDeviceRef device, wchar_t *buf, size_t len) -{ - return get_string_property(device, CFSTR(kIOHIDProductKey), buf, len); -} - - -/* Implementation of wcsdup() for Mac. */ -static wchar_t *dup_wcs(const wchar_t *s) -{ - size_t len = wcslen(s); - wchar_t *ret = malloc((len+1)*sizeof(wchar_t)); - wcscpy(ret, s); - - return ret; -} - - -static int make_path(IOHIDDeviceRef device, char *buf, size_t len) -{ - int res; - unsigned short vid, pid; - char transport[32]; - - buf[0] = '\0'; - - res = get_string_property_utf8( - device, CFSTR(kIOHIDTransportKey), - transport, sizeof(transport)); - - if (!res) - return -1; - - vid = get_vendor_id(device); - pid = get_product_id(device); - - res = snprintf(buf, len, "%s_%04hx_%04hx_%p", - transport, vid, pid, device); - - - buf[len-1] = '\0'; - return res+1; -} - -static int init_hid_manager(void) -{ - IOReturn res; - - /* Initialize all the HID Manager Objects */ - hid_mgr = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); - IOHIDManagerSetDeviceMatching(hid_mgr, NULL); - IOHIDManagerScheduleWithRunLoop(hid_mgr, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - res = IOHIDManagerOpen(hid_mgr, kIOHIDOptionsTypeNone); - return (res == kIOReturnSuccess)? 0: -1; -} - -int HID_API_EXPORT hid_init(void) -{ - if (!hid_mgr) { - if (init_hid_manager() < 0) { - hid_exit(); - return -1; - } - } - return 0; -} - -int HID_API_EXPORT hid_exit(void) -{ - if (hid_mgr) { - /* Close the HID manager. */ - IOHIDManagerClose(hid_mgr, kIOHIDOptionsTypeNone); - CFRelease(hid_mgr); - hid_mgr = NULL; - } - - return 0; -} - -struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id, unsigned short product_id) -{ - struct hid_device_info *root = NULL; // return object - struct hid_device_info *cur_dev = NULL; - CFIndex num_devices; - int i; - - setlocale(LC_ALL,""); - - /* Set up the HID Manager if it hasn't been done */ - hid_init(); - - /* Get a list of the Devices */ - CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr); - - /* Convert the list into a C array so we can iterate easily. */ - num_devices = CFSetGetCount(device_set); - IOHIDDeviceRef *device_array = calloc(num_devices, sizeof(IOHIDDeviceRef)); - CFSetGetValues(device_set, (const void **) device_array); - - /* Iterate over each device, making an entry for it. */ - for (i = 0; i < num_devices; i++) { - unsigned short dev_vid; - unsigned short dev_pid; - #define BUF_LEN 256 - wchar_t buf[BUF_LEN]; - char cbuf[BUF_LEN]; - - IOHIDDeviceRef dev = device_array[i]; - - if (!dev) { - continue; - } - dev_vid = get_vendor_id(dev); - dev_pid = get_product_id(dev); - - /* Check the VID/PID against the arguments */ - if ((vendor_id == 0x0 && product_id == 0x0) || - (vendor_id == dev_vid && product_id == dev_pid)) { - struct hid_device_info *tmp; - size_t len; - - /* VID/PID match. Create the record. */ - tmp = malloc(sizeof(struct hid_device_info)); - if (cur_dev) { - cur_dev->next = tmp; - } - else { - root = tmp; - } - cur_dev = tmp; - - // Get the Usage Page and Usage for this device. - cur_dev->usage_page = get_int_property(dev, CFSTR(kIOHIDPrimaryUsagePageKey)); - cur_dev->usage = get_int_property(dev, CFSTR(kIOHIDPrimaryUsageKey)); - - /* Fill out the record */ - cur_dev->next = NULL; - len = make_path(dev, cbuf, sizeof(cbuf)); - cur_dev->path = strdup(cbuf); - - /* Serial Number */ - get_serial_number(dev, buf, BUF_LEN); - cur_dev->serial_number = dup_wcs(buf); - - /* Manufacturer and Product strings */ - get_manufacturer_string(dev, buf, BUF_LEN); - cur_dev->manufacturer_string = dup_wcs(buf); - get_product_string(dev, buf, BUF_LEN); - cur_dev->product_string = dup_wcs(buf); - - /* VID/PID */ - cur_dev->vendor_id = dev_vid; - cur_dev->product_id = dev_pid; - - /* Release Number */ - cur_dev->release_number = get_int_property(dev, CFSTR(kIOHIDVersionNumberKey)); - - /* Interface Number (Unsupported on Mac)*/ - cur_dev->interface_number = -1; - } - } - - free(device_array); - CFRelease(device_set); - - return root; -} - -void HID_API_EXPORT hid_free_enumeration(struct hid_device_info *devs) -{ - /* This function is identical to the Linux version. Platform independent. */ - struct hid_device_info *d = devs; - while (d) { - struct hid_device_info *next = d->next; - free(d->path); - free(d->serial_number); - free(d->manufacturer_string); - free(d->product_string); - free(d); - d = next; - } -} - -hid_device * HID_API_EXPORT hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number) -{ - /* This function is identical to the Linux version. Platform independent. */ - struct hid_device_info *devs, *cur_dev; - const char *path_to_open = NULL; - hid_device * handle = NULL; - - devs = hid_enumerate(vendor_id, product_id); - cur_dev = devs; - while (cur_dev) { - if (cur_dev->vendor_id == vendor_id && - cur_dev->product_id == product_id) { - if (serial_number) { - if (wcscmp(serial_number, cur_dev->serial_number) == 0) { - path_to_open = cur_dev->path; - break; - } - } - else { - path_to_open = cur_dev->path; - break; - } - } - cur_dev = cur_dev->next; - } - - if (path_to_open) { - /* Open the device */ - handle = hid_open_path(path_to_open); - } - - hid_free_enumeration(devs); - - return handle; -} - -static void hid_device_removal_callback(void *context, IOReturn result, - void *sender, IOHIDDeviceRef dev_ref) -{ - /* Stop the Run Loop for this device. */ - pthread_mutex_lock(&device_list_mutex); - hid_device *d = device_list; - while (d) { - if (d->device_handle == dev_ref) { - d->disconnected = 1; - CFRunLoopStop(d->run_loop); - } - - d = d->next; - } - pthread_mutex_unlock(&device_list_mutex); -} - -/* The Run Loop calls this function for each input report received. - This function puts the data into a linked list to be picked up by - hid_read(). */ -static void hid_report_callback(void *context, IOReturn result, void *sender, - IOHIDReportType report_type, uint32_t report_id, - uint8_t *report, CFIndex report_length) -{ - struct input_report *rpt; - hid_device *dev = context; - - /* Make a new Input Report object */ - rpt = calloc(1, sizeof(struct input_report)); - rpt->data = calloc(1, report_length); - memcpy(rpt->data, report, report_length); - rpt->len = report_length; - rpt->next = NULL; - - /* Lock this section */ - pthread_mutex_lock(&dev->mutex); - - /* Attach the new report object to the end of the list. */ - if (dev->input_reports == NULL) { - /* The list is empty. Put it at the root. */ - dev->input_reports = rpt; - } - else { - /* Find the end of the list and attach. */ - struct input_report *cur = dev->input_reports; - int num_queued = 0; - while (cur->next != NULL) { - cur = cur->next; - num_queued++; - } - cur->next = rpt; - - /* Pop one off if we've reached 30 in the queue. This - way we don't grow forever if the user never reads - anything from the device. */ - if (num_queued > 30) { - return_data(dev, NULL, 0); - } - } - - /* Signal a waiting thread that there is data. */ - pthread_cond_signal(&dev->condition); - - /* Unlock */ - pthread_mutex_unlock(&dev->mutex); - -} - -/* This gets called when the read_thred's run loop gets signaled by - hid_close(), and serves to stop the read_thread's run loop. */ -static void perform_signal_callback(void *context) -{ - hid_device *dev = context; - CFRunLoopStop(dev->run_loop); //TODO: CFRunLoopGetCurrent() -} - -static void *read_thread(void *param) -{ - hid_device *dev = param; - - /* Move the device's run loop to this thread. */ - IOHIDDeviceScheduleWithRunLoop(dev->device_handle, CFRunLoopGetCurrent(), dev->run_loop_mode); - - /* Create the RunLoopSource which is used to signal the - event loop to stop when hid_close() is called. */ - CFRunLoopSourceContext ctx; - memset(&ctx, 0, sizeof(ctx)); - ctx.version = 0; - ctx.info = dev; - ctx.perform = &perform_signal_callback; - dev->source = CFRunLoopSourceCreate(kCFAllocatorDefault, 0/*order*/, &ctx); - CFRunLoopAddSource(CFRunLoopGetCurrent(), dev->source, dev->run_loop_mode); - - /* Store off the Run Loop so it can be stopped from hid_close() - and on device disconnection. */ - dev->run_loop = CFRunLoopGetCurrent(); - - /* Notify the main thread that the read thread is up and running. */ - pthread_barrier_wait(&dev->barrier); - - /* Run the Event Loop. CFRunLoopRunInMode() will dispatch HID input - reports into the hid_report_callback(). */ - SInt32 code; - while (!dev->shutdown_thread && !dev->disconnected) { - code = CFRunLoopRunInMode(dev->run_loop_mode, 1000/*sec*/, FALSE); - /* Return if the device has been disconnected */ - if (code == kCFRunLoopRunFinished) { - dev->disconnected = 1; - break; - } - - - /* Break if The Run Loop returns Finished or Stopped. */ - if (code != kCFRunLoopRunTimedOut && - code != kCFRunLoopRunHandledSource) { - /* There was some kind of error. Setting - shutdown seems to make sense, but - there may be something else more appropriate */ - dev->shutdown_thread = 1; - break; - } - } - - /* Now that the read thread is stopping, Wake any threads which are - waiting on data (in hid_read_timeout()). Do this under a mutex to - make sure that a thread which is about to go to sleep waiting on - the condition acutally will go to sleep before the condition is - signaled. */ - pthread_mutex_lock(&dev->mutex); - pthread_cond_broadcast(&dev->condition); - pthread_mutex_unlock(&dev->mutex); - - /* Close the OS handle to the device, but only if it's not - been unplugged. If it's been unplugged, then calling - IOHIDDeviceClose() will crash. */ - if (!dev->disconnected) { - IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone); - } - - /* Wait here until hid_close() is called and makes it past - the call to CFRunLoopWakeUp(). This thread still needs to - be valid when that function is called on the other thread. */ - pthread_barrier_wait(&dev->shutdown_barrier); - - return NULL; -} - -hid_device * HID_API_EXPORT hid_open_path(const char *path) -{ - int i; - hid_device *dev = NULL; - CFIndex num_devices; - - dev = new_hid_device(); - - /* Set up the HID Manager if it hasn't been done */ - hid_init(); - - CFSetRef device_set = IOHIDManagerCopyDevices(hid_mgr); - - num_devices = CFSetGetCount(device_set); - IOHIDDeviceRef *device_array = calloc(num_devices, sizeof(IOHIDDeviceRef)); - CFSetGetValues(device_set, (const void **) device_array); - for (i = 0; i < num_devices; i++) { - char cbuf[BUF_LEN]; - size_t len; - IOHIDDeviceRef os_dev = device_array[i]; - - len = make_path(os_dev, cbuf, sizeof(cbuf)); - if (!strcmp(cbuf, path)) { - // Matched Paths. Open this Device. - IOReturn ret = IOHIDDeviceOpen(os_dev, kIOHIDOptionsTypeNone); - if (ret == kIOReturnSuccess) { - char str[32]; - - free(device_array); - CFRelease(device_set); - dev->device_handle = os_dev; - - /* Create the buffers for receiving data */ - dev->max_input_report_len = (CFIndex) get_max_report_length(os_dev); - dev->input_report_buf = calloc(dev->max_input_report_len, sizeof(uint8_t)); - - /* Create the Run Loop Mode for this device. - printing the reference seems to work. */ - sprintf(str, "HIDAPI_%p", os_dev); - dev->run_loop_mode = - CFStringCreateWithCString(NULL, str, kCFStringEncodingASCII); - - /* Attach the device to a Run Loop */ - IOHIDDeviceRegisterInputReportCallback( - os_dev, dev->input_report_buf, dev->max_input_report_len, - &hid_report_callback, dev); - IOHIDManagerRegisterDeviceRemovalCallback(hid_mgr, hid_device_removal_callback, NULL); - - /* Start the read thread */ - pthread_create(&dev->thread, NULL, read_thread, dev); - - /* Wait here for the read thread to be initialized. */ - pthread_barrier_wait(&dev->barrier); - - return dev; - } - else { - goto return_error; - } - } - } - -return_error: - free(device_array); - CFRelease(device_set); - free_hid_device(dev); - return NULL; -} - -static int set_report(hid_device *dev, IOHIDReportType type, const unsigned char *data, size_t length) -{ - const unsigned char *data_to_send; - size_t length_to_send; - IOReturn res; - - /* Return if the device has been disconnected. */ - if (dev->disconnected) - return -1; - - if (data[0] == 0x0) { - /* Not using numbered Reports. - Don't send the report number. */ - data_to_send = data+1; - length_to_send = length-1; - } - else { - /* Using numbered Reports. - Send the Report Number */ - data_to_send = data; - length_to_send = length; - } - - if (!dev->disconnected) { - res = IOHIDDeviceSetReport(dev->device_handle, - type, - data[0], /* Report ID*/ - data_to_send, length_to_send); - - if (res == kIOReturnSuccess) { - return length; - } - else - return -1; - } - - return -1; -} - -int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length) -{ - return set_report(dev, kIOHIDReportTypeOutput, data, length); -} - -/* Helper function, so that this isn't duplicated in hid_read(). */ -static int return_data(hid_device *dev, unsigned char *data, size_t length) -{ - /* Copy the data out of the linked list item (rpt) into the - return buffer (data), and delete the liked list item. */ - struct input_report *rpt = dev->input_reports; - size_t len = (length < rpt->len)? length: rpt->len; - memcpy(data, rpt->data, len); - dev->input_reports = rpt->next; - free(rpt->data); - free(rpt); - return len; -} - -static int cond_wait(const hid_device *dev, pthread_cond_t *cond, pthread_mutex_t *mutex) -{ - while (!dev->input_reports) { - int res = pthread_cond_wait(cond, mutex); - if (res != 0) - return res; - - /* A res of 0 means we may have been signaled or it may - be a spurious wakeup. Check to see that there's acutally - data in the queue before returning, and if not, go back - to sleep. See the pthread_cond_timedwait() man page for - details. */ - - if (dev->shutdown_thread || dev->disconnected) - return -1; - } - - return 0; -} - -static int cond_timedwait(const hid_device *dev, pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime) -{ - while (!dev->input_reports) { - int res = pthread_cond_timedwait(cond, mutex, abstime); - if (res != 0) - return res; - - /* A res of 0 means we may have been signaled or it may - be a spurious wakeup. Check to see that there's acutally - data in the queue before returning, and if not, go back - to sleep. See the pthread_cond_timedwait() man page for - details. */ - - if (dev->shutdown_thread || dev->disconnected) - return -1; - } - - return 0; - -} - -int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds) -{ - int bytes_read = -1; - - /* Lock the access to the report list. */ - pthread_mutex_lock(&dev->mutex); - - /* There's an input report queued up. Return it. */ - if (dev->input_reports) { - /* Return the first one */ - bytes_read = return_data(dev, data, length); - goto ret; - } - - /* Return if the device has been disconnected. */ - if (dev->disconnected) { - bytes_read = -1; - goto ret; - } - - if (dev->shutdown_thread) { - /* This means the device has been closed (or there - has been an error. An error code of -1 should - be returned. */ - bytes_read = -1; - goto ret; - } - - /* There is no data. Go to sleep and wait for data. */ - - if (milliseconds == -1) { - /* Blocking */ - int res; - res = cond_wait(dev, &dev->condition, &dev->mutex); - if (res == 0) - bytes_read = return_data(dev, data, length); - else { - /* There was an error, or a device disconnection. */ - bytes_read = -1; - } - } - else if (milliseconds > 0) { - /* Non-blocking, but called with timeout. */ - int res; - struct timespec ts; - struct timeval tv; - gettimeofday(&tv, NULL); - TIMEVAL_TO_TIMESPEC(&tv, &ts); - ts.tv_sec += milliseconds / 1000; - ts.tv_nsec += (milliseconds % 1000) * 1000000; - if (ts.tv_nsec >= 1000000000L) { - ts.tv_sec++; - ts.tv_nsec -= 1000000000L; - } - - res = cond_timedwait(dev, &dev->condition, &dev->mutex, &ts); - if (res == 0) - bytes_read = return_data(dev, data, length); - else if (res == ETIMEDOUT) - bytes_read = 0; - else - bytes_read = -1; - } - else { - /* Purely non-blocking */ - bytes_read = 0; - } - -ret: - /* Unlock */ - pthread_mutex_unlock(&dev->mutex); - return bytes_read; -} - -int HID_API_EXPORT hid_read(hid_device *dev, unsigned char *data, size_t length) -{ - return hid_read_timeout(dev, data, length, (dev->blocking)? -1: 0); -} - -int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock) -{ - /* All Nonblocking operation is handled by the library. */ - dev->blocking = !nonblock; - - return 0; -} - -int HID_API_EXPORT hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length) -{ - return set_report(dev, kIOHIDReportTypeFeature, data, length); -} - -int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length) -{ - CFIndex len = length; - IOReturn res; - - /* Return if the device has been unplugged. */ - if (dev->disconnected) - return -1; - - res = IOHIDDeviceGetReport(dev->device_handle, - kIOHIDReportTypeFeature, - data[0], /* Report ID */ - data, &len); - if (res == kIOReturnSuccess) - return len; - else - return -1; -} - - -void HID_API_EXPORT hid_close(hid_device *dev) -{ - if (!dev) - return; - - /* Disconnect the report callback before close. */ - if (!dev->disconnected) { - IOHIDDeviceRegisterInputReportCallback( - dev->device_handle, dev->input_report_buf, dev->max_input_report_len, - NULL, dev); - IOHIDManagerRegisterDeviceRemovalCallback(hid_mgr, NULL, dev); - IOHIDDeviceUnscheduleFromRunLoop(dev->device_handle, dev->run_loop, dev->run_loop_mode); - IOHIDDeviceScheduleWithRunLoop(dev->device_handle, CFRunLoopGetMain(), kCFRunLoopDefaultMode); - } - - /* Cause read_thread() to stop. */ - dev->shutdown_thread = 1; - - /* Wake up the run thread's event loop so that the thread can exit. */ - CFRunLoopSourceSignal(dev->source); - CFRunLoopWakeUp(dev->run_loop); - - /* Notify the read thread that it can shut down now. */ - pthread_barrier_wait(&dev->shutdown_barrier); - - /* Wait for read_thread() to end. */ - pthread_join(dev->thread, NULL); - - /* Close the OS handle to the device, but only if it's not - been unplugged. If it's been unplugged, then calling - IOHIDDeviceClose() will crash. */ - if (!dev->disconnected) { - IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone); - } - - /* Clear out the queue of received reports. */ - pthread_mutex_lock(&dev->mutex); - while (dev->input_reports) { - return_data(dev, NULL, 0); - } - pthread_mutex_unlock(&dev->mutex); - - free_hid_device(dev); -} - -int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return get_manufacturer_string(dev->device_handle, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return get_product_string(dev->device_handle, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - return get_serial_number(dev->device_handle, string, maxlen); -} - -int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen) -{ - // TODO: - - return 0; -} - - -HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev) -{ - // TODO: - - return NULL; -} - - - - - - -#if 0 -static int32_t get_location_id(IOHIDDeviceRef device) -{ - return get_int_property(device, CFSTR(kIOHIDLocationIDKey)); -} - -static int32_t get_usage(IOHIDDeviceRef device) -{ - int32_t res; - res = get_int_property(device, CFSTR(kIOHIDDeviceUsageKey)); - if (!res) - res = get_int_property(device, CFSTR(kIOHIDPrimaryUsageKey)); - return res; -} - -static int32_t get_usage_page(IOHIDDeviceRef device) -{ - int32_t res; - res = get_int_property(device, CFSTR(kIOHIDDeviceUsagePageKey)); - if (!res) - res = get_int_property(device, CFSTR(kIOHIDPrimaryUsagePageKey)); - return res; -} - -static int get_transport(IOHIDDeviceRef device, wchar_t *buf, size_t len) -{ - return get_string_property(device, CFSTR(kIOHIDTransportKey), buf, len); -} - - -int main(void) -{ - IOHIDManagerRef mgr; - int i; - - mgr = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); - IOHIDManagerSetDeviceMatching(mgr, NULL); - IOHIDManagerOpen(mgr, kIOHIDOptionsTypeNone); - - CFSetRef device_set = IOHIDManagerCopyDevices(mgr); - - CFIndex num_devices = CFSetGetCount(device_set); - IOHIDDeviceRef *device_array = calloc(num_devices, sizeof(IOHIDDeviceRef)); - CFSetGetValues(device_set, (const void **) device_array); - - setlocale(LC_ALL, ""); - - for (i = 0; i < num_devices; i++) { - IOHIDDeviceRef dev = device_array[i]; - printf("Device: %p\n", dev); - printf(" %04hx %04hx\n", get_vendor_id(dev), get_product_id(dev)); - - wchar_t serial[256], buf[256]; - char cbuf[256]; - get_serial_number(dev, serial, 256); - - - printf(" Serial: %ls\n", serial); - printf(" Loc: %ld\n", get_location_id(dev)); - get_transport(dev, buf, 256); - printf(" Trans: %ls\n", buf); - make_path(dev, cbuf, 256); - printf(" Path: %s\n", cbuf); - - } - - return 0; -} -#endif diff --git a/gr-fcd/lib/hid/hidwin.c b/gr-fcd/lib/hid/hidwin.c deleted file mode 100644 index 5d34aadf48..0000000000 --- a/gr-fcd/lib/hid/hidwin.c +++ /dev/null @@ -1,873 +0,0 @@ -/******************************************************* - HIDAPI - Multi-Platform library for - communication with HID devices. - - Alan Ott - Signal 11 Software - - 8/22/2009 - - Copyright 2009, All Rights Reserved. - - At the discretion of the user of this library, - this software may be licensed under the terms of the - GNU Public License v3, a BSD-Style license, or the - original HIDAPI license as outlined in the LICENSE.txt, - LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt - files located at the root of the source distribution. - These files may also be found in the public source - code repository located at: - http://github.com/signal11/hidapi . -********************************************************/ - -#include <windows.h> - -#ifndef _NTDEF_ -typedef LONG NTSTATUS; -#endif - -#ifdef __MINGW32__ -#include <ntdef.h> -#include <winbase.h> -#endif - -#ifdef __CYGWIN__ -#include <ntdef.h> -#define _wcsdup wcsdup -#endif - -//#define HIDAPI_USE_DDK - -#ifdef __cplusplus -extern "C" { -#endif - #include <setupapi.h> - #include <winioctl.h> - #ifdef HIDAPI_USE_DDK - #include <hidsdi.h> - #endif - - // Copied from inc/ddk/hidclass.h, part of the Windows DDK. - #define HID_OUT_CTL_CODE(id) \ - CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - #define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100) - -#ifdef __cplusplus -} // extern "C" -#endif - -#include <stdio.h> -#include <stdlib.h> - - -#include "hidapi.h" - -#ifdef _MSC_VER - // Thanks Microsoft, but I know how to use strncpy(). - #pragma warning(disable:4996) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HIDAPI_USE_DDK - // Since we're not building with the DDK, and the HID header - // files aren't part of the SDK, we have to define all this - // stuff here. In lookup_functions(), the function pointers - // defined below are set. - typedef struct _HIDD_ATTRIBUTES{ - ULONG Size; - USHORT VendorID; - USHORT ProductID; - USHORT VersionNumber; - } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; - - typedef USHORT USAGE; - typedef struct _HIDP_CAPS { - USAGE Usage; - USAGE UsagePage; - USHORT InputReportByteLength; - USHORT OutputReportByteLength; - USHORT FeatureReportByteLength; - USHORT Reserved[17]; - USHORT fields_not_used_by_hidapi[10]; - } HIDP_CAPS, *PHIDP_CAPS; - typedef char* HIDP_PREPARSED_DATA; - #define HIDP_STATUS_SUCCESS 0x0 - - typedef BOOLEAN (__stdcall *HidD_GetAttributes_)(HANDLE device, PHIDD_ATTRIBUTES attrib); - typedef BOOLEAN (__stdcall *HidD_GetSerialNumberString_)(HANDLE device, PVOID buffer, ULONG buffer_len); - typedef BOOLEAN (__stdcall *HidD_GetManufacturerString_)(HANDLE handle, PVOID buffer, ULONG buffer_len); - typedef BOOLEAN (__stdcall *HidD_GetProductString_)(HANDLE handle, PVOID buffer, ULONG buffer_len); - typedef BOOLEAN (__stdcall *HidD_SetFeature_)(HANDLE handle, PVOID data, ULONG length); - typedef BOOLEAN (__stdcall *HidD_GetFeature_)(HANDLE handle, PVOID data, ULONG length); - typedef BOOLEAN (__stdcall *HidD_GetIndexedString_)(HANDLE handle, ULONG string_index, PVOID buffer, ULONG buffer_len); - typedef BOOLEAN (__stdcall *HidD_GetPreparsedData_)(HANDLE handle, HIDP_PREPARSED_DATA **preparsed_data); - typedef BOOLEAN (__stdcall *HidD_FreePreparsedData_)(HIDP_PREPARSED_DATA *preparsed_data); - typedef BOOLEAN (__stdcall *HidP_GetCaps_)(HIDP_PREPARSED_DATA *preparsed_data, HIDP_CAPS *caps); - - static HidD_GetAttributes_ HidD_GetAttributes; - static HidD_GetSerialNumberString_ HidD_GetSerialNumberString; - static HidD_GetManufacturerString_ HidD_GetManufacturerString; - static HidD_GetProductString_ HidD_GetProductString; - static HidD_SetFeature_ HidD_SetFeature; - static HidD_GetFeature_ HidD_GetFeature; - static HidD_GetIndexedString_ HidD_GetIndexedString; - static HidD_GetPreparsedData_ HidD_GetPreparsedData; - static HidD_FreePreparsedData_ HidD_FreePreparsedData; - static HidP_GetCaps_ HidP_GetCaps; - - static HMODULE lib_handle = NULL; - static BOOLEAN initialized = FALSE; -#endif // HIDAPI_USE_DDK - -struct hid_device_ { - HANDLE device_handle; - BOOL blocking; - size_t input_report_length; - void *last_error_str; - DWORD last_error_num; - BOOL read_pending; - char *read_buf; - OVERLAPPED ol; -}; - -static hid_device *new_hid_device() -{ - hid_device *dev = (hid_device*) calloc(1, sizeof(hid_device)); - dev->device_handle = INVALID_HANDLE_VALUE; - dev->blocking = TRUE; - dev->input_report_length = 0; - dev->last_error_str = NULL; - dev->last_error_num = 0; - dev->read_pending = FALSE; - dev->read_buf = NULL; - memset(&dev->ol, 0, sizeof(dev->ol)); - dev->ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*inital state f=nonsignaled*/, NULL); - - return dev; -} - - -static void register_error(hid_device *device, const char *op) -{ - WCHAR *ptr, *msg; - - FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPWSTR)&msg, 0/*sz*/, - NULL); - - // Get rid of the CR and LF that FormatMessage() sticks at the - // end of the message. Thanks Microsoft! - ptr = msg; - while (*ptr) { - if (*ptr == '\r') { - *ptr = 0x0000; - break; - } - ptr++; - } - - // Store the message off in the Device entry so that - // the hid_error() function can pick it up. - LocalFree(device->last_error_str); - device->last_error_str = msg; -} - -#ifndef HIDAPI_USE_DDK -static int lookup_functions() -{ - lib_handle = LoadLibraryA("hid.dll"); - if (lib_handle) { -#define RESOLVE(x) x = (x##_)GetProcAddress(lib_handle, #x); if (!x) return -1; - RESOLVE(HidD_GetAttributes); - RESOLVE(HidD_GetSerialNumberString); - RESOLVE(HidD_GetManufacturerString); - RESOLVE(HidD_GetProductString); - RESOLVE(HidD_SetFeature); - RESOLVE(HidD_GetFeature); - RESOLVE(HidD_GetIndexedString); - RESOLVE(HidD_GetPreparsedData); - RESOLVE(HidD_FreePreparsedData); - RESOLVE(HidP_GetCaps); -#undef RESOLVE - } - else - return -1; - - return 0; -} -#endif - -static HANDLE open_device(const char *path) -{ - HANDLE handle; - - /* First, try to open with sharing mode turned off. This will make it so - that a HID device can only be opened once. This is to be consistent - with the behavior on the other platforms. */ - handle = CreateFileA(path, - GENERIC_WRITE |GENERIC_READ, - 0, /*share mode*/ - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED,//FILE_ATTRIBUTE_NORMAL, - 0); - - if (handle == INVALID_HANDLE_VALUE) { - /* Couldn't open the device. Some devices must be opened - with sharing enabled (even though they are only opened once), - so try it here. */ - handle = CreateFileA(path, - GENERIC_WRITE |GENERIC_READ, - FILE_SHARE_READ|FILE_SHARE_WRITE, /*share mode*/ - NULL, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED,//FILE_ATTRIBUTE_NORMAL, - 0); - } - - return handle; -} - -int HID_API_EXPORT hid_init(void) -{ -#ifndef HIDAPI_USE_DDK - if (!initialized) { - if (lookup_functions() < 0) { - hid_exit(); - return -1; - } - initialized = TRUE; - } -#endif - return 0; -} - -int HID_API_EXPORT hid_exit(void) -{ -#ifndef HIDAPI_USE_DDK - if (lib_handle) - FreeLibrary(lib_handle); - lib_handle = NULL; - initialized = FALSE; -#endif - return 0; -} - -struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id) -{ - BOOL res; - struct hid_device_info *root = NULL; // return object - struct hid_device_info *cur_dev = NULL; - - // Windows objects for interacting with the driver. - GUID InterfaceClassGuid = {0x4d1e55b2, 0xf16f, 0x11cf, {0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30} }; - SP_DEVINFO_DATA devinfo_data; - SP_DEVICE_INTERFACE_DATA device_interface_data; - SP_DEVICE_INTERFACE_DETAIL_DATA_A *device_interface_detail_data = NULL; - HDEVINFO device_info_set = INVALID_HANDLE_VALUE; - int device_index = 0; - - if (hid_init() < 0) - return NULL; - - // Initialize the Windows objects. - devinfo_data.cbSize = sizeof(SP_DEVINFO_DATA); - device_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); - - // Get information for all the devices belonging to the HID class. - device_info_set = SetupDiGetClassDevsA(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); - - // Iterate over each device in the HID class, looking for the right one. - - for (;;) { - HANDLE write_handle = INVALID_HANDLE_VALUE; - DWORD required_size = 0; - HIDD_ATTRIBUTES attrib; - - res = SetupDiEnumDeviceInterfaces(device_info_set, - NULL, - &InterfaceClassGuid, - device_index, - &device_interface_data); - - if (!res) { - // A return of FALSE from this function means that - // there are no more devices. - break; - } - - // Call with 0-sized detail size, and let the function - // tell us how long the detail struct needs to be. The - // size is put in &required_size. - res = SetupDiGetDeviceInterfaceDetailA(device_info_set, - &device_interface_data, - NULL, - 0, - &required_size, - NULL); - - // Allocate a long enough structure for device_interface_detail_data. - device_interface_detail_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) malloc(required_size); - device_interface_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A); - - // Get the detailed data for this device. The detail data gives us - // the device path for this device, which is then passed into - // CreateFile() to get a handle to the device. - res = SetupDiGetDeviceInterfaceDetailA(device_info_set, - &device_interface_data, - device_interface_detail_data, - required_size, - NULL, - NULL); - - if (!res) { - //register_error(dev, "Unable to call SetupDiGetDeviceInterfaceDetail"); - // Continue to the next device. - goto cont; - } - - //wprintf(L"HandleName: %s\n", device_interface_detail_data->DevicePath); - - // Open a handle to the device - write_handle = open_device(device_interface_detail_data->DevicePath); - - // Check validity of write_handle. - if (write_handle == INVALID_HANDLE_VALUE) { - // Unable to open the device. - //register_error(dev, "CreateFile"); - goto cont_close; - } - - - // Get the Vendor ID and Product ID for this device. - attrib.Size = sizeof(HIDD_ATTRIBUTES); - HidD_GetAttributes(write_handle, &attrib); - //wprintf(L"Product/Vendor: %x %x\n", attrib.ProductID, attrib.VendorID); - - // Check the VID/PID to see if we should add this - // device to the enumeration list. - if ((vendor_id == 0x0 && product_id == 0x0) || - (attrib.VendorID == vendor_id && attrib.ProductID == product_id)) { - - #define WSTR_LEN 512 - const char *str; - struct hid_device_info *tmp; - HIDP_PREPARSED_DATA *pp_data = NULL; - HIDP_CAPS caps; - BOOLEAN res; - NTSTATUS nt_res; - wchar_t wstr[WSTR_LEN]; // TODO: Determine Size - size_t len; - - /* VID/PID match. Create the record. */ - tmp = (struct hid_device_info*) calloc(1, sizeof(struct hid_device_info)); - if (cur_dev) { - cur_dev->next = tmp; - } - else { - root = tmp; - } - cur_dev = tmp; - - // Get the Usage Page and Usage for this device. - res = HidD_GetPreparsedData(write_handle, &pp_data); - if (res) { - nt_res = HidP_GetCaps(pp_data, &caps); - if (nt_res == HIDP_STATUS_SUCCESS) { - cur_dev->usage_page = caps.UsagePage; - cur_dev->usage = caps.Usage; - } - - HidD_FreePreparsedData(pp_data); - } - - /* Fill out the record */ - cur_dev->next = NULL; - str = device_interface_detail_data->DevicePath; - if (str) { - len = strlen(str); - cur_dev->path = (char*) calloc(len+1, sizeof(char)); - strncpy(cur_dev->path, str, len+1); - cur_dev->path[len] = '\0'; - } - else - cur_dev->path = NULL; - - /* Serial Number */ - res = HidD_GetSerialNumberString(write_handle, wstr, sizeof(wstr)); - wstr[WSTR_LEN-1] = 0x0000; - if (res) { - cur_dev->serial_number = _wcsdup(wstr); - } - - /* Manufacturer String */ - res = HidD_GetManufacturerString(write_handle, wstr, sizeof(wstr)); - wstr[WSTR_LEN-1] = 0x0000; - if (res) { - cur_dev->manufacturer_string = _wcsdup(wstr); - } - - /* Product String */ - res = HidD_GetProductString(write_handle, wstr, sizeof(wstr)); - wstr[WSTR_LEN-1] = 0x0000; - if (res) { - cur_dev->product_string = _wcsdup(wstr); - } - - /* VID/PID */ - cur_dev->vendor_id = attrib.VendorID; - cur_dev->product_id = attrib.ProductID; - - /* Release Number */ - cur_dev->release_number = attrib.VersionNumber; - - /* Interface Number. It can sometimes be parsed out of the path - on Windows if a device has multiple interfaces. See - http://msdn.microsoft.com/en-us/windows/hardware/gg487473 or - search for "Hardware IDs for HID Devices" at MSDN. If it's not - in the path, it's set to -1. */ - cur_dev->interface_number = -1; - if (cur_dev->path) { - char *interface_component = strstr(cur_dev->path, "&mi_"); - if (interface_component) { - char *hex_str = interface_component + 4; - char *endptr = NULL; - cur_dev->interface_number = strtol(hex_str, &endptr, 16); - if (endptr == hex_str) { - /* The parsing failed. Set interface_number to -1. */ - cur_dev->interface_number = -1; - } - } - } - } - -cont_close: - CloseHandle(write_handle); -cont: - // We no longer need the detail data. It can be freed - free(device_interface_detail_data); - - device_index++; - - } - - // Close the device information handle. - SetupDiDestroyDeviceInfoList(device_info_set); - - return root; - -} - -void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs) -{ - // TODO: Merge this with the Linux version. This function is platform-independent. - struct hid_device_info *d = devs; - while (d) { - struct hid_device_info *next = d->next; - free(d->path); - free(d->serial_number); - free(d->manufacturer_string); - free(d->product_string); - free(d); - d = next; - } -} - - -HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, wchar_t *serial_number) -{ - // TODO: Merge this functions with the Linux version. This function should be platform independent. - struct hid_device_info *devs, *cur_dev; - const char *path_to_open = NULL; - hid_device *handle = NULL; - - devs = hid_enumerate(vendor_id, product_id); - cur_dev = devs; - while (cur_dev) { - if (cur_dev->vendor_id == vendor_id && - cur_dev->product_id == product_id) { - if (serial_number) { - if (wcscmp(serial_number, cur_dev->serial_number) == 0) { - path_to_open = cur_dev->path; - break; - } - } - else { - path_to_open = cur_dev->path; - break; - } - } - cur_dev = cur_dev->next; - } - - if (path_to_open) { - /* Open the device */ - handle = hid_open_path(path_to_open); - } - - hid_free_enumeration(devs); - - return handle; -} - -HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path) -{ - hid_device *dev; - HIDP_CAPS caps; - HIDP_PREPARSED_DATA *pp_data = NULL; - BOOLEAN res; - NTSTATUS nt_res; - - if (hid_init() < 0) { - return NULL; - } - - dev = new_hid_device(); - - // Open a handle to the device - dev->device_handle = open_device(path); - - // Check validity of write_handle. - if (dev->device_handle == INVALID_HANDLE_VALUE) { - // Unable to open the device. - register_error(dev, "CreateFile"); - goto err; - } - - // Get the Input Report length for the device. - res = HidD_GetPreparsedData(dev->device_handle, &pp_data); - if (!res) { - register_error(dev, "HidD_GetPreparsedData"); - goto err; - } - nt_res = HidP_GetCaps(pp_data, &caps); - if (nt_res != HIDP_STATUS_SUCCESS) { - register_error(dev, "HidP_GetCaps"); - goto err_pp_data; - } - dev->input_report_length = caps.InputReportByteLength; - HidD_FreePreparsedData(pp_data); - - dev->read_buf = (char*) malloc(dev->input_report_length); - - return dev; - -err_pp_data: - HidD_FreePreparsedData(pp_data); -err: - CloseHandle(dev->device_handle); - free(dev); - return NULL; -} - -int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length) -{ - DWORD bytes_written; - BOOL res; - - OVERLAPPED ol; - memset(&ol, 0, sizeof(ol)); - - res = WriteFile(dev->device_handle, data, length, NULL, &ol); - - if (!res) { - if (GetLastError() != ERROR_IO_PENDING) { - // WriteFile() failed. Return error. - register_error(dev, "WriteFile"); - return -1; - } - } - - // Wait here until the write is done. This makes - // hid_write() synchronous. - res = GetOverlappedResult(dev->device_handle, &ol, &bytes_written, TRUE/*wait*/); - if (!res) { - // The Write operation failed. - register_error(dev, "WriteFile"); - return -1; - } - - return bytes_written; -} - - -int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds) -{ - DWORD bytes_read = 0; - BOOL res; - - // Copy the handle for convenience. - HANDLE ev = dev->ol.hEvent; - - if (!dev->read_pending) { - // Start an Overlapped I/O read. - dev->read_pending = TRUE; - ResetEvent(ev); - res = ReadFile(dev->device_handle, dev->read_buf, dev->input_report_length, &bytes_read, &dev->ol); - - if (!res) { - if (GetLastError() != ERROR_IO_PENDING) { - // ReadFile() has failed. - // Clean up and return error. - CancelIo(dev->device_handle); - dev->read_pending = FALSE; - goto end_of_function; - } - } - } - - if (milliseconds >= 0) { - // See if there is any data yet. - res = WaitForSingleObject(ev, milliseconds); - if (res != WAIT_OBJECT_0) { - // There was no data this time. Return zero bytes available, - // but leave the Overlapped I/O running. - return 0; - } - } - - // Either WaitForSingleObject() told us that ReadFile has completed, or - // we are in non-blocking mode. Get the number of bytes read. The actual - // data has been copied to the data[] array which was passed to ReadFile(). - res = GetOverlappedResult(dev->device_handle, &dev->ol, &bytes_read, TRUE/*wait*/); - - // Set pending back to false, even if GetOverlappedResult() returned error. - dev->read_pending = FALSE; - - if (res && bytes_read > 0) { - if (dev->read_buf[0] == 0x0) { - /* If report numbers aren't being used, but Windows sticks a report - number (0x0) on the beginning of the report anyway. To make this - work like the other platforms, and to make it work more like the - HID spec, we'll skip over this byte. */ - bytes_read--; - memcpy(data, dev->read_buf+1, length); - } - else { - /* Copy the whole buffer, report number and all. */ - memcpy(data, dev->read_buf, length); - } - } - -end_of_function: - if (!res) { - register_error(dev, "GetOverlappedResult"); - return -1; - } - - return bytes_read; -} - -int HID_API_EXPORT HID_API_CALL hid_read(hid_device *dev, unsigned char *data, size_t length) -{ - return hid_read_timeout(dev, data, length, (dev->blocking)? -1: 0); -} - -int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *dev, int nonblock) -{ - dev->blocking = !nonblock; - return 0; /* Success */ -} - -int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length) -{ - BOOL res = HidD_SetFeature(dev->device_handle, (PVOID)data, length); - if (!res) { - register_error(dev, "HidD_SetFeature"); - return -1; - } - - return length; -} - - -int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length) -{ - BOOL res; -#if 0 - res = HidD_GetFeature(dev->device_handle, data, length); - if (!res) { - register_error(dev, "HidD_GetFeature"); - return -1; - } - return 0; /* HidD_GetFeature() doesn't give us an actual length, unfortunately */ -#else - DWORD bytes_returned; - - OVERLAPPED ol; - memset(&ol, 0, sizeof(ol)); - - res = DeviceIoControl(dev->device_handle, - IOCTL_HID_GET_FEATURE, - data, length, - data, length, - &bytes_returned, &ol); - - if (!res) { - if (GetLastError() != ERROR_IO_PENDING) { - // DeviceIoControl() failed. Return error. - register_error(dev, "Send Feature Report DeviceIoControl"); - return -1; - } - } - - // Wait here until the write is done. This makes - // hid_get_feature_report() synchronous. - res = GetOverlappedResult(dev->device_handle, &ol, &bytes_returned, TRUE/*wait*/); - if (!res) { - // The operation failed. - register_error(dev, "Send Feature Report GetOverLappedResult"); - return -1; - } - return bytes_returned; -#endif -} - -void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev) -{ - if (!dev) - return; - CancelIo(dev->device_handle); - CloseHandle(dev->ol.hEvent); - CloseHandle(dev->device_handle); - LocalFree(dev->last_error_str); - free(dev->read_buf); - free(dev); -} - -int HID_API_EXPORT_CALL HID_API_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - BOOL res; - - res = HidD_GetManufacturerString(dev->device_handle, string, 2 * maxlen); - if (!res) { - register_error(dev, "HidD_GetManufacturerString"); - return -1; - } - - return 0; -} - -int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - BOOL res; - - res = HidD_GetProductString(dev->device_handle, string, 2 * maxlen); - if (!res) { - register_error(dev, "HidD_GetProductString"); - return -1; - } - - return 0; -} - -int HID_API_EXPORT_CALL HID_API_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen) -{ - BOOL res; - - res = HidD_GetSerialNumberString(dev->device_handle, string, 2 * maxlen); - if (!res) { - register_error(dev, "HidD_GetSerialNumberString"); - return -1; - } - - return 0; -} - -int HID_API_EXPORT_CALL HID_API_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen) -{ - BOOL res; - - res = HidD_GetIndexedString(dev->device_handle, string_index, string, 2 * maxlen); - if (!res) { - register_error(dev, "HidD_GetIndexedString"); - return -1; - } - - return 0; -} - - -HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev) -{ - return (wchar_t*)dev->last_error_str; -} - - -//#define PICPGM -//#define S11 -#define P32 -#ifdef S11 - unsigned short VendorID = 0xa0a0; - unsigned short ProductID = 0x0001; -#endif - -#ifdef P32 - unsigned short VendorID = 0x04d8; - unsigned short ProductID = 0x3f; -#endif - - -#ifdef PICPGM - unsigned short VendorID = 0x04d8; - unsigned short ProductID = 0x0033; -#endif - - -#if 0 -int __cdecl main(int argc, char* argv[]) -{ - int res; - unsigned char buf[65]; - - UNREFERENCED_PARAMETER(argc); - UNREFERENCED_PARAMETER(argv); - - // Set up the command buffer. - memset(buf,0x00,sizeof(buf)); - buf[0] = 0; - buf[1] = 0x81; - - - // Open the device. - int handle = open(VendorID, ProductID, L"12345"); - if (handle < 0) - printf("unable to open device\n"); - - - // Toggle LED (cmd 0x80) - buf[1] = 0x80; - res = write(handle, buf, 65); - if (res < 0) - printf("Unable to write()\n"); - - // Request state (cmd 0x81) - buf[1] = 0x81; - write(handle, buf, 65); - if (res < 0) - printf("Unable to write() (2)\n"); - - // Read requested state - read(handle, buf, 65); - if (res < 0) - printf("Unable to read()\n"); - - // Print out the returned buffer. - for (int i = 0; i < 4; i++) - printf("buf[%d]: %d\n", i, buf[i]); - - return 0; -} -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/gr-fcd/lib/source_c_impl.cc b/gr-fcd/lib/source_c_impl.cc deleted file mode 100644 index fddd05687c..0000000000 --- a/gr-fcd/lib/source_c_impl.cc +++ /dev/null @@ -1,252 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011-2013 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "source_c_impl.h" -#include <fcd.h> -#include <fcdhidcmd.h> // needed for extended API -#include <gnuradio/io_signature.h> -#include <gnuradio/blocks/float_to_complex.h> -#include <gnuradio/attributes.h> - -//#include <iostream> -//using namespace std; - -namespace gr { - namespace fcd { - - /* - * Create a new instance of gr::fcd::source_c_impl and return an - * upcasted boost shared_ptr. This is effectively the public - * constructor. - */ - source_c::sptr - source_c::make(const std::string device_name) - { - return gnuradio::get_initial_sptr - (new source_c_impl(device_name)); - } - - static const int MIN_IN = 0; /*!< Mininum number of input streams. */ - static const int MAX_IN = 0; /*!< Maximum number of input streams. */ - static const int MIN_OUT = 1; /*!< Minimum number of output streams. */ - static const int MAX_OUT = 1; /*!< Maximum number of output streams. */ - - source_c_impl::source_c_impl(const std::string device_name) - : gr::hier_block2("fcd_source_c", - gr::io_signature::make(MIN_IN, MAX_IN, sizeof(gr_complex)), - gr::io_signature::make(MIN_OUT, MAX_OUT, sizeof(gr_complex))), - d_freq_corr(-120), - d_freq_req(0) - { - gr::blocks::float_to_complex::sptr f2c; - - /* Audio source; sample rate fixed at 96kHz */ - fcd = gr::audio::source::make(96000, device_name, true); - - /* block to convert stereo audio to a complex stream */ - f2c = gr::blocks::float_to_complex::make(1); - - connect(fcd, 0, f2c, 0); - connect(fcd, 1, f2c, 1); - connect(f2c, 0, self(), 0); - } - - source_c_impl::~source_c_impl() - { - } - - // Set frequency with Hz resolution - void source_c_impl::set_freq(int freq) - { - FCD_MODE_ENUM __GR_ATTR_UNUSED fme; - double f = (double)freq; - - /* valid range 50 MHz - 2.0 GHz */ - if((freq < 50000000) || (freq > 2000000000)) { - return; - } - - d_freq_req = freq; - f *= 1.0 + d_freq_corr/1000000.0; - - fme = fcdAppSetFreq((int)f); - /* TODO: check fme */ - } - - // Set frequency with Hz resolution (type float) - void source_c_impl::set_freq(float freq) - { - FCD_MODE_ENUM __GR_ATTR_UNUSED fme; - double f = (double)freq; - - /* valid range 50 MHz - 2.0 GHz */ - if((freq < 50.0e6) || (freq > 2.0e9)) { - return; - } - - d_freq_req = (int)freq; - f *= 1.0 + d_freq_corr/1000000.0; - - fme = fcdAppSetFreq((int)f); - /* TODO: check fme */ - } - - - // Set frequency with kHz resolution. - void source_c_impl::set_freq_khz(int freq) - { - FCD_MODE_ENUM __GR_ATTR_UNUSED fme; - double f = freq*1000.0; - - /* valid range 50 MHz - 2.0 GHz */ - if((freq < 50000) || (freq > 2000000)) { - return; - } - - d_freq_req = freq*1000; - f *= 1.0 + d_freq_corr/1000000.0; - - fme = fcdAppSetFreqkHz((int)(f/1000.0)); - /* TODO: check fme */ - } - - - // Set LNA gain - void source_c_impl::set_lna_gain(float gain) - { - FCD_MODE_ENUM __GR_ATTR_UNUSED fme; - unsigned char g; - - /* convert to nearest discrete value */ - if(gain > 27.5) { - g = 14; // 30.0 dB - } - else if(gain > 22.5) { - g = 13; // 25.0 dB - } - else if(gain > 18.75) { - g = 12; // 20.0 dB - } - else if(gain > 16.25) { - g = 11; // 17.5 dB - } - else if(gain > 13.75) { - g = 10; // 15.0 dB - } - else if(gain > 11.25) { - g = 9; // 12.5 dB - } - else if(gain > 8.75) { - g = 8; // 10.0 dB - } - else if(gain > 6.25) { - g = 7; // 7.5 dB - } - else if(gain > 3.75) { - g = 6; // 5.0 dB - } - else if(gain > 1.25) { - g = 5; // 2.5 dB - } - else if(gain > -1.25) { - g = 4; // 0.0 dB - } - else if(gain > -3.75) { - g = 1; // -2.5 dB - } - else { - g = 0; // -5.0 dB - } - - fme = fcdAppSetParam(FCD_CMD_APP_SET_LNA_GAIN, &g, 1); - /* TODO: check fme */ - } - - // Set mixer gain - void source_c_impl::set_mixer_gain(float gain) - { - __GR_ATTR_UNUSED FCD_MODE_ENUM fme; - unsigned char g; - - if( gain > 4.0 ) { - g = TMGE_P12_0DB; - } - else { - g = TMGE_P4_0DB; - } - - fme = fcdAppSetParam(FCD_CMD_APP_SET_MIXER_GAIN, &g, 1); - /* TODO: check fme */ - } - - // Set new frequency correction - void source_c_impl::set_freq_corr(int ppm) - { - d_freq_corr = ppm; - // re-tune with new correction value - set_freq(d_freq_req); - } - - // Set DC offset correction. - void source_c_impl::set_dc_corr(double _dci, double _dcq) - { - union { - unsigned char auc[4]; - struct { - signed short dci; // equivalent of qint16 which should be 16 bit everywhere - signed short dcq; - }; - } dcinfo; - - if((_dci < -1.0) || (_dci > 1.0) || (_dcq < -1.0) || (_dcq > 1.0)) - return; - - dcinfo.dci = static_cast<signed short>(_dci*32768.0); - dcinfo.dcq = static_cast<signed short>(_dcq*32768.0); - - fcdAppSetParam(FCD_CMD_APP_SET_DC_CORR, dcinfo.auc, 4); - } - - // Set IQ phase and gain balance. - void source_c_impl::set_iq_corr(double _gain, double _phase) - { - union { - unsigned char auc[4]; - struct { - signed short phase; - signed short gain; - }; - } iqinfo; - - if ((_gain < -1.0) || (_gain > 1.0) || (_phase < -1.0) || (_phase > 1.0)) - return; - - iqinfo.phase = static_cast<signed short>(_phase*32768.0); - iqinfo.gain = static_cast<signed short>(_gain*32768.0); - - fcdAppSetParam(FCD_CMD_APP_SET_IQ_CORR, iqinfo.auc, 4); - } - - } /* namespace fcd */ -} /* namespace gr */ diff --git a/gr-fcd/lib/source_c_impl.h b/gr-fcd/lib/source_c_impl.h deleted file mode 100644 index d8a33e82d9..0000000000 --- a/gr-fcd/lib/source_c_impl.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011-2013 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_FCD_SOURCE_C_IMPL_H -#define INCLUDED_FCD_SOURCE_C_IMPL_H - -#include <gnuradio/fcd/source_c.h> -#include <gnuradio/audio/source.h> - -namespace gr { - namespace fcd { - - class source_c_impl : public source_c - { - public: - source_c_impl(const std::string device_name = ""); - ~source_c_impl(); - - /* Public API functions documented in include/gnuradio/fcd/source_c.h */ - void set_freq(int freq); - void set_freq(float freq); - void set_freq_khz(int freq); - void set_lna_gain(float gain); - void set_mixer_gain(float gain); - void set_freq_corr(int ppm); - void set_dc_corr(double _dci, double _dcq); - void set_iq_corr(double _gain, double _phase); - - private: - gr::audio::source::sptr fcd; /*!< The audio input source */ - int d_freq_corr; /*!< The frequency correction in ppm */ - int d_freq_req; /*!< The latest requested frequency in Hz */ - }; - - } /* namespace fcd */ -} /* namespace gr */ - -#endif /* INCLUDED_FCD_SOURCE_C_IMPL_H */ diff --git a/gr-fcd/python/fcd/CMakeLists.txt b/gr-fcd/python/fcd/CMakeLists.txt deleted file mode 100644 index 78ae54bd94..0000000000 --- a/gr-fcd/python/fcd/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -include(GrPython) - -GR_PYTHON_INSTALL( - FILES - __init__.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio/fcd - COMPONENT "fcd_python" -) - -######################################################################## -# Handle the unit tests -######################################################################## -if(ENABLE_TESTING) - - set(GR_TEST_TARGET_DEPS "") - set(GR_TEST_LIBRARY_DIRS "") - set(GR_TEST_PYTHON_DIRS - ${CMAKE_BINARY_DIR}/gnuradio-runtime/python - ) - - include(GrTest) - file(GLOB py_qa_test_files "qa_*.py") - foreach(py_qa_test_file ${py_qa_test_files}) - get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) - endforeach(py_qa_test_file) -endif(ENABLE_TESTING) diff --git a/gr-fcd/python/fcd/__init__.py b/gr-fcd/python/fcd/__init__.py deleted file mode 100644 index e7cd7f40ed..0000000000 --- a/gr-fcd/python/fcd/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright 2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -''' -Provides a source block for the FunCube Dongle hardware. -''' -import os - -try: - from fcd_swig import * -except ImportError: - dirname, filename = os.path.split(os.path.abspath(__file__)) - __path__.append(os.path.join(dirname, "..", "..", "swig")) - from fcd_swig import * - diff --git a/gr-fcd/python/fcd/qa_fcd.py b/gr-fcd/python/fcd/qa_fcd.py deleted file mode 100755 index 33771be5ff..0000000000 --- a/gr-fcd/python/fcd/qa_fcd.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest, fcd - -class test_fcd(gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block() - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module...""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_fcd, "test_fcd.xml") diff --git a/gr-fcd/python/fcd/run_tests.in b/gr-fcd/python/fcd/run_tests.in deleted file mode 100644 index 4d28c1522d..0000000000 --- a/gr-fcd/python/fcd/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-fcd \ - @abs_top_builddir@/gr-fcd \ - @srcdir@ diff --git a/gr-fcd/swig/CMakeLists.txt b/gr-fcd/swig/CMakeLists.txt deleted file mode 100644 index b91cf92272..0000000000 --- a/gr-fcd/swig/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup swig generation -######################################################################## -include(GrPython) -include(GrSwig) - -#set(GR_SWIG_FLAGS -DGR_HAVE_FCD) #needed to parse fcd_swig.i - -set(GR_SWIG_INCLUDE_DIRS - ${GR_FCD_INCLUDE_DIRS} - ${GR_AUDIO_INCLUDE_DIRS} - ${GR_BLOCKS_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -if(ENABLE_GR_CTRLPORT) - list(APPEND GR_SWIG_FLAGS "-DGR_CTRLPORT") -endif(ENABLE_GR_CTRLPORT) - -set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/fcd_swig_doc.i) -set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/fcd) -set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc) - -set(GR_SWIG_LIBRARIES gnuradio-fcd - gnuradio-runtime gnuradio-audio gnuradio-blocks) - -GR_SWIG_MAKE(fcd_swig fcd_swig.i) - -GR_SWIG_INSTALL( - TARGETS fcd_swig - DESTINATION ${GR_PYTHON_DIR}/gnuradio/fcd - COMPONENT "fcd_python" -) - -install( - FILES - fcd_swig.i - ${CMAKE_CURRENT_BINARY_DIR}/fcd_swig_doc.i - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig - COMPONENT "fcd_swig" -) diff --git a/gr-fcd/swig/fcd_swig.i b/gr-fcd/swig/fcd_swig.i deleted file mode 100644 index 451bf562c1..0000000000 --- a/gr-fcd/swig/fcd_swig.i +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#define FCD_API - -//suppress 319. No access specifier given for base class name (ignored). -#pragma SWIG nowarn=319 - -%include "gnuradio.i" - -//load generated python docstrings -%include "fcd_swig_doc.i" - -%{ -#include "gnuradio/fcd/source_c.h" -%} - -%include "gnuradio/fcd/source_c.h" - -GR_SWIG_BLOCK_MAGIC2(fcd, source_c); -//source_c_sptr gr::fcd::source_c::make(const std::string device_name = ""); diff --git a/gr-fec/grc/fec_block_tree.xml b/gr-fec/grc/fec_block_tree.xml index 5efc144cbd..b1535e3c42 100644 --- a/gr-fec/grc/fec_block_tree.xml +++ b/gr-fec/grc/fec_block_tree.xml @@ -5,7 +5,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Error Coding</name> <cat> diff --git a/gr-fft/grc/fft_block_tree.xml b/gr-fft/grc/fft_block_tree.xml index 7028ed1049..e844d837b4 100644 --- a/gr-fft/grc/fft_block_tree.xml +++ b/gr-fft/grc/fft_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <!-- Blank for Root Name --> <cat> <name>Fourier Analysis</name> <block>fft_vxx</block> diff --git a/gr-filter/grc/filter_block_tree.xml b/gr-filter/grc/filter_block_tree.xml index ea869a75bd..3613df8202 100644 --- a/gr-filter/grc/filter_block_tree.xml +++ b/gr-filter/grc/filter_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Filters</name> <!-- FIR filter tap generators --> diff --git a/gr-noaa/CMakeLists.txt b/gr-noaa/CMakeLists.txt deleted file mode 100644 index d4fe53ecf1..0000000000 --- a/gr-noaa/CMakeLists.txt +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright 2011,2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup dependencies -######################################################################## -include(GrBoost) - -######################################################################## -# Register component -######################################################################## -include(GrComponent) -GR_REGISTER_COMPONENT("gr-noaa" ENABLE_GR_NOAA - Boost_FOUND - ENABLE_GNURADIO_RUNTIME - ENABLE_GR_BLOCKS -) - -GR_SET_GLOBAL(GR_NOAA_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR}/include -) - -GR_SET_GLOBAL(GR_NOAA_SWIG_INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/swig -) - -SET(GR_PKG_NOAA_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/noaa) - -######################################################################## -# Begin conditional configuration -######################################################################## -if(ENABLE_GR_NOAA) - -######################################################################## -# Setup CPack components -######################################################################## -include(GrPackage) -CPACK_SET(CPACK_COMPONENT_GROUP_NOAA_DESCRIPTION "GNU Radio NOAA Blocks") - -CPACK_COMPONENT("noaa_runtime" - GROUP "NOAA" - DISPLAY_NAME "Runtime" - DESCRIPTION "Runtime" - DEPENDS "runtime_runtime" -) - -CPACK_COMPONENT("noaa_devel" - GROUP "NOAA" - DISPLAY_NAME "Development" - DESCRIPTION "C++ headers, package config, import libraries" - DEPENDS "runtime_devel" -) - -CPACK_COMPONENT("noaa_python" - GROUP "NOAA" - DISPLAY_NAME "Python" - DESCRIPTION "Python modules for runtime; GRC xml files" - DEPENDS "runtime_python;noaa_runtime" -) - -CPACK_COMPONENT("noaa_swig" - GROUP "NOAA" - DISPLAY_NAME "SWIG" - DESCRIPTION "SWIG development .i files" - DEPENDS "runtime_swig;noaa_python;noaa_devel" -) - -######################################################################## -# Add subdirectories -######################################################################## -add_subdirectory(include/gnuradio/noaa) -add_subdirectory(lib) -if(ENABLE_PYTHON) - add_subdirectory(swig) - add_subdirectory(python/noaa) - add_subdirectory(grc) - add_subdirectory(examples) -endif(ENABLE_PYTHON) - -######################################################################## -# Create Pkg Config File -######################################################################## -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-noaa.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.pc -@ONLY) - -install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.pc - DESTINATION ${GR_LIBRARY_DIR}/pkgconfig - COMPONENT "noaa_devel" -) - -endif(ENABLE_GR_NOAA) diff --git a/gr-noaa/README b/gr-noaa/README deleted file mode 100644 index 88364cafda..0000000000 --- a/gr-noaa/README +++ /dev/null @@ -1,67 +0,0 @@ -This component implements an NOAA POES HRPT receiver. After installation, -the scripts described below will be install in the users PATH. - -As the scripts are generated using GRC, GRC must be installed at runtime -in order for them to operate. - - -HRPT OPERATION - -usrp_rx_hrpt.py ---------------- - -This GUI script will receive HRPT RF, demodulate, synchronize, and deframe -HRPT minor frames into a file. The file stores a series of 11090 word, -16-bits per word corresponding to the HRPT minor frame format (only the -lower 10-bits per word are significant.) - -The script file by default uses USRP side A, 1698 MHz, at a sampling rate of -4MHz. The gnuradio configuration file ~/.gnuradio/config.conf, section -'usrp_rx_hrpt.cfg', will allow changing this, as well as implementing -persistent storage of GUI entered parameters from invocation to invocation. - -The present HRPT demodulator is only tested at 4MS/s. - -file_rx_hrpt.py ---------------- - -This GUI script operates like usrp_rx_hrpt.py, but reads from a pre-captured -data file supplied by -F on the command line. - - -usrp_rx_hrpt_nogui.py ---------------------- - -This non-GUI script operates without a display and requires that all parameters -be set in the configuration file prior to running. It has no command-line -parameters, and works identically to the GUI scripts. - - -hrpt_demod_file.py ------------------- - -This non-GUI script will operate on a file generated with -usrp_rx_cfile.py and output frames in the same format as above. It does -*not* use the configuration file above; instead you must pass parameters to -it on the command line. To exit the program, press Enter. - -Usage: demod_hrpt_file.py: [options] - -Options: - -h, --help show this help message and exit - -d DECIM, --decim=DECIM - Set Decimation [default=16] - -p PLL_ALPHA, --pll-alpha=PLL_ALPHA - Set pll_alpha [default=50m] - -s CLOCK_ALPHA, --clock-alpha=CLOCK_ALPHA - Set clock_alpha [default=50m] - -F INPUT_FILENAME, --input-filename=INPUT_FILENAME - Set Filename [default=usrp.dat] - -o OUTPUT_FILENAME, --output-filename=OUTPUT_FILENAME - Set Output [default=frames.dat] - - -LRIT Operation --------------- - -The work-in-progress LRIT GRC script is not currently in a usable state. diff --git a/gr-noaa/examples/CMakeLists.txt b/gr-noaa/examples/CMakeLists.txt deleted file mode 100644 index 6994148dfd..0000000000 --- a/gr-noaa/examples/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -INSTALL( - FILES - hrpt_decode.grc - hrpt_demod.grc - file_rx_hrpt.grc - usrp_rx_hrpt.grc - usrp_rx_hrpt_nogui.grc - DESTINATION ${GR_PKG_NOAA_EXAMPLES_DIR} - COMPONENT "noaa_python" -) diff --git a/gr-noaa/examples/file_rx_hrpt.grc b/gr-noaa/examples/file_rx_hrpt.grc deleted file mode 100644 index 93a39d1f5d..0000000000 --- a/gr-noaa/examples/file_rx_hrpt.grc +++ /dev/null @@ -1,1139 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Sat Jul 12 11:18:29 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>file_rx_hrpt</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>USRP HRPT Receiver</value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4096,4096</value> - </param> - <param> - <key>generate_options</key> - <value>no_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sample_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>4e6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(198, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>config_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>os.environ['HOME']+'/.gnuradio/config.conf'</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(13, 168)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_clock_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>100e-6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(705, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>hs</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>int(sps/2.0)</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(499, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>sample_rate/sym_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(397, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sym_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>600*1109</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(301, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(575, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>import math, os</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(9, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_clock_recovery_mm_xx</key> - <param> - <key>id</key> - <value>digital_clock_recovery_mm_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>omega</key> - <value>sps/2.0</value> - </param> - <param> - <key>gain_omega</key> - <value>clock_alpha**2/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>clock_alpha</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>max_clock_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(897, 341)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_sink</key> - <param> - <key>id</key> - <value>virtual_sink_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(1139, 373)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_moving_average_xx</key> - <param> - <key>id</key> - <value>blocks_moving_average_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>length</key> - <value>hs</value> - </param> - <param> - <key>scale</key> - <value>1.0/hs</value> - </param> - <param> - <key>max_iter</key> - <value>4000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(683, 357)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_file_sink</key> - <param> - <key>id</key> - <value>frame_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>output_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>unbuffered</key> - <value>False</value> - </param> - <param> - <key>append</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(809, 595)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_decoder</key> - <param> - <key>id</key> - <value>decoder</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>True</value> - </param> - <param> - <key>output</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(810, 496)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>1698e6</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'freq'</value> - </param> - <param> - <key>writeback</key> - <value>freq</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(218, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>35</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'gain'</value> - </param> - <param> - <key>writeback</key> - <value>gain</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(375, 105)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'pll_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>pll_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(534, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'clock_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>clock_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(692, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>output_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>'frames.hrpt'</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'filename'</value> - </param> - <param> - <key>writeback</key> - <value>output_filename</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(850, 105)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(598, 546)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_source</key> - <param> - <key>id</key> - <value>virtual_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(90, 542)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_binary_slicer_fb</key> - <param> - <key>id</key> - <value>digital_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(332, 546)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_pll_cf</key> - <param> - <key>id</key> - <value>pll</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>pll_alpha</value> - </param> - <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> - </param> - <param> - <key>max_offset</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(470, 357)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_interleaved_short_to_complex</key> - <param> - <key>id</key> - <value>blocks_interleaved_short_to_complex_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>vector_input</key> - <value>False</value> - </param> - <param> - <key>swap</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(99, 373)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_file_source</key> - <param> - <key>id</key> - <value>blocks_file_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>input_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>repeat</key> - <value>False</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(102, 253)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_throttle</key> - <param> - <key>id</key> - <value>throttle</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>samples_per_second</key> - <value>2*sample_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>ignoretag</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(101, 319)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>analog_agc_xx</key> - <param> - <key>id</key> - <value>analog_agc_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>rate</key> - <value>1e-6</value> - </param> - <param> - <key>reference</key> - <value>1.0</value> - </param> - <param> - <key>gain</key> - <value>1.0</value> - </param> - <param> - <key>max_gain</key> - <value>65536</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(285, 349)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>digital_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>virtual_sink_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_moving_average_xx_0</source_block_id> - <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>pll</source_block_id> - <sink_block_id>blocks_moving_average_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>decoder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>frame_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>throttle</source_block_id> - <sink_block_id>blocks_interleaved_short_to_complex_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>virtual_source_0</source_block_id> - <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_binary_slicer_fb_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_agc_xx_0</source_block_id> - <sink_block_id>pll</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_interleaved_short_to_complex_0</source_block_id> - <sink_block_id>analog_agc_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_file_source_0</source_block_id> - <sink_block_id>throttle</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/examples/hrpt_decode.grc b/gr-noaa/examples/hrpt_decode.grc deleted file mode 100644 index 2fb57746e8..0000000000 --- a/gr-noaa/examples/hrpt_decode.grc +++ /dev/null @@ -1,428 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Sun Nov 8 10:48:59 2009</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>hrpt_decode</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value></value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4096,4096</value> - </param> - <param> - <key>generate_options</key> - <value>no_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>run</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> - </param> - <param> - <key>_coordinate</key> - <value>(575, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>hs</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>int(sps/2.0)</value> - </param> - <param> - <key>_coordinate</key> - <value>(499, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sample_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>64e6/decim</value> - </param> - <param> - <key>_coordinate</key> - <value>(198, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>import math, os</value> - </param> - <param> - <key>_coordinate</key> - <value>(11, 103)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_clock_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>100e-6</value> - </param> - <param> - <key>_coordinate</key> - <value>(710, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sym_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>600*1109</value> - </param> - <param> - <key>_coordinate</key> - <value>(307, 18)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>sample_rate/sym_rate</value> - </param> - <param> - <key>_coordinate</key> - <value>(400, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>decim</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>decim</value> - </param> - <param> - <key>value</key> - <value>32</value> - </param> - <param> - <key>type</key> - <value>intx</value> - </param> - <param> - <key>short_id</key> - <value>d</value> - </param> - <param> - <key>_coordinate</key> - <value>(202, 102)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>pll_alpha</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>eng_float</value> - </param> - <param> - <key>short_id</key> - <value>p</value> - </param> - <param> - <key>_coordinate</key> - <value>(294, 101)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>clock_alpha</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>eng_float</value> - </param> - <param> - <key>short_id</key> - <value>s</value> - </param> - <param> - <key>_coordinate</key> - <value>(395, 101)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_file_source</key> - <param> - <key>id</key> - <value>file_source</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>input_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>repeat</key> - <value>False</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(231, 419)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_decoder</key> - <param> - <key>id</key> - <value>decoder</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>True</value> - </param> - <param> - <key>output</key> - <value>True</value> - </param> - <param> - <key>_coordinate</key> - <value>(462, 419)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>input_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>input_filename</value> - </param> - <param> - <key>value</key> - <value>frames.hrpt</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>short_id</key> - <value>F</value> - </param> - <param> - <key>_coordinate</key> - <value>(522, 100)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>file_source</source_block_id> - <sink_block_id>decoder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/examples/hrpt_demod.grc b/gr-noaa/examples/hrpt_demod.grc deleted file mode 100644 index cbb02d83ca..0000000000 --- a/gr-noaa/examples/hrpt_demod.grc +++ /dev/null @@ -1,963 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Sat Jul 12 11:19:23 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>hrpt_demod</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value></value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4096,4096</value> - </param> - <param> - <key>generate_options</key> - <value>no_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>run</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(575, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>hs</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>int(sps/2.0)</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(499, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_clock_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>100e-6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(710, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sym_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>600*1109</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(307, 18)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>sample_rate/sym_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(400, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sample_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>4e6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(198, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>import math, os</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(11, 103)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>input_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>input_filename</value> - </param> - <param> - <key>value</key> - <value>usrp.dat</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>short_id</key> - <value>F</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(618, 102)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>output_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>output_filename</value> - </param> - <param> - <key>value</key> - <value>frames.dat</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>short_id</key> - <value>o</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(726, 102)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>blocks_file_source</key> - <param> - <key>id</key> - <value>file_source</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>input_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>repeat</key> - <value>False</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(63, 277)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>decim</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>decim</value> - </param> - <param> - <key>value</key> - <value>32</value> - </param> - <param> - <key>type</key> - <value>intx</value> - </param> - <param> - <key>short_id</key> - <value>d</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(202, 102)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>pll_alpha</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>eng_float</value> - </param> - <param> - <key>short_id</key> - <value>p</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(294, 101)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>parameter</key> - <param> - <key>id</key> - <value>clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>clock_alpha</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>eng_float</value> - </param> - <param> - <key>short_id</key> - <value>s</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(395, 101)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_decoder</key> - <param> - <key>id</key> - <value>decoder</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>True</value> - </param> - <param> - <key>output</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(1150, 341)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>blocks_file_sink</key> - <param> - <key>id</key> - <value>blocks_file_sink_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>output_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>unbuffered</key> - <value>False</value> - </param> - <param> - <key>append</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(1144, 489)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>blocks_moving_average_xx</key> - <param> - <key>id</key> - <value>blocks_moving_average_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>length</key> - <value>hs</value> - </param> - <param> - <key>scale</key> - <value>1.0/hs</value> - </param> - <param> - <key>max_iter</key> - <value>4000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(504, 402)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_clock_recovery_mm_xx</key> - <param> - <key>id</key> - <value>digital_clock_recovery_mm_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>omega</key> - <value>sps/2.0</value> - </param> - <param> - <key>gain_omega</key> - <value>clock_alpha**2/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>clock_alpha</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>max_clock_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(704, 386)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>noaa_hrpt_deframer_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(1142, 422)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_binary_slicer_fb</key> - <param> - <key>id</key> - <value>digital_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(957, 422)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_interleaved_short_to_complex</key> - <param> - <key>id</key> - <value>cs2cf</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>vector_input</key> - <value>False</value> - </param> - <param> - <key>swap</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(275, 289)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_pll_cf</key> - <param> - <key>id</key> - <value>pll</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>pll_alpha</value> - </param> - <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> - </param> - <param> - <key>max_offset</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(292, 402)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_agc_xx</key> - <param> - <key>id</key> - <value>analog_agc_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>rate</key> - <value>1e-5</value> - </param> - <param> - <key>reference</key> - <value>1.0</value> - </param> - <param> - <key>gain</key> - <value>1.0/32768.0</value> - </param> - <param> - <key>max_gain</key> - <value>65536</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(124, 394)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>file_source</source_block_id> - <sink_block_id>cs2cf</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>pll</source_block_id> - <sink_block_id>blocks_moving_average_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>noaa_hrpt_deframer_0</source_block_id> - <sink_block_id>blocks_file_sink_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>noaa_hrpt_deframer_0</source_block_id> - <sink_block_id>decoder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_moving_average_xx_0</source_block_id> - <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_binary_slicer_fb_0</source_block_id> - <sink_block_id>noaa_hrpt_deframer_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>cs2cf</source_block_id> - <sink_block_id>analog_agc_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_agc_xx_0</source_block_id> - <sink_block_id>pll</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/examples/usrp_rx_hrpt.grc b/gr-noaa/examples/usrp_rx_hrpt.grc deleted file mode 100644 index 209bf41c56..0000000000 --- a/gr-noaa/examples/usrp_rx_hrpt.grc +++ /dev/null @@ -1,2267 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Sat Jul 12 11:19:58 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>usrp_rx_hrpt</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>USRP HRPT Receiver</value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4096,4096</value> - </param> - <param> - <key>generate_options</key> - <value>wx_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sample_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>4e6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(198, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>config_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>os.environ['HOME']+'/.gnuradio/config.conf'</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(13, 168)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_clock_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>100e-6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(705, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>hs</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>int(sps/2.0)</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(499, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>sample_rate/sym_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(397, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sym_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>600*1109</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(301, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(575, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>RX Gain</value> - </param> - <param> - <key>value</key> - <value>saved_gain</value> - </param> - <param> - <key>min</key> - <value>0</value> - </param> - <param> - <key>max</key> - <value>100</value> - </param> - <param> - <key>num_steps</key> - <value>100</value> - </param> - <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> - </param> - <param> - <key>converver</key> - <value>float_converter</value> - </param> - <param> - <key>grid_pos</key> - <value>0, 1, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(340, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_text_box</key> - <param> - <key>id</key> - <value>freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Frequency</value> - </param> - <param> - <key>value</key> - <value>saved_freq</value> - </param> - <param> - <key>converver</key> - <value>float_converter</value> - </param> - <param> - <key>formatter</key> - <value>None</value> - </param> - <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(199, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>PLL Alpha</value> - </param> - <param> - <key>value</key> - <value>saved_pll_alpha</value> - </param> - <param> - <key>min</key> - <value>0.0</value> - </param> - <param> - <key>max</key> - <value>0.5</value> - </param> - <param> - <key>num_steps</key> - <value>100</value> - </param> - <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> - </param> - <param> - <key>converver</key> - <value>float_converter</value> - </param> - <param> - <key>grid_pos</key> - <value>0, 2, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(479, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_slider</key> - <param> - <key>id</key> - <value>clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Clock Alpha</value> - </param> - <param> - <key>value</key> - <value>saved_clock_alpha</value> - </param> - <param> - <key>min</key> - <value>0.0</value> - </param> - <param> - <key>max</key> - <value>0.5</value> - </param> - <param> - <key>num_steps</key> - <value>100</value> - </param> - <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> - </param> - <param> - <key>converver</key> - <value>float_converter</value> - </param> - <param> - <key>grid_pos</key> - <value>0, 3, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(618, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>notebook</key> - <param> - <key>id</key> - <value>displays</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>style</key> - <value>wx.NB_TOP</value> - </param> - <param> - <key>labels</key> - <value>['Spectrum','Demod']</value> - </param> - <param> - <key>grid_pos</key> - <value>2,0,1,4</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(12, 249)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>addr</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>""</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'addr'</value> - </param> - <param> - <key>writeback</key> - <value>addr</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(194, 253)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_static_text</key> - <param> - <key>id</key> - <value>addr_text</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>USRP Addr</value> - </param> - <param> - <key>value</key> - <value>addr</value> - </param> - <param> - <key>converver</key> - <value>str_converter</value> - </param> - <param> - <key>formatter</key> - <value>None</value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(828, 20)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_static_text</key> - <param> - <key>id</key> - <value>rate_text</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>label</key> - <value>Baseband Rate</value> - </param> - <param> - <key>value</key> - <value>sample_rate</value> - </param> - <param> - <key>converver</key> - <value>float_converter</value> - </param> - <param> - <key>formatter</key> - <value>None</value> - </param> - <param> - <key>grid_pos</key> - <value>1, 1, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(973, 20)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>import math, os</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(9, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>output_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>'frames.hrpt'</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'filename'</value> - </param> - <param> - <key>writeback</key> - <value>output_filename</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(990, 255)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'clock_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>clock_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(832, 254)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'pll_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>pll_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(674, 254)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>35</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'gain'</value> - </param> - <param> - <key>writeback</key> - <value>gain</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(515, 255)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>saved_freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>1698e6</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'freq'</value> - </param> - <param> - <key>writeback</key> - <value>freq</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(358, 254)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_scopesink2</key> - <param> - <key>id</key> - <value>demod_scope</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>title</key> - <value>Post-Demod</value> - </param> - <param> - <key>samp_rate</key> - <value>sym_rate*2.0</value> - </param> - <param> - <key>v_scale</key> - <value>0.5</value> - </param> - <param> - <key>v_offset</key> - <value>0</value> - </param> - <param> - <key>t_scale</key> - <value>10.0/sym_rate</value> - </param> - <param> - <key>ac_couple</key> - <value>False</value> - </param> - <param> - <key>xy_mode</key> - <value>False</value> - </param> - <param> - <key>num_inputs</key> - <value>1</value> - </param> - <param> - <key>win_size</key> - <value></value> - </param> - <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 1</value> - </param> - <param> - <key>trig_mode</key> - <value>wxgui.TRIG_MODE_AUTO</value> - </param> - <param> - <key>y_axis_label</key> - <value>Counts</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(666, 542)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>blocks_moving_average_xx</key> - <param> - <key>id</key> - <value>blocks_moving_average_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>length</key> - <value>hs</value> - </param> - <param> - <key>scale</key> - <value>1.0/hs</value> - </param> - <param> - <key>max_iter</key> - <value>4000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(682, 713)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_sink</key> - <param> - <key>id</key> - <value>virtual_sink_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(1138, 729)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_clock_recovery_mm_xx</key> - <param> - <key>id</key> - <value>digital_clock_recovery_mm_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>omega</key> - <value>sps/2.0</value> - </param> - <param> - <key>gain_omega</key> - <value>clock_alpha**2/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>clock_alpha</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>max_clock_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(896, 697)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_source</key> - <param> - <key>id</key> - <value>virtual_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(173, 971)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_binary_slicer_fb</key> - <param> - <key>id</key> - <value>digital_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(423, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(762, 975)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_decoder</key> - <param> - <key>id</key> - <value>decoder</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>True</value> - </param> - <param> - <key>output</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(974, 925)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_file_sink</key> - <param> - <key>id</key> - <value>frame_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>output_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>unbuffered</key> - <value>False</value> - </param> - <param> - <key>append</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(973, 1024)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>rx_fft</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>RX Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>baseband_freq</key> - <value>freq</value> - </param> - <param> - <key>y_per_div</key> - <value>5</value> - </param> - <param> - <key>y_divs</key> - <value>8</value> - </param> - <param> - <key>ref_level</key> - <value>-5</value> - </param> - <param> - <key>ref_scale</key> - <value>2.0</value> - </param> - <param> - <key>fft_size</key> - <value>1024</value> - </param> - <param> - <key>fft_rate</key> - <value>15</value> - </param> - <param> - <key>peak_hold</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>True</value> - </param> - <param> - <key>avg_alpha</key> - <value>0.1</value> - </param> - <param> - <key>win</key> - <value>None</value> - </param> - <param> - <key>win_size</key> - <value>640, 360</value> - </param> - <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> - </param> - <param> - <key>notebook</key> - <value>displays, 0</value> - </param> - <param> - <key>freqvar</key> - <value>None</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(477, 457)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_pll_cf</key> - <param> - <key>id</key> - <value>pll</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>pll_alpha</value> - </param> - <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> - </param> - <param> - <key>max_offset</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(469, 713)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>uhd_usrp_source</key> - <param> - <key>id</key> - <value>uhd_usrp_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fc32</value> - </param> - <param> - <key>otw</key> - <value></value> - </param> - <param> - <key>stream_args</key> - <value></value> - </param> - <param> - <key>stream_chans</key> - <value>[]</value> - </param> - <param> - <key>dev_addr</key> - <value>addr</value> - </param> - <param> - <key>dev_args</key> - <value>""</value> - </param> - <param> - <key>sync</key> - <value></value> - </param> - <param> - <key>clock_rate</key> - <value>0.0</value> - </param> - <param> - <key>num_mboards</key> - <value>1</value> - </param> - <param> - <key>clock_source0</key> - <value></value> - </param> - <param> - <key>time_source0</key> - <value></value> - </param> - <param> - <key>sd_spec0</key> - <value></value> - </param> - <param> - <key>clock_source1</key> - <value></value> - </param> - <param> - <key>time_source1</key> - <value></value> - </param> - <param> - <key>sd_spec1</key> - <value></value> - </param> - <param> - <key>clock_source2</key> - <value></value> - </param> - <param> - <key>time_source2</key> - <value></value> - </param> - <param> - <key>sd_spec2</key> - <value></value> - </param> - <param> - <key>clock_source3</key> - <value></value> - </param> - <param> - <key>time_source3</key> - <value></value> - </param> - <param> - <key>sd_spec3</key> - <value></value> - </param> - <param> - <key>clock_source4</key> - <value></value> - </param> - <param> - <key>time_source4</key> - <value></value> - </param> - <param> - <key>sd_spec4</key> - <value></value> - </param> - <param> - <key>clock_source5</key> - <value></value> - </param> - <param> - <key>time_source5</key> - <value></value> - </param> - <param> - <key>sd_spec5</key> - <value></value> - </param> - <param> - <key>clock_source6</key> - <value></value> - </param> - <param> - <key>time_source6</key> - <value></value> - </param> - <param> - <key>sd_spec6</key> - <value></value> - </param> - <param> - <key>clock_source7</key> - <value></value> - </param> - <param> - <key>time_source7</key> - <value></value> - </param> - <param> - <key>sd_spec7</key> - <value></value> - </param> - <param> - <key>nchan</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>center_freq0</key> - <value>freq</value> - </param> - <param> - <key>gain0</key> - <value>0</value> - </param> - <param> - <key>ant0</key> - <value></value> - </param> - <param> - <key>bw0</key> - <value>0</value> - </param> - <param> - <key>center_freq1</key> - <value>0</value> - </param> - <param> - <key>gain1</key> - <value>0</value> - </param> - <param> - <key>ant1</key> - <value></value> - </param> - <param> - <key>bw1</key> - <value>0</value> - </param> - <param> - <key>center_freq2</key> - <value>0</value> - </param> - <param> - <key>gain2</key> - <value>0</value> - </param> - <param> - <key>ant2</key> - <value></value> - </param> - <param> - <key>bw2</key> - <value>0</value> - </param> - <param> - <key>center_freq3</key> - <value>0</value> - </param> - <param> - <key>gain3</key> - <value>0</value> - </param> - <param> - <key>ant3</key> - <value></value> - </param> - <param> - <key>bw3</key> - <value>0</value> - </param> - <param> - <key>center_freq4</key> - <value>0</value> - </param> - <param> - <key>gain4</key> - <value>0</value> - </param> - <param> - <key>ant4</key> - <value></value> - </param> - <param> - <key>bw4</key> - <value>0</value> - </param> - <param> - <key>center_freq5</key> - <value>0</value> - </param> - <param> - <key>gain5</key> - <value>0</value> - </param> - <param> - <key>ant5</key> - <value></value> - </param> - <param> - <key>bw5</key> - <value>0</value> - </param> - <param> - <key>center_freq6</key> - <value>0</value> - </param> - <param> - <key>gain6</key> - <value>0</value> - </param> - <param> - <key>ant6</key> - <value></value> - </param> - <param> - <key>bw6</key> - <value>0</value> - </param> - <param> - <key>center_freq7</key> - <value>0</value> - </param> - <param> - <key>gain7</key> - <value>0</value> - </param> - <param> - <key>ant7</key> - <value></value> - </param> - <param> - <key>bw7</key> - <value>0</value> - </param> - <param> - <key>center_freq8</key> - <value>0</value> - </param> - <param> - <key>gain8</key> - <value>0</value> - </param> - <param> - <key>ant8</key> - <value></value> - </param> - <param> - <key>bw8</key> - <value>0</value> - </param> - <param> - <key>center_freq9</key> - <value>0</value> - </param> - <param> - <key>gain9</key> - <value>0</value> - </param> - <param> - <key>ant9</key> - <value></value> - </param> - <param> - <key>bw9</key> - <value>0</value> - </param> - <param> - <key>center_freq10</key> - <value>0</value> - </param> - <param> - <key>gain10</key> - <value>0</value> - </param> - <param> - <key>ant10</key> - <value></value> - </param> - <param> - <key>bw10</key> - <value>0</value> - </param> - <param> - <key>center_freq11</key> - <value>0</value> - </param> - <param> - <key>gain11</key> - <value>0</value> - </param> - <param> - <key>ant11</key> - <value></value> - </param> - <param> - <key>bw11</key> - <value>0</value> - </param> - <param> - <key>center_freq12</key> - <value>0</value> - </param> - <param> - <key>gain12</key> - <value>0</value> - </param> - <param> - <key>ant12</key> - <value></value> - </param> - <param> - <key>bw12</key> - <value>0</value> - </param> - <param> - <key>center_freq13</key> - <value>0</value> - </param> - <param> - <key>gain13</key> - <value>0</value> - </param> - <param> - <key>ant13</key> - <value></value> - </param> - <param> - <key>bw13</key> - <value>0</value> - </param> - <param> - <key>center_freq14</key> - <value>0</value> - </param> - <param> - <key>gain14</key> - <value>0</value> - </param> - <param> - <key>ant14</key> - <value></value> - </param> - <param> - <key>bw14</key> - <value>0</value> - </param> - <param> - <key>center_freq15</key> - <value>0</value> - </param> - <param> - <key>gain15</key> - <value>0</value> - </param> - <param> - <key>ant15</key> - <value></value> - </param> - <param> - <key>bw15</key> - <value>0</value> - </param> - <param> - <key>center_freq16</key> - <value>0</value> - </param> - <param> - <key>gain16</key> - <value>0</value> - </param> - <param> - <key>ant16</key> - <value></value> - </param> - <param> - <key>bw16</key> - <value>0</value> - </param> - <param> - <key>center_freq17</key> - <value>0</value> - </param> - <param> - <key>gain17</key> - <value>0</value> - </param> - <param> - <key>ant17</key> - <value></value> - </param> - <param> - <key>bw17</key> - <value>0</value> - </param> - <param> - <key>center_freq18</key> - <value>0</value> - </param> - <param> - <key>gain18</key> - <value>0</value> - </param> - <param> - <key>ant18</key> - <value></value> - </param> - <param> - <key>bw18</key> - <value>0</value> - </param> - <param> - <key>center_freq19</key> - <value>0</value> - </param> - <param> - <key>gain19</key> - <value>0</value> - </param> - <param> - <key>ant19</key> - <value></value> - </param> - <param> - <key>bw19</key> - <value>0</value> - </param> - <param> - <key>center_freq20</key> - <value>0</value> - </param> - <param> - <key>gain20</key> - <value>0</value> - </param> - <param> - <key>ant20</key> - <value></value> - </param> - <param> - <key>bw20</key> - <value>0</value> - </param> - <param> - <key>center_freq21</key> - <value>0</value> - </param> - <param> - <key>gain21</key> - <value>0</value> - </param> - <param> - <key>ant21</key> - <value></value> - </param> - <param> - <key>bw21</key> - <value>0</value> - </param> - <param> - <key>center_freq22</key> - <value>0</value> - </param> - <param> - <key>gain22</key> - <value>0</value> - </param> - <param> - <key>ant22</key> - <value></value> - </param> - <param> - <key>bw22</key> - <value>0</value> - </param> - <param> - <key>center_freq23</key> - <value>0</value> - </param> - <param> - <key>gain23</key> - <value>0</value> - </param> - <param> - <key>ant23</key> - <value></value> - </param> - <param> - <key>bw23</key> - <value>0</value> - </param> - <param> - <key>center_freq24</key> - <value>0</value> - </param> - <param> - <key>gain24</key> - <value>0</value> - </param> - <param> - <key>ant24</key> - <value></value> - </param> - <param> - <key>bw24</key> - <value>0</value> - </param> - <param> - <key>center_freq25</key> - <value>0</value> - </param> - <param> - <key>gain25</key> - <value>0</value> - </param> - <param> - <key>ant25</key> - <value></value> - </param> - <param> - <key>bw25</key> - <value>0</value> - </param> - <param> - <key>center_freq26</key> - <value>0</value> - </param> - <param> - <key>gain26</key> - <value>0</value> - </param> - <param> - <key>ant26</key> - <value></value> - </param> - <param> - <key>bw26</key> - <value>0</value> - </param> - <param> - <key>center_freq27</key> - <value>0</value> - </param> - <param> - <key>gain27</key> - <value>0</value> - </param> - <param> - <key>ant27</key> - <value></value> - </param> - <param> - <key>bw27</key> - <value>0</value> - </param> - <param> - <key>center_freq28</key> - <value>0</value> - </param> - <param> - <key>gain28</key> - <value>0</value> - </param> - <param> - <key>ant28</key> - <value></value> - </param> - <param> - <key>bw28</key> - <value>0</value> - </param> - <param> - <key>center_freq29</key> - <value>0</value> - </param> - <param> - <key>gain29</key> - <value>0</value> - </param> - <param> - <key>ant29</key> - <value></value> - </param> - <param> - <key>bw29</key> - <value>0</value> - </param> - <param> - <key>center_freq30</key> - <value>0</value> - </param> - <param> - <key>gain30</key> - <value>0</value> - </param> - <param> - <key>ant30</key> - <value></value> - </param> - <param> - <key>bw30</key> - <value>0</value> - </param> - <param> - <key>center_freq31</key> - <value>0</value> - </param> - <param> - <key>gain31</key> - <value>0</value> - </param> - <param> - <key>ant31</key> - <value></value> - </param> - <param> - <key>bw31</key> - <value>0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(49, 713)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_agc_xx</key> - <param> - <key>id</key> - <value>analog_agc_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>rate</key> - <value>1e-6</value> - </param> - <param> - <key>reference</key> - <value>1.0</value> - </param> - <param> - <key>gain</key> - <value>1.0</value> - </param> - <param> - <key>max_gain</key> - <value>65536</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(276, 705)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>frame_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>decoder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>pll</source_block_id> - <sink_block_id>blocks_moving_average_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_moving_average_xx_0</source_block_id> - <sink_block_id>demod_scope</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_moving_average_xx_0</source_block_id> - <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>virtual_sink_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>virtual_source_0</source_block_id> - <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_binary_slicer_fb_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_agc_xx_0</source_block_id> - <sink_block_id>rx_fft</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_agc_xx_0</source_block_id> - <sink_block_id>pll</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>uhd_usrp_source_0</source_block_id> - <sink_block_id>analog_agc_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/examples/usrp_rx_hrpt_nogui.grc b/gr-noaa/examples/usrp_rx_hrpt_nogui.grc deleted file mode 100644 index f8722fa61c..0000000000 --- a/gr-noaa/examples/usrp_rx_hrpt_nogui.grc +++ /dev/null @@ -1,1716 +0,0 @@ -<?xml version='1.0' encoding='ASCII'?> -<flow_graph> - <timestamp>Sat Jul 12 11:20:19 2014</timestamp> - <block> - <key>options</key> - <param> - <key>id</key> - <value>usrp_rx_hrpt_nogui</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>title</key> - <value>USRP HRPT Receiver</value> - </param> - <param> - <key>author</key> - <value></value> - </param> - <param> - <key>description</key> - <value></value> - </param> - <param> - <key>window_size</key> - <value>4096,4096</value> - </param> - <param> - <key>generate_options</key> - <value>no_gui</value> - </param> - <param> - <key>category</key> - <value>Custom</value> - </param> - <param> - <key>run_options</key> - <value>prompt</value> - </param> - <param> - <key>run</key> - <value>True</value> - </param> - <param> - <key>max_nouts</key> - <value>0</value> - </param> - <param> - <key>realtime_scheduling</key> - <value></value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sample_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>4e6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(198, 17)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>config_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>os.environ['HOME']+'/.gnuradio/config.conf'</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(13, 168)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_clock_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>100e-6</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(705, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>hs</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>int(sps/2.0)</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(499, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sps</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>sample_rate/sym_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(397, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>sym_rate</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>600*1109</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(301, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable</key> - <param> - <key>id</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>2*math.pi*100e3/sample_rate</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(575, 19)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>import</key> - <param> - <key>id</key> - <value>import_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>import</key> - <value>import math, os</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(9, 106)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>clock_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'clock_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>clock_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(833, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>pll_alpha</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>0.01</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'pll_alpha'</value> - </param> - <param> - <key>writeback</key> - <value>pll_alpha</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(675, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>gain</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>35</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'gain'</value> - </param> - <param> - <key>writeback</key> - <value>gain</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(516, 105)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>freq</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>1698e6</value> - </param> - <param> - <key>type</key> - <value>real</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'freq'</value> - </param> - <param> - <key>writeback</key> - <value>freq</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(359, 104)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>output_filename</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>'frames.hrpt'</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'filename'</value> - </param> - <param> - <key>writeback</key> - <value>output_filename</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(991, 105)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_clock_recovery_mm_xx</key> - <param> - <key>id</key> - <value>digital_clock_recovery_mm_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>omega</key> - <value>sps/2.0</value> - </param> - <param> - <key>gain_omega</key> - <value>clock_alpha**2/4.0</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>gain_mu</key> - <value>clock_alpha</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>max_clock_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(897, 341)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_sink</key> - <param> - <key>id</key> - <value>virtual_sink_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(1139, 373)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_moving_average_xx</key> - <param> - <key>id</key> - <value>blocks_moving_average_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>length</key> - <value>hs</value> - </param> - <param> - <key>scale</key> - <value>1.0/hs</value> - </param> - <param> - <key>max_iter</key> - <value>4000</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(683, 357)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>blocks_file_sink</key> - <param> - <key>id</key> - <value>frame_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>output_filename</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>unbuffered</key> - <value>False</value> - </param> - <param> - <key>append</key> - <value>False</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(809, 595)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_deframer</key> - <param> - <key>id</key> - <value>deframer</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(598, 546)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_binary_slicer_fb</key> - <param> - <key>id</key> - <value>digital_binary_slicer_fb_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(259, 546)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>virtual_source</key> - <param> - <key>id</key> - <value>virtual_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>stream_id</key> - <value>baseband</value> - </param> - <param> - <key>_coordinate</key> - <value>(40, 542)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_decoder</key> - <param> - <key>id</key> - <value>decoder</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>True</value> - </param> - <param> - <key>output</key> - <value>True</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(810, 496)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_config</key> - <param> - <key>id</key> - <value>addr</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>value</key> - <value>""</value> - </param> - <param> - <key>type</key> - <value>string</value> - </param> - <param> - <key>config_file</key> - <value>config_filename</value> - </param> - <param> - <key>section</key> - <value>'usrp_rx_hrpt'</value> - </param> - <param> - <key>option</key> - <value>'addr'</value> - </param> - <param> - <key>writeback</key> - <value>addr</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>_coordinate</key> - <value>(195, 103)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>uhd_usrp_source</key> - <param> - <key>id</key> - <value>uhd_usrp_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>fc32</value> - </param> - <param> - <key>otw</key> - <value></value> - </param> - <param> - <key>stream_args</key> - <value></value> - </param> - <param> - <key>stream_chans</key> - <value>[]</value> - </param> - <param> - <key>dev_addr</key> - <value>addr</value> - </param> - <param> - <key>dev_args</key> - <value>""</value> - </param> - <param> - <key>sync</key> - <value></value> - </param> - <param> - <key>clock_rate</key> - <value>0.0</value> - </param> - <param> - <key>num_mboards</key> - <value>1</value> - </param> - <param> - <key>clock_source0</key> - <value></value> - </param> - <param> - <key>time_source0</key> - <value></value> - </param> - <param> - <key>sd_spec0</key> - <value></value> - </param> - <param> - <key>clock_source1</key> - <value></value> - </param> - <param> - <key>time_source1</key> - <value></value> - </param> - <param> - <key>sd_spec1</key> - <value></value> - </param> - <param> - <key>clock_source2</key> - <value></value> - </param> - <param> - <key>time_source2</key> - <value></value> - </param> - <param> - <key>sd_spec2</key> - <value></value> - </param> - <param> - <key>clock_source3</key> - <value></value> - </param> - <param> - <key>time_source3</key> - <value></value> - </param> - <param> - <key>sd_spec3</key> - <value></value> - </param> - <param> - <key>clock_source4</key> - <value></value> - </param> - <param> - <key>time_source4</key> - <value></value> - </param> - <param> - <key>sd_spec4</key> - <value></value> - </param> - <param> - <key>clock_source5</key> - <value></value> - </param> - <param> - <key>time_source5</key> - <value></value> - </param> - <param> - <key>sd_spec5</key> - <value></value> - </param> - <param> - <key>clock_source6</key> - <value></value> - </param> - <param> - <key>time_source6</key> - <value></value> - </param> - <param> - <key>sd_spec6</key> - <value></value> - </param> - <param> - <key>clock_source7</key> - <value></value> - </param> - <param> - <key>time_source7</key> - <value></value> - </param> - <param> - <key>sd_spec7</key> - <value></value> - </param> - <param> - <key>nchan</key> - <value>1</value> - </param> - <param> - <key>samp_rate</key> - <value>sample_rate</value> - </param> - <param> - <key>center_freq0</key> - <value>freq</value> - </param> - <param> - <key>gain0</key> - <value>0</value> - </param> - <param> - <key>ant0</key> - <value></value> - </param> - <param> - <key>bw0</key> - <value>0</value> - </param> - <param> - <key>center_freq1</key> - <value>0</value> - </param> - <param> - <key>gain1</key> - <value>0</value> - </param> - <param> - <key>ant1</key> - <value></value> - </param> - <param> - <key>bw1</key> - <value>0</value> - </param> - <param> - <key>center_freq2</key> - <value>0</value> - </param> - <param> - <key>gain2</key> - <value>0</value> - </param> - <param> - <key>ant2</key> - <value></value> - </param> - <param> - <key>bw2</key> - <value>0</value> - </param> - <param> - <key>center_freq3</key> - <value>0</value> - </param> - <param> - <key>gain3</key> - <value>0</value> - </param> - <param> - <key>ant3</key> - <value></value> - </param> - <param> - <key>bw3</key> - <value>0</value> - </param> - <param> - <key>center_freq4</key> - <value>0</value> - </param> - <param> - <key>gain4</key> - <value>0</value> - </param> - <param> - <key>ant4</key> - <value></value> - </param> - <param> - <key>bw4</key> - <value>0</value> - </param> - <param> - <key>center_freq5</key> - <value>0</value> - </param> - <param> - <key>gain5</key> - <value>0</value> - </param> - <param> - <key>ant5</key> - <value></value> - </param> - <param> - <key>bw5</key> - <value>0</value> - </param> - <param> - <key>center_freq6</key> - <value>0</value> - </param> - <param> - <key>gain6</key> - <value>0</value> - </param> - <param> - <key>ant6</key> - <value></value> - </param> - <param> - <key>bw6</key> - <value>0</value> - </param> - <param> - <key>center_freq7</key> - <value>0</value> - </param> - <param> - <key>gain7</key> - <value>0</value> - </param> - <param> - <key>ant7</key> - <value></value> - </param> - <param> - <key>bw7</key> - <value>0</value> - </param> - <param> - <key>center_freq8</key> - <value>0</value> - </param> - <param> - <key>gain8</key> - <value>0</value> - </param> - <param> - <key>ant8</key> - <value></value> - </param> - <param> - <key>bw8</key> - <value>0</value> - </param> - <param> - <key>center_freq9</key> - <value>0</value> - </param> - <param> - <key>gain9</key> - <value>0</value> - </param> - <param> - <key>ant9</key> - <value></value> - </param> - <param> - <key>bw9</key> - <value>0</value> - </param> - <param> - <key>center_freq10</key> - <value>0</value> - </param> - <param> - <key>gain10</key> - <value>0</value> - </param> - <param> - <key>ant10</key> - <value></value> - </param> - <param> - <key>bw10</key> - <value>0</value> - </param> - <param> - <key>center_freq11</key> - <value>0</value> - </param> - <param> - <key>gain11</key> - <value>0</value> - </param> - <param> - <key>ant11</key> - <value></value> - </param> - <param> - <key>bw11</key> - <value>0</value> - </param> - <param> - <key>center_freq12</key> - <value>0</value> - </param> - <param> - <key>gain12</key> - <value>0</value> - </param> - <param> - <key>ant12</key> - <value></value> - </param> - <param> - <key>bw12</key> - <value>0</value> - </param> - <param> - <key>center_freq13</key> - <value>0</value> - </param> - <param> - <key>gain13</key> - <value>0</value> - </param> - <param> - <key>ant13</key> - <value></value> - </param> - <param> - <key>bw13</key> - <value>0</value> - </param> - <param> - <key>center_freq14</key> - <value>0</value> - </param> - <param> - <key>gain14</key> - <value>0</value> - </param> - <param> - <key>ant14</key> - <value></value> - </param> - <param> - <key>bw14</key> - <value>0</value> - </param> - <param> - <key>center_freq15</key> - <value>0</value> - </param> - <param> - <key>gain15</key> - <value>0</value> - </param> - <param> - <key>ant15</key> - <value></value> - </param> - <param> - <key>bw15</key> - <value>0</value> - </param> - <param> - <key>center_freq16</key> - <value>0</value> - </param> - <param> - <key>gain16</key> - <value>0</value> - </param> - <param> - <key>ant16</key> - <value></value> - </param> - <param> - <key>bw16</key> - <value>0</value> - </param> - <param> - <key>center_freq17</key> - <value>0</value> - </param> - <param> - <key>gain17</key> - <value>0</value> - </param> - <param> - <key>ant17</key> - <value></value> - </param> - <param> - <key>bw17</key> - <value>0</value> - </param> - <param> - <key>center_freq18</key> - <value>0</value> - </param> - <param> - <key>gain18</key> - <value>0</value> - </param> - <param> - <key>ant18</key> - <value></value> - </param> - <param> - <key>bw18</key> - <value>0</value> - </param> - <param> - <key>center_freq19</key> - <value>0</value> - </param> - <param> - <key>gain19</key> - <value>0</value> - </param> - <param> - <key>ant19</key> - <value></value> - </param> - <param> - <key>bw19</key> - <value>0</value> - </param> - <param> - <key>center_freq20</key> - <value>0</value> - </param> - <param> - <key>gain20</key> - <value>0</value> - </param> - <param> - <key>ant20</key> - <value></value> - </param> - <param> - <key>bw20</key> - <value>0</value> - </param> - <param> - <key>center_freq21</key> - <value>0</value> - </param> - <param> - <key>gain21</key> - <value>0</value> - </param> - <param> - <key>ant21</key> - <value></value> - </param> - <param> - <key>bw21</key> - <value>0</value> - </param> - <param> - <key>center_freq22</key> - <value>0</value> - </param> - <param> - <key>gain22</key> - <value>0</value> - </param> - <param> - <key>ant22</key> - <value></value> - </param> - <param> - <key>bw22</key> - <value>0</value> - </param> - <param> - <key>center_freq23</key> - <value>0</value> - </param> - <param> - <key>gain23</key> - <value>0</value> - </param> - <param> - <key>ant23</key> - <value></value> - </param> - <param> - <key>bw23</key> - <value>0</value> - </param> - <param> - <key>center_freq24</key> - <value>0</value> - </param> - <param> - <key>gain24</key> - <value>0</value> - </param> - <param> - <key>ant24</key> - <value></value> - </param> - <param> - <key>bw24</key> - <value>0</value> - </param> - <param> - <key>center_freq25</key> - <value>0</value> - </param> - <param> - <key>gain25</key> - <value>0</value> - </param> - <param> - <key>ant25</key> - <value></value> - </param> - <param> - <key>bw25</key> - <value>0</value> - </param> - <param> - <key>center_freq26</key> - <value>0</value> - </param> - <param> - <key>gain26</key> - <value>0</value> - </param> - <param> - <key>ant26</key> - <value></value> - </param> - <param> - <key>bw26</key> - <value>0</value> - </param> - <param> - <key>center_freq27</key> - <value>0</value> - </param> - <param> - <key>gain27</key> - <value>0</value> - </param> - <param> - <key>ant27</key> - <value></value> - </param> - <param> - <key>bw27</key> - <value>0</value> - </param> - <param> - <key>center_freq28</key> - <value>0</value> - </param> - <param> - <key>gain28</key> - <value>0</value> - </param> - <param> - <key>ant28</key> - <value></value> - </param> - <param> - <key>bw28</key> - <value>0</value> - </param> - <param> - <key>center_freq29</key> - <value>0</value> - </param> - <param> - <key>gain29</key> - <value>0</value> - </param> - <param> - <key>ant29</key> - <value></value> - </param> - <param> - <key>bw29</key> - <value>0</value> - </param> - <param> - <key>center_freq30</key> - <value>0</value> - </param> - <param> - <key>gain30</key> - <value>0</value> - </param> - <param> - <key>ant30</key> - <value></value> - </param> - <param> - <key>bw30</key> - <value>0</value> - </param> - <param> - <key>center_freq31</key> - <value>0</value> - </param> - <param> - <key>gain31</key> - <value>0</value> - </param> - <param> - <key>ant31</key> - <value></value> - </param> - <param> - <key>bw31</key> - <value>0</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(50, 357)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>noaa_hrpt_pll_cf</key> - <param> - <key>id</key> - <value>pll</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>alpha</key> - <value>pll_alpha</value> - </param> - <param> - <key>beta</key> - <value>pll_alpha**2/4.0</value> - </param> - <param> - <key>max_offset</key> - <value>max_carrier_offset</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(470, 357)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>analog_agc_xx</key> - <param> - <key>id</key> - <value>analog_agc_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>rate</key> - <value>1e-6</value> - </param> - <param> - <key>reference</key> - <value>1.0</value> - </param> - <param> - <key>gain</key> - <value>1.0</value> - </param> - <param> - <key>max_gain</key> - <value>65536</value> - </param> - <param> - <key>alias</key> - <value></value> - </param> - <param> - <key>affinity</key> - <value></value> - </param> - <param> - <key>minoutbuf</key> - <value>0</value> - </param> - <param> - <key>maxoutbuf</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(286, 349)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <connection> - <source_block_id>digital_clock_recovery_mm_xx_0</source_block_id> - <sink_block_id>virtual_sink_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blocks_moving_average_xx_0</source_block_id> - <sink_block_id>digital_clock_recovery_mm_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>pll</source_block_id> - <sink_block_id>blocks_moving_average_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_binary_slicer_fb_0</source_block_id> - <sink_block_id>deframer</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>virtual_source_0</source_block_id> - <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>decoder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>deframer</source_block_id> - <sink_block_id>frame_sink</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>uhd_usrp_source_0</source_block_id> - <sink_block_id>analog_agc_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>analog_agc_xx_0</source_block_id> - <sink_block_id>pll</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> -</flow_graph> diff --git a/gr-noaa/gnuradio-noaa.pc.in b/gr-noaa/gnuradio-noaa.pc.in deleted file mode 100644 index 134b31bc5e..0000000000 --- a/gr-noaa/gnuradio-noaa.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-noaa -Description: GNU Radio blocks implementing a NOAA satellite protocols -Requires: gnuradio-runtime -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-noaa -Cflags: -I${includedir} diff --git a/gr-noaa/grc/CMakeLists.txt b/gr-noaa/grc/CMakeLists.txt deleted file mode 100644 index ae04d4b6e5..0000000000 --- a/gr-noaa/grc/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -install(FILES - noaa_hrpt_decoder.xml - noaa_hrpt_deframer.xml - noaa_hrpt_pll_cf.xml - DESTINATION ${GRC_BLOCKS_DIR} - COMPONENT "noaa_python" -) diff --git a/gr-noaa/grc/noaa_hrpt_decoder.xml b/gr-noaa/grc/noaa_hrpt_decoder.xml deleted file mode 100644 index 2d6e98c531..0000000000 --- a/gr-noaa/grc/noaa_hrpt_decoder.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>HRPT Decoder</name> - <key>noaa_hrpt_decoder</key> - <category>NOAA</category> - <import>from gnuradio import noaa</import> - <make>noaa.hrpt_decoder($verbose,$output)</make> - - <param> - <name>Verbose</name> - <key>verbose</key> - <type>bool</type> - </param> - - <param> - <name>Output Files</name> - <key>output</key> - <type>bool</type> - </param> - - <sink> - <name>in</name> - <type>short</type> - </sink> -</block> diff --git a/gr-noaa/grc/noaa_hrpt_deframer.xml b/gr-noaa/grc/noaa_hrpt_deframer.xml deleted file mode 100644 index af36abf2a2..0000000000 --- a/gr-noaa/grc/noaa_hrpt_deframer.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>HRPT Deframer</name> - <key>noaa_hrpt_deframer</key> - <category>NOAA</category> - <import>from gnuradio import noaa</import> - <make>noaa.hrpt_deframer()</make> - <sink> - <name>in</name> - <type>byte</type> - </sink> - <source> - <name>out</name> - <type>short</type> - </source> -</block> diff --git a/gr-noaa/grc/noaa_hrpt_pll_cf.xml b/gr-noaa/grc/noaa_hrpt_pll_cf.xml deleted file mode 100644 index bbe15e8c32..0000000000 --- a/gr-noaa/grc/noaa_hrpt_pll_cf.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<block> - <name>HRPT PLL</name> - <key>noaa_hrpt_pll_cf</key> - <category>NOAA</category> - <import>from gnuradio import noaa</import> - <make>noaa.hrpt_pll_cf($alpha, $beta, $max_offset)</make> - <callback>set_alpha($alpha)</callback> - <callback>set_beta($beta)</callback> - <callback>set_max_offset($max_offset)</callback> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <param> - <name>Beta</name> - <key>beta</key> - <type>real</type> - </param> - <param> - <name>Max Offset</name> - <key>max_offset</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/gr-noaa/include/gnuradio/noaa/CMakeLists.txt b/gr-noaa/include/gnuradio/noaa/CMakeLists.txt deleted file mode 100644 index a3a18d2c26..0000000000 --- a/gr-noaa/include/gnuradio/noaa/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2012,2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Install header files -######################################################################## -install(FILES - api.h - hrpt_decoder.h - hrpt_deframer.h - hrpt.h - hrpt_pll_cf.h - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/noaa - COMPONENT "noaa_devel" -) diff --git a/gr-noaa/include/gnuradio/noaa/api.h b/gr-noaa/include/gnuradio/noaa/api.h deleted file mode 100644 index d30cbf4746..0000000000 --- a/gr-noaa/include/gnuradio/noaa/api.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_API_H -#define INCLUDED_NOAA_API_H - -#include <gnuradio/attributes.h> - -#ifdef gnuradio_noaa_EXPORTS -# define NOAA_API __GR_ATTR_EXPORT -#else -# define NOAA_API __GR_ATTR_IMPORT -#endif - -#endif /* INCLUDED_NOAA_API_H */ diff --git a/gr-noaa/include/gnuradio/noaa/hrpt.h b/gr-noaa/include/gnuradio/noaa/hrpt.h deleted file mode 100644 index f0f0e53f4d..0000000000 --- a/gr-noaa/include/gnuradio/noaa/hrpt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_H -#define INCLUDED_NOAA_HRPT_H - -#define HRPT_SYNC1 0x0284 -#define HRPT_SYNC2 0x016F -#define HRPT_SYNC3 0x035C -#define HRPT_SYNC4 0x019D -#define HRPT_SYNC5 0x020F -#define HRPT_SYNC6 0x0095 - -#define HRPT_MINOR_FRAME_SYNC 0x0A116FD719D83C95LL - -#define HRPT_SYNC_WORDS 6 -#define HRPT_MINOR_FRAME_WORDS 11090 -#define HRPT_BITS_PER_WORD 10 - -#endif /* INCLUDED_NOAA_HRPT_H */ diff --git a/gr-noaa/include/gnuradio/noaa/hrpt_decoder.h b/gr-noaa/include/gnuradio/noaa/hrpt_decoder.h deleted file mode 100644 index 1a8882633e..0000000000 --- a/gr-noaa/include/gnuradio/noaa/hrpt_decoder.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_DECODER_H -#define INCLUDED_NOAA_HRPT_DECODER_H - -#include <gnuradio/noaa/api.h> -#include <gnuradio/sync_block.h> - -namespace gr { - namespace noaa { - - /*! - * \brief NOAA HRPT Decoder - * \ingroup noaa_blk - */ - class NOAA_API hrpt_decoder : virtual public sync_block - { - public: - // gr::noaa::hrpt_decoder::sptr - typedef boost::shared_ptr<hrpt_decoder> sptr; - - /*! - * \brief Make NOAA HRPT Decoder - */ - static sptr make(bool verbose, bool output_files); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DECODER_H */ diff --git a/gr-noaa/include/gnuradio/noaa/hrpt_deframer.h b/gr-noaa/include/gnuradio/noaa/hrpt_deframer.h deleted file mode 100644 index cafb2334e8..0000000000 --- a/gr-noaa/include/gnuradio/noaa/hrpt_deframer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_DEFRAMER_H -#define INCLUDED_NOAA_HRPT_DEFRAMER_H - -#include <gnuradio/noaa/api.h> -#include <gnuradio/block.h> - -namespace gr { - namespace noaa { - - /*! - * \brief NOAA HRPT Deframer - * \ingroup noaa_blk - */ - class NOAA_API hrpt_deframer : virtual public block - { - public: - // gr::noaa::hrpt_deframer::sptr - typedef boost::shared_ptr<hrpt_deframer> sptr; - - /*! - * \brief Make NOAA HRPT Deframer - */ - static sptr make(); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DEFRAMER_H */ diff --git a/gr-noaa/include/gnuradio/noaa/hrpt_pll_cf.h b/gr-noaa/include/gnuradio/noaa/hrpt_pll_cf.h deleted file mode 100644 index d66663da01..0000000000 --- a/gr-noaa/include/gnuradio/noaa/hrpt_pll_cf.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_PLL_CF_H -#define INCLUDED_NOAA_HRPT_PLL_CF_H - -#include <gnuradio/noaa/api.h> -#include <gnuradio/sync_block.h> - -namespace gr { - namespace noaa { - - /*! - * \brief NOAA HRPT PLL - * \ingroup noaa_blk - */ - class NOAA_API hrpt_pll_cf : virtual public sync_block - { - public: - // gr::noaa::hrpt_pll_cf::sptr - typedef boost::shared_ptr<hrpt_pll_cf> sptr; - - static sptr make(float alpha, float beta, float max_offset); - - virtual void set_alpha(float alpha) = 0; - virtual void set_beta(float beta) = 0; - virtual void set_max_offset(float max_offset) = 0; - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_PLL_CF_H */ diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt deleted file mode 100644 index d8db07d922..0000000000 --- a/gr-noaa/lib/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2011-2013 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup the include and linker paths -######################################################################## -include_directories( - ${GR_NOAA_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${LOG4CPP_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -link_directories(${Boost_LIBRARY_DIRS}) -link_directories(${LOG4CPP_LIBRARY_DIRS}) - -if(ENABLE_GR_CTRLPORT) - ADD_DEFINITIONS(-DGR_CTRLPORT) -endif(ENABLE_GR_CTRLPORT) - -######################################################################## -# Setup library -######################################################################## -list(APPEND noaa_sources - hrpt_decoder_impl.cc - hrpt_deframer_impl.cc - hrpt_pll_cf_impl.cc -) - -#Add Windows DLL resource file if using MSVC -if(MSVC) - include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-noaa.rc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.rc - @ONLY) - - list(APPEND gr_noaa_sources - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.rc - ) -endif(MSVC) - -list(APPEND noaa_libs - gnuradio-runtime - ${Boost_LIBRARIES} - ${LOG4CPP_LIBRARIES} -) - -add_library(gnuradio-noaa SHARED ${noaa_sources}) -target_link_libraries(gnuradio-noaa ${noaa_libs}) -GR_LIBRARY_FOO(gnuradio-noaa RUNTIME_COMPONENT "noaa_runtime" DEVEL_COMPONENT "noaa_devel") - -if(ENABLE_STATIC_LIBS) - if(ENABLE_GR_CTRLPORT) - # Remove GR_CTRLPORT set this target's definitions. - # Makes sure we don't try to use ControlPort stuff in source files - GET_DIRECTORY_PROPERTY(STATIC_DEFS COMPILE_DEFINITIONS) - list(REMOVE_ITEM STATIC_DEFS "GR_CTRLPORT") - SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS "${STATIC_DEFS}") - - # readd it to the target since we removed it from the directory-wide list. - SET_PROPERTY(TARGET gnuradio-noaa APPEND PROPERTY COMPILE_DEFINITIONS "GR_CTRLPORT") - endif(ENABLE_GR_CTRLPORT) - - add_library(gnuradio-noaa_static STATIC ${noaa_sources}) - - if(NOT WIN32) - set_target_properties(gnuradio-noaa_static - PROPERTIES OUTPUT_NAME gnuradio-noaa) - endif(NOT WIN32) - - install(TARGETS gnuradio-noaa_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "noaa_devel" # .lib file - ) -endif(ENABLE_STATIC_LIBS) diff --git a/gr-noaa/lib/gnuradio-noaa.rc.in b/gr-noaa/lib/gnuradio-noaa.rc.in deleted file mode 100644 index 2f19f110b7..0000000000 --- a/gr-noaa/lib/gnuradio-noaa.rc.in +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2013 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 <afxres.h> - -VS_VERSION_INFO VERSIONINFO - FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - FILEFLAGSMASK 0x3fL -#ifndef NDEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_DRV_INSTALLABLE - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "gnuradio-noaa" - VALUE "FileVersion", "@VERSION@" - VALUE "InternalName", "gnuradio-noaa.dll" - VALUE "LegalCopyright", "Licensed under GPLv3 or any later version" - VALUE "OriginalFilename", "gnuradio-noaa.dll" - VALUE "ProductName", "gnuradio-noaa" - VALUE "ProductVersion", "@VERSION@" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END - END diff --git a/gr-noaa/lib/hrpt_decoder_impl.cc b/gr-noaa/lib/hrpt_decoder_impl.cc deleted file mode 100644 index dc7b8f0ec2..0000000000 --- a/gr-noaa/lib/hrpt_decoder_impl.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_decoder_impl.h" -#include <gnuradio/noaa/hrpt.h> -#include <gnuradio/io_signature.h> -#include <cstdio> - -namespace gr { - namespace noaa { - - static const char *hrpt_ids[] = { - "000000", - "NOAA11", - "000002", - "NOAA16", - "000004", - "000005", - "000006", - "NOAA15", - "000008", - "NOAA12", - "000010", - "NOAA17", - "000012", - "NOAA18", - "000014", - "NOAA19" - }; - - hrpt_decoder::sptr - hrpt_decoder::make(bool verbose, bool output_files) - { - return gnuradio::get_initial_sptr - (new hrpt_decoder_impl(verbose, output_files)); - } - - hrpt_decoder_impl::hrpt_decoder_impl(bool verbose, bool output_files) - : sync_block("noaa_hrpt_decoder", - io_signature::make(1, 1, sizeof(short)), - io_signature::make(0, 0, 0)), - d_verbose(verbose), - d_output_files(output_files), - d_word_num(0), - d_frames_seen(0), - d_current_mfnum(0), - d_expected_mfnum(0), - d_seq_errs(0), - d_address(0), - d_day_of_year(0), - d_milliseconds(0), - d_last_time(0) - { - // Start of capture processing here - } - - hrpt_decoder_impl::~hrpt_decoder_impl() - { - // End of capture processing here - - if(d_verbose) { - fprintf(stderr, "Frames seen: %10i\n", d_frames_seen); - fprintf(stderr, "Sequence errors: %10i\n", d_seq_errs); - } - } - - int - hrpt_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned short *in = (const unsigned short*)input_items[0]; - - int i = 0; - while(i < noutput_items) { - d_current_word = in[i++] & 0x3FF; - d_word_num++; - - // Per HRPT word processing here - - switch(d_word_num) { - case 7: - process_mfnum(); - process_address(); - break; - - case 9: - process_day_of_year(); - break; - - case 10: - process_milli1(); - break; - - case 11: - process_milli2(); - break; - - case 12: - process_milli3(); - break; - - default: - break; - } - - if(d_word_num == HRPT_MINOR_FRAME_WORDS) { - // End of minor frame processing here - d_frames_seen++; - d_word_num = 0; - fprintf(stderr, "\n"); - } - } - - return i; - } - - void - hrpt_decoder_impl::process_mfnum() - { - d_current_mfnum = (d_current_word & 0x180) >> 7; - - if(d_verbose) - fprintf(stderr, "MF:"); - - if(d_current_mfnum != d_expected_mfnum && d_frames_seen > 0) { - d_seq_errs++; - - if(d_verbose) - fprintf(stderr, "*"); - } - else - if(d_verbose) - fprintf(stderr, " "); - - if(d_verbose) - fprintf(stderr, "%i ", d_current_mfnum); - d_expected_mfnum = (d_current_mfnum == 3) ? 1 : d_current_mfnum+1; - } - - void - hrpt_decoder_impl::process_address() - { - d_address = ((d_current_word & 0x078) >> 3) & 0x000F; - - if(d_verbose) - fprintf(stderr, "SA: %s ", hrpt_ids[d_address]); - } - - void - hrpt_decoder_impl::process_day_of_year() - { - d_day_of_year = d_current_word >> 1; - - if(d_verbose) - fprintf(stderr, "DOY: %3i ", d_day_of_year); - } - - void - hrpt_decoder_impl::process_milli1() - { - d_milliseconds = (d_current_word & 0x7F) << 20; - } - - void - hrpt_decoder_impl::process_milli2() - { - d_milliseconds |= (d_current_word << 10); - } - - void - hrpt_decoder_impl::process_milli3() - { - d_milliseconds |= d_current_word; - int delta = d_milliseconds - d_last_time; - d_last_time = d_milliseconds; - - if(d_verbose) - fprintf(stderr, "MS: %8i DT: %8i", d_milliseconds, delta); - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_decoder_impl.h b/gr-noaa/lib/hrpt_decoder_impl.h deleted file mode 100644 index 9a43c98acd..0000000000 --- a/gr-noaa/lib/hrpt_decoder_impl.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_DECODER_IMPL_H -#define INCLUDED_NOAA_HRPT_DECODER_IMPL_H - -#include <gnuradio/noaa/hrpt_decoder.h> - -namespace gr { - namespace noaa { - - class hrpt_decoder_impl : public hrpt_decoder - { - private: - // Configuration - bool d_verbose; - bool d_output_files; - - // Frame-level state - unsigned short d_current_word; - unsigned int d_word_num; - int d_frames_seen; - - // Minor frame number - int d_current_mfnum; - int d_expected_mfnum; - int d_seq_errs; - - // Spacecraft address - int d_address; - - // Minor frame timestamp - int d_day_of_year; - int d_milliseconds; - int d_last_time; - - void process_mfnum(); - void process_address(); - void process_day_of_year(); - void process_milli1(); - void process_milli2(); - void process_milli3(); - - public: - hrpt_decoder_impl(bool verbose, bool output_files); - ~hrpt_decoder_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DECODER_IMPL_H */ diff --git a/gr-noaa/lib/hrpt_deframer_impl.cc b/gr-noaa/lib/hrpt_deframer_impl.cc deleted file mode 100644 index 65bff09adb..0000000000 --- a/gr-noaa/lib/hrpt_deframer_impl.cc +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_deframer_impl.h" -#include <gnuradio/io_signature.h> -#include <gnuradio/noaa/hrpt.h> -#include <cstring> -#include <cstdio> - -namespace gr { - namespace noaa { - -#define ST_IDLE 0 -#define ST_SYNCED 1 - - hrpt_deframer::sptr - hrpt_deframer::make() - { - return gnuradio::get_initial_sptr - (new hrpt_deframer_impl()); - } - - hrpt_deframer_impl::hrpt_deframer_impl() - : block("noaa_hrpt_deframer", - io_signature::make(1, 1, sizeof(char)), - io_signature::make(1, 1, sizeof(short))) - { - set_output_multiple(6); // room for writing full sync when received - d_mid_bit = true; - d_last_bit = 0; - enter_idle(); - } - - hrpt_deframer_impl::~hrpt_deframer_impl() - { - } - - void - hrpt_deframer_impl::enter_idle() - { - d_state = ST_IDLE; - } - - void - hrpt_deframer_impl::enter_synced() - { - d_state = ST_SYNCED; - d_bit_count = HRPT_BITS_PER_WORD; - d_word_count = HRPT_MINOR_FRAME_WORDS-HRPT_SYNC_WORDS; - d_word = 0; - } - - int - hrpt_deframer_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - int ninputs = ninput_items[0]; - const char *in = (const char *)input_items[0]; - unsigned short *out = (unsigned short *)output_items[0]; - - int i = 0, j = 0; - while(i < ninputs && j < noutput_items) { - char bit = in[i++]; - char diff = bit^d_last_bit; - d_last_bit = bit; - - // Wait for transition if not synced, otherwise, alternate bits - if(d_mid_bit && (diff | (d_state == ST_SYNCED))) { - switch(d_state) { - case ST_IDLE: - d_shifter = (d_shifter << 1) | bit; // MSB transmitted first - - if((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) { - out[j++] = HRPT_SYNC1; - out[j++] = HRPT_SYNC2; - out[j++] = HRPT_SYNC3; - out[j++] = HRPT_SYNC4; - out[j++] = HRPT_SYNC5; - out[j++] = HRPT_SYNC6; - enter_synced(); - } - break; - - case ST_SYNCED: - d_word = (d_word << 1) | bit; // MSB transmitted first - if(--d_bit_count == 0) { - out[j++] = d_word; - d_word = 0; - d_bit_count = HRPT_BITS_PER_WORD; - if(--d_word_count == 0) { - enter_idle(); - } - } - break; - - default: - throw std::runtime_error("hrpt_deframer_impl: bad state\n"); - } - - d_mid_bit = false; - } - else { - d_mid_bit = true; - } - } - - consume_each(i); - return j; - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_deframer_impl.h b/gr-noaa/lib/hrpt_deframer_impl.h deleted file mode 100644 index d654f9f606..0000000000 --- a/gr-noaa/lib/hrpt_deframer_impl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_DEFRAMER_IMPL_H -#define INCLUDED_NOAA_HRPT_DEFRAMER_IMPL_H - -#include <gnuradio/noaa/hrpt_deframer.h> - -namespace gr { - namespace noaa { - - class hrpt_deframer_impl : public hrpt_deframer - { - private: - unsigned int d_state; - bool d_mid_bit; - unsigned char d_last_bit; - unsigned int d_bit_count; - unsigned int d_word_count; - unsigned long long d_shifter; // 60 bit sync word - unsigned short d_word; // 10 bit HRPT word - - void enter_idle(); - void enter_synced(); - - public: - hrpt_deframer_impl(); - ~hrpt_deframer_impl(); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DEFRAMER_IMPL_H */ diff --git a/gr-noaa/lib/hrpt_pll_cf_impl.cc b/gr-noaa/lib/hrpt_pll_cf_impl.cc deleted file mode 100644 index 26376be351..0000000000 --- a/gr-noaa/lib/hrpt_pll_cf_impl.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_pll_cf_impl.h" -#include <gnuradio/io_signature.h> -#include <gnuradio/math.h> -#include <gnuradio/sincos.h> - -namespace gr { - namespace noaa { - -#define M_TWOPI (2*M_PI) - - float - phase_wrap(float phase) - { - while (phase < -M_PI) - phase += M_TWOPI; - while (phase > M_PI) - phase -= M_TWOPI; - - return phase; - } - - hrpt_pll_cf::sptr - hrpt_pll_cf::make(float alpha, float beta, float max_offset) - { - return gnuradio::get_initial_sptr - (new hrpt_pll_cf_impl(alpha, beta, max_offset)); - } - - hrpt_pll_cf_impl::hrpt_pll_cf_impl(float alpha, float beta, float max_offset) - : sync_block("noaa_hrpt_pll_cf", - io_signature::make(1, 1, sizeof(gr_complex)), - io_signature::make(1, 1, sizeof(float))), - d_alpha(alpha), d_beta(beta), d_max_offset(max_offset), - d_phase(0.0), d_freq(0.0) - { - } - - hrpt_pll_cf_impl::~hrpt_pll_cf_impl() - { - } - - int - hrpt_pll_cf_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *)input_items[0]; - float *out = (float *)output_items[0]; - - for(int i = 0; i < noutput_items; i++) { - - // Generate and mix out carrier - float re, im; - gr::sincosf(d_phase, &im, &re); - out[i] = (in[i]*gr_complex(re, -im)).imag(); - - // Adjust PLL phase/frequency - float error = phase_wrap(gr::fast_atan2f(in[i].imag(), in[i].real()) - d_phase); - d_freq = gr::branchless_clip(d_freq + error*d_beta, d_max_offset); - d_phase = phase_wrap(d_phase + error*d_alpha + d_freq); - } - - return noutput_items; - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_pll_cf_impl.h b/gr-noaa/lib/hrpt_pll_cf_impl.h deleted file mode 100644 index 40b0a21459..0000000000 --- a/gr-noaa/lib/hrpt_pll_cf_impl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_NOAA_HRPT_PLL_CF_IMPL_H -#define INCLUDED_NOAA_HRPT_PLL_CF_IMPL_H - -#include <gnuradio/noaa/hrpt_pll_cf.h> - -namespace gr { - namespace noaa { - - class hrpt_pll_cf_impl : public hrpt_pll_cf - { - private: - float d_alpha; // 1st order loop constant - float d_beta; // 2nd order loop constant - float d_max_offset; // Maximum frequency offset, radians/sample - float d_phase; // Instantaneous carrier phase - float d_freq; // Instantaneous carrier frequency, radians/sample - - public: - hrpt_pll_cf_impl(float alpha, float beta, float max_offset); - ~hrpt_pll_cf_impl(); - - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void set_alpha(float alpha) { d_alpha = alpha; } - void set_beta(float beta) { d_beta = beta; } - void set_max_offset(float max_offset) { d_max_offset = max_offset; } - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_PLL_CF_IMPL_H */ diff --git a/gr-noaa/oct/frames-to-png.sh b/gr-noaa/oct/frames-to-png.sh deleted file mode 100755 index cb3e3fb7d5..0000000000 --- a/gr-noaa/oct/frames-to-png.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -octave --eval frames_to_ppm - -convert chan1.ppm chan1.png && rm chan1.ppm -convert chan2.ppm chan2.png && rm chan2.ppm -convert chan3.ppm chan3.png && rm chan3.ppm -convert chan4.ppm chan4.png && rm chan4.ppm -convert chan5.ppm chan5.png && rm chan5.ppm diff --git a/gr-noaa/oct/frames_to_ppm.m b/gr-noaa/oct/frames_to_ppm.m deleted file mode 100644 index 099f96f2b4..0000000000 --- a/gr-noaa/oct/frames_to_ppm.m +++ /dev/null @@ -1,85 +0,0 @@ -% -*- octave -*- -% -% Copyright 2009 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. -% - -% Extract AVHRR images from HRPT frames.dat -clear - -fid = fopen('frames.hrpt'); -dat = fread(fid, 'uint16'); - -frame_len = 11090; - -len = floor(length(dat) / frame_len); - -chan1 = zeros(len, 2048); - -start = 751; -stop = 10986; - -for line = 1:len - chan1(line, 1:2048) = dat(start:5:stop)'; - start = start + frame_len; - stop = stop + frame_len; -end - -start = 752; -stop = 10987; - -for line = 1:len - chan2(line, 1:2048) = dat(start:5:stop)'; -start = start + frame_len; -stop = stop + frame_len; -end - -start = 753; -stop = 10988; - -for line = 1:len - chan3(line, 1:2048) = dat(start:5:stop)'; - start = start + frame_len; - stop = stop + frame_len; -end - -start = 754; -stop = 10989; - -for line = 1:len - chan4(line, 1:2048) = dat(start:5:stop)'; -start = start + frame_len; -stop = stop + frame_len; -end - -start = 755; -stop = 10990; - -for line = 1:len - chan5(line, 1:2048) = dat(start:5:stop)'; - start = start + frame_len; - stop = stop + frame_len; -end - -colormap(gray) -saveimage("chan1.ppm", chan1/4, 'ppm') -saveimage("chan2.ppm", chan2/4, 'ppm') -saveimage("chan3.ppm", chan3/4, 'ppm') -saveimage("chan4.ppm", chan4/4, 'ppm') -saveimage("chan5.ppm", chan5/4, 'ppm') diff --git a/gr-noaa/python/noaa/CMakeLists.txt b/gr-noaa/python/noaa/CMakeLists.txt deleted file mode 100644 index 7b7ec4783c..0000000000 --- a/gr-noaa/python/noaa/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup python install -######################################################################## -include(GrPython) - -GR_PYTHON_INSTALL( - FILES - __init__.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio/noaa - COMPONENT "noaa_python" -) - -######################################################################## -# Handle the unit tests -######################################################################## -if(ENABLE_TESTING) - - set(GR_TEST_TARGET_DEPS "") - set(GR_TEST_LIBRARY_DIRS "") - set(GR_TEST_PYTHON_DIRS - ${CMAKE_BINARY_DIR}/gnuradio-runtime/python - ) - - include(GrTest) - file(GLOB py_qa_test_files "qa_*.py") - foreach(py_qa_test_file ${py_qa_test_files}) - get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) - endforeach(py_qa_test_file) -endif(ENABLE_TESTING) diff --git a/gr-noaa/python/noaa/__init__.py b/gr-noaa/python/noaa/__init__.py deleted file mode 100644 index 876d5100ba..0000000000 --- a/gr-noaa/python/noaa/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -''' -Blocks and utilities for NOAA app. -''' - -# The presence of this file turns this directory into a Python package - -import os - -try: - from noaa_swig import * -except ImportError: - dirname, filename = os.path.split(os.path.abspath(__file__)) - __path__.append(os.path.join(dirname, "..", "..", "swig")) - from noaa_swig import * diff --git a/gr-noaa/python/noaa/qa_noaa.py b/gr-noaa/python/noaa/qa_noaa.py deleted file mode 100755 index 9b00f6a269..0000000000 --- a/gr-noaa/python/noaa/qa_noaa.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest, noaa - -class test_noaa(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block() - - def tearDown(self): - self.tb = None - - def test_000_nop(self): - """ - Just see if we can import the module... - """ - pass - -if __name__ == '__main__': - gr_unittest.run(test_noaa, "test_noaa.xml") diff --git a/gr-noaa/swig/CMakeLists.txt b/gr-noaa/swig/CMakeLists.txt deleted file mode 100644 index 8d39b678f8..0000000000 --- a/gr-noaa/swig/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2011,2012 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -######################################################################## -# Setup swig generation -######################################################################## -include(GrPython) -include(GrSwig) - -set(GR_SWIG_INCLUDE_DIRS - ${GR_NOAA_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_SWIG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -if(ENABLE_GR_CTRLPORT) - list(APPEND GR_SWIG_FLAGS "-DGR_CTRLPORT") -endif(ENABLE_GR_CTRLPORT) - -set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/noaa_swig_doc.i) -set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/noaa) -set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc) - -set(GR_SWIG_LIBRARIES gnuradio-noaa) - -GR_SWIG_MAKE(noaa_swig noaa_swig.i) - -GR_SWIG_INSTALL( - TARGETS noaa_swig - DESTINATION ${GR_PYTHON_DIR}/gnuradio/noaa - COMPONENT "noaa_python" -) - -install( - FILES - noaa_swig.i - ${CMAKE_CURRENT_BINARY_DIR}/noaa_swig_doc.i - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig - COMPONENT "noaa_swig" -) diff --git a/gr-noaa/swig/noaa_swig.i b/gr-noaa/swig/noaa_swig.i deleted file mode 100644 index bbaa57fbbb..0000000000 --- a/gr-noaa/swig/noaa_swig.i +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#define NOAA_API - -%include "gnuradio.i" - -//load generated python docstrings -%include "noaa_swig_doc.i" - -%{ -#include "gnuradio/noaa/hrpt_decoder.h" -#include "gnuradio/noaa/hrpt_deframer.h" -#include "gnuradio/noaa/hrpt_pll_cf.h" -%} - -%include "gnuradio/noaa/hrpt_decoder.h" -%include "gnuradio/noaa/hrpt_deframer.h" -%include "gnuradio/noaa/hrpt_pll_cf.h" - -GR_SWIG_BLOCK_MAGIC2(noaa, hrpt_decoder); -GR_SWIG_BLOCK_MAGIC2(noaa, hrpt_deframer); -GR_SWIG_BLOCK_MAGIC2(noaa, hrpt_pll_cf); diff --git a/gr-pager/grc/pager_flex_deinterleave.xml b/gr-pager/grc/pager_flex_deinterleave.xml index 14e5782da1..a006023212 100644 --- a/gr-pager/grc/pager_flex_deinterleave.xml +++ b/gr-pager/grc/pager_flex_deinterleave.xml @@ -7,7 +7,7 @@ <block> <name>FLEX Deinterleave</name> <key>pager_flex_deinterleave</key> - <category>Pager</category> + <category>[Core]/Pager</category> <import>from gnuradio import pager</import> <make>pager.flex_deinterleave()</make> diff --git a/gr-pager/grc/pager_flex_sync.xml b/gr-pager/grc/pager_flex_sync.xml index ec22321aa5..d37a4fb7a9 100644 --- a/gr-pager/grc/pager_flex_sync.xml +++ b/gr-pager/grc/pager_flex_sync.xml @@ -7,7 +7,7 @@ <block> <name>FLEX Synchronizer</name> <key>pager_flex_sync</key> - <category>Pager</category> + <category>[Core]/Pager</category> <import>from gnuradio import pager</import> <make>pager.flex_sync()</make> diff --git a/gr-pager/grc/pager_slicer_fb.xml b/gr-pager/grc/pager_slicer_fb.xml index 25642cb48f..f3e95e0748 100644 --- a/gr-pager/grc/pager_slicer_fb.xml +++ b/gr-pager/grc/pager_slicer_fb.xml @@ -7,7 +7,7 @@ <block> <name>4-Level Slicer/DCR</name> <key>pager_slicer_fb</key> - <category>Pager</category> + <category>[Core]/Pager</category> <import>from gnuradio import pager</import> <make>pager.slicer_fb($alpha)</make> diff --git a/gr-qtgui/grc/qtgui_block_tree.xml b/gr-qtgui/grc/qtgui_block_tree.xml index 300c7a786d..33fb12a7b5 100644 --- a/gr-qtgui/grc/qtgui_block_tree.xml +++ b/gr-qtgui/grc/qtgui_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Instrumentation</name> <cat> diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index 276c3e4856..b1ee580398 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -160,6 +160,11 @@ list(APPEND qtgui_libs ${FFTW3F_LIBRARIES} ${LOG4CPP_LIBRARIES} ) +if (WIN32) + list(APPEND qtgui_libs + dwrite + ) +endif(WIN32) include(GrPython) if(ENABLE_PYTHON) diff --git a/gr-trellis/grc/trellis_encoder_xx.xml b/gr-trellis/grc/trellis_encoder_xx.xml index d59903ca2d..ab7d5226e9 100644 --- a/gr-trellis/grc/trellis_encoder_xx.xml +++ b/gr-trellis/grc/trellis_encoder_xx.xml @@ -8,7 +8,7 @@ <block> <name>Trellis Encoder</name> <key>trellis_encoder_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make> trellis.encoder_$(type)(trellis.fsm($fsm_args), $init_state, $blocklength) if $blockwise else trellis.encoder_$(type)(trellis.fsm($fsm_args), $init_state) </make> <callback>set_FSM(trellis.fsm($fsm_args))</callback> diff --git a/gr-trellis/grc/trellis_metrics_x.xml b/gr-trellis/grc/trellis_metrics_x.xml index 8bb978f275..15e7338098 100644 --- a/gr-trellis/grc/trellis_metrics_x.xml +++ b/gr-trellis/grc/trellis_metrics_x.xml @@ -9,7 +9,7 @@ <block> <name>Trellis Metrics</name> <key>trellis_metrics_x</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis, digital</import> <make>trellis.metrics_$(type)($card, $dim, $table, $metric_type)</make> <callback>set_O($card)</callback> diff --git a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml index ff727fbf8b..7bb38db893 100644 --- a/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml +++ b/gr-trellis/grc/trellis_pccc_decoder_combined_xx.xml @@ -9,7 +9,7 @@ <block> <name>PCCC Decoder Combo</name> <key>trellis_pccc_decoder_combined_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis, digital</import> <make>trellis.pccc_decoder_combined_$(type)$(out_type)( trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, diff --git a/gr-trellis/grc/trellis_pccc_decoder_x.xml b/gr-trellis/grc/trellis_pccc_decoder_x.xml index 81f4282728..08d1f526af 100644 --- a/gr-trellis/grc/trellis_pccc_decoder_x.xml +++ b/gr-trellis/grc/trellis_pccc_decoder_x.xml @@ -9,7 +9,7 @@ <block> <name>PCCC Decoder</name> <key>trellis_pccc_decoder_x</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.pccc_decoder_$(out_type)( trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, diff --git a/gr-trellis/grc/trellis_pccc_encoder_xx.xml b/gr-trellis/grc/trellis_pccc_encoder_xx.xml index faaa0c1233..85348e6e9b 100644 --- a/gr-trellis/grc/trellis_pccc_encoder_xx.xml +++ b/gr-trellis/grc/trellis_pccc_encoder_xx.xml @@ -8,7 +8,7 @@ <block> <name>PCCC Encoder</name> <key>trellis_pccc_encoder_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.pccc_encoder_$(type)(trellis.fsm($o_fsm_args), $o_init_state, trellis.fsm($i_fsm_args), $i_init_state, trellis.interleaver($interleaver_args), $bl)</make> <param> diff --git a/gr-trellis/grc/trellis_permutation.xml b/gr-trellis/grc/trellis_permutation.xml index 0f118e889f..99eb2d291c 100644 --- a/gr-trellis/grc/trellis_permutation.xml +++ b/gr-trellis/grc/trellis_permutation.xml @@ -9,7 +9,7 @@ <block> <name>Trellis Permutation</name> <key>trellis_permutation</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.permutation($interleaver_size, $table, $syms_per_block, $type.size*$vlen)</make> <callback>set_K($interleaver_size)</callback> diff --git a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml index 4947376d94..79be0b8b5d 100644 --- a/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml +++ b/gr-trellis/grc/trellis_sccc_decoder_combined_xx.xml @@ -9,7 +9,7 @@ <block> <name>SCCC Decoder Combo</name> <key>trellis_sccc_decoder_combined_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis, digital</import> <make>trellis.sccc_decoder_combined_$(type)$(out_type)( trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, diff --git a/gr-trellis/grc/trellis_sccc_decoder_x.xml b/gr-trellis/grc/trellis_sccc_decoder_x.xml index 38348cbb51..584ff0b0af 100644 --- a/gr-trellis/grc/trellis_sccc_decoder_x.xml +++ b/gr-trellis/grc/trellis_sccc_decoder_x.xml @@ -9,7 +9,7 @@ <block> <name>SCCC Decoder</name> <key>trellis_sccc_decoder_x</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.sccc_decoder_$(out_type)( trellis.fsm($o_fsm_args), $o_init_state, $o_final_state, diff --git a/gr-trellis/grc/trellis_sccc_encoder_xx.xml b/gr-trellis/grc/trellis_sccc_encoder_xx.xml index a87db79ac2..7b4ab30c75 100644 --- a/gr-trellis/grc/trellis_sccc_encoder_xx.xml +++ b/gr-trellis/grc/trellis_sccc_encoder_xx.xml @@ -8,7 +8,7 @@ <block> <name>SCCC Encoder</name> <key>trellis_sccc_encoder_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.sccc_encoder_$(type)(trellis.fsm($o_fsm_args), $o_init_state, trellis.fsm($i_fsm_args), $i_init_state, trellis.interleaver($interleaver_args), $bl)</make> <param> diff --git a/gr-trellis/grc/trellis_siso_combined_f.xml b/gr-trellis/grc/trellis_siso_combined_f.xml index 542bba6d8b..f8ec9c2d21 100644 --- a/gr-trellis/grc/trellis_siso_combined_f.xml +++ b/gr-trellis/grc/trellis_siso_combined_f.xml @@ -9,7 +9,7 @@ <block> <name>SISO Combo</name> <key>trellis_siso_combined_f</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.siso_combined_f(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $a_post_in, $a_post_out, $siso_type, $dim, $table, $metric_type)</make> <callback>set_FSM(trellis.fsm($fsm_args))</callback> diff --git a/gr-trellis/grc/trellis_siso_f.xml b/gr-trellis/grc/trellis_siso_f.xml index 30849d2723..e121643e3f 100644 --- a/gr-trellis/grc/trellis_siso_f.xml +++ b/gr-trellis/grc/trellis_siso_f.xml @@ -9,7 +9,7 @@ <block> <name>SISO</name> <key>trellis_siso_f</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.siso_f(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $a_post_in, $a_post_out, $siso_type)</make> <callback>set_FSM(trellis.fsm($fsm_args))</callback> diff --git a/gr-trellis/grc/trellis_viterbi_combined_xx.xml b/gr-trellis/grc/trellis_viterbi_combined_xx.xml index 9c755dc524..a52e5ed2b5 100644 --- a/gr-trellis/grc/trellis_viterbi_combined_xx.xml +++ b/gr-trellis/grc/trellis_viterbi_combined_xx.xml @@ -9,7 +9,7 @@ <block> <name>Viterbi Combo</name> <key>trellis_viterbi_combined_xx</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis, digital</import> <make>trellis.viterbi_combined_$(type)$(out_type)(trellis.fsm($fsm_args), $block_size, $init_state, $final_state, $dim, $table, $metric_type)</make> <callback>set_FSM(trellis.fsm($fsm_args))</callback> diff --git a/gr-trellis/grc/trellis_viterbi_x.xml b/gr-trellis/grc/trellis_viterbi_x.xml index 9083061e6b..21611ee51d 100644 --- a/gr-trellis/grc/trellis_viterbi_x.xml +++ b/gr-trellis/grc/trellis_viterbi_x.xml @@ -9,7 +9,7 @@ <block> <name>Viterbi</name> <key>trellis_viterbi_x</key> - <category>Trellis Coding</category> + <category>[Core]/Trellis Coding</category> <import>from gnuradio import trellis</import> <make>trellis.viterbi_$(type)(trellis.fsm($fsm_args), $block_size, $init_state, $final_state)</make> <callback>set_FSM(trellis.fsm($fsm_args))</callback> diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index fd2e77707e..e99de0d7d0 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -82,6 +82,12 @@ self.\$(id).set_antenna(\$ant$(n), $n) self.\$(id).set_bandwidth(\$bw$(n), $n) \#end if #if $sourk == 'source' + \#if \$lo_export$(n)() and not \$hide_lo_controls() +self.\$(id).set_lo_export_enabled(\$lo_export$(n), uhd.ALL_LOS, $n) + \#end if + \#if \$lo_source$(n)() and not \$hide_lo_controls() +self.\$(id).set_lo_source(\$lo_source$(n), uhd.ALL_LOS, $n) + \#end if \#if \$dc_offs_enb$(n)() self.\$(id).set_auto_dc_offset(\$dc_offs_enb$(n), $n) \#end if @@ -101,6 +107,14 @@ self.\$(id).set_normalized_gain(\$gain$(n), $n) self.\$(id).set_gain(\$gain$(n), $n) \#end if </callback> + <callback>\#if not \$hide_lo_controls() +set_lo_source(\$lo_source$(n), uhd.ALL_LOS, $n) +\#end if + </callback> + <callback>\#if not \$hide_lo_controls() +set_lo_export_enabled(\$lo_export$(n), uhd.ALL_LOS, $n) +\#end if + </callback> <callback>set_antenna(\$ant$(n), $n)</callback> <callback>set_bandwidth(\$bw$(n), $n)</callback> #end for @@ -524,6 +538,62 @@ PARAMS_TMPL = """ <param> </param> #if $sourk == 'source' <param> + <name>Ch$(n): LO Source</name> + <key>lo_source$(n)</key> + <value>internal</value> + <type>string</type> + <hide> + \#if not \$nchan() > $n + all + \#elif \$hide_lo_controls() + all + \#else + none + \#end if + </hide> + <option> + <name>Internal</name> + <key>internal</key> + </option> + <option> + <name>External</name> + <key>external</key> + </option> + <option> + <name>Companion</name> + <key>companion</key> + </option> + <tab>RF Options</tab> + </param> +#end if +#if $sourk == 'source' + <param> + <name>Ch$(n): LO Export</name> + <key>lo_export$(n)</key> + <value>False</value> + <type>bool</type> + <hide> + \#if not \$nchan() > $n + all + \#elif \$hide_lo_controls() + all + \#else + none + \#end if + </hide> + <option> + <name>True</name> + <key>True</key> + </option> + <option> + <name>False</name> + <key>False</key> + </option> + <tab>RF Options</tab> + </param> +#end if +#if $sourk == 'source' + <param> <name>Ch$(n): Enable DC Offset Correction</name> <key>dc_offs_enb$(n)</key> <value>""</value> @@ -573,6 +643,25 @@ SHOW_CMD_PORT_PARAM = """ </param> """ +SHOW_LO_CONTROLS_PARAM = """ + <param> + <name>Show LO Controls</name> + <key>hide_lo_controls</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option> + <name>Yes</name> + <key>False</key> + </option> + <option> + <name>No</name> + <key>True</key> + </option> + <tab>Advanced</tab> + </param> +""" + TSBTAG_PARAM = """ <param> <name>TSB tag name</name> <key>len_tag_name</key> @@ -605,7 +694,8 @@ if __name__ == '__main__': else: raise Exception, 'is %s a source or sink?'%file params = ''.join([parse_tmpl(PARAMS_TMPL, n=n, sourk=sourk) for n in range(max_num_channels)]) - params += SHOW_CMD_PORT_PARAM + params += SHOW_CMD_PORT_PARAM + params += SHOW_LO_CONTROLS_PARAM if sourk == 'sink': params += TSBTAG_PARAM lentag_arg = TSBTAG_ARG diff --git a/gr-uhd/grc/uhd_block_tree.xml b/gr-uhd/grc/uhd_block_tree.xml index 5d3b493936..c598645526 100644 --- a/gr-uhd/grc/uhd_block_tree.xml +++ b/gr-uhd/grc/uhd_block_tree.xml @@ -5,7 +5,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <!-- Blank for Root Name --> <cat> <name>UHD</name> <block>uhd_usrp_source</block> diff --git a/gr-uhd/include/gnuradio/uhd/usrp_source.h b/gr-uhd/include/gnuradio/uhd/usrp_source.h index 19201c031c..a0022b3876 100644 --- a/gr-uhd/include/gnuradio/uhd/usrp_source.h +++ b/gr-uhd/include/gnuradio/uhd/usrp_source.h @@ -140,6 +140,83 @@ namespace gr { */ virtual ::uhd::dict<std::string, std::string> get_usrp_info(size_t chan = 0) = 0; + + /*! + * Get a list of possible LO stage names + * \param chan the channel index 0 to N-1 + * \return a vector of strings for possible LO names + */ + virtual std::vector<std::string> get_lo_names(size_t chan = 0) = 0; + + /*! + * Set the LO source for the usrp device. + * For usrps that support selectable LOs, this function + * allows switching between them. + * Typical options for source: internal, external. + * \param src a string representing the LO source + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 + */ + virtual void set_lo_source(const std::string &src, const std::string &name, size_t chan = 0) = 0; + + /*! + * Get the currently set LO source. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return the configured LO source + */ + virtual const std::string get_lo_source(const std::string &name, size_t chan = 0) = 0; + + /*! + * Get a list of possible LO sources. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return a vector of strings for possible settings + */ + virtual std::vector<std::string> get_lo_sources(const std::string &name, size_t chan = 0) = 0; + + /*! + * Set whether the LO used by the usrp device is exported + * For usrps that support exportable LOs, this function + * configures if the LO used by chan is exported or not. + * \param enabled if true then export the LO + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 for the source channel + */ + virtual void set_lo_export_enabled(bool enabled, const std::string &name, size_t chan = 0) = 0; + + /*! + * Returns true if the currently selected LO is being exported. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + */ + virtual bool get_lo_export_enabled(const std::string &name, size_t chan = 0) = 0; + + /*! + * Set the RX LO frequency (Advanced). + * \param freq the frequency to set the LO to + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 + * \return a coerced LO frequency + */ + virtual double set_lo_freq(double freq, const std::string &name, size_t chan = 0) = 0; + + /*! + * Get the current RX LO frequency (Advanced). + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return the configured LO frequency + */ + virtual double get_lo_freq(const std::string &name, size_t chan = 0) = 0; + + /*! + * Get the LO frequency range of the RX LO. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return a frequency range object + */ + virtual ::uhd::freq_range_t get_lo_freq_range(const std::string &name, size_t chan = 0) = 0; + /*! * Enable/disable the automatic DC offset correction. * The automatic correction subtracts out the long-run average. diff --git a/gr-uhd/lib/usrp_block_impl.h b/gr-uhd/lib/usrp_block_impl.h index cb07fb356d..a1bbf97826 100644 --- a/gr-uhd/lib/usrp_block_impl.h +++ b/gr-uhd/lib/usrp_block_impl.h @@ -40,6 +40,14 @@ namespace gr { namespace uhd { + static const size_t ALL_MBOARDS = ::uhd::usrp::multi_usrp::ALL_MBOARDS; + static const size_t ALL_CHANS = ::uhd::usrp::multi_usrp::ALL_CHANS; + static const std::string ALL_GAINS = ::uhd::usrp::multi_usrp::ALL_GAINS; +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + static const std::string ALL_LOS = ::uhd::usrp::multi_usrp::ALL_LOS; +#else + static const std::string ALL_LOS; +#endif class usrp_block_impl : virtual public usrp_block { public: diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc index 666f09cbf5..d8f98fdd80 100644 --- a/gr-uhd/lib/usrp_sink_impl.cc +++ b/gr-uhd/lib/usrp_sink_impl.cc @@ -29,8 +29,6 @@ namespace gr { namespace uhd { - static const size_t ALL_CHANS = ::uhd::usrp::multi_usrp::ALL_CHANS; - usrp_sink::sptr usrp_sink::make(const ::uhd::device_addr_t &device_addr, const ::uhd::io_type_t &io_type, @@ -64,9 +62,9 @@ namespace gr { usrp_sink_impl::usrp_sink_impl(const ::uhd::device_addr_t &device_addr, const ::uhd::stream_args_t &stream_args, const std::string &length_tag_name) - : usrp_block("gr uhd usrp sink", - args_to_io_sig(stream_args), - io_signature::make(0, 0, 0)), + : usrp_block("usrp_sink", + args_to_io_sig(stream_args), + io_signature::make(0, 0, 0)), usrp_block_impl(device_addr, stream_args, length_tag_name), _length_tag_key(length_tag_name.empty() ? pmt::PMT_NIL : pmt::string_to_symbol(length_tag_name)), _nitems_to_send(0) diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc index 0a09ed34b3..ed0b891770 100644 --- a/gr-uhd/lib/usrp_source_impl.cc +++ b/gr-uhd/lib/usrp_source_impl.cc @@ -66,9 +66,9 @@ namespace gr { usrp_source_impl::usrp_source_impl(const ::uhd::device_addr_t &device_addr, const ::uhd::stream_args_t &stream_args, const bool issue_stream_cmd_on_start): - usrp_block("gr uhd usrp source", - io_signature::make(0, 0, 0), - args_to_io_sig(stream_args)), + usrp_block("usrp_source", + io_signature::make(0, 0, 0), + args_to_io_sig(stream_args)), usrp_block_impl(device_addr, stream_args, ""), _tag_now(false), _issue_stream_cmd_on_start(issue_stream_cmd_on_start) @@ -281,6 +281,104 @@ namespace gr { return _dev->get_rx_bandwidth_range(chan); } + std::vector<std::string> + usrp_source_impl::get_lo_names(size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_names(chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + const std::string + usrp_source_impl::get_lo_source(const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_source(name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + std::vector<std::string> + usrp_source_impl::get_lo_sources(const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_sources(name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + void + usrp_source_impl::set_lo_source(const std::string &src, const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->set_rx_lo_source(src, name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + bool + usrp_source_impl::get_lo_export_enabled(const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_export_enabled(name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + void + usrp_source_impl::set_lo_export_enabled(bool enabled, const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->set_rx_lo_export_enabled(enabled, name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + ::uhd::freq_range_t + usrp_source_impl::get_lo_freq_range(const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_freq_range(name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + double + usrp_source_impl::get_lo_freq(const std::string &name, size_t chan) + { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->get_rx_lo_freq(name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + + double + usrp_source_impl::set_lo_freq(double freq, const std::string &name, size_t chan) { +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API + chan = _stream_args.channels[chan]; + return _dev->set_rx_lo_freq(freq, name, chan); +#else + throw std::runtime_error("not implemented in this version"); +#endif + } + void usrp_source_impl::set_auto_dc_offset(const bool enable, size_t chan) { diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h index 78a8341a5a..f6225a7e35 100644 --- a/gr-uhd/lib/usrp_source_impl.h +++ b/gr-uhd/lib/usrp_source_impl.h @@ -77,6 +77,12 @@ namespace gr { ::uhd::sensor_value_t get_sensor(const std::string &name, size_t chan); std::vector<std::string> get_sensor_names(size_t chan); ::uhd::usrp::dboard_iface::sptr get_dboard_iface(size_t chan); + std::vector<std::string> get_lo_names(size_t chan); + const std::string get_lo_source(const std::string &name, size_t chan); + std::vector<std::string> get_lo_sources(const std::string &name, size_t chan); + bool get_lo_export_enabled(const std::string &name, size_t chan); + double get_lo_freq(const std::string &name, size_t chan); + ::uhd::freq_range_t get_lo_freq_range(const std::string &name, size_t chan); // Set Commands void set_subdev_spec(const std::string &spec, size_t mboard); @@ -96,6 +102,9 @@ namespace gr { void set_iq_balance(const std::complex<double> &correction, size_t chan); void set_stream_args(const ::uhd::stream_args_t &stream_args); void set_start_time(const ::uhd::time_spec_t &time); + void set_lo_source(const std::string &src, const std::string &name = ALL_LOS, size_t chan = 0); + void set_lo_export_enabled(bool enabled, const std::string &name = ALL_LOS, size_t chan = 0); + double set_lo_freq(double freq, const std::string &name, size_t chan); void issue_stream_cmd(const ::uhd::stream_cmd_t &cmd); void flush(void); diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 108f544da3..b82d0fdae9 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -155,8 +155,20 @@ static uhd::device_addrs_t find_devices_raw(const uhd::device_addr_t &dev_addr = //////////////////////////////////////////////////////////////////////// %{ static const size_t ALL_MBOARDS = uhd::usrp::multi_usrp::ALL_MBOARDS; +static const size_t ALL_CHANS = uhd::usrp::multi_usrp::ALL_CHANS; +static const std::string ALL_GAINS = uhd::usrp::multi_usrp::ALL_GAINS; + +#ifdef UHD_USRP_MULTI_USRP_LO_CONFIG_API +static const std::string ALL_LOS = uhd::usrp::multi_usrp::ALL_LOS; +#else +static const std::string ALL_LOS; +#endif %} + static const size_t ALL_MBOARDS; +static const size_t ALL_CHANS; +static const std::string ALL_GAINS; +static const std::string ALL_LOS; %{ #include <uhd/version.hpp> diff --git a/gr-utils/CMakeLists.txt b/gr-utils/CMakeLists.txt index 7985535aa8..b9d3763e48 100644 --- a/gr-utils/CMakeLists.txt +++ b/gr-utils/CMakeLists.txt @@ -20,14 +20,24 @@ ######################################################################## # Setup dependencies ######################################################################## +include(GrPython) + +GR_PYTHON_CHECK_MODULE("Mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND) ######################################################################## # Register component ######################################################################## include(GrComponent) +if(NOT CMAKE_CROSSCOMPILING) + set(utils_python_deps + MAKO_FOUND + ) +endif(NOT CMAKE_CROSSCOMPILING) + GR_REGISTER_COMPONENT("gr-utils" ENABLE_GR_UTILS ENABLE_GNURADIO_RUNTIME ENABLE_PYTHON + ${utils_python_deps} ) ######################################################################## diff --git a/gr-utils/python/modtool/__init__.py b/gr-utils/python/modtool/__init__.py index 0319b91326..1bc841ecf5 100644 --- a/gr-utils/python/modtool/__init__.py +++ b/gr-utils/python/modtool/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,6 @@ # from cmakefile_editor import CMakeFileEditor -from code_generator import GRMTemplate from grc_xml_generator import GRCXMLGenerator from modtool_base import ModTool, ModToolException, get_class_dict from modtool_add import ModToolAdd diff --git a/gr-utils/python/modtool/code_generator.py b/gr-utils/python/modtool/code_generator.py index 99f91761af..326b2d5986 100644 --- a/gr-utils/python/modtool/code_generator.py +++ b/gr-utils/python/modtool/code_generator.py @@ -1,5 +1,5 @@ # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,39 +20,41 @@ # """ A code generator (needed by ModToolAdd) """ +from mako.template import Template from templates import Templates -import Cheetah.Template from util_functions import str_to_fancyc_comment from util_functions import str_to_python_comment from util_functions import strip_default_values from util_functions import strip_arg_types from util_functions import strip_arg_types_grc -class GRMTemplate(Cheetah.Template.Template): - """ An extended template class """ - def __init__(self, src, searchList): - self.grtypelist = { - 'sync': 'sync_block', - 'sink': 'sync_block', - 'source': 'sync_block', - 'decimator': 'sync_decimator', - 'interpolator': 'sync_interpolator', - 'general': 'block', - 'tagged_stream': 'tagged_stream_block', - 'hier': 'hier_block2', - 'noblock': ''} - searchList['str_to_fancyc_comment'] = str_to_fancyc_comment - searchList['str_to_python_comment'] = str_to_python_comment - searchList['strip_default_values'] = strip_default_values - searchList['strip_arg_types'] = strip_arg_types - searchList['strip_arg_types_grc'] = strip_arg_types_grc - Cheetah.Template.Template.__init__(self, src, searchList=searchList) - self.grblocktype = self.grtypelist[searchList['blocktype']] - if searchList['is_component']: - self.include_dir_prefix = "gnuradio/" + searchList['modname'] - else: - self.include_dir_prefix = searchList['modname'] +GRTYPELIST = { + 'sync': 'sync_block', + 'sink': 'sync_block', + 'source': 'sync_block', + 'decimator': 'sync_decimator', + 'interpolator': 'sync_interpolator', + 'general': 'block', + 'tagged_stream': 'tagged_stream_block', + 'hier': 'hier_block2', + 'noblock': '' +} + +def render_template(tpl_id, **kwargs): + """ Return the parsed and rendered template given by tpl_id """ + # Choose template + tpl = Template(Templates[tpl_id]) + # Set up all variables + kwargs['str_to_fancyc_comment'] = str_to_fancyc_comment + kwargs['str_to_python_comment'] = str_to_python_comment + kwargs['strip_default_values'] = strip_default_values + kwargs['strip_arg_types'] = strip_arg_types + kwargs['strip_arg_types_grc'] = strip_arg_types_grc + kwargs['grblocktype'] = GRTYPELIST[kwargs['blocktype']] + if kwargs['is_component']: + kwargs['include_dir_prefix'] = "gnuradio/" + kwargs['modname'] + else: + kwargs['include_dir_prefix'] = kwargs['modname'] + # Render and return + return tpl.render(**kwargs) -def get_template(tpl_id, **kwargs): - """ Return the template given by tpl_id, parsed through Cheetah """ - return str(GRMTemplate(Templates[tpl_id], searchList=kwargs)) diff --git a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt index 6f32f21833..bde9dc0c0f 100644 --- a/gr-utils/python/modtool/gr-newmod/CMakeLists.txt +++ b/gr-utils/python/modtool/gr-newmod/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011,2012,2014 Free Software Foundation, Inc. +# Copyright 2011,2012,2014,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -40,6 +40,12 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") #make sure our local CMake Modules path comes first list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) +# Set the version information here +set(VERSION_INFO_MAJOR_VERSION 1) +set(VERSION_INFO_API_COMPAT 0) +set(VERSION_INFO_MINOR_VERSION 0) +set(VERSION_INFO_MAINT_VERSION git) + ######################################################################## # Compiler specific setup ######################################################################## @@ -119,6 +125,7 @@ find_package(Doxygen) set(GR_REQUIRED_COMPONENTS RUNTIME) find_package(Gnuradio "3.7.2" REQUIRED) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) +include(GrVersion) if(NOT CPPUNIT_FOUND) message(FATAL_ERROR "CppUnit required to compile howto") diff --git a/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt b/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt index 6192c51f04..10a15b7dd9 100644 --- a/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt +++ b/gr-utils/python/modtool/gr-newmod/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011,2012 Free Software Foundation, Inc. +# Copyright 2011,2012,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -47,11 +47,8 @@ endif(APPLE) ######################################################################## # Install built library files ######################################################################## -install(TARGETS gnuradio-howto - LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file - ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file - RUNTIME DESTINATION bin # .dll file -) +include(GrMiscUtils) +GR_LIBRARY_FOO(gnuradio-howto RUNTIME_COMPONENT "howto_runtime" DEVEL_COMPONENT "howto_devel") ######################################################################## # Build and register unit test @@ -76,3 +73,10 @@ target_link_libraries( ) GR_ADD_TEST(test_howto test-howto) + +######################################################################## +# Print summary +######################################################################## +message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Building for version: ${VERSION} / ${LIBVER}") + diff --git a/gr-utils/python/modtool/grc_xml_generator.py b/gr-utils/python/modtool/grc_xml_generator.py index 7ccd443196..af17ca1822 100644 --- a/gr-utils/python/modtool/grc_xml_generator.py +++ b/gr-utils/python/modtool/grc_xml_generator.py @@ -35,7 +35,7 @@ class GRCXMLGenerator(object): # Can't make a dict 'cause order matters self._header = (('name', blockname.replace('_', ' ').capitalize()), ('key', '%s_%s' % (modname, blockname)), - ('category', modname.upper()), + ('category', '[%s]' % modname.upper()), ('import', 'import %s' % modname), ('make', '%s.%s(%s)' % (modname, blockname, ', '.join(params_list))) ) diff --git a/gr-utils/python/modtool/modtool_add.py b/gr-utils/python/modtool/modtool_add.py index 3627dc6ad1..d560c0878c 100644 --- a/gr-utils/python/modtool/modtool_add.py +++ b/gr-utils/python/modtool/modtool_add.py @@ -1,5 +1,5 @@ # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,9 +28,7 @@ from util_functions import append_re_line_sequence, ask_yes_no from cmakefile_editor import CMakeFileEditor from modtool_base import ModTool, ModToolException from templates import Templates -from code_generator import get_template -import Cheetah.Template - +from code_generator import render_template class ModToolAdd(ModTool): """ Add block to the out-of-tree module. """ @@ -84,9 +82,8 @@ class ModToolAdd(ModTool): if self._info['lang'] is None: while self._info['lang'] not in ['cpp', 'python']: self._info['lang'] = raw_input("Language (python/cpp): ") - - if self._info['lang'] == 'c++': - self._info['lang'] = 'cpp' + if self._info['lang'] == 'c++': + self._info['lang'] = 'cpp' print "Language: %s" % {'cpp': 'C++', 'python': 'Python'}[self._info['lang']] @@ -152,7 +149,7 @@ class ModToolAdd(ModTool): """ Shorthand for writing a substituted template to a file""" path_to_file = os.path.join(path, fname) print "Adding file '%s'..." % path_to_file - open(path_to_file, 'w').write(get_template(tpl, **self._info)) + open(path_to_file, 'w').write(render_template(tpl, **self._info)) self.scm.add_files((path_to_file,)) def run(self): @@ -205,26 +202,6 @@ class ModToolAdd(ModTool): self.scm.mark_files_updated((self._file['qalib'],)) except IOError: print "Can't add C++ QA files." - def _add_qa36(): - " Add C++ QA files for pre-3.7 API (not autotools) " - fname_qa_cc = 'qa_%s.cc' % self._info['fullblockname'] - self._write_tpl('qa_cpp36', 'lib', fname_qa_cc) - if not self._skip_cmakefiles: - open(self._file['cmlib'], 'a').write( - str( - Cheetah.Template.Template( - Templates['qa_cmakeentry36'], - searchList={'basename': os.path.splitext(fname_qa_cc)[0], - 'upperbasename': os.path.splitext(fname_qa_cc)[0].upper(), - 'filename': fname_qa_cc, - 'modname': self._info['modname'] - } - ) - ) - ) - ed = CMakeFileEditor(self._file['cmlib']) - ed.remove_double_newlines() - ed.write() fname_cc = None fname_h = None if self._info['version'] == '37': @@ -245,7 +222,7 @@ class ModToolAdd(ModTool): if self._info['version'] == '37': _add_qa() elif self._info['version'] == '36': - _add_qa36() + print "Warning: C++ QA files not supported for 3.6-style OOTs." elif self._info['version'] == 'autofoo': print "Warning: C++ QA files not supported for autotools." if not self._skip_cmakefiles: @@ -270,7 +247,7 @@ class ModToolAdd(ModTool): mod_block_sep = '/' if self._info['version'] == '36': mod_block_sep = '_' - swig_block_magic_str = get_template('swig_block_magic', **self._info) + swig_block_magic_str = render_template('swig_block_magic', **self._info) open(self._file['swig'], 'a').write(swig_block_magic_str) include_str = '#include "%s%s%s.h"' % ( {True: 'gnuradio/' + self._info['modname'], False: self._info['modname']}[self._info['is_component']], diff --git a/gr-utils/python/modtool/modtool_rename.py b/gr-utils/python/modtool/modtool_rename.py index 4d3f5cb17e..86bafc56a5 100644 --- a/gr-utils/python/modtool/modtool_rename.py +++ b/gr-utils/python/modtool/modtool_rename.py @@ -28,9 +28,6 @@ from util_functions import append_re_line_sequence, ask_yes_no from cmakefile_editor import CMakeFileEditor from modtool_base import ModTool, ModToolException from templates import Templates -from code_generator import get_template -import Cheetah.Template - class ModToolRename(ModTool): """ Rename a block in the out-of-tree module. """ diff --git a/gr-utils/python/modtool/templates.py b/gr-utils/python/modtool/templates.py index 9caf658194..07534e5673 100644 --- a/gr-utils/python/modtool/templates.py +++ b/gr-utils/python/modtool/templates.py @@ -1,5 +1,5 @@ # -# Copyright 2013 Free Software Foundation, Inc. +# Copyright 2013-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -42,10 +42,10 @@ You should have received a copy of the GNU General Public License along with this software; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301, USA. -''' % datetime.now().year +'''.format(datetime.now().year) Templates['grlicense'] = ''' -Copyright %d Free Software Foundation, Inc. +Copyright {0} Free Software Foundation, Inc. This file is part of GNU Radio @@ -63,15 +63,15 @@ 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. -''' % datetime.now().year +'''.format(datetime.now().year) # Header file of a sync/decimator/interpolator block Templates['block_impl_h'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} -\#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H -\#define INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H +${str_to_fancyc_comment(license)} +#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H +#define INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H -\#include <${include_dir_prefix}/${blockname}.h> +#include <${include_dir_prefix}/${blockname}.h> namespace gr { namespace ${modname} { @@ -81,112 +81,118 @@ namespace gr { private: // Nothing to declare in this block. -#if $blocktype == 'tagged_stream' +% if blocktype == 'tagged_stream': protected: int calculate_output_stream_length(const gr_vector_int &ninput_items); -#end if +% endif public: - ${blockname}_impl(${strip_default_values($arglist)}); + ${blockname}_impl(${strip_default_values(arglist)}); ~${blockname}_impl(); // Where all the action really happens -#if $blocktype == 'general' +% if blocktype == 'general': void forecast (int noutput_items, gr_vector_int &ninput_items_required); int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); -#else if $blocktype == 'tagged_stream' - int work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -#else if $blocktype == 'hier' -#silent pass -#else - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -#end if + +% elif blocktype == 'tagged_stream': + int work( + int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items + ); +% elif blocktype == 'hier': +% else: + int work( + int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items + ); +% endif }; } // namespace ${modname} } // namespace gr -\#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H */ +#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_IMPL_H */ ''' # C++ file of a GR block Templates['block_impl_cpp'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} -\#ifdef HAVE_CONFIG_H -\#include "config.h" -\#endif - -\#include <gnuradio/io_signature.h> -#if $blocktype == 'noblock' -\#include <${include_dir_prefix}/${blockname}.h> -#else -\#include "${blockname}_impl.h" -#end if +${str_to_fancyc_comment(license)} +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gnuradio/io_signature.h> +% if blocktype == 'noblock': +#include <${include_dir_prefix}/${blockname}.h> +% else: +#include "${blockname}_impl.h" +% endif namespace gr { namespace ${modname} { -#if $blocktype == 'noblock' - $blockname::${blockname}(${strip_default_values($arglist)}) +% if blocktype == 'noblock': + ${blockname}::${blockname}(${strip_default_values(arglist)}) { } - $blockname::~${blockname}() + ${blockname}::~${blockname}() { } -#else +% else: ${blockname}::sptr - ${blockname}::make(${strip_default_values($arglist)}) + ${blockname}::make(${strip_default_values(arglist)}) { return gnuradio::get_initial_sptr - (new ${blockname}_impl(${strip_arg_types($arglist)})); + (new ${blockname}_impl(${strip_arg_types(arglist)})); } -#if $blocktype == 'decimator' -#set $decimation = ', <+decimation+>' -#else if $blocktype == 'interpolator' -#set $decimation = ', <+interpolation+>' -#else if $blocktype == 'tagged_stream' -#set $decimation = ', <+len_tag_key+>' -#else -#set $decimation = '' -#end if -#if $blocktype == 'source' -#set $inputsig = '0, 0, 0' -#else -#set $inputsig = '<+MIN_IN+>, <+MAX_IN+>, sizeof(<+ITYPE+>)' -#end if -#if $blocktype == 'sink' -#set $outputsig = '0, 0, 0' -#else -#set $outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, sizeof(<+OTYPE+>)' -#end if +<% + if blocktype == 'decimator': + decimation = ', <+decimation+>' + elif blocktype == 'interpolator': + decimation = ', <+interpolation+>' + elif blocktype == 'tagged_stream': + decimation = ', <+len_tag_key+>' + else: + decimation = '' + endif + if blocktype == 'source': + inputsig = '0, 0, 0' + else: + inputsig = '<+MIN_IN+>, <+MAX_IN+>, sizeof(<+ITYPE+>)' + endif + if blocktype == 'sink': + outputsig = '0, 0, 0' + else: + outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, sizeof(<+OTYPE+>)' + endif +%> /* * The private constructor */ - ${blockname}_impl::${blockname}_impl(${strip_default_values($arglist)}) + ${blockname}_impl::${blockname}_impl(${strip_default_values(arglist)}) : gr::${grblocktype}("${blockname}", - gr::io_signature::make($inputsig), - gr::io_signature::make($outputsig)$decimation) -#if $blocktype == 'hier' + gr::io_signature::make(${inputsig}), + gr::io_signature::make(${outputsig})${decimation}) + % if blocktype == 'hier': { connect(self(), 0, d_firstblock, 0); // connect other blocks connect(d_lastblock, 0, self(), 0); } -#else + % else: {} -#end if + % endif /* * Our virtual destructor. @@ -195,7 +201,7 @@ namespace gr { { } -#if $blocktype == 'general' + % if blocktype == 'general': void ${blockname}_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) { @@ -219,7 +225,7 @@ namespace gr { // Tell runtime system how many output items we produced. return noutput_items; } -#else if $blocktype == 'tagged_stream' + % elif blocktype == 'tagged_stream': int ${blockname}_impl::calculate_output_stream_length(const gr_vector_int &ninput_items) { @@ -241,32 +247,27 @@ namespace gr { // Tell runtime system how many output items we produced. return noutput_items; } -#else if $blocktype == 'hier' -#silent pass -#else + % elif blocktype == 'hier': + % else: int ${blockname}_impl::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { -#if $blocktype == 'source' -#silent pass -#else + % if blocktype != 'source': const <+ITYPE+> *in = (const <+ITYPE+> *) input_items[0]; -#end if -#if $blocktype == 'sink' -#silent pass -#else + % endif + % if blocktype != 'sink': <+OTYPE+> *out = (<+OTYPE+> *) output_items[0]; -#end if + % endif // Do <+signal processing+> // Tell runtime system how many output items we produced. return noutput_items; } -#end if -#end if + % endif +% endif } /* namespace ${modname} */ } /* namespace gr */ @@ -275,38 +276,38 @@ namespace gr { # Block definition header file (for include/) Templates['block_def_h'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} +${str_to_fancyc_comment(license)} -\#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_H -\#define INCLUDED_${modname.upper()}_${blockname.upper()}_H +#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_H +#define INCLUDED_${modname.upper()}_${blockname.upper()}_H -\#include <${include_dir_prefix}/api.h> -#if $blocktype != 'noblock' -\#include <gnuradio/${grblocktype}.h> -#end if +#include <${include_dir_prefix}/api.h> +% if blocktype != 'noblock': +#include <gnuradio/${grblocktype}.h> +% endif namespace gr { namespace ${modname} { -#if $blocktype == 'noblock' +% if blocktype == 'noblock': /*! * \\brief <+description+> * */ - class ${modname.upper()}_API $blockname + class ${modname.upper()}_API ${blockname} { public: ${blockname}(${arglist}); ~${blockname}(); private: }; -#else +% else: /*! * \\brief <+description of block+> * \ingroup ${modname} * */ - class ${modname.upper()}_API ${blockname} : virtual public gr::$grblocktype + class ${modname.upper()}_API ${blockname} : virtual public gr::${grblocktype} { public: typedef boost::shared_ptr<${blockname}> sptr; @@ -319,85 +320,94 @@ namespace gr { * class. ${modname}::${blockname}::make is the public interface for * creating new instances. */ - static sptr make($arglist); + static sptr make(${arglist}); }; -#end if +% endif } // namespace ${modname} } // namespace gr -\#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_H */ +#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_H */ ''' # Python block -Templates['block_python'] = '''\#!/usr/bin/env python +Templates['block_python'] = '''#!/usr/bin/env python # -*- coding: utf-8 -*- -${str_to_python_comment($license)} -# -#if $blocktype == 'noblock' -#stop -#end if - -#if $blocktype in ('sync', 'sink', 'source') -#set $parenttype = 'gr.sync_block' -#else -#set $parenttype = {'hier': 'gr.hier_block2', 'interpolator': 'gr.interp_block', 'decimator': 'gr.decim_block', 'general': 'gr.basic_block'}[$blocktype] -#end if -#if $blocktype != 'hier' -import numpy -#if $blocktype == 'source' -#set $inputsig = 'None' -#else -#set $inputsig = '[<+numpy.float+>]' -#end if -#if $blocktype == 'sink' -#set $outputsig = 'None' -#else -#set $outputsig = '[<+numpy.float+>]' -#end if -#else -#if $blocktype == 'source' -#set $inputsig = '0, 0, 0' -#else -#set $inputsig = '<+MIN_IN+>, <+MAX_IN+>, gr.sizeof_<+ITYPE+>' -#end if -#if $blocktype == 'sink' -#set $outputsig = '0, 0, 0' -#else -#set $outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, gr.sizeof_<+OTYPE+>' -#end if -#end if -#if $blocktype == 'interpolator' -#set $deciminterp = ', <+interpolation+>' -#else if $blocktype == 'decimator' -#set $deciminterp = ', <+decimation+>' -#else -#set $deciminterp = '' -#end if -from gnuradio import gr +${str_to_python_comment(license)} +#\ +<% + if blocktype == 'noblock': + return + if blocktype in ('sync', 'sink', 'source'): + parenttype = 'gr.sync_block' + else: + parenttype = { + 'hier': 'gr.hier_block2', + 'interpolator': 'gr.interp_block', + 'decimator': 'gr.decim_block', + 'general': 'gr.basic_block' + }[blocktype] +%> +% if blocktype != 'hier': + +import numpy\ +<% + if blocktype == 'source': + inputsig = 'None' + else: + inputsig = '[<+numpy.float32+>]' + if blocktype == 'sink': + outputsig = 'None' + else: + outputsig = '[<+numpy.float32+>]' +%> +% else: +<% + if blocktype == 'source': + inputsig = '0, 0, 0' + else: + inputsig = '<+MIN_IN+>, <+MAX_IN+>, gr.sizeof_<+ITYPE+>' + if blocktype == 'sink': + outputsig = '0, 0, 0' + else: + outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, gr.sizeof_<+OTYPE+>' +%> +% endif +<% + if blocktype == 'interpolator': + deciminterp = ', <+interpolation+>' + elif blocktype == 'decimator': + deciminterp = ', <+decimation+>' + else: + deciminterp = '' + if arglist == '': + arglistsep = '' + else: + arglistsep = ', ' +%>from gnuradio import gr class ${blockname}(${parenttype}): """ docstring for block ${blockname} """ - def __init__(self#if $arglist == '' then '' else ', '#$arglist): + def __init__(self${arglistsep}${arglist}): ${parenttype}.__init__(self, -#if $blocktype == 'hier' - "$blockname", +% if blocktype == 'hier': + "${blockname}", gr.io_signature(${inputsig}), # Input signature gr.io_signature(${outputsig})) # Output signature # Define blocks and connect them self.connect() -#stop -#else +<% return %> +% else: name="${blockname}", in_sig=${inputsig}, out_sig=${outputsig}${deciminterp}) -#end if +% endif -#if $blocktype == 'general' +% if blocktype == 'general': def forecast(self, noutput_items, ninput_items_required): #setup size of input_items[i] for work call for i in range(len(ninput_items_required)): @@ -408,37 +418,37 @@ class ${blockname}(${parenttype}): consume(0, len(input_items[0])) \#self.consume_each(len(input_items[0])) return len(output_items[0]) -#stop -#end if +<% return %> +% endif def work(self, input_items, output_items): -#if $blocktype != 'source' +% if blocktype != 'source': in0 = input_items[0] -#end if -#if $blocktype != 'sink' +% endif +% if blocktype != 'sink': out = output_items[0] -#end if +% endif # <+signal processing here+> -#if $blocktype in ('sync', 'decimator', 'interpolator') +% if blocktype in ('sync', 'decimator', 'interpolator'): out[:] = in0 return len(output_items[0]) -#else if $blocktype == 'sink' +% elif blocktype == 'sink': return len(input_items[0]) -#else if $blocktype == 'source' +% elif blocktype == 'source': out[:] = whatever return len(output_items[0]) -#end if +% endif ''' # C++ file for QA Templates['qa_cpp'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} +${str_to_fancyc_comment(license)} -\#include <gnuradio/attributes.h> -\#include <cppunit/TestAssert.h> -\#include "qa_${blockname}.h" -\#include <${include_dir_prefix}/${blockname}.h> +#include <gnuradio/attributes.h> +#include <cppunit/TestAssert.h> +#include "qa_${blockname}.h" +#include <${include_dir_prefix}/${blockname}.h> namespace gr { namespace ${modname} { @@ -456,13 +466,13 @@ namespace gr { # Header file for QA Templates['qa_h'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} +${str_to_fancyc_comment(license)} -\#ifndef _QA_${blockname.upper()}_H_ -\#define _QA_${blockname.upper()}_H_ +#ifndef _QA_${blockname.upper()}_H_ +#define _QA_${blockname.upper()}_H_ -\#include <cppunit/extensions/HelperMacros.h> -\#include <cppunit/TestCase.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCase.h> namespace gr { namespace ${modname} { @@ -481,25 +491,25 @@ namespace gr { } /* namespace ${modname} */ } /* namespace gr */ -\#endif /* _QA_${blockname.upper()}_H_ */ +#endif /* _QA_${blockname.upper()}_H_ */ ''' # Python QA code -Templates['qa_python'] = '''\#!/usr/bin/env python +Templates['qa_python'] = '''#!/usr/bin/env python # -*- coding: utf-8 -*- -${str_to_python_comment($license)} +${str_to_python_comment(license)} # from gnuradio import gr, gr_unittest from gnuradio import blocks -#if $lang == 'cpp' +% if lang == 'cpp': import ${modname}_swig as ${modname} -#else +% else: from ${blockname} import ${blockname} -#end if +% endif -class qa_$blockname (gr_unittest.TestCase): +class qa_${blockname} (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () @@ -519,11 +529,11 @@ if __name__ == '__main__': Templates['grc_xml'] = '''<?xml version="1.0"?> <block> - <name>$blockname</name> - <key>${modname}_$blockname</key> - <category>$modname</category> - <import>import $modname</import> - <make>${modname}.${blockname}(${strip_arg_types_grc($arglist)})</make> + <name>${blockname}</name> + <key>${modname}_${blockname}</key> + <category>[${modname}]</category> + <import>import ${modname}</import> + <make>${modname}.${blockname}(${strip_arg_types_grc(arglist)})</make> <!-- Make one 'param' node for every Parameter you want settable from the GUI. Sub-nodes: * name @@ -564,80 +574,85 @@ gr_modtool help -- Show a list of commands. gr_modtool help <command> -- Shows the help for a given command. ''' # SWIG string -Templates['swig_block_magic'] = """#if $version == '36' -#if $blocktype != 'noblock' -GR_SWIG_BLOCK_MAGIC($modname, $blockname); -#end if -%include "${modname}_${blockname}.h" -#else -%include "${include_dir_prefix}/${blockname}.h" -#if $blocktype != 'noblock' -GR_SWIG_BLOCK_MAGIC2($modname, $blockname); -#end if -#end if +Templates['swig_block_magic'] = """% if version == '36': +% if blocktype != 'noblock': +GR_SWIG_BLOCK_MAGIC(${modname}, ${blockname}); +% endif +%%include "${modname}_${blockname}.h" +% else: +%%include "${include_dir_prefix}/${blockname}.h" + % if blocktype != 'noblock': +GR_SWIG_BLOCK_MAGIC2(${modname}, ${blockname}); + % endif +% endif """ ## Old stuff # C++ file of a GR block Templates['block_cpp36'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} -\#ifdef HAVE_CONFIG_H -\#include "config.h" -\#endif - -#if $blocktype != 'noblock' -\#include <gr_io_signature.h> -#end if -\#include "${modname}_${blockname}.h" - -#if $blocktype == 'noblock' -${modname}_${blockname}::${modname}_${blockname}(${strip_default_values($arglist)}) +${str_to_fancyc_comment(license)} +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +% if blocktype != 'noblock': +#include <gr_io_signature.h> +% endif +#include "${modname}_${blockname}.h" + +% if blocktype == 'noblock': +${modname}_${blockname}::${modname}_${blockname}(${strip_default_values(arglist)}) { } ${modname}_${blockname}::~${modname}_${blockname}() { } -#else +% else: ${modname}_${blockname}_sptr -${modname}_make_${blockname} (${strip_default_values($arglist)}) +${modname}_make_${blockname} (${strip_default_values(arglist)}) { - return gnuradio::get_initial_sptr (new ${modname}_${blockname}(${strip_arg_types($arglist)})); + return gnuradio::get_initial_sptr (new ${modname}_${blockname}(${strip_arg_types(arglist)})); } -#if $blocktype == 'decimator' -#set $decimation = ', <+decimation+>' -#else if $blocktype == 'interpolator' -#set $decimation = ', <+interpolation+>' -#else -#set $decimation = '' -#end if -#if $blocktype == 'sink' -#set $inputsig = '0, 0, 0' -#else -#set $inputsig = '<+MIN_IN+>, <+MAX_IN+>, sizeof(<+ITYPE+>)' -#end if -#if $blocktype == 'source' -#set $outputsig = '0, 0, 0' -#else -#set $outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, sizeof(<+OTYPE+>)' -#end if +<% + if blocktype == 'interpolator': + deciminterp = ', <+interpolation+>' + elif blocktype == 'decimator': + deciminterp = ', <+decimation+>' + else: + deciminterp = '' + if arglist == '': + arglistsep = '' + else: + arglistsep = ', ' + if blocktype == 'source': + inputsig = '0, 0, 0' + else: + inputsig = '<+MIN_IN+>, <+MAX_IN+>, sizeof(<+ITYPE+>)' + endif + if blocktype == 'sink': + outputsig = '0, 0, 0' + else: + outputsig = '<+MIN_OUT+>, <+MAX_OUT+>, sizeof(<+OTYPE+>)' + endif +%> /* * The private constructor */ -${modname}_${blockname}::${modname}_${blockname} (${strip_default_values($arglist)}) +${modname}_${blockname}::${modname}_${blockname} (${strip_default_values(arglist)}) : gr_${grblocktype} ("${blockname}", - gr_make_io_signature($inputsig), - gr_make_io_signature($outputsig)$decimation) + gr_make_io_signature(${inputsig}), + gr_make_io_signature(${outputsig})${deciminterp}) { -#if $blocktype == 'hier' +% if blocktype == 'hier' connect(self(), 0, d_firstblock, 0); // <+connect other blocks+> connect(d_lastblock, 0, self(), 0); -#else +% else: // Put in <+constructor stuff+> here -#end if +% endif } @@ -648,10 +663,10 @@ ${modname}_${blockname}::~${modname}_${blockname}() { // Put in <+destructor stuff+> here } -#end if +% endif -#if $blocktype == 'general' +% if blocktype == 'general' void ${modname}_${blockname}::forecast (int noutput_items, gr_vector_int &ninput_items_required) { @@ -675,9 +690,8 @@ ${modname}_${blockname}::general_work (int noutput_items, // Tell runtime system how many output items we produced. return noutput_items; } -#else if $blocktype == 'hier' or $blocktype == 'noblock' -#pass -#else +% elif blocktype == 'hier' or $blocktype == 'noblock': +% else: int ${modname}_${blockname}::work(int noutput_items, gr_vector_const_void_star &input_items, @@ -691,51 +705,51 @@ ${modname}_${blockname}::work(int noutput_items, // Tell runtime system how many output items we produced. return noutput_items; } -#end if +% endif ''' # Block definition header file (for include/) Templates['block_h36'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} +${str_to_fancyc_comment(license)} -\#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_H -\#define INCLUDED_${modname.upper()}_${blockname.upper()}_H +#ifndef INCLUDED_${modname.upper()}_${blockname.upper()}_H +#define INCLUDED_${modname.upper()}_${blockname.upper()}_H -\#include <${modname}_api.h> -#if $blocktype == 'noblock' -class ${modname.upper()}_API $blockname +#include <${modname}_api.h> +% if blocktype == 'noblock' +class ${modname.upper()}_API ${blockname} { ${blockname}(${arglist}); ~${blockname}(); private: }; -#else -\#include <gr_${grblocktype}.h> +% else: +#include <gr_${grblocktype}.h> class ${modname}_${blockname}; typedef boost::shared_ptr<${modname}_${blockname}> ${modname}_${blockname}_sptr; -${modname.upper()}_API ${modname}_${blockname}_sptr ${modname}_make_${blockname} ($arglist); +${modname.upper()}_API ${modname}_${blockname}_sptr ${modname}_make_${blockname} (${arglist}); /*! * \\brief <+description+> * \ingroup ${modname} * */ -class ${modname.upper()}_API ${modname}_${blockname} : public gr_$grblocktype +class ${modname.upper()}_API ${modname}_${blockname} : public gr_${grblocktype} { private: - friend ${modname.upper()}_API ${modname}_${blockname}_sptr ${modname}_make_${blockname} (${strip_default_values($arglist)}); + friend ${modname.upper()}_API ${modname}_${blockname}_sptr ${modname}_make_${blockname} (${strip_default_values(arglist)}); - ${modname}_${blockname}(${strip_default_values($arglist)}); + ${modname}_${blockname}(${strip_default_values(arglist)}); public: ~${modname}_${blockname}(); -#if $blocktype == 'general' + % if blocktype == 'general': void forecast (int noutput_items, gr_vector_int &ninput_items_required); // Where all the action really happens @@ -743,43 +757,16 @@ class ${modname.upper()}_API ${modname}_${blockname} : public gr_$grblocktype gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); -#else if $blocktype == 'hier' -#pass -#else + % elif blocktype == 'hier': + % else: // Where all the action really happens int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); -#end if + % endif }; -#end if - -\#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_H */ - -''' - -# C++ file for QA -Templates['qa_cpp36'] = '''/* -*- c++ -*- */ -${str_to_fancyc_comment($license)} - -\#include <boost/test/unit_test.hpp> +% endif -BOOST_AUTO_TEST_CASE(qa_${modname}_${blockname}_t1){ - BOOST_CHECK_EQUAL(2 + 2, 4); - // TODO BOOST_* test macros here -} - -BOOST_AUTO_TEST_CASE(qa_${modname}_${blockname}_t2){ - BOOST_CHECK_EQUAL(2 + 2, 4); - // TODO BOOST_* test macros here -} +#endif /* INCLUDED_${modname.upper()}_${blockname.upper()}_H */ ''' - -# Header file for QA -Templates['qa_cmakeentry36'] = """ -add_executable($basename $filename) -target_link_libraries($basename gnuradio-$modname \${Boost_LIBRARIES}) -GR_ADD_TEST($basename $basename) -""" - diff --git a/gr-utils/python/utils/grcc b/gr-utils/python/utils/grcc index 82db5435db..776af799d3 100755 --- a/gr-utils/python/utils/grcc +++ b/gr-utils/python/utils/grcc @@ -22,7 +22,7 @@ import os import sys -from optparse import OptionParser +from argparse import ArgumentParser import warnings warnings.simplefilter('ignore') @@ -57,28 +57,25 @@ class GRCC: def main(): - usage="%prog: [options] filename" description = "Compiles a GRC file (.grc) into a GNU Radio Python program. The program is stored in ~/.grc_gnuradio by default, but this location can be changed with the -d option." - parser = OptionParser(conflict_handler="resolve", usage=usage, description=description) - parser.add_option("-d", "--directory", type="string", default='{0}/.grc_gnuradio/'.format(os.environ["HOME"]), - help="Specify the directory to output the compile program [default=%default]") - parser.add_option("-e", "--execute", action="store_true", default=False, - help="Run the program after compiling [default=%default]") - (options, args) = parser.parse_args () - - if len(args) != 1: - sys.stderr.write("Please specify a GRC file name to compile.\n") - sys.exit(1) + parser = ArgumentParser(description=description) + parser.add_argument("-d", "--directory", + default='{0}/.grc_gnuradio/'.format(os.environ["HOME"]), + help="Specify the directory to output the compile program [default=%(default)s]") + parser.add_argument("-e", "--execute", action="store_true", default=False, + help="Run the program after compiling [default=%(default)s]") + parser.add_argument('grc_file', metavar="GRC_FILE", help=".grc file to compile") + args = parser.parse_args() try: - g = GRCC(args[0], options.directory + "/") + g = GRCC(args.grc_file, args.directory + "/") except Exception as e: sys.stderr.write(str(e) + "\n") sys.stderr.write("Error during file compilation.\n") sys.exit(1) - if options.execute: + if args.execute: g.exec_program() diff --git a/gr-video-sdl/grc/video_block_tree.xml b/gr-video-sdl/grc/video_block_tree.xml index 442c68a787..f4f3e4199c 100644 --- a/gr-video-sdl/grc/video_block_tree.xml +++ b/gr-video-sdl/grc/video_block_tree.xml @@ -5,7 +5,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Video</name> <block>video_sdl_sink</block> diff --git a/gr-vocoder/grc/vocoder_block_tree.xml b/gr-vocoder/grc/vocoder_block_tree.xml index c96a5cc687..07d8ba8fd1 100644 --- a/gr-vocoder/grc/vocoder_block_tree.xml +++ b/gr-vocoder/grc/vocoder_block_tree.xml @@ -27,7 +27,7 @@ ################################################### --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Audio</name> <block>vocoder_alaw_decode_bs</block> diff --git a/gr-vocoder/lib/codec2/fdmdv.c b/gr-vocoder/lib/codec2/fdmdv.c index 8855f76ae5..51d6bef544 100644 --- a/gr-vocoder/lib/codec2/fdmdv.c +++ b/gr-vocoder/lib/codec2/fdmdv.c @@ -25,7 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && (_MSC_VER < 1800) // round() not available before VS 2013 #define round(number) number < 0.0 ? ceil(number - 0.5) : floor(number + 0.5) #endif diff --git a/gr-wxgui/grc/notebook.xml b/gr-wxgui/grc/notebook.xml index 5f30c06201..1e4b0d0679 100644 --- a/gr-wxgui/grc/notebook.xml +++ b/gr-wxgui/grc/notebook.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Notebook</name> <key>notebook</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from grc_gnuradio import wxgui as grc_wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) diff --git a/gr-wxgui/grc/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml index 75dae78215..da8bb8b8d5 100644 --- a/gr-wxgui/grc/variable_check_box.xml +++ b/gr-wxgui/grc/variable_check_box.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Check Box</name> <key>variable_check_box</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml index ef75a04337..216be01e08 100644 --- a/gr-wxgui/grc/variable_chooser.xml +++ b/gr-wxgui/grc/variable_chooser.xml @@ -9,7 +9,7 @@ <block> <name>WX GUI Chooser</name> <key>variable_chooser</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml index 96c0b5ec70..29f3182d0a 100644 --- a/gr-wxgui/grc/variable_slider.xml +++ b/gr-wxgui/grc/variable_slider.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Slider</name> <key>variable_slider</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml index d68b00a1dd..e47f5c3731 100644 --- a/gr-wxgui/grc/variable_static_text.xml +++ b/gr-wxgui/grc/variable_static_text.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Static Text</name> <key>variable_static_text</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml index a2cf1a8220..8c8119433a 100644 --- a/gr-wxgui/grc/variable_text_box.xml +++ b/gr-wxgui/grc/variable_text_box.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Text Box</name> <key>variable_text_box</key> - <category>GUI Widgets/WX</category> + <category>[Core]/GUI Widgets/WX</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml index d0314ca547..999ebbe2cf 100644 --- a/gr-wxgui/grc/wxgui_constellationsink2.xml +++ b/gr-wxgui/grc/wxgui_constellationsink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Constellation Sink</name> <key>wxgui_constellationsink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.wxgui import constsink_gl</import> <import>from gnuradio import wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml index 5f82670ac5..11e9c7255e 100644 --- a/gr-wxgui/grc/wxgui_fftsink2.xml +++ b/gr-wxgui/grc/wxgui_fftsink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI FFT Sink</name> <key>wxgui_fftsink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.fft import window</import> <import>from gnuradio.wxgui import fftsink2</import> <import>from gnuradio import wxgui</import> diff --git a/gr-wxgui/grc/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml index 4fc331ab8e..63bfc000ae 100644 --- a/gr-wxgui/grc/wxgui_histosink2.xml +++ b/gr-wxgui/grc/wxgui_histosink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Histo Sink</name> <key>wxgui_histosink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.wxgui import histosink_gl</import> <import>from gnuradio import wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml index 4697164088..6f4d4a574a 100644 --- a/gr-wxgui/grc/wxgui_numbersink2.xml +++ b/gr-wxgui/grc/wxgui_numbersink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Number Sink</name> <key>wxgui_numbersink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.wxgui import numbersink2</import> <import>from gnuradio import wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml index ea43d3a690..7e896897d6 100644 --- a/gr-wxgui/grc/wxgui_scopesink2.xml +++ b/gr-wxgui/grc/wxgui_scopesink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Scope Sink</name> <key>wxgui_scopesink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.wxgui import scopesink2</import> <import>from gnuradio import wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_termsink.xml b/gr-wxgui/grc/wxgui_termsink.xml index 1367f4af8a..54fedde081 100644 --- a/gr-wxgui/grc/wxgui_termsink.xml +++ b/gr-wxgui/grc/wxgui_termsink.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Terminal Sink</name> <key>wxgui_termsink</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.wxgui import termsink</import> <import>from gnuradio import wxgui</import> diff --git a/gr-wxgui/grc/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml index bee28f23fa..5b56f98ebe 100644 --- a/gr-wxgui/grc/wxgui_waterfallsink2.xml +++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml @@ -7,7 +7,7 @@ <block> <name>WX GUI Waterfall Sink</name> <key>wxgui_waterfallsink2</key> - <category>Instrumentation/WX</category> + <category>[Core]/Instrumentation/WX</category> <import>from gnuradio.fft import window</import> <import>from gnuradio.wxgui import waterfallsink2</import> <import>from gnuradio import wxgui</import> diff --git a/gr-zeromq/grc/zeromq_pub_msg_sink.xml b/gr-zeromq/grc/zeromq_pub_msg_sink.xml index 8f541ce731..245ac37180 100644 --- a/gr-zeromq/grc/zeromq_pub_msg_sink.xml +++ b/gr-zeromq/grc/zeromq_pub_msg_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PUB Message Sink</name> <key>zeromq_pub_msg_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.pub_msg_sink($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_pub_sink.xml b/gr-zeromq/grc/zeromq_pub_sink.xml index 1b2f9ec52a..af130eeb21 100644 --- a/gr-zeromq/grc/zeromq_pub_sink.xml +++ b/gr-zeromq/grc/zeromq_pub_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PUB Sink</name> <key>zeromq_pub_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.pub_sink($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/grc/zeromq_pull_msg_source.xml b/gr-zeromq/grc/zeromq_pull_msg_source.xml index c0a6ca5a17..c6004d987e 100644 --- a/gr-zeromq/grc/zeromq_pull_msg_source.xml +++ b/gr-zeromq/grc/zeromq_pull_msg_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PULL Message Source</name> <key>zeromq_pull_msg_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.pull_msg_source($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_pull_source.xml b/gr-zeromq/grc/zeromq_pull_source.xml index 8158b47361..f2c8b61d86 100644 --- a/gr-zeromq/grc/zeromq_pull_source.xml +++ b/gr-zeromq/grc/zeromq_pull_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PULL Source</name> <key>zeromq_pull_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.pull_source($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/grc/zeromq_push_msg_sink.xml b/gr-zeromq/grc/zeromq_push_msg_sink.xml index 65626c0761..283a250064 100644 --- a/gr-zeromq/grc/zeromq_push_msg_sink.xml +++ b/gr-zeromq/grc/zeromq_push_msg_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PUSH Message Sink</name> <key>zeromq_push_msg_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.push_msg_sink($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_push_sink.xml b/gr-zeromq/grc/zeromq_push_sink.xml index 528da94ee6..8277c02c22 100644 --- a/gr-zeromq/grc/zeromq_push_sink.xml +++ b/gr-zeromq/grc/zeromq_push_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ PUSH Sink</name> <key>zeromq_push_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.push_sink($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/grc/zeromq_rep_msg_sink.xml b/gr-zeromq/grc/zeromq_rep_msg_sink.xml index f978f442a7..37515b39bc 100644 --- a/gr-zeromq/grc/zeromq_rep_msg_sink.xml +++ b/gr-zeromq/grc/zeromq_rep_msg_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ REP Message Sink</name> <key>zeromq_rep_msg_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.rep_msg_sink($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_rep_sink.xml b/gr-zeromq/grc/zeromq_rep_sink.xml index db735a37bb..17c824156c 100644 --- a/gr-zeromq/grc/zeromq_rep_sink.xml +++ b/gr-zeromq/grc/zeromq_rep_sink.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ REP Sink</name> <key>zeromq_rep_sink</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.rep_sink($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/grc/zeromq_req_msg_source.xml b/gr-zeromq/grc/zeromq_req_msg_source.xml index 3ba7488223..ae34c30dd0 100644 --- a/gr-zeromq/grc/zeromq_req_msg_source.xml +++ b/gr-zeromq/grc/zeromq_req_msg_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ REQ Message Source</name> <key>zeromq_req_msg_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.req_msg_source($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_req_source.xml b/gr-zeromq/grc/zeromq_req_source.xml index 2ef224399d..0fc1aa1488 100644 --- a/gr-zeromq/grc/zeromq_req_source.xml +++ b/gr-zeromq/grc/zeromq_req_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ REQ Source</name> <key>zeromq_req_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.req_source($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/grc/zeromq_sub_msg_source.xml b/gr-zeromq/grc/zeromq_sub_msg_source.xml index 32a1c9862b..475537f5fe 100644 --- a/gr-zeromq/grc/zeromq_sub_msg_source.xml +++ b/gr-zeromq/grc/zeromq_sub_msg_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ SUB Message Source</name> <key>zeromq_sub_msg_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.sub_msg_source($address, $timeout)</make> diff --git a/gr-zeromq/grc/zeromq_sub_source.xml b/gr-zeromq/grc/zeromq_sub_source.xml index 268a8938d5..31e6170c6a 100644 --- a/gr-zeromq/grc/zeromq_sub_source.xml +++ b/gr-zeromq/grc/zeromq_sub_source.xml @@ -2,7 +2,7 @@ <block> <name>ZMQ SUB Source</name> <key>zeromq_sub_source</key> - <category>ZeroMQ Interfaces</category> + <category>[Core]/ZeroMQ Interfaces</category> <import>from gnuradio import zeromq</import> <make>zeromq.sub_source($type.itemsize, $vlen, $address, $timeout, $pass_tags, $hwm)</make> diff --git a/gr-zeromq/lib/pull_msg_source_impl.cc b/gr-zeromq/lib/pull_msg_source_impl.cc index ca496ef216..9d00cdfd74 100644 --- a/gr-zeromq/lib/pull_msg_source_impl.cc +++ b/gr-zeromq/lib/pull_msg_source_impl.cc @@ -25,6 +25,8 @@ #endif #include <gnuradio/io_signature.h> +#include <boost/thread/thread.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include "pull_msg_source_impl.h" #include "tag_headers.h" @@ -102,7 +104,7 @@ namespace gr { message_port_pub(pmt::mp("out"), m); } else { - usleep(100); + boost::this_thread::sleep(boost::posix_time::microseconds(100)); } } } diff --git a/gr-zeromq/lib/req_msg_source_impl.cc b/gr-zeromq/lib/req_msg_source_impl.cc index b30ef2679d..e231a31962 100644 --- a/gr-zeromq/lib/req_msg_source_impl.cc +++ b/gr-zeromq/lib/req_msg_source_impl.cc @@ -25,6 +25,8 @@ #endif #include <gnuradio/io_signature.h> +#include <boost/thread/thread.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include "req_msg_source_impl.h" #include "tag_headers.h" @@ -114,7 +116,7 @@ namespace gr { message_port_pub(pmt::mp("out"), m); } else { - usleep(100); + boost::this_thread::sleep(boost::posix_time::microseconds(100)); } } } diff --git a/gr-zeromq/lib/sub_msg_source_impl.cc b/gr-zeromq/lib/sub_msg_source_impl.cc index b016405d40..0a11ea77f0 100644 --- a/gr-zeromq/lib/sub_msg_source_impl.cc +++ b/gr-zeromq/lib/sub_msg_source_impl.cc @@ -25,6 +25,8 @@ #endif #include <gnuradio/io_signature.h> +#include <boost/thread/thread.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include "sub_msg_source_impl.h" #include "tag_headers.h" @@ -101,7 +103,7 @@ namespace gr { message_port_pub(pmt::mp("out"), m); } else { - usleep(100); + boost::this_thread::sleep(boost::posix_time::microseconds(100)); } } } diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index a8775d6872..3125864d4d 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -1,11 +1,6 @@ <?xml version="1.0"?> -<!-- -################################################### -##Block Tree for platform gnuradio python. -################################################### - --> <cat> - <name></name> <!-- Blank for Root Name --> + <name>[Core]</name> <cat> <name>Misc</name> <block>pad_source</block> @@ -18,12 +13,16 @@ <block>bus_structure_sink</block> <block>bus_structure_source</block> + <block>epy_block</block> + <block>epy_module</block> + <block>note</block> <block>import</block> </cat> <cat> <name>Variables</name> <block>variable</block> + <block>variable_struct</block> <block>variable_config</block> <block>variable_function_probe</block> <block>parameter</block> diff --git a/grc/blocks/epy_block.xml b/grc/blocks/epy_block.xml index 3fd5aa84f1..65e78c4062 100644 --- a/grc/blocks/epy_block.xml +++ b/grc/blocks/epy_block.xml @@ -2,7 +2,6 @@ <block> <name>Python Block</name> <key>epy_block</key> - <category>Misc</category> <import></import> <make></make> <param><!-- Cache the last working block IO to keep FG sane --> diff --git a/grc/blocks/epy_module.xml b/grc/blocks/epy_module.xml index 6d6d71804c..fa3e5f91f4 100644 --- a/grc/blocks/epy_module.xml +++ b/grc/blocks/epy_module.xml @@ -2,7 +2,6 @@ <block> <name>Python Module</name> <key>epy_module</key> - <category>Misc</category> <import>import $id # embedded python module</import> <make></make> <param> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 937cfe82ea..55f411884d 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -20,8 +20,8 @@ from PyQt4 import Qt import sys #end if #if not $generate_options().startswith('hb') -from optparse import OptionParser -from gnuradio.eng_option import eng_option +from argparse import ArgumentParser +from gnuradio.eng_arg import eng_float, intx from gnuradio import eng_notation #end if</import> <make></make> @@ -84,7 +84,7 @@ else: self.stop(); self.wait()</callback> <param> <name>Category</name> <key>category</key> - <value>Custom</value> + <value>[GRC Hier Blocks]</value> <type>string</type> <hide>#if $generate_options().startswith('hb') then 'none' else 'all'#</hide> </param> diff --git a/grc/blocks/parameter.xml b/grc/blocks/parameter.xml index e35b8f4d1d..b0713218fd 100644 --- a/grc/blocks/parameter.xml +++ b/grc/blocks/parameter.xml @@ -55,9 +55,11 @@ </option> <option> <name>String</name> - <key>string</key> + <key>str</key> <opt>type:string</opt> - </option> + </option> + <!-- Do not forget to add option value type handler import into + grc/python/flow_graph.tmpl for each new type. --> <!-- not supported yet in tmpl <option> <name>Boolean</name> diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml index baa996c0ec..47c11b29fe 100644 --- a/grc/blocks/variable_function_probe.xml +++ b/grc/blocks/variable_function_probe.xml @@ -10,7 +10,7 @@ <import>import time</import> <import>import threading</import> <var_make>self.$(id) = $(id) = $value</var_make> - <make>#slurp + <make> def _$(id)_probe(): while True: #set $obj = 'self' + ('.' + $block_id() if $block_id() else '') @@ -22,15 +22,10 @@ def _$(id)_probe(): time.sleep(1.0 / ($poll_rate)) _$(id)_thread = threading.Thread(target=_$(id)_probe) _$(id)_thread.daemon = True -_$(id)_thread.start()</make> +_$(id)_thread.start() + </make> <callback>self.set_$(id)($value)</callback> <param> - <name>Value</name> - <key>value</key> - <value>0</value> - <type>raw</type> - </param> - <param> <name>Block ID</name> <key>block_id</key> <value>my_block_0</value> @@ -55,6 +50,13 @@ _$(id)_thread.start()</make> <value>10</value> <type>real</type> </param> + <param> + <name>Initial Value</name> + <key>value</key> + <value>0</value> + <type>raw</type> + <hide>part</hide> + </param> <doc> Periodically probe a function and set its value to this variable. diff --git a/grc/blocks/variable_struct.xml.py b/grc/blocks/variable_struct.xml.py index e43200828b..de4411e975 100644 --- a/grc/blocks/variable_struct.xml.py +++ b/grc/blocks/variable_struct.xml.py @@ -6,7 +6,6 @@ HEADER = """\ <block> <name>Struct Variable</name> <key>variable_struct</key> - <category>Variables</category> <import>def struct(data): return type('Struct', (object,), data)()</import> <var_make>self.$id = $id = struct({{#slurp #for $i in range({0}): diff --git a/grc/core/Block.py b/grc/core/Block.py index ff7f041dc0..9fff5afcb7 100644 --- a/grc/core/Block.py +++ b/grc/core/Block.py @@ -67,7 +67,7 @@ class Block(Element): self._name = n['name'] self._key = n['key'] - self._category = n.get('category', '') + self.category = [cat.strip() for cat in n.get('category', '').split('/') if cat.strip()] self._flags = n.get('flags', '') self._doc = n.get('doc', '').strip('\n').replace('\\\n', '') @@ -491,12 +491,6 @@ class Block(Element): def get_key(self): return self._key - def get_category(self): - return self._category - - def set_category(self, cat): - self._category = cat - def get_ports(self): return self.get_sources() + self.get_sinks() diff --git a/grc/core/Constants.py b/grc/core/Constants.py index 8a99f8b256..992d5e7d83 100644 --- a/grc/core/Constants.py +++ b/grc/core/Constants.py @@ -41,6 +41,7 @@ FLOW_GRAPH_FILE_FORMAT_VERSION = 1 # Param tabs DEFAULT_PARAM_TAB = "General" ADVANCED_PARAM_TAB = "Advanced" +DEFAULT_BLOCK_MODULE_NAME = '(no module specified)' # Port domains GR_STREAM_DOMAIN = "gr_stream" diff --git a/grc/core/Element.pyi b/grc/core/Element.pyi new file mode 100644 index 0000000000..c81180a33e --- /dev/null +++ b/grc/core/Element.pyi @@ -0,0 +1,54 @@ +# Copyright 2008, 2009, 2015, 2016 Free Software Foundation, Inc. +# This file is part of GNU Radio +# +# GNU Radio Companion 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 2 +# of the License, or (at your option) any later version. +# +# GNU Radio Companion is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +from . import Platform, FlowGraph, Block + +def lazy_property(func): + return func + + +class Element(object): + + def __init__(self, parent=None): + ... + + @property + def parent(self): + ... + + def get_parent_by_type(self, cls): + parent = self.parent + if parent is None: + return None + elif isinstance(parent, cls): + return parent + else: + return parent.get_parent_by_type(cls) + + @lazy_property + def parent_platform(self): -> Platform.Platform + ... + + @lazy_property + def parent_flowgraph(self): -> FlowGraph.FlowGraph + ... + + @lazy_property + def parent_block(self): -> Block.Block + ... + + diff --git a/grc/core/Platform.py b/grc/core/Platform.py index 069870d389..be7b60ca59 100644 --- a/grc/core/Platform.py +++ b/grc/core/Platform.py @@ -69,7 +69,7 @@ class Platform(Element): self.blocks = {} self._blocks_n = {} - self._category_trees_n = [] + self._block_categories = {} self.domains = {} self.connection_templates = {} @@ -79,7 +79,8 @@ class Platform(Element): self._flow_graph = Element.__new__(FlowGraph) Element.__init__(self._flow_graph, self) self._flow_graph.connections = [] - self.load_blocks() + + self.build_block_library() def __str__(self): return 'Platform - {}({})'.format(self.config.key, self.config.name) @@ -137,14 +138,14 @@ class Platform(Element): self.load_block_xml(generator.file_path_xml) return True - def load_blocks(self): + def build_block_library(self): """load the blocks and block tree from the search paths""" self._docstring_extractor.start() # Reset self.blocks.clear() self._blocks_n.clear() - del self._category_trees_n[:] + self._block_categories.clear() self.domains.clear() self.connection_templates.clear() ParseXML.xml_failures.clear() @@ -162,9 +163,21 @@ class Platform(Element): # print >> sys.stderr, 'Warning: Block validation failed:\n\t%s\n\tIgnoring: %s' % (e, xml_file) pass except Exception as e: - raise print('Warning: XML parsing failed:\n\t%r\n\tIgnoring: %s' % (e, xml_file), file=sys.stderr) + # Add blocks to block tree + for key, block in six.iteritems(self.blocks): + category = self._block_categories.get(key, block.category) + # Blocks with empty categories are hidden + if not category: + continue + root = category[0] + if root.startswith('[') and root.endswith(']'): + category[0] = root[1:-1] + else: + category.insert(0, Constants.DEFAULT_BLOCK_MODULE_NAME) + block.category = category + self._docstring_extractor.finish() # self._docstring_extractor.wait() @@ -202,8 +215,19 @@ class Platform(Element): def load_category_tree_xml(self, xml_file): """Validate and parse category tree file and add it to list""" ParseXML.validate_dtd(xml_file, Constants.BLOCK_TREE_DTD) - n = ParseXML.from_file(xml_file).get('cat', {}) - self._category_trees_n.append(n) + xml = ParseXML.from_file(xml_file) + path = [] + + def load_category(cat_n): + path.append(cat_n.get('name').strip()) + for block_key in cat_n.get('block', []): + if block_key not in self._block_categories: + self._block_categories[block_key] = list(path) + for sub_cat_n in cat_n.get('cat', []): + load_category(sub_cat_n) + path.pop() + + load_category(xml.get('cat', {})) def load_domain_xml(self, xml_file): """Load a domain properties and connection templates from XML""" @@ -248,44 +272,6 @@ class Platform(Element): else: self.connection_templates[key] = connection_n.get('make') or '' - def load_block_tree(self, block_tree): - """ - Load a block tree with categories and blocks. - Step 1: Load all blocks from the xml specification. - Step 2: Load blocks with builtin category specifications. - - Args: - block_tree: the block tree object - """ - # Recursive function to load categories and blocks - def load_category(cat_n, parent=None): - # Add this category - parent = (parent or []) + [cat_n.get('name')] - block_tree.add_block(parent) - # Recursive call to load sub categories - for cat in cat_n.get('cat', []): - load_category(cat, parent) - # Add blocks in this category - for block_key in cat_n.get('block', []): - if block_key not in self.blocks: - print('Warning: Block key "{}" not found when loading category tree.'.format(block_key), file=sys.stderr) - continue - block = self.blocks[block_key] - # If it exists, the block's category shall not be overridden by the xml tree - if not block.get_category(): - block.set_category(parent) - - # Recursively load the category trees and update the categories for each block - for category_tree_n in self._category_trees_n: - load_category(category_tree_n) - - # Add blocks to block tree - for block in six.itervalues(self.blocks): - # Blocks with empty categories are hidden - if not block.get_category(): - continue - block_tree.add_block(block.get_category(), block) - def _save_docstring_extraction_result(self, key, docstrings): docs = {} for match, docstring in six.iteritems(docstrings): diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py index c3308d6c32..9c7d07e76b 100644 --- a/grc/core/generator/Generator.py +++ b/grc/core/generator/Generator.py @@ -144,16 +144,16 @@ class TopBlockGenerator(object): pass return code - blocks = expr_utils.sort_objects( + blocks_all = expr_utils.sort_objects( [b for b in fg.blocks if b.get_enabled() and not b.get_bypassed()], operator.methodcaller('get_id'), _get_block_sort_text ) - deprecated_block_keys = set(block.get_name() for block in blocks if block.is_deprecated) + deprecated_block_keys = set(b.get_name() for b in blocks_all if b.is_deprecated) for key in deprecated_block_keys: Messages.send_warning("The block {!r} is deprecated.".format(key)) # List of regular blocks (all blocks minus the special ones) - blocks = [b for b in blocks if b not in imports and b not in parameters] + blocks = [b for b in blocks_all if b not in imports and b not in parameters] for block in blocks: key = block.get_key() @@ -220,18 +220,20 @@ class TopBlockGenerator(object): # List of variable names var_ids = [var.get_id() for var in parameters + variables] - # Prepend self. - replace_dict = dict([(var_id, 'self.%s' % var_id) for var_id in var_ids]) - # List of callbacks - callbacks = [ - expr_utils.expr_replace(cb, replace_dict) - for cb in sum([block.get_callbacks() for block in fg.get_enabled_blocks()], []) - ] + replace_dict = dict((var_id, 'self.' + var_id) for var_id in var_ids) + callbacks_all = [] + for block in blocks_all: + callbacks_all.extend(expr_utils.expr_replace(cb, replace_dict) for cb in block.get_callbacks()) + # Map var id to callbacks - var_id2cbs = dict([ - (var_id, [c for c in callbacks if expr_utils.get_variable_dependencies(c, [var_id])]) - for var_id in var_ids - ]) + def uses_var_id(): + used = expr_utils.get_variable_dependencies(callback, [var_id]) + return used and 'self.' + var_id in callback # callback might contain var_id itself + + callbacks = {} + for var_id in var_ids: + callbacks[var_id] = [callback for callback in callbacks_all if uses_var_id()] + # Load the namespace namespace = { 'title': title, @@ -245,7 +247,7 @@ class TopBlockGenerator(object): 'connection_templates': connection_templates, 'msgs': msgs, 'generate_options': self._generate_options, - 'var_id2cbs': var_id2cbs, + 'callbacks': callbacks, } # Build the template t = Template(open(FLOW_GRAPH_TEMPLATE, 'r').read(), namespace) @@ -265,8 +267,9 @@ class HierBlockGenerator(TopBlockGenerator): file_path: where to write the py file (the xml goes into HIER_BLOCK_LIB_DIR) """ TopBlockGenerator.__init__(self, flow_graph, file_path) + platform = flow_graph.parent - hier_block_lib_dir = flow_graph.parent_platform.config.hier_block_lib_dir + hier_block_lib_dir = platform.config.hier_block_lib_dir if not os.path.exists(hier_block_lib_dir): os.mkdir(hier_block_lib_dir) diff --git a/grc/core/generator/flow_graph.tmpl b/grc/core/generator/flow_graph.tmpl index c86808455b..5eef3d2042 100644 --- a/grc/core/generator/flow_graph.tmpl +++ b/grc/core/generator/flow_graph.tmpl @@ -13,7 +13,7 @@ ##@param connections the connections ##@param msgs the msg type connections ##@param generate_options the type of flow graph -##@param var_id2cbs variable id map to callback strings +##@param callbacks variable id map to callback strings ######################################################## #def indent($code) #set $code = '\n '.join(str($code).splitlines()) @@ -301,12 +301,12 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) #if $flow_graph.get_option('thread_safe_setters') with self._lock: self.$id = $id - #for $callback in $var_id2cbs[$id] + #for $callback in $callbacks[$id] $indent($callback) #end for #else self.$id = $id - #for $callback in $var_id2cbs[$id] + #for $callback in $callbacks[$id] $indent($callback) #end for #end if @@ -336,19 +336,22 @@ $short_id#slurp def argument_parser(): - #set $desc_args = 'usage="%prog: [options]", option_class=eng_option' + #set $arg_parser_args = '' #if $flow_graph.get_option('description') - #set $desc_args += ', description=description' + #set $arg_parser_args = 'description=description' description = $repr($flow_graph.get_option('description')) #end if - parser = OptionParser($desc_args) + parser = ArgumentParser($arg_parser_args) #for $param in $parameters #set $type = $param.get_param('type').get_value() #if $type #silent $params_eq_list.append('%s=options.%s'%($param.get_id(), $param.get_id())) - parser.add_option( - "$make_short_id($param)", "--$param.get_id().replace('_', '-')", dest="$param.get_id()", type="$type", default=$make_default($type, $param), - help="Set $($param.get_param('label').get_evaluated() or $param.get_id()) [default=%default]") + parser.add_argument( + #if $make_short_id($param) + "$make_short_id($param)", #slurp + #end if + "--$param.get_id().replace('_', '-')", dest="$param.get_id()", type=$type, default=$make_default($type, $param), + help="Set $($param.get_param('label').get_evaluated() or $param.get_id()) [default=%(default)r]") #end if #end for return parser @@ -358,7 +361,7 @@ def argument_parser(): def main(top_block_cls=$(class_name), options=None): #if $parameters if options is None: - options, _ = argument_parser().parse_args() + options = argument_parser().parse_args() #end if #if $flow_graph.get_option('realtime_scheduling') if gr.enable_realtime_scheduling() != gr.RT_OK: diff --git a/grc/core/utils/expr_utils.py b/grc/core/utils/expr_utils.py index 0577f06a75..555bd709b1 100644 --- a/grc/core/utils/expr_utils.py +++ b/grc/core/utils/expr_utils.py @@ -61,7 +61,7 @@ class graph(object): return self._graph[node_key] -def expr_split(expr): +def expr_split(expr, var_chars=VAR_CHARS): """ Split up an expression by non alphanumeric characters, including underscore. Leave strings in-tact. @@ -77,7 +77,7 @@ def expr_split(expr): tok = '' quote = '' for char in expr: - if quote or char in VAR_CHARS: + if quote or char in var_chars: if char == quote: quote = '' tok += char @@ -104,7 +104,7 @@ def expr_replace(expr, replace_dict): Returns: a new expression with the prepend """ - expr_splits = expr_split(expr) + expr_splits = expr_split(expr, var_chars=VAR_CHARS + '.') for i, es in enumerate(expr_splits): if es in list(replace_dict.keys()): expr_splits[i] = replace_dict[es] @@ -195,7 +195,3 @@ def sort_objects(objects, get_id, get_expr): # Return list of sorted objects return [id2obj[id] for id in sorted_ids] - -if __name__ == '__main__': - for i in sort_variables({'x': '1', 'y': 'x+1', 'a': 'x+y', 'b': 'y+1', 'c': 'a+b+x+y'}): - print(i) diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 8d4dc7841f..25c779b4d2 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -608,9 +608,8 @@ class ActionHandler: elif action == Actions.PAGE_CHANGE: # pass and run the global actions pass elif action == Actions.RELOAD_BLOCKS: - self.platform.load_blocks() - main.btwin.clear() - self.platform.load_block_tree(main.btwin) + self.platform.build_block_library() + main.btwin.repopulate() Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(bool( ParseXML.xml_failures)) Messages.send_xml_errors_if_any(ParseXML.xml_failures) diff --git a/grc/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py index 26086f58e9..89aac53a0e 100644 --- a/grc/gui/BlockTreeWindow.py +++ b/grc/gui/BlockTreeWindow.py @@ -27,7 +27,8 @@ from gi.repository import Gdk from gi.repository import GObject from . import Actions, Utils -from .Constants import DEFAULT_BLOCKS_WINDOW_WIDTH, DND_TARGETS +from . import Constants + NAME_INDEX, KEY_INDEX, DOC_INDEX = range(3) @@ -51,6 +52,18 @@ def _format_doc(doc): return out or 'undocumented' +def _format_cat_tooltip(category): + tooltip = '{}: {}'.format('Category' if len(category) > 1 else 'Module', category[-1]) + + if category == ('Core',): + tooltip += '\n\nThis subtree is meant for blocks included with GNU Radio (in-tree).' + + elif category == (Constants.DEFAULT_BLOCK_MODULE_NAME,): + tooltip += '\n\n' + Constants.DEFAULT_BLOCK_MODULE_TOOLTIP + + return tooltip + + class BlockTreeWindow(Gtk.VBox): """The block selection panel.""" @@ -100,66 +113,68 @@ class BlockTreeWindow(Gtk.VBox): renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn('Blocks', renderer, text=NAME_INDEX) self.treeview.append_column(column) - # try to enable the tooltips (available in pygtk 2.12 and above) - try: - self.treeview.set_tooltip_column(DOC_INDEX) - except: - pass + self.treeview.set_tooltip_column(DOC_INDEX) # setup sort order column.set_sort_column_id(0) self.treestore.set_sort_column_id(0, Gtk.SortType.ASCENDING) # setup drag and drop - self.treeview.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, DND_TARGETS, Gdk.DragAction.COPY) + self.treeview.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, Constants.DND_TARGETS, Gdk.DragAction.COPY) self.treeview.connect('drag-data-get', self._handle_drag_get_data) # make the scrolled window to hold the tree view scrolled_window = Gtk.ScrolledWindow() scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scrolled_window.add_with_viewport(self.treeview) - scrolled_window.set_size_request(DEFAULT_BLOCKS_WINDOW_WIDTH, -1) + scrolled_window.set_size_request(Constants.DEFAULT_BLOCKS_WINDOW_WIDTH, -1) self.pack_start(scrolled_window, True, True, 0) # map categories to iters, automatic mapping for root self._categories = {tuple(): None} self._categories_search = {tuple(): None} - # add blocks and categories - self.platform.load_block_tree(self) self.platform.block_docstrings_loaded_callback = self.update_docs + self.repopulate() def clear(self): - self.treestore.clear(); - self._categories = {tuple(): None} + self.treestore.clear() + self._categories = {(): None} + + def repopulate(self): + self.clear() + for block in six.itervalues(self.platform.blocks): + if block.category: + self.add_block(block) + self.expand_module_in_tree() + + def expand_module_in_tree(self, module_name='Core'): + self.treeview.collapse_all() + core_module_iter = self._categories.get((module_name,)) + if core_module_iter: + self.treeview.expand_row(self.treestore.get_path(core_module_iter), False) ############################################################ ## Block Tree Methods ############################################################ - def add_block(self, category, block=None, treestore=None, categories=None): + def add_block(self, block, treestore=None, categories=None): """ Add a block with category to this selection window. Add only the category when block is None. Args: - category: the category list or path string block: the block object or None """ - if treestore is None: - treestore = self.treestore - if categories is None: - categories = self._categories - - if isinstance(category, (str, six.text_type)): - category = category.split('/') - category = tuple(x for x in category if x) # tuple is hashable + treestore = treestore or self.treestore + categories = categories or self._categories + + category = tuple(filter(str, block.category)) # tuple is hashable, remove empty cats + # add category and all sub categories - for i, cat_name in enumerate(category): - sub_category = category[:i+1] - if sub_category not in categories: - iter_ = treestore.insert_before(categories[sub_category[:-1]], None) - treestore.set_value(iter_, NAME_INDEX, cat_name) + for level, parent_cat_name in enumerate(category, 1): + parent_category = category[:level] + if parent_category not in categories: + iter_ = treestore.insert_before(categories[parent_category[:-1]], None) + treestore.set_value(iter_, NAME_INDEX, parent_cat_name) treestore.set_value(iter_, KEY_INDEX, '') - treestore.set_value(iter_, DOC_INDEX, 'Category: ' + Utils.encode(cat_name)) - categories[sub_category] = iter_ + treestore.set_value(iter_, DOC_INDEX, _format_cat_tooltip(parent_cat_name)) + categories[parent_category] = iter_ # add block - if block is None: - return iter_ = treestore.insert_before(categories[category], None) treestore.set_value(iter_, NAME_INDEX, block.get_name()) treestore.set_value(iter_, KEY_INDEX, block.get_key()) @@ -212,7 +227,7 @@ class BlockTreeWindow(Gtk.VBox): key = widget.get_text().lower() if not key: self.treeview.set_model(self.treestore) - self.treeview.collapse_all() + self.expand_module_in_tree() else: matching_blocks = [b for b in list(self.platform.blocks.values()) if key in b.get_key().lower() or key in b.get_name().lower()] @@ -220,8 +235,7 @@ class BlockTreeWindow(Gtk.VBox): self.treestore_search.clear() self._categories_search = {tuple(): None} for block in matching_blocks: - self.add_block(block.get_category() or 'None', block, - self.treestore_search, self._categories_search) + self.add_block(block, self.treestore_search, self._categories_search) self.treeview.set_model(self.treestore_search) self.treeview.expand_all() diff --git a/grc/gui/Constants.py b/grc/gui/Constants.py index 8bb15acc09..035a7f8ca9 100644 --- a/grc/gui/Constants.py +++ b/grc/gui/Constants.py @@ -96,6 +96,13 @@ SCROLL_DISTANCE = 15 # How close the mouse click can be to a line and register a connection select. LINE_SELECT_SENSITIVITY = 5 +DEFAULT_BLOCK_MODULE_TOOLTIP = """\ +This subtree holds all blocks (from OOT modules) that specify no module name. \ +The module name is the root category enclosed in square brackets. + +Please consider contacting OOT module maintainer for any block in here \ +and kindly ask to update their GRC Block Descriptions or Block Tree to include a module name.""" + def update_font_size(font_size): global PORT_SEPARATION, BLOCK_FONT, PORT_FONT, PARAM_FONT, FONT_SIZE diff --git a/grc/main.py b/grc/main.py index 810ac7c66f..ff0811e22a 100755 --- a/grc/main.py +++ b/grc/main.py @@ -15,8 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -from __future__ import absolute_import -import optparse +import argparse import gi gi.require_version('Gtk', '3.0') @@ -38,10 +37,10 @@ This is free software, and you are welcome to redistribute it. def main(): - parser = optparse.OptionParser( - usage='usage: %prog [options] [saved flow graphs]', - version=VERSION_AND_DISCLAIMER_TEMPLATE % gr.version()) - options, args = parser.parse_args() + parser = argparse.ArgumentParser( + description=VERSION_AND_DISCLAIMER_TEMPLATE % gr.version()) + parser.add_argument('flow_graphs', nargs='*') + args = parser.parse_args() try: Gtk.window_set_default_icon(Gtk.IconTheme().load_icon('gnuradio-grc', 256, 0)) @@ -54,6 +53,6 @@ def main(): version_parts=(gr.major_version(), gr.api_version(), gr.minor_version()), install_prefix=gr.prefix() ) - ActionHandler(args, platform) + ActionHandler(args.flow_graphs, platform) Gtk.main() diff --git a/grc/test/.cache/v/cache/lastfailed b/grc/test/.cache/v/cache/lastfailed new file mode 100644 index 0000000000..9c73bf7055 --- /dev/null +++ b/grc/test/.cache/v/cache/lastfailed @@ -0,0 +1,3 @@ +{ + "test_no_re_cheetah_find.py::test_nested": true +}
\ No newline at end of file diff --git a/volk b/volk -Subproject f1c4b5534db875a05e71b3b0dd3fbf486ef2c6d +Subproject b930d7ffb9561be5d333301dea852fdbe104d36 |