diff options
Diffstat (limited to 'gr-analog/lib')
-rw-r--r-- | gr-analog/lib/CMakeLists.txt | 11 | ||||
-rw-r--r-- | gr-analog/lib/frequency_modulator_fc_impl.cc | 6 | ||||
-rw-r--r-- | gr-analog/lib/pll_carriertracking_cc_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/pll_freqdet_cf_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/pll_refout_cc_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/qa_analog.cc | 4 | ||||
-rw-r--r-- | gr-analog/lib/qa_sincos.cc | 75 | ||||
-rw-r--r-- | gr-analog/lib/qa_sincos.h | 47 | ||||
-rw-r--r-- | gr-analog/lib/sig_source_X_impl.h.t | 4 | ||||
-rw-r--r-- | gr-analog/lib/sincos.cc | 89 |
10 files changed, 8 insertions, 240 deletions
diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index 53cbb00a51..48fbb71b2f 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -140,7 +140,6 @@ list(APPEND analog_sources quadrature_demod_cf_impl.cc rail_ff_impl.cc simple_squelch_cc_impl.cc - sincos.cc ) #Add Windows DLL resource file if using MSVC @@ -162,7 +161,6 @@ list(APPEND analog_libs volk gnuradio-core gnuradio-filter - gnuradio-blocks ${Boost_LIBRARIES} ) @@ -184,7 +182,6 @@ if(ENABLE_TESTING) list(APPEND test_gr_analog_sources ${CMAKE_CURRENT_SOURCE_DIR}/test_gr_analog.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_analog.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_sincos.cc ) add_executable(test-gr-analog ${test_gr_analog_sources}) @@ -201,11 +198,3 @@ if(ENABLE_TESTING) GR_ADD_TEST(test_gr_analog test-gr-analog) endif(ENABLE_TESTING) - -CHECK_CXX_SOURCE_COMPILES(" - #define _GNU_SOURCE - #include <math.h> - int main(){double x, sin, cos; sincos(x, &sin, &cos); return 0;} - " HAVE_SINCOS -) -GR_ADD_COND_DEF(HAVE_SINCOS) diff --git a/gr-analog/lib/frequency_modulator_fc_impl.cc b/gr-analog/lib/frequency_modulator_fc_impl.cc index ae8c95d02f..2da7ee15f1 100644 --- a/gr-analog/lib/frequency_modulator_fc_impl.cc +++ b/gr-analog/lib/frequency_modulator_fc_impl.cc @@ -26,7 +26,7 @@ #include "frequency_modulator_fc_impl.h" #include <gr_io_signature.h> -#include <blocks/fxpt.h> +#include <gr_fxpt.h> #include <math.h> #include <boost/math/special_functions/trunc.hpp> @@ -70,8 +70,8 @@ namespace gr { float oi, oq; - int32_t angle = gr::blocks::fxpt::float_to_fixed (d_phase); - gr::blocks::fxpt::sincos(angle, &oq, &oi); + gr_int32 angle = gr_fxpt::float_to_fixed (d_phase); + gr_fxpt::sincos(angle, &oq, &oi); out[i] = gr_complex(oi, oq); } diff --git a/gr-analog/lib/pll_carriertracking_cc_impl.h b/gr-analog/lib/pll_carriertracking_cc_impl.h index 54de4442d1..c809736709 100644 --- a/gr-analog/lib/pll_carriertracking_cc_impl.h +++ b/gr-analog/lib/pll_carriertracking_cc_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_CARRIERTRACKING_CC_IMPL_H #include <analog/pll_carriertracking_cc.h> -#include <blocks/control_loop.h> namespace gr { namespace analog { - class pll_carriertracking_cc_impl - : public pll_carriertracking_cc, public blocks::control_loop + class pll_carriertracking_cc_impl : public pll_carriertracking_cc { private: float d_locksig,d_lock_threshold; diff --git a/gr-analog/lib/pll_freqdet_cf_impl.h b/gr-analog/lib/pll_freqdet_cf_impl.h index 10bcdc2157..3170d819b6 100644 --- a/gr-analog/lib/pll_freqdet_cf_impl.h +++ b/gr-analog/lib/pll_freqdet_cf_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_FREQDET_CF_IMPL_H #include <analog/pll_freqdet_cf.h> -#include <blocks/control_loop.h> namespace gr { namespace analog { - class pll_freqdet_cf_impl : - public pll_freqdet_cf, public blocks::control_loop + class pll_freqdet_cf_impl : public pll_freqdet_cf { private: float phase_detector(gr_complex sample,float ref_phase); diff --git a/gr-analog/lib/pll_refout_cc_impl.h b/gr-analog/lib/pll_refout_cc_impl.h index f8572f9b64..1734b6e138 100644 --- a/gr-analog/lib/pll_refout_cc_impl.h +++ b/gr-analog/lib/pll_refout_cc_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_REFOUT_CC_IMPL_H #include <analog/pll_refout_cc.h> -#include <blocks/control_loop.h> namespace gr { namespace analog { - class pll_refout_cc_impl - : public pll_refout_cc, public blocks::control_loop + class pll_refout_cc_impl : public pll_refout_cc { private: float mod_2pi (float in); diff --git a/gr-analog/lib/qa_analog.cc b/gr-analog/lib/qa_analog.cc index f1e3a45e27..c7c975a3e5 100644 --- a/gr-analog/lib/qa_analog.cc +++ b/gr-analog/lib/qa_analog.cc @@ -26,15 +26,11 @@ */ #include <qa_analog.h> -#include <qa_sincos.h> -#include <qa_rotator.h> CppUnit::TestSuite * qa_gr_analog::suite() { CppUnit::TestSuite *s = new CppUnit::TestSuite("gr-analog"); - s->addTest(gr::analog::qa_sincos::suite()); - return s; } diff --git a/gr-analog/lib/qa_sincos.cc b/gr-analog/lib/qa_sincos.cc deleted file mode 100644 index 62642c1171..0000000000 --- a/gr-analog/lib/qa_sincos.cc +++ /dev/null @@ -1,75 +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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <qa_sincos.h> -#include <analog/sincos.h> -#include <gruel/attributes.h> -#include <cppunit/TestAssert.h> -#include <cmath> - -namespace gr { - namespace analog { - - void - qa_sincos::t1() - { - static const unsigned int N = 1000; - double c_sin, c_cos; - double gr_sin, gr_cos; - - for(unsigned i = 0; i < N; i++) { - double x = i/100.0; - c_sin = sin(x); - c_cos = cos(x); - - analog::sincos(x, &gr_sin, &gr_cos); - - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_sin, gr_sin, 0.0001); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_cos, gr_cos, 0.0001); - } - } - - void - qa_sincos::t2() - { - static const unsigned int N = 1000; - float c_sin, c_cos; - float gr_sin, gr_cos; - - for(unsigned i = 0; i < N; i++) { - float x = i/100.0; - c_sin = sinf(x); - c_cos = cosf(x); - - analog::sincosf(x, &gr_sin, &gr_cos); - - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_sin, gr_sin, 0.0001); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_cos, gr_cos, 0.0001); - } - } - - } /* namespace analog */ -} /* namespace gr */ diff --git a/gr-analog/lib/qa_sincos.h b/gr-analog/lib/qa_sincos.h deleted file mode 100644 index f18e879dd8..0000000000 --- a/gr-analog/lib/qa_sincos.h +++ /dev/null @@ -1,47 +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. - */ - -#ifndef _QA_ANALOG_SINCOS_H_ -#define _QA_ANALOG_SINCOS_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -namespace gr { - namespace analog { - - class qa_sincos : public CppUnit::TestCase - { - CPPUNIT_TEST_SUITE(qa_sincos); - CPPUNIT_TEST(t1); - CPPUNIT_TEST(t2); - CPPUNIT_TEST_SUITE_END(); - - private: - void t1(); - void t2(); - }; - - } /* namespace analog */ -} /* namespace gr */ - -#endif /* _QA_ANALOG_SINCOS_H_ */ diff --git a/gr-analog/lib/sig_source_X_impl.h.t b/gr-analog/lib/sig_source_X_impl.h.t index 4fed9a060a..50f1791270 100644 --- a/gr-analog/lib/sig_source_X_impl.h.t +++ b/gr-analog/lib/sig_source_X_impl.h.t @@ -27,7 +27,7 @@ #include <analog/@BASE_NAME@.h> #include <gr_sync_block.h> -#include <blocks/fxpt_nco.h> +#include <gr_fxpt_nco.h> namespace gr { namespace analog { @@ -40,7 +40,7 @@ namespace gr { double d_frequency; double d_ampl; @TYPE@ d_offset; - gr::blocks::fxpt_nco d_nco; + gr_fxpt_nco d_nco; public: @IMPL_NAME@(double sampling_freq, gr_waveform_t waveform, diff --git a/gr-analog/lib/sincos.cc b/gr-analog/lib/sincos.cc deleted file mode 100644 index 14ceeb3a29..0000000000 --- a/gr-analog/lib/sincos.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,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 - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE // ask for GNU extensions if available -#endif - -#include <analog/sincos.h> -#include <math.h> - -namespace gr { - namespace analog { - -// ---------------------------------------------------------------- - -#if defined (HAVE_SINCOS) - - void - sincos(double x, double *sinx, double *cosx) - { - ::sincos(x, sinx, cosx); - } - -#else - - void - sincos(double x, double *sinx, double *cosx) - { - *sinx = sin(x); - *cosx = cos(x); - } - -#endif - -// ---------------------------------------------------------------- - -#if defined (HAVE_SINCOSF) - - void - sincosf(float x, float *sinx, float *cosx) - { - sincosf(x, sinx, cosx); - } - -#elif defined (HAVE_SINF) && defined (HAVE_COSF) - - void - sincosf(float x, float *sinx, float *cosx) - { - *sinx = sinf(x); - *cosx = cosf(x); - } - -#else - - void - sincosf(float x, float *sinx, float *cosx) - { - *sinx = sin(x); - *cosx = cos(x); - } - -#endif - - } /* namespace analog */ -} /* namespace gr */ |