diff options
author | Josh Blum <josh@joshknows.com> | 2011-07-28 17:02:58 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-07-28 17:02:58 -0700 |
commit | 8bc1c4dc5a8d31594e8768a10e05b4b0172e733e (patch) | |
tree | fcb957028a108ca719a6cb879e7d62713b35ba1c /gr-digital/swig | |
parent | 8c824bf2e3e6758aff05ee4b5f4d3f106a13c672 (diff) | |
parent | 8b3c4ccf922c602ae77dad7f3911b16bdd0112d3 (diff) |
Merge branch 'digital' of https://github.com/trondeau/gnuradio into digital
Conflicts:
gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.h
gnuradio-core/src/lib/general/gr_constellation_decoder_cb.h
gnuradio-core/src/lib/general/gr_costas_loop_cc.h
gnuradio-core/src/lib/general/gr_lms_dfe_cc.h
gnuradio-core/src/lib/general/gr_lms_dfe_ff.h
gr-digital/lib/Makefile.am
gr-digital/lib/digital_binary_slicer_fb.h
gr-digital/lib/digital_clock_recovery_mm_cc.h
gr-digital/lib/digital_clock_recovery_mm_ff.h
gr-digital/lib/digital_correlate_access_code_bb.h
gr-digital/lib/digital_crc32.h
gr-digital/lib/digital_mpsk_receiver_cc.h
gr-digital/python/Makefile.am
gr-digital/python/__init__.py
gr-digital/python/generic_mod_demod.py
gr-digital/python/pkt.py
gr-digital/python/psk2.py
gr-digital/python/qam.py
Diffstat (limited to 'gr-digital/swig')
-rw-r--r-- | gr-digital/swig/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gr-digital/swig/Makefile.am | 8 | ||||
-rw-r--r-- | gr-digital/swig/digital_binary_slicer_fb.i | 33 | ||||
-rw-r--r-- | gr-digital/swig/digital_clock_recovery_mm_cc.i | 51 | ||||
-rw-r--r-- | gr-digital/swig/digital_clock_recovery_mm_ff.i | 47 | ||||
-rw-r--r-- | gr-digital/swig/digital_correlate_access_code_bb.i | 60 | ||||
-rw-r--r-- | gr-digital/swig/digital_crc32.i | 27 | ||||
-rw-r--r-- | gr-digital/swig/digital_mpsk_receiver_cc.i | 60 | ||||
-rw-r--r-- | gr-digital/swig/digital_swig.i | 28 |
9 files changed, 311 insertions, 9 deletions
diff --git a/gr-digital/swig/CMakeLists.txt b/gr-digital/swig/CMakeLists.txt index a7374f0f0d..037c0a3f19 100644 --- a/gr-digital/swig/CMakeLists.txt +++ b/gr-digital/swig/CMakeLists.txt @@ -40,13 +40,19 @@ GR_SWIG_INSTALL( INSTALL( FILES + digital_binary_slicer_fb.i + digital_clock_recovery_mm_cc.i + digital_clock_recovery_mm_ff.i digital_constellation.i digital_constellation_receiver_cb.i digital_constellation_decoder_cb.i + digital_correlate_access_code_bb.i digital_costas_loop_cc.i digital_cma_equalizer_cc.i + digital_crc32.i digital_lms_dd_equalizer_cc.i digital_kurtotic_equalizer_cc.i + digital_mpsk_receiver_cc.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "digital_swig" ) diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am index b9ebf4cc54..08fb140acd 100644 --- a/gr-digital/swig/Makefile.am +++ b/gr-digital/swig/Makefile.am @@ -58,13 +58,19 @@ digital_swig_la_swig_libadd = \ # additional SWIG files to be installed digital_swig_swiginclude_headers = \ + digital_binary_slicer_fb.i \ + digital_clock_recovery_mm_cc.i \ + digital_clock_recovery_mm_ff.i \ digital_constellation.i \ digital_constellation_receiver_cb.i \ digital_constellation_decoder_cb.i \ + digital_correlate_access_code_bb.i \ digital_costas_loop_cc.i \ digital_cma_equalizer_cc.i \ + digital_crc32.i \ digital_lms_dd_equalizer_cc.i \ - digital_kurtotic_equalizer_cc.i + digital_kurtotic_equalizer_cc.i \ + digital_mpsk_receiver_cc.i digital_swig_swig_args = \ -I$(abs_top_srcdir)/gr-digital/lib \ diff --git a/gr-digital/swig/digital_binary_slicer_fb.i b/gr-digital/swig/digital_binary_slicer_fb.i new file mode 100644 index 0000000000..30603748b3 --- /dev/null +++ b/gr-digital/swig/digital_binary_slicer_fb.i @@ -0,0 +1,33 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,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. + */ + +GR_SWIG_BLOCK_MAGIC(digital,binary_slicer_fb); + +digital_binary_slicer_fb_sptr digital_make_binary_slicer_fb (); + +class digital_binary_slicer_fb : public gr_sync_block +{ + private: + digital_binary_slicer_fb (); + + public: +}; diff --git a/gr-digital/swig/digital_clock_recovery_mm_cc.i b/gr-digital/swig/digital_clock_recovery_mm_cc.i new file mode 100644 index 0000000000..4ce9a9725d --- /dev/null +++ b/gr-digital/swig/digital_clock_recovery_mm_cc.i @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,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. + */ + +GR_SWIG_BLOCK_MAGIC(digital,clock_recovery_mm_cc); + +digital_clock_recovery_mm_cc_sptr +digital_make_clock_recovery_mm_cc (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit) throw(std::exception); + +class digital_clock_recovery_mm_cc : public gr_sync_block +{ + private: + digital_clock_recovery_mm_cc (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit); + +public: + float mu() const { return d_mu;} + float omega() const { return d_omega;} + float gain_mu() const { return d_gain_mu;} + float gain_omega() const { return d_gain_omega;} + + void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; } + void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; } + void set_mu (float omega) { d_mu = mu; } + void set_omega (float omega) { d_omega = omega; + d_min_omega = omega*(1.0 - d_omega_relative_limit); + d_max_omega = omega*(1.0 + d_omega_relative_limit); + } + void set_verbose (bool verbose) { d_verbose = verbose; } +}; diff --git a/gr-digital/swig/digital_clock_recovery_mm_ff.i b/gr-digital/swig/digital_clock_recovery_mm_ff.i new file mode 100644 index 0000000000..054ef9ebfe --- /dev/null +++ b/gr-digital/swig/digital_clock_recovery_mm_ff.i @@ -0,0 +1,47 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,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. + */ + +GR_SWIG_BLOCK_MAGIC(digital,clock_recovery_mm_ff); + +digital_clock_recovery_mm_ff_sptr +digital_make_clock_recovery_mm_ff (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit=0.001) throw(std::exception); + +class digital_clock_recovery_mm_ff : public gr_sync_block +{ + private: + digital_clock_recovery_mm_ff (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit); + +public: + float mu() const; + float omega() const; + float gain_mu() const; + float gain_omega() const; + + void set_gain_mu (float gain_mu); + void set_gain_omega (float gain_omega); + void set_mu (float omega); + void set_omega (float omega); +}; diff --git a/gr-digital/swig/digital_correlate_access_code_bb.i b/gr-digital/swig/digital_correlate_access_code_bb.i new file mode 100644 index 0000000000..01087b8e93 --- /dev/null +++ b/gr-digital/swig/digital_correlate_access_code_bb.i @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,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. + */ + +GR_SWIG_BLOCK_MAGIC(digital,correlate_access_code_bb); + +/*! + * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100" + * \param threshold maximum number of bits that may be wrong + */ +digital_correlate_access_code_bb_sptr +digital_make_correlate_access_code_bb (const std::string &access_code, int threshold) + throw(std::out_of_range); + +/*! + * \brief Examine input for specified access code, one bit at a time. + * \ingroup block + * + * input: stream of bits, 1 bit per input byte (data in LSB) + * output: stream of bits, 2 bits per output byte (data in LSB, flag in next higher bit) + * + * Each output byte contains two valid bits, the data bit, and the + * flag bit. The LSB (bit 0) is the data bit, and is the original + * input data, delayed 64 bits. Bit 1 is the + * flag bit and is 1 if the corresponding data bit is the first data + * bit following the access code. Otherwise the flag bit is 0. + */ +class digital_correlate_access_code_bb : public gr_sync_block +{ + friend digital_correlate_access_code_bb_sptr + digital_make_correlate_access_code_bb (const std::string &access_code, int threshold); + protected: + digital_correlate_access_code_bb(const std::string &access_code, int threshold); + + public: + ~digital_correlate_access_code_bb(); + + /*! + * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100" + */ + bool set_access_code (const std::string &access_code); +}; diff --git a/gr-digital/swig/digital_crc32.i b/gr-digital/swig/digital_crc32.i new file mode 100644 index 0000000000..806bfad6a0 --- /dev/null +++ b/gr-digital/swig/digital_crc32.i @@ -0,0 +1,27 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,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. + */ + +%rename(update_crc32) digital_update_crc32; +%rename(crc32) digital_crc32; + +unsigned int digital_update_crc32(unsigned int crc, const std::string buf); +unsigned int digital_crc32(const std::string buf); diff --git a/gr-digital/swig/digital_mpsk_receiver_cc.i b/gr-digital/swig/digital_mpsk_receiver_cc.i new file mode 100644 index 0000000000..cdc9f661b5 --- /dev/null +++ b/gr-digital/swig/digital_mpsk_receiver_cc.i @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,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. + */ + +GR_SWIG_BLOCK_MAGIC(digital,mpsk_receiver_cc); + +digital_mpsk_receiver_cc_sptr digital_make_mpsk_receiver_cc (unsigned int M, float theta, + float alpha, float beta, + float fmin, float fmax, + float mu, float gain_mu, + float omega, float gain_omega, + float omega_rel); +class digital_mpsk_receiver_cc : public gr_block +{ + private: + digital_mpsk_receiver_cc (unsigned int M,float theta, + float alpha, float beta, + float fmin, float fmax, + float mu, float gain_mu, + float omega, float gain_omega, float omega_rel); +public: + float mu() const { return d_mu;} + float omega() const { return d_omega;} + float gain_mu() const { return d_gain_mu;} + float gain_omega() const { return d_gain_omega;} + void set_mu (float mu) { d_mu = mu; } + void set_omega (float omega) { + d_omega = omega; + d_min_omega = omega*(1.0 - d_omega_rel); + d_max_omega = omega*(1.0 + d_omega_rel); + } + void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; } + void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; } + float alpha() const { return d_alpha; } + float beta() const { return d_beta; } + float freq() const { return d_freq; } + float phase() const { return d_phase; } + void set_alpha(float alpha) { d_alpha = alpha; } + void set_beta(float beta) { d_beta = beta; } + void set_freq(float freq) { d_freq = freq; } + void set_phase(float phase) { d_phase = phase; } +}; diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i index 26a9dd130a..cfaadcaea4 100644 --- a/gr-digital/swig/digital_swig.i +++ b/gr-digital/swig/digital_swig.i @@ -22,22 +22,34 @@ %include "gnuradio.i" %{ +#include "digital_binary_slicer_fb.h" +#include "digital_clock_recovery_mm_cc.h" +#include "digital_clock_recovery_mm_ff.h" +#include "digital_cma_equalizer_cc.h" #include "digital_constellation.h" +#include "digital_constellation_decoder_cb.h" +#include "digital_constellation_receiver_cb.h" +#include "digital_correlate_access_code_bb.h" #include "digital_costas_loop_cc.h" -#include "digital_cma_equalizer_cc.h" -#include "digital_lms_dd_equalizer_cc.h" +#include "digital_crc32.h" #include "digital_kurtotic_equalizer_cc.h" -#include "digital_constellation_receiver_cb.h" -#include "digital_constellation_decoder_cb.h" +#include "digital_lms_dd_equalizer_cc.h" +#include "digital_mpsk_receiver_cc.h" %} +%include "digital_binary_slicer_fb.i" +%include "digital_clock_recovery_mm_cc.i" +%include "digital_clock_recovery_mm_ff.i" +%include "digital_cma_equalizer_cc.i" %include "digital_constellation.i" +%include "digital_constellation_decoder_cb.i" +%include "digital_constellation_receiver_cb.i" +%include "digital_correlate_access_code_bb.i" %include "digital_costas_loop_cc.i" -%include "digital_cma_equalizer_cc.i" -%include "digital_lms_dd_equalizer_cc.i" +%include "digital_crc32.i" %include "digital_kurtotic_equalizer_cc.i" -%include "digital_constellation_receiver_cb.i" -%include "digital_constellation_decoder_cb.i" +%include "digital_lms_dd_equalizer_cc.i" +%include "digital_mpsk_receiver_cc.i" #if SWIGGUILE %scheme %{ |