Update to gnuradio 3.7 API
This is one huge / ugly patch. It uses the new 3.7 namespaces and include path stuff. I stayed away from that _impl pattern because that's just dumb. Based on original patch by Dimitri Stolnikov <horiz0n@gmx.net> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
0039c7fec6
commit
022ec6859f
|
@ -1,22 +1,23 @@
|
||||||
# Copyright 2011 Free Software Foundation, Inc.
|
# Copyright 2011,2012 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of GNU Radio
|
# This file is part of GNU Radio
|
||||||
#
|
#
|
||||||
# GNU Radio is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 3, or (at your option)
|
# the Free Software Foundation; either version 3, or (at your option)
|
||||||
# any later version.
|
# any later version.
|
||||||
#
|
#
|
||||||
# GNU Radio is distributed in the hope that it will be useful,
|
# GNU Radio is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNU Radio; see the file COPYING. If not, write to
|
# along with GNU Radio; see the file COPYING. If not, write to
|
||||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Project setup
|
# Project setup
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -44,9 +45,9 @@ endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
# Find boost
|
# Find boost
|
||||||
########################################################################
|
########################################################################
|
||||||
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
|
if(UNIX AND EXISTS "/usr/lib64")
|
||||||
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
|
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
|
||||||
endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
|
endif(UNIX AND EXISTS "/usr/lib64")
|
||||||
set(Boost_ADDITIONAL_VERSIONS
|
set(Boost_ADDITIONAL_VERSIONS
|
||||||
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
|
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
|
||||||
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
|
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
|
||||||
|
@ -56,7 +57,7 @@ set(Boost_ADDITIONAL_VERSIONS
|
||||||
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
|
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
|
||||||
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
|
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
|
||||||
)
|
)
|
||||||
find_package(Boost "1.35")
|
find_package(Boost "1.35" COMPONENTS system)
|
||||||
|
|
||||||
if(NOT Boost_FOUND)
|
if(NOT Boost_FOUND)
|
||||||
message(FATAL_ERROR "Boost required to compile iqbalance")
|
message(FATAL_ERROR "Boost required to compile iqbalance")
|
||||||
|
@ -107,15 +108,10 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
|
||||||
########################################################################
|
########################################################################
|
||||||
# Find gnuradio build dependencies
|
# Find gnuradio build dependencies
|
||||||
########################################################################
|
########################################################################
|
||||||
find_package(Gruel)
|
set(GR_REQUIRED_COMPONENTS RUNTIME)
|
||||||
find_package(GnuradioCore)
|
find_package(Gnuradio "3.7.0")
|
||||||
|
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||||
if(NOT GRUEL_FOUND)
|
message(FATAL_ERROR "GnuRadio Runtime required to compile iqbalance")
|
||||||
message(FATAL_ERROR "Gruel required to compile iqbalance")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT GNURADIO_CORE_FOUND)
|
|
||||||
message(FATAL_ERROR "GnuRadio Core required to compile iqbalance")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -126,16 +122,14 @@ include_directories(
|
||||||
${Boost_INCLUDE_DIRS}
|
${Boost_INCLUDE_DIRS}
|
||||||
${FFTW3F_INCLUDE_DIRS}
|
${FFTW3F_INCLUDE_DIRS}
|
||||||
${LIBOSMODSP_INCLUDE_DIRS}
|
${LIBOSMODSP_INCLUDE_DIRS}
|
||||||
${GRUEL_INCLUDE_DIRS}
|
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||||
${GNURADIO_CORE_INCLUDE_DIRS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(
|
link_directories(
|
||||||
${Boost_LIBRARY_DIRS}
|
${Boost_LIBRARY_DIRS}
|
||||||
${FFTW3F_LIBRARY_DIRS}
|
${FFTW3F_LIBRARY_DIRS}
|
||||||
${LIBOSMODSP_LIBRARY_DIRS}
|
${LIBOSMODSP_LIBRARY_DIRS}
|
||||||
${GRUEL_LIBRARY_DIRS}
|
${GNURADIO_RUNTIME_LIBRARY_DIRS}
|
||||||
${GNURADIO_CORE_LIBRARY_DIRS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set component parameters
|
# Set component parameters
|
||||||
|
@ -157,7 +151,7 @@ add_custom_target(uninstall
|
||||||
########################################################################
|
########################################################################
|
||||||
# Add subdirectories
|
# Add subdirectories
|
||||||
########################################################################
|
########################################################################
|
||||||
add_subdirectory(include)
|
add_subdirectory(include/gnuradio/iqbalance)
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
add_subdirectory(swig)
|
add_subdirectory(swig)
|
||||||
add_subdirectory(python)
|
add_subdirectory(python)
|
||||||
|
|
|
@ -18,5 +18,6 @@
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
install(FILES
|
install(FILES
|
||||||
iqbalance_fix_cc.xml
|
iqbalance_fix_cc.xml
|
||||||
iqbalance_optimize_c.xml DESTINATION share/gnuradio/grc/blocks
|
iqbalance_optimize_c.xml
|
||||||
|
DESTINATION share/gnuradio/grc/blocks
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<name>IQ Bal Fix</name>
|
<name>IQ Bal Fix</name>
|
||||||
<key>iqbalance_fix_cc</key>
|
<key>iqbalance_fix_cc</key>
|
||||||
<category>IQ Balance</category>
|
<category>IQ Balance</category>
|
||||||
<import>import iqbalance</import>
|
<import>from gnuradio import iqbalance</import>
|
||||||
<make>iqbalance.fix_cc($mag, $phase)</make>
|
<make>iqbalance.fix_cc($mag, $phase)</make>
|
||||||
<callback>set_mag($mag)</callback>
|
<callback>set_mag($mag)</callback>
|
||||||
<callback>set_phase($phase)</callback>
|
<callback>set_phase($phase)</callback>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<name>IQ Bal Optimize</name>
|
<name>IQ Bal Optimize</name>
|
||||||
<key>iqbalance_optimize_c</key>
|
<key>iqbalance_optimize_c</key>
|
||||||
<category>IQ Balance</category>
|
<category>IQ Balance</category>
|
||||||
<import>import iqbalance</import>
|
<import>from gnuradio import iqbalance</import>
|
||||||
<make>iqbalance.optimize_c($period)</make>
|
<make>iqbalance.optimize_c($period)</make>
|
||||||
<callback>set_period($period)</callback>
|
<callback>set_period($period)</callback>
|
||||||
<param>
|
<param>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright 2011 Free Software Foundation, Inc.
|
# Copyright 2011,2012 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of GNU Radio
|
# This file is part of GNU Radio
|
||||||
#
|
#
|
||||||
|
@ -21,7 +21,8 @@
|
||||||
# Install public header files
|
# Install public header files
|
||||||
########################################################################
|
########################################################################
|
||||||
install(FILES
|
install(FILES
|
||||||
iqbalance_api.h
|
api.h
|
||||||
iqbalance_fix_cc.h
|
fix_cc.h
|
||||||
iqbalance_optimize_c.h DESTINATION include/iqbalance
|
optimize_c.h
|
||||||
|
DESTINATION include/gnuradio/iqbalance
|
||||||
)
|
)
|
|
@ -22,7 +22,7 @@
|
||||||
#ifndef INCLUDED_IQBALANCE_API_H
|
#ifndef INCLUDED_IQBALANCE_API_H
|
||||||
#define INCLUDED_IQBALANCE_API_H
|
#define INCLUDED_IQBALANCE_API_H
|
||||||
|
|
||||||
#include <gruel/attributes.h>
|
#include <gnuradio/attributes.h>
|
||||||
|
|
||||||
#ifdef gnuradio_iqbalance_EXPORTS
|
#ifdef gnuradio_iqbalance_EXPORTS
|
||||||
# define IQBALANCE_API __GR_ATTR_EXPORT
|
# define IQBALANCE_API __GR_ATTR_EXPORT
|
|
@ -0,0 +1,62 @@
|
||||||
|
/* -*- c++ -*- */
|
||||||
|
/*
|
||||||
|
* Copyright 2013 Sylvain Munaut <tnt@246tNt.com>
|
||||||
|
*
|
||||||
|
* 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_IQBALANCE_FIX_CC_H
|
||||||
|
#define INCLUDED_IQBALANCE_FIX_CC_H
|
||||||
|
|
||||||
|
#include <gnuradio/iqbalance/api.h>
|
||||||
|
#include <gnuradio/sync_block.h>
|
||||||
|
|
||||||
|
namespace gr {
|
||||||
|
namespace iqbalance {
|
||||||
|
|
||||||
|
class IQBALANCE_API fix_cc : public gr::sync_block
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
fix_cc(float mag, float phase);
|
||||||
|
|
||||||
|
float d_mag, d_phase;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef boost::shared_ptr<fix_cc> sptr;
|
||||||
|
|
||||||
|
static sptr make(float mag=0.0f, float phase=0.0f);
|
||||||
|
|
||||||
|
~fix_cc();
|
||||||
|
|
||||||
|
void set_mag(float mag) { this->d_mag = mag; }
|
||||||
|
void set_phase(float phase) { this->d_phase = phase; }
|
||||||
|
|
||||||
|
float mag() const { return this->d_mag; }
|
||||||
|
float phase() const { return this->d_phase; }
|
||||||
|
|
||||||
|
void apply_new_corrections (pmt::pmt_t msg);
|
||||||
|
|
||||||
|
int work (int noutput_items,
|
||||||
|
gr_vector_const_void_star &input_items,
|
||||||
|
gr_vector_void_star &output_items);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace iqbalance
|
||||||
|
} // namespace gr
|
||||||
|
|
||||||
|
#endif /* INCLUDED_IQBALANCE_FIX_CC_H */
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/* -*- c++ -*- */
|
||||||
|
/*
|
||||||
|
* Copyright 2013 Sylvain Munaut <tnt@246tNt.com>
|
||||||
|
*
|
||||||
|
* 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_IQBALANCE_OPTIMIZE_C_H
|
||||||
|
#define INCLUDED_IQBALANCE_OPTIMIZE_C_H
|
||||||
|
|
||||||
|
#include <gnuradio/iqbalance/api.h>
|
||||||
|
#include <gnuradio/sync_block.h>
|
||||||
|
|
||||||
|
namespace gr {
|
||||||
|
namespace iqbalance {
|
||||||
|
|
||||||
|
class IQBALANCE_API optimize_c : public gr::sync_block
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
optimize_c(int period);
|
||||||
|
|
||||||
|
int d_period, d_count;
|
||||||
|
bool d_first;
|
||||||
|
float d_mag, d_phase;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef boost::shared_ptr<optimize_c> sptr;
|
||||||
|
|
||||||
|
static sptr make(int period=0);
|
||||||
|
|
||||||
|
~optimize_c();
|
||||||
|
|
||||||
|
void set_period(int period) { this->d_period = period; }
|
||||||
|
int period() const { return this->d_period; }
|
||||||
|
|
||||||
|
float mag() const { return this->d_mag; }
|
||||||
|
float phase() const { return this->d_phase; }
|
||||||
|
|
||||||
|
void reset(void) {
|
||||||
|
this->d_first = true;
|
||||||
|
this->d_count = 0;
|
||||||
|
this->d_mag = this->d_phase = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace iqbalance
|
||||||
|
} // namespace gr
|
||||||
|
|
||||||
|
#endif /* INCLUDED_IQBALANCE_OPTIMIZE_C_H */
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
/* -*- c++ -*- */
|
|
||||||
/*
|
|
||||||
* Copyright 2013 Sylvain Munaut <tnt@246tNt.com>
|
|
||||||
*
|
|
||||||
* 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_IQBALANCE_FIX_CC_H
|
|
||||||
#define INCLUDED_IQBALANCE_FIX_CC_H
|
|
||||||
|
|
||||||
#include <iqbalance_api.h>
|
|
||||||
#include <gr_sync_block.h>
|
|
||||||
|
|
||||||
class iqbalance_fix_cc;
|
|
||||||
|
|
||||||
typedef boost::shared_ptr<iqbalance_fix_cc> iqbalance_fix_cc_sptr;
|
|
||||||
|
|
||||||
IQBALANCE_API iqbalance_fix_cc_sptr iqbalance_make_fix_cc (float mag=0.0f, float phase=0.0f);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief <+description+>
|
|
||||||
* \ingroup block
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class IQBALANCE_API iqbalance_fix_cc : public gr_sync_block
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
friend IQBALANCE_API iqbalance_fix_cc_sptr iqbalance_make_fix_cc (float mag, float phase);
|
|
||||||
|
|
||||||
iqbalance_fix_cc(float mag, float phase);
|
|
||||||
|
|
||||||
float d_mag, d_phase;
|
|
||||||
|
|
||||||
public:
|
|
||||||
~iqbalance_fix_cc();
|
|
||||||
|
|
||||||
void set_mag(float mag) { this->d_mag = mag; }
|
|
||||||
void set_phase(float phase) { this->d_phase = phase; }
|
|
||||||
|
|
||||||
float mag() const { return this->d_mag; }
|
|
||||||
float phase() const { return this->d_phase; }
|
|
||||||
|
|
||||||
void apply_new_corrections (pmt::pmt_t msg);
|
|
||||||
|
|
||||||
int work (int noutput_items,
|
|
||||||
gr_vector_const_void_star &input_items,
|
|
||||||
gr_vector_void_star &output_items);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* INCLUDED_IQBALANCE_FIX_CC_H */
|
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
/* -*- c++ -*- */
|
|
||||||
/*
|
|
||||||
* Copyright 2013 Sylvain Munaut <tnt@246tNt.com>
|
|
||||||
*
|
|
||||||
* 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_IQBALANCE_OPTIMIZE_C_H
|
|
||||||
#define INCLUDED_IQBALANCE_OPTIMIZE_C_H
|
|
||||||
|
|
||||||
#include <iqbalance_api.h>
|
|
||||||
#include <gr_sync_block.h>
|
|
||||||
|
|
||||||
class iqbalance_optimize_c;
|
|
||||||
|
|
||||||
typedef boost::shared_ptr<iqbalance_optimize_c> iqbalance_optimize_c_sptr;
|
|
||||||
|
|
||||||
IQBALANCE_API iqbalance_optimize_c_sptr iqbalance_make_optimize_c (int period=0);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief <+description+>
|
|
||||||
* \ingroup block
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class IQBALANCE_API iqbalance_optimize_c : public gr_sync_block
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
friend IQBALANCE_API iqbalance_optimize_c_sptr iqbalance_make_optimize_c (int period);
|
|
||||||
|
|
||||||
iqbalance_optimize_c(int period);
|
|
||||||
|
|
||||||
int d_period, d_count;
|
|
||||||
bool d_first;
|
|
||||||
float d_mag, d_phase;
|
|
||||||
|
|
||||||
public:
|
|
||||||
~iqbalance_optimize_c();
|
|
||||||
|
|
||||||
void set_period(int period) { this->d_period = period; }
|
|
||||||
int period() const { return this->d_period; }
|
|
||||||
|
|
||||||
float mag() const { return this->d_mag; }
|
|
||||||
float phase() const { return this->d_phase; }
|
|
||||||
|
|
||||||
void reset(void) {
|
|
||||||
this->d_first = true;
|
|
||||||
this->d_count = 0;
|
|
||||||
this->d_mag = this->d_phase = 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* INCLUDED_IQBALANCE_OPTIMIZE_C_H */
|
|
||||||
|
|
|
@ -19,8 +19,17 @@
|
||||||
# Setup library
|
# Setup library
|
||||||
########################################################################
|
########################################################################
|
||||||
include(GrPlatform) #define LIB_SUFFIX
|
include(GrPlatform) #define LIB_SUFFIX
|
||||||
add_library(gnuradio-iqbalance SHARED iqbalance_fix_cc.cc iqbalance_optimize_c.cc ${LIBOSMODSP_SOURCES})
|
|
||||||
target_link_libraries(gnuradio-iqbalance ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} ${LIBOSMODSP_LIBRARIES})
|
include_directories(${Boost_INCLUDE_DIR})
|
||||||
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
list(APPEND iqbalance_sources
|
||||||
|
fix_cc.cc
|
||||||
|
optimize_c.cc
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(gnuradio-iqbalance SHARED ${iqbalance_sources} ${LIBOSMODSP_SOURCES})
|
||||||
|
target_link_libraries(gnuradio-iqbalance ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${LIBOSMODSP_LIBRARIES})
|
||||||
set_target_properties(gnuradio-iqbalance PROPERTIES DEFINE_SYMBOL "gnuradio_iqbalance_EXPORTS")
|
set_target_properties(gnuradio-iqbalance PROPERTIES DEFINE_SYMBOL "gnuradio_iqbalance_EXPORTS")
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -22,49 +22,50 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gr_io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include "iqbalance_fix_cc.h"
|
#include <gnuradio/iqbalance/fix_cc.h>
|
||||||
|
|
||||||
|
namespace gr {
|
||||||
|
|
||||||
iqbalance_fix_cc_sptr
|
iqbalance::fix_cc::sptr
|
||||||
iqbalance_make_fix_cc (float mag, float phase)
|
iqbalance::fix_cc::make(float mag, float phase)
|
||||||
{
|
{
|
||||||
return gnuradio::get_initial_sptr (new iqbalance_fix_cc(mag, phase));
|
return gnuradio::get_initial_sptr(new iqbalance::fix_cc(mag, phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
iqbalance_fix_cc::iqbalance_fix_cc (float mag, float phase)
|
iqbalance::fix_cc::fix_cc(float mag, float phase)
|
||||||
: gr_sync_block ("fix_cc",
|
: gr::sync_block ("fix_cc",
|
||||||
gr_make_io_signature(1, 1, sizeof (gr_complex)),
|
gr::io_signature::make(1, 1, sizeof (gr_complex)),
|
||||||
gr_make_io_signature(1, 1, sizeof (gr_complex))),
|
gr::io_signature::make(1, 1, sizeof (gr_complex))),
|
||||||
d_mag(mag),
|
d_mag(mag),
|
||||||
d_phase(phase)
|
d_phase(phase)
|
||||||
{
|
{
|
||||||
message_port_register_in(pmt::mp("iqbal_corr"));
|
message_port_register_in(pmt::mp("iqbal_corr"));
|
||||||
set_msg_handler(pmt::mp("iqbal_corr"),
|
set_msg_handler(pmt::mp("iqbal_corr"),
|
||||||
boost::bind(&iqbalance_fix_cc::apply_new_corrections, this, _1));
|
boost::bind(&iqbalance::fix_cc::apply_new_corrections, this, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
iqbalance_fix_cc::~iqbalance_fix_cc()
|
iqbalance::fix_cc::~fix_cc()
|
||||||
{
|
{
|
||||||
/* Nothing to do */
|
/* Nothing to do */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
iqbalance_fix_cc::apply_new_corrections (pmt::pmt_t msg)
|
iqbalance::fix_cc::apply_new_corrections(pmt::pmt_t msg)
|
||||||
{
|
{
|
||||||
if (!pmt_is_f32vector(msg))
|
if (!pmt::is_f32vector(msg))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->set_mag(pmt_f32vector_ref(msg, 0));
|
this->set_mag(pmt::f32vector_ref(msg, 0));
|
||||||
this->set_phase(pmt_f32vector_ref(msg, 1));
|
this->set_phase(pmt::f32vector_ref(msg, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
iqbalance_fix_cc::work (int noutput_items,
|
iqbalance::fix_cc::work(int noutput_items,
|
||||||
gr_vector_const_void_star &input_items,
|
gr_vector_const_void_star &input_items,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
|
@ -90,3 +91,6 @@ iqbalance_fix_cc::work (int noutput_items,
|
||||||
|
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* namespace gr */
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gr_io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
#include "iqbalance_optimize_c.h"
|
#include <gnuradio/iqbalance/optimize_c.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <osmocom/dsp/cxvec.h>
|
#include <osmocom/dsp/cxvec.h>
|
||||||
|
@ -34,30 +34,32 @@ extern "C" {
|
||||||
#define FFT_COUNT 4
|
#define FFT_COUNT 4
|
||||||
|
|
||||||
|
|
||||||
iqbalance_optimize_c_sptr
|
namespace gr {
|
||||||
iqbalance_make_optimize_c (int period)
|
|
||||||
|
iqbalance::optimize_c::sptr
|
||||||
|
iqbalance::optimize_c::make(int period)
|
||||||
{
|
{
|
||||||
return gnuradio::get_initial_sptr (new iqbalance_optimize_c(period));
|
return gnuradio::get_initial_sptr (new iqbalance::optimize_c(period));
|
||||||
}
|
}
|
||||||
|
|
||||||
iqbalance_optimize_c::iqbalance_optimize_c (int period)
|
iqbalance::optimize_c::optimize_c(int period)
|
||||||
: gr_sync_block ("optimize_c",
|
: gr::sync_block ("optimize_c",
|
||||||
gr_make_io_signature(1, 1, sizeof (gr_complex)),
|
gr::io_signature::make(1, 1, sizeof (gr_complex)),
|
||||||
gr_make_io_signature(0, 0, 0)),
|
gr::io_signature::make(0, 0, 0)),
|
||||||
d_period(period), d_count(0), d_first(true), d_mag(0.0f), d_phase(0.0f)
|
d_period(period), d_count(0), d_first(true), d_mag(0.0f), d_phase(0.0f)
|
||||||
{
|
{
|
||||||
message_port_register_out(pmt::mp("iqbal_corr"));
|
message_port_register_out(pmt::mp("iqbal_corr"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
iqbalance_optimize_c::~iqbalance_optimize_c()
|
iqbalance::optimize_c::~optimize_c()
|
||||||
{
|
{
|
||||||
/* Nothing to do */
|
/* Nothing to do */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
iqbalance_optimize_c::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
iqbalance::optimize_c::forecast(int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
unsigned ninputs = ninput_items_required.size ();
|
unsigned ninputs = ninput_items_required.size ();
|
||||||
for (unsigned i = 0; i < ninputs; i++)
|
for (unsigned i = 0; i < ninputs; i++)
|
||||||
|
@ -66,7 +68,7 @@ iqbalance_optimize_c::forecast (int noutput_items, gr_vector_int &ninput_items_r
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
iqbalance_optimize_c::work(int noutput_items,
|
iqbalance::optimize_c::work(int noutput_items,
|
||||||
gr_vector_const_void_star &input_items,
|
gr_vector_const_void_star &input_items,
|
||||||
gr_vector_void_star &output_items)
|
gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
|
@ -121,8 +123,11 @@ iqbalance_optimize_c::work(int noutput_items,
|
||||||
|
|
||||||
p[0] = this->d_mag;
|
p[0] = this->d_mag;
|
||||||
p[1] = this->d_phase;
|
p[1] = this->d_phase;
|
||||||
pmt::pmt_t msg = pmt::pmt_init_f32vector(2, p);
|
pmt::pmt_t msg = pmt::init_f32vector(2, p);
|
||||||
message_port_pub(pmt::mp("iqbal_corr"), msg);
|
message_port_pub(pmt::mp("iqbal_corr"), msg);
|
||||||
|
|
||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* namespace gr */
|
||||||
|
|
|
@ -31,7 +31,7 @@ endif()
|
||||||
GR_PYTHON_INSTALL(
|
GR_PYTHON_INSTALL(
|
||||||
FILES
|
FILES
|
||||||
__init__.py
|
__init__.py
|
||||||
DESTINATION ${GR_PYTHON_DIR}/iqbalance
|
DESTINATION ${GR_PYTHON_DIR}/gnuradio/iqbalance
|
||||||
)
|
)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# Boston, MA 02110-1301, USA.
|
# Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Include swig generation macros
|
# Setup swig generation
|
||||||
########################################################################
|
########################################################################
|
||||||
find_package(SWIG)
|
find_package(SWIG)
|
||||||
find_package(PythonLibs)
|
find_package(PythonLibs)
|
||||||
|
@ -28,34 +28,23 @@ endif()
|
||||||
include(GrSwig)
|
include(GrSwig)
|
||||||
include(GrPython)
|
include(GrPython)
|
||||||
|
|
||||||
########################################################################
|
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
|
||||||
# Setup swig generation
|
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
|
||||||
########################################################################
|
|
||||||
foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS})
|
|
||||||
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig)
|
|
||||||
endforeach(incdir)
|
endforeach(incdir)
|
||||||
|
|
||||||
foreach(incdir ${GRUEL_INCLUDE_DIRS})
|
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/iqbalance_swig_doc.i)
|
||||||
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig)
|
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/iqbalance)
|
||||||
endforeach(incdir)
|
set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc)
|
||||||
|
|
||||||
set(GR_SWIG_LIBRARIES gnuradio-iqbalance)
|
set(GR_SWIG_LIBRARIES gnuradio-iqbalance)
|
||||||
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/iqbalance_swig_doc.i)
|
|
||||||
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
|
||||||
|
|
||||||
GR_SWIG_MAKE(iqbalance_swig iqbalance_swig.i)
|
GR_SWIG_MAKE(iqbalance_swig iqbalance_swig.i)
|
||||||
|
|
||||||
########################################################################
|
GR_SWIG_INSTALL(TARGETS iqbalance_swig DESTINATION ${GR_PYTHON_DIR}/gnuradio/iqbalance)
|
||||||
# Install the build swig module
|
|
||||||
########################################################################
|
|
||||||
GR_SWIG_INSTALL(TARGETS iqbalance_swig DESTINATION ${GR_PYTHON_DIR}/iqbalance)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Install swig .i files for development
|
|
||||||
########################################################################
|
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
iqbalance_swig.i
|
iqbalance_swig.i
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/iqbalance_swig_doc.i
|
${CMAKE_CURRENT_BINARY_DIR}/iqbalance_swig_doc.i
|
||||||
DESTINATION ${GR_INCLUDE_DIR}/iqbalance/swig
|
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include "iqbalance_fix_cc.h"
|
#include "gnuradio/iqbalance/fix_cc.h"
|
||||||
#include "iqbalance_optimize_c.h"
|
#include "gnuradio/iqbalance/optimize_c.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
GR_SWIG_BLOCK_MAGIC(iqbalance,fix_cc);
|
%include "gnuradio/iqbalance/fix_cc.h"
|
||||||
%include "iqbalance_fix_cc.h"
|
GR_SWIG_BLOCK_MAGIC2(iqbalance, fix_cc);
|
||||||
|
|
||||||
GR_SWIG_BLOCK_MAGIC(iqbalance,optimize_c);
|
%include "gnuradio/iqbalance/optimize_c.h"
|
||||||
%include "iqbalance_optimize_c.h"
|
GR_SWIG_BLOCK_MAGIC2(iqbalance, optimize_c);
|
||||||
|
|
Loading…
Reference in New Issue