From a88e67cb485d6b4b7bc21aa3c9dedbab37190cb9 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Sun, 22 Jan 2017 00:51:47 +0000 Subject: am-am am-pm diagram in syncmeasurement.ipynb --- gr-dpd/grc/CMakeLists.txt | 4 ++- gr-dpd/grc/dpd_lut.xml | 72 +++++++++++++++++++++++++++++++++++++++ gr-dpd/include/dpd/CMakeLists.txt | 4 ++- gr-dpd/include/dpd/lut.h | 66 +++++++++++++++++++++++++++++++++++ gr-dpd/python/CMakeLists.txt | 2 ++ gr-dpd/python/qa_lut.py | 41 ++++++++++++++++++++++ gr-dpd/swig/dpd_swig.i | 6 ++++ 7 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 gr-dpd/grc/dpd_lut.xml create mode 100644 gr-dpd/include/dpd/lut.h create mode 100755 gr-dpd/python/qa_lut.py (limited to 'gr-dpd') diff --git a/gr-dpd/grc/CMakeLists.txt b/gr-dpd/grc/CMakeLists.txt index a8e0497..3c4feb1 100644 --- a/gr-dpd/grc/CMakeLists.txt +++ b/gr-dpd/grc/CMakeLists.txt @@ -18,5 +18,7 @@ # Boston, MA 02110-1301, USA. install(FILES - dpd_memless_poly.xml DESTINATION share/gnuradio/grc/blocks + dpd_memless_poly.xml + dpd_lut.xml + dpd_clut.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/gr-dpd/grc/dpd_lut.xml b/gr-dpd/grc/dpd_lut.xml new file mode 100644 index 0000000..6af793e --- /dev/null +++ b/gr-dpd/grc/dpd_lut.xml @@ -0,0 +1,72 @@ + + + lut + dpd_lut + dpd + import dpd + dpd.lut($a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8) + set_a1($a1) + set_a2($a2) + set_a3($a3) + set_a4($a4) + set_a5($a5) + set_a6($a6) + set_a7($a7) + set_a8($a8) + + a1 + a1 + 0 + real + + + a2 + a2 + 0 + real + + + a3 + a3 + 0 + real + + + a4 + a4 + 0 + real + + + a5 + a5 + 0 + real + + + a6 + a6 + 0 + real + + + a7 + a7 + 0 + real + + + a8 + a8 + 0 + real + + + in + complex + + + out + complex + + diff --git a/gr-dpd/include/dpd/CMakeLists.txt b/gr-dpd/include/dpd/CMakeLists.txt index 700317c..6598918 100644 --- a/gr-dpd/include/dpd/CMakeLists.txt +++ b/gr-dpd/include/dpd/CMakeLists.txt @@ -22,5 +22,7 @@ ######################################################################## install(FILES api.h - memless_poly.h DESTINATION include/dpd + memless_poly.h + lut.h + clut.h DESTINATION include/dpd ) diff --git a/gr-dpd/include/dpd/lut.h b/gr-dpd/include/dpd/lut.h new file mode 100644 index 0000000..7bf568a --- /dev/null +++ b/gr-dpd/include/dpd/lut.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +/* + * Copyright 2017 <+YOU OR YOUR COMPANY+>. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR 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 software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef INCLUDED_DPD_LUT_H +#define INCLUDED_DPD_LUT_H + +#include +#include + +namespace gr { + namespace dpd { + + /*! + * \brief <+description of block+> + * \ingroup dpd + * + */ + class DPD_API lut : virtual public gr::block + { + public: + typedef boost::shared_ptr sptr; + + /*! + * \brief Return a shared_ptr to a new instance of dpd::lut. + * + * To avoid accidental use of raw pointers, dpd::lut's + * constructor is in a private implementation + * class. dpd::lut::make is the public interface for + * creating new instances. + */ + static sptr make(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8); + + virtual void set_a1(float sens) = 0; + virtual void set_a2(float sens) = 0; + virtual void set_a3(float sens) = 0; + virtual void set_a4(float sens) = 0; + virtual void set_a5(float sens) = 0; + virtual void set_a6(float sens) = 0; + virtual void set_a7(float sens) = 0; + virtual void set_a8(float sens) = 0; + + }; + + } // namespace dpd +} // namespace gr + +#endif /* INCLUDED_DPD_LUT_H */ + diff --git a/gr-dpd/python/CMakeLists.txt b/gr-dpd/python/CMakeLists.txt index e876217..afb0f59 100644 --- a/gr-dpd/python/CMakeLists.txt +++ b/gr-dpd/python/CMakeLists.txt @@ -42,3 +42,5 @@ include(GrTest) set(GR_TEST_TARGET_DEPS gnuradio-dpd) set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) GR_ADD_TEST(qa_memless_poly ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_memless_poly.py) +GR_ADD_TEST(qa_lut ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_lut.py) +GR_ADD_TEST(qa_clut ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_clut.py) diff --git a/gr-dpd/python/qa_lut.py b/gr-dpd/python/qa_lut.py new file mode 100755 index 0000000..d1cf636 --- /dev/null +++ b/gr-dpd/python/qa_lut.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright 2017 <+YOU OR YOUR COMPANY+>. +# +# This is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This software is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR 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 software; 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 +from gnuradio import blocks +import dpd_swig as dpd + +class qa_lut (gr_unittest.TestCase): + + def setUp (self): + self.tb = gr.top_block () + + def tearDown (self): + self.tb = None + + def test_001_t (self): + # set up fg + self.tb.run () + # check data + + +if __name__ == '__main__': + gr_unittest.run(qa_lut, "qa_lut.xml") diff --git a/gr-dpd/swig/dpd_swig.i b/gr-dpd/swig/dpd_swig.i index 18f93ab..5636efe 100644 --- a/gr-dpd/swig/dpd_swig.i +++ b/gr-dpd/swig/dpd_swig.i @@ -9,8 +9,14 @@ %{ #include "dpd/memless_poly.h" +#include "dpd/lut.h" +#include "dpd/clut.h" %} %include "dpd/memless_poly.h" GR_SWIG_BLOCK_MAGIC2(dpd, memless_poly); +%include "dpd/lut.h" +GR_SWIG_BLOCK_MAGIC2(dpd, lut); +%include "dpd/clut.h" +GR_SWIG_BLOCK_MAGIC2(dpd, clut); -- cgit v1.2.3