diff options
author | Tom Rondeau | 2011-06-22 16:33:45 -0700 |
---|---|---|
committer | Tom Rondeau | 2011-06-22 16:33:45 -0700 |
commit | e13fcfbd9d82ea37610c5423229fa3a228fa604d (patch) | |
tree | 9ddefc3f2eff9ab3e7de394e1304b6dd83715b83 | |
parent | 5ce630cbce6460b739b175257ce0d717095a55f4 (diff) | |
parent | 233621d6bbc3c68109998d0e68ffc7df7de69eb4 (diff) | |
download | gnuradio-e13fcfbd9d82ea37610c5423229fa3a228fa604d.tar.gz gnuradio-e13fcfbd9d82ea37610c5423229fa3a228fa604d.tar.bz2 gnuradio-e13fcfbd9d82ea37610c5423229fa3a228fa604d.zip |
Merge pull request #2 from benreynwar/8psk
Constell obj
37 files changed, 636 insertions, 75 deletions
diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4 index 7cb25cfe4..c67696c7d 100644 --- a/config/grc_gnuradio_core.m4 +++ b/config/grc_gnuradio_core.m4 @@ -107,8 +107,6 @@ AC_DEFUN([GRC_GNURADIO_CORE],[ gnuradio-core/src/python/gnuradio/gru/Makefile \ gnuradio-core/src/python/gnuradio/gruimpl/Makefile \ gnuradio-core/src/python/gnuradio/vocoder/Makefile \ - gnuradio-core/src/python/gnuradio/utils/run_tests \ - gnuradio-core/src/python/gnuradio/utils/Makefile \ gnuradio-core/src/tests/Makefile \ gnuradio-core/src/utils/Makefile \ ]) diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index de1e50f0e..c157d4528 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -262,7 +262,6 @@ grinclude_HEADERS = \ gr_log2_const.h \ gr_map_bb.h \ gr_math.h \ - gr_metric_type.h \ gr_misc.h \ gr_nco.h \ gr_nlog10_ff.h \ diff --git a/gnuradio-core/src/python/gnuradio/Makefile.am b/gnuradio-core/src/python/gnuradio/Makefile.am index 1bec7dd19..eff35e95c 100644 --- a/gnuradio-core/src/python/gnuradio/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common if PYTHON -SUBDIRS = gr gru gruimpl blks2 blks2impl vocoder utils +SUBDIRS = gr gru gruimpl blks2 blks2impl vocoder grpython_PYTHON = \ __init__.py \ diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am b/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am index 6a2e7d5f7..34e246b36 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am @@ -29,7 +29,6 @@ grblkspythondir = $(grpythondir)/blks2impl grblkspython_PYTHON = \ __init__.py \ am_demod.py \ - bpsk.py \ channel_model.py \ dbpsk.py \ dbpsk2.py \ @@ -39,7 +38,6 @@ grblkspython_PYTHON = \ filterbank.py \ fm_demod.py \ fm_emph.py \ - generic_mod_demod.py \ generic_usrp.py \ gmsk.py \ cpm.py \ @@ -58,9 +56,6 @@ grblkspython_PYTHON = \ pfb_interpolator.py \ pkt.py \ psk.py \ - psk2.py \ - qam.py \ - qpsk.py \ rational_resampler.py \ standard_squelch.py \ stream_to_vector_decimator.py \ diff --git a/gr-digital/grc/Makefile.am b/gr-digital/grc/Makefile.am index 1c8ab9b33..d271ca06a 100644 --- a/gr-digital/grc/Makefile.am +++ b/gr-digital/grc/Makefile.am @@ -30,4 +30,8 @@ dist_grcblocks_DATA = \ digital_lms_dd_equalizer_cc.xml \ digital_kurtotic_equalizer_cc.xml \ digital_dxpsk_mod.xml \ - digital_dxpsk_demod.xml + digital_dxpsk_demod.xml \ + digital_psk_mod.xml \ + digital_psk_demod.xml \ + digital_qam_mod.xml \ + digital_qam_demod.xml diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml index 596669e5e..1be4110e1 100644 --- a/gr-digital/grc/digital_block_tree.xml +++ b/gr-digital/grc/digital_block_tree.xml @@ -39,5 +39,9 @@ <name>Digital Modulators</name> <block>digital_dxpsk_mod</block> <block>digital_dxpsk_demod</block> + <block>digital_psk_mod</block> + <block>digital_psk_demod</block> + <block>digital_qam_mod</block> + <block>digital_qam_demod</block> </cat> </cat> diff --git a/gr-digital/grc/digital_psk_demod.xml b/gr-digital/grc/digital_psk_demod.xml new file mode 100644 index 000000000..b2628ac88 --- /dev/null +++ b/gr-digital/grc/digital_psk_demod.xml @@ -0,0 +1,158 @@ +<?xml version="1.0"?> + +<!-- + Copyright 2009,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. +--> + +<!-- +################################################### +##PSK Demod +################################################### + --> +<block> + <name>PSK Demod</name> + <key>digital_psk_demod</key> + <import>from gnuradio import digital</import> + <make>digital.psk.psk_demod( + constellation_points=$constellation_points, + mod_code=$mod_code, + differential=$differential, + samples_per_symbol=$samples_per_symbol, + excess_bw=$excess_bw, + freq_alpha=$freq_alpha, + timing_alpha=$timing_alpha, + timing_max_dev=$timing_max_dev, + phase_alpha=$phase_alpha, + verbose=$verbose, + log=$log, + )</make> + <param> + <name>Number of Constellation Points</name> + <key>constellation_points</key> + <value>8</value> + <type>int</type> + </param> + <param> + <name>Gray Code</name> + <key>mod_code</key> + <type>enum</type> + <option> + <name>Yes</name> + <key>gray</key> + </option> + <option> + <name>No</name> + <key>none</key> + </option> + </param> + <param> + <name>Differential Encoding</name> + <key>differential</key> + <value>True</value> + <type>bool</type> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <param> + <name>Samples/Symbol</name> + <key>samples_per_symbol</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Excess BW</name> + <key>excess_bw</key> + <value>0.35</value> + <type>real</type> + </param> + <param> + <name>Frequency Alpha</name> + <key>freq_alpha</key> + <value>0.01</value> + <type>real</type> + </param> + <param> + <name>Timing Alpha</name> + <key>timing_alpha</key> + <value>0.100</value> + <type>real</type> + </param> + <param> + <name>Timing Max Dev</name> + <key>timing_max_dev</key> + <value>1.5</value> + <type>real</type> + </param> + <param> + <name>Phase Alpha</name> + <key>phase_alpha</key> + <value>0.1</value> + <type>real</type> + </param> + <param> + <name>Verbose</name> + <key>verbose</key> + <value>False</value> + <type>bool</type> + <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <param> + <name>Logging</name> + <key>log</key> + <value>False</value> + <type>bool</type> + <hide>#if str($log) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <sink> + <name>in</name> + <type>complex</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> + <source> + <name>sync</name> + <type>complex</type> + <optional>1</optional> + </source> +</block> diff --git a/gr-digital/grc/digital_psk_mod.xml b/gr-digital/grc/digital_psk_mod.xml new file mode 100644 index 000000000..f4566c2b4 --- /dev/null +++ b/gr-digital/grc/digital_psk_mod.xml @@ -0,0 +1,130 @@ +<?xml version="1.0"?> + +<!-- + Copyright 2009,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. +--> + +<!-- +################################################### +##PSK Mod +################################################### + --> +<block> + <name>PSK Mod</name> + <key>digital_psk_mod</key> + <import>from gnuradio import digital</import> + <make>digital.psk2.psk_mod( + constellation_points=$constellation_points, + mod_code=$mod_code, + differential=$differential, + samples_per_symbol=$samples_per_symbol, + excess_bw=$excess_bw, + verbose=$verbose, + log=$log, + )</make> + <param> + <name>Number of Constellation Points</name> + <key>constellation_points</key> + <value>8</value> + <type>int</type> + </param> + <param> + <name>Gray Code</name> + <key>mod_code</key> + <type>enum</type> + <option> + <name>Yes</name> + <key>gray</key> + </option> + <option> + <name>No</name> + <key>none</key> + </option> + </param> + <param> + <name>Differential Encoding</name> + <key>differential</key> + <value>True</value> + <type>bool</type> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <param> + <name>Samples/Symbol</name> + <key>samples_per_symbol</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Excess BW</name> + <key>excess_bw</key> + <value>0.35</value> + <type>real</type> + </param> + <param> + <name>Verbose</name> + <key>verbose</key> + <value>False</value> + <type>bool</type> + <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <param> + <name>Logging</name> + <key>log</key> + <value>False</value> + <type>bool</type> + <hide>#if str($log) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <sink> + <name>in</name> + <type>complex</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> + <source> + <name>sync</name> + <type>complex</type> + <optional>1</optional> + </source> +</block> diff --git a/gr-digital/grc/digital_qam_demod.xml b/gr-digital/grc/digital_qam_demod.xml new file mode 100644 index 000000000..88b20293e --- /dev/null +++ b/gr-digital/grc/digital_qam_demod.xml @@ -0,0 +1,158 @@ +<?xml version="1.0"?> + +<!-- + Copyright 2009,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. +--> + +<!-- +################################################### +##QAM Demod +################################################### + --> +<block> + <name>QAM Demod</name> + <key>digital_qam_demod</key> + <import>from gnuradio import digital</import> + <make>digital.qam.qam_demod( + constellation_points=$constellation_points, + mod_code=$mod_code, + differential=$differential, + samples_per_symbol=$samples_per_symbol, + excess_bw=$excess_bw, + freq_alpha=$freq_alpha, + timing_alpha=$timing_alpha, + timing_max_dev=$timing_max_dev, + phase_alpha=$phase_alpha, + verbose=$verbose, + log=$log, + )</make> + <param> + <name>Number of Constellation Points</name> + <key>constellation_points</key> + <value>16</value> + <type>int</type> + </param> + <param> + <name>Gray Code</name> + <key>mod_code</key> + <type>enum</type> + <option> + <name>Yes</name> + <key>gray</key> + </option> + <option> + <name>No</name> + <key>none</key> + </option> + </param> + <param> + <name>Differential Encoding</name> + <key>differential</key> + <value>True</value> + <type>bool</type> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <param> + <name>Samples/Symbol</name> + <key>samples_per_symbol</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Excess BW</name> + <key>excess_bw</key> + <value>0.35</value> + <type>real</type> + </param> + <param> + <name>Frequency Alpha</name> + <key>freq_alpha</key> + <value>0.01</value> + <type>real</type> + </param> + <param> + <name>Timing Alpha</name> + <key>timing_alpha</key> + <value>0.100</value> + <type>real</type> + </param> + <param> + <name>Timing Max Dev</name> + <key>timing_max_dev</key> + <value>1.5</value> + <type>real</type> + </param> + <param> + <name>Phase Alpha</name> + <key>phase_alpha</key> + <value>0.1</value> + <type>real</type> + </param> + <param> + <name>Verbose</name> + <key>verbose</key> + <value>False</value> + <type>bool</type> + <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <param> + <name>Logging</name> + <key>log</key> + <value>False</value> + <type>bool</type> + <hide>#if str($log) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <sink> + <name>in</name> + <type>complex</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> + <source> + <name>sync</name> + <type>complex</type> + <optional>1</optional> + </source> +</block> diff --git a/gr-digital/grc/digital_qam_mod.xml b/gr-digital/grc/digital_qam_mod.xml new file mode 100644 index 000000000..87782fe86 --- /dev/null +++ b/gr-digital/grc/digital_qam_mod.xml @@ -0,0 +1,130 @@ +<?xml version="1.0"?> + +<!-- + Copyright 2009,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. +--> + +<!-- +################################################### +##QAM Mod +################################################### + --> +<block> + <name>QAM Mod</name> + <key>digital_qam_mod</key> + <import>from gnuradio import digital</import> + <make>digital.qam.qam_mod( + constellation_points=$constellation_points, + mod_code=$mod_code, + differential=$differential, + samples_per_symbol=$samples_per_symbol, + excess_bw=$excess_bw, + verbose=$verbose, + log=$log, + )</make> + <param> + <name>Number of Constellation Points</name> + <key>constellation_points</key> + <value>16</value> + <type>int</type> + </param> + <param> + <name>Gray Code</name> + <key>mod_code</key> + <type>enum</type> + <option> + <name>Yes</name> + <key>gray</key> + </option> + <option> + <name>No</name> + <key>none</key> + </option> + </param> + <param> + <name>Differential Encoding</name> + <key>differential</key> + <value>True</value> + <type>bool</type> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <param> + <name>Samples/Symbol</name> + <key>samples_per_symbol</key> + <value>2</value> + <type>int</type> + </param> + <param> + <name>Excess BW</name> + <key>excess_bw</key> + <value>0.35</value> + <type>real</type> + </param> + <param> + <name>Verbose</name> + <key>verbose</key> + <value>False</value> + <type>bool</type> + <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <param> + <name>Logging</name> + <key>log</key> + <value>False</value> + <type>bool</type> + <hide>#if str($log) == 'False' then 'part' else 'none'#</hide> + <option> + <name>On</name> + <key>True</key> + </option> + <option> + <name>Off</name> + <key>False</key> + </option> + </param> + <sink> + <name>in</name> + <type>complex</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> + <source> + <name>sync</name> + <type>complex</type> + <optional>1</optional> + </source> +</block> diff --git a/gr-digital/lib/Makefile.am b/gr-digital/lib/Makefile.am index 25a2b6f7f..5d7fdecbf 100644 --- a/gr-digital/lib/Makefile.am +++ b/gr-digital/lib/Makefile.am @@ -29,7 +29,8 @@ grinclude_HEADERS = \ digital_costas_loop_cc.h \ digital_cma_equalizer_cc.h \ digital_lms_dd_equalizer_cc.h \ - digital_kurtotic_equalizer_cc.h + digital_kurtotic_equalizer_cc.h \ + digital_metric_type.h lib_LTLIBRARIES = libgnuradio-digital.la diff --git a/gr-digital/lib/digital_constellation.cc b/gr-digital/lib/digital_constellation.cc index edf0bda22..2263bba0b 100644 --- a/gr-digital/lib/digital_constellation.cc +++ b/gr-digital/lib/digital_constellation.cc @@ -22,7 +22,7 @@ #include <gr_io_signature.h> #include <digital_constellation.h> -#include <gr_metric_type.h> +#include <digital_metric_type.h> #include <gr_math.h> #include <gr_complex.h> #include <math.h> diff --git a/gr-digital/lib/digital_constellation.h b/gr-digital/lib/digital_constellation.h index 9da87a4de..4119b5803 100644 --- a/gr-digital/lib/digital_constellation.h +++ b/gr-digital/lib/digital_constellation.h @@ -27,7 +27,7 @@ #include <math.h> #include <gr_complex.h> #include <boost/enable_shared_from_this.hpp> -#include <gr_metric_type.h> +#include <digital_metric_type.h> /************************************************************/ /* digital_constellation */ diff --git a/gnuradio-core/src/lib/general/gr_metric_type.h b/gr-digital/lib/digital_metric_type.h index 74c93b55e..83de166f0 100644 --- a/gnuradio-core/src/lib/general/gr_metric_type.h +++ b/gr-digital/lib/digital_metric_type.h @@ -20,8 +20,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_METRIC_TYPE_H -#define INCLUDED_GR_METRIC_TYPE_H +#ifndef INCLUDED_DIGITAL_METRIC_TYPE_H +#define INCLUDED_DIGITAL_METRIC_TYPE_H typedef enum { TRELLIS_EUCLIDEAN = 200, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT diff --git a/gr-digital/python/Makefile.am b/gr-digital/python/Makefile.am index 13a3d1157..b1d0d11d8 100644 --- a/gr-digital/python/Makefile.am +++ b/gr-digital/python/Makefile.am @@ -38,5 +38,10 @@ digital_PYTHON = \ psk.py \ dbpsk.py \ dqpsk.py \ - d8psk.py + d8psk.py \ + psk2.py \ + generic_mod_demod.py \ + qam.py \ + bpsk.py \ + qpsk.py endif diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/bpsk.py b/gr-digital/python/bpsk.py index 16524de94..6d2eb5d6d 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/bpsk.py +++ b/gr-digital/python/bpsk.py @@ -27,7 +27,7 @@ from math import pi, log from cmath import exp from gnuradio import gr, modulation_utils2 -from gnuradio.blks2impl.generic_mod_demod import generic_mod, generic_demod +from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod # Default number of points in constellation. _def_constellation_points = 2 diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/generic_mod_demod.py b/gr-digital/python/generic_mod_demod.py index 44779754b..4b1819ed7 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/generic_mod_demod.py +++ b/gr-digital/python/generic_mod_demod.py @@ -27,7 +27,7 @@ Generic modulation and demodulation. from gnuradio import gr from gnuradio.modulation_utils2 import extract_kwargs_from_options_for_class -from gnuradio.utils import mod_codes +from gnuradio.digital.utils import mod_codes # default values (used in __init__ and add_options) _def_samples_per_symbol = 2 diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/psk2.py b/gr-digital/python/psk2.py index aaa9659a4..089af11dd 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/psk2.py +++ b/gr-digital/python/psk2.py @@ -27,8 +27,8 @@ from math import pi, log from cmath import exp from gnuradio import gr, modulation_utils2 -from gnuradio.blks2impl.generic_mod_demod import generic_mod, generic_demod -from gnuradio.utils import mod_codes, gray_code +from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod +from gnuradio.digital.utils import mod_codes, gray_code # Default number of points in constellation. _def_constellation_points = 4 diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qam.py b/gr-digital/python/qam.py index 9c135b25a..d22aac55e 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/qam.py +++ b/gr-digital/python/qam.py @@ -26,9 +26,9 @@ QAM modulation and demodulation. from math import pi, sqrt, log from gnuradio import gr, modulation_utils2 -from gnuradio.blks2impl.generic_mod_demod import generic_mod, generic_demod -from gnuradio.utils.gray_code import gray_code -from gnuradio.utils import mod_codes +from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod +from gnuradio.digital.utils.gray_code import gray_code +from gnuradio.digital.utils import mod_codes # Default number of points in constellation. _def_constellation_points = 16 diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qpsk.py b/gr-digital/python/qpsk.py index 4af8d0018..ea1724424 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/qpsk.py +++ b/gr-digital/python/qpsk.py @@ -27,7 +27,7 @@ doesn't work for non-differential encodings. """ from gnuradio import gr, modulation_utils2 -from gnuradio.blks2impl.generic_mod_demod import generic_mod +from gnuradio.digital.generic_mod_demod import generic_mod # Default number of points in constellation. diff --git a/gr-digital/python/utils/.gitignore b/gr-digital/python/utils/.gitignore new file mode 100644 index 000000000..60c81fdce --- /dev/null +++ b/gr-digital/python/utils/.gitignore @@ -0,0 +1,3 @@ +run_tests +Makefile +Makefile.in diff --git a/gnuradio-core/src/python/gnuradio/utils/Makefile.am b/gr-digital/python/utils/Makefile.am index c35951b44..c35951b44 100644 --- a/gnuradio-core/src/python/gnuradio/utils/Makefile.am +++ b/gr-digital/python/utils/Makefile.am diff --git a/gnuradio-core/src/python/gnuradio/utils/__init__.py b/gr-digital/python/utils/__init__.py index b3e997f9f..b3e997f9f 100644 --- a/gnuradio-core/src/python/gnuradio/utils/__init__.py +++ b/gr-digital/python/utils/__init__.py diff --git a/gnuradio-core/src/python/gnuradio/utils/alignment.py b/gr-digital/python/utils/alignment.py index d32365866..d32365866 100644 --- a/gnuradio-core/src/python/gnuradio/utils/alignment.py +++ b/gr-digital/python/utils/alignment.py diff --git a/gnuradio-core/src/python/gnuradio/utils/gray_code.py b/gr-digital/python/utils/gray_code.py index 926a1ded1..926a1ded1 100644 --- a/gnuradio-core/src/python/gnuradio/utils/gray_code.py +++ b/gr-digital/python/utils/gray_code.py diff --git a/gnuradio-core/src/python/gnuradio/utils/mod_codes.py b/gr-digital/python/utils/mod_codes.py index caacda5cc..caacda5cc 100644 --- a/gnuradio-core/src/python/gnuradio/utils/mod_codes.py +++ b/gr-digital/python/utils/mod_codes.py diff --git a/gnuradio-core/src/python/gnuradio/utils/run_tests.in b/gr-digital/python/utils/run_tests.in index adcbdfd21..adcbdfd21 100644 --- a/gnuradio-core/src/python/gnuradio/utils/run_tests.in +++ b/gr-digital/python/utils/run_tests.in diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am index 1e5c1de6d..69adf2568 100644 --- a/gr-digital/swig/Makefile.am +++ b/gr-digital/swig/Makefile.am @@ -63,6 +63,9 @@ digital_swig_swiginclude_headers = \ digital_lms_dd_equalizer_cc.i \ digital_kurtotic_equalizer_cc.i +digital_swig_swig_args = \ + -I$(abs_top_builddir)/gr-digital/lib + if GUILE TESTS += run_guile_tests endif
\ No newline at end of file diff --git a/gr-digital/swig/digital_constellation.i b/gr-digital/swig/digital_constellation.i index 7296ca114..40dd28a2b 100644 --- a/gr-digital/swig/digital_constellation.i +++ b/gr-digital/swig/digital_constellation.i @@ -24,7 +24,7 @@ %template(unsigned_int_vector) std::vector<unsigned int>; // Make sure metric types get SWIGed. -%include gr_metric_type.h +%include digital_metric_type.h class digital_constellation; typedef boost::shared_ptr<digital_constellation> digital_constellation_sptr; diff --git a/gr-trellis/src/lib/Makefile.am b/gr-trellis/src/lib/Makefile.am index 152608286..e81490089 100644 --- a/gr-trellis/src/lib/Makefile.am +++ b/gr-trellis/src/lib/Makefile.am @@ -29,8 +29,9 @@ EXTRA_DIST += \ trellis.test -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) \ + -I$(abs_top_builddir)/gr-digital/lib + # ---------------------------------------------------------------- # these scripts generate trellis codes from template files @@ -81,7 +82,6 @@ grinclude_HEADERS = \ quicksort_index.h \ base.h \ interleaver.h \ - metric_type.h \ calc_metric.h \ core_algorithms.h \ trellis_permutation.h \ @@ -160,6 +160,11 @@ include $(top_srcdir)/Makefile.par.gen BUILT_SOURCES += $(python_built_sources) +# Location of non-standard SWIG interface files +trellis_swig_args = \ + -I$(abs_top_builddir)/gr-digital/lib \ + -I$(abs_top_builddir)/gr-digital/swig + if GUILE TESTS += run_guile_tests endif diff --git a/gr-trellis/src/lib/calc_metric.h b/gr-trellis/src/lib/calc_metric.h index d628f44e0..fd20f8d36 100644 --- a/gr-trellis/src/lib/calc_metric.h +++ b/gr-trellis/src/lib/calc_metric.h @@ -25,7 +25,7 @@ #include <vector> #include <gr_complex.h> -#include <metric_type.h> +#include <digital_metric_type.h> template <class T> diff --git a/gr-trellis/src/lib/core_algorithms.h b/gr-trellis/src/lib/core_algorithms.h index fdb5f398e..fd45844c0 100644 --- a/gr-trellis/src/lib/core_algorithms.h +++ b/gr-trellis/src/lib/core_algorithms.h @@ -26,7 +26,7 @@ #include <cmath> #include <vector> //#include <gr_complex.h> -#include "metric_type.h" +#include "digital_metric_type.h" #include "fsm.h" #include "interleaver.h" diff --git a/gr-trellis/src/lib/metric_type.h b/gr-trellis/src/lib/metric_type.h deleted file mode 100644 index a1040f108..000000000 --- a/gr-trellis/src/lib/metric_type.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 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_TRELLIS_METRIC_TYPE_H -#define INCLUDED_TRELLIS_METRIC_TYPE_H - -typedef enum { - TRELLIS_EUCLIDEAN = 200, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT -} trellis_metric_type_t; - -#endif - diff --git a/gr-trellis/src/lib/trellis.i b/gr-trellis/src/lib/trellis.i index ee5f5da39..a030ab906 100644 --- a/gr-trellis/src/lib/trellis.i +++ b/gr-trellis/src/lib/trellis.i @@ -29,7 +29,7 @@ #include "trellis_siso_f.h" #include "trellis_siso_combined_f.h" #include "trellis_constellation_metrics_cf.h" -#include "gr_constellation.h" +#include "digital_constellation.h" %} @@ -41,15 +41,14 @@ %include "trellis_siso_f.i" %include "trellis_siso_combined_f.i" -%include "metric_type.h" %include "siso_type.h" %include "trellis_constellation_metrics_cf.i" %include "trellis_generated.i" -%import "gr_metric_type.h" -%import "gr_constellation.i" +%import "digital_metric_type.h" +%import "digital_constellation.i" %pythoncode %{ from gnuradio.gr import TRELLIS_EUCLIDEAN, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc index fb529aaa7..1d03886f1 100644 --- a/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc +++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc @@ -35,14 +35,14 @@ trellis_constellation_metrics_cf_sptr -trellis_make_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE) +trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE) { return gnuradio::get_initial_sptr (new trellis_constellation_metrics_cf (constellation, TYPE)); } -trellis_constellation_metrics_cf::trellis_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE) +trellis_constellation_metrics_cf::trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE) : gr_block ("constellation_metrics_cf", gr_make_io_signature (1, -1, sizeof (gr_complex)), gr_make_io_signature (1, -1, sizeof (float))), diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.h b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h index df35f16d2..a34c335ec 100644 --- a/gr-trellis/src/lib/trellis_constellation_metrics_cf.h +++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h @@ -24,13 +24,13 @@ #define INCLUDED_TRELLIS_CONSTELLATION_METRICS_CF_H #include <gr_block.h> -#include <gr_constellation.h> -#include <gr_metric_type.h> +#include <digital_constellation.h> +#include <digital_metric_type.h> class trellis_constellation_metrics_cf; typedef boost::shared_ptr<trellis_constellation_metrics_cf> trellis_constellation_metrics_cf_sptr; -trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE); +trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); /*! * \brief Evaluate metrics for use by the Viterbi algorithm. @@ -46,14 +46,14 @@ class trellis_constellation_metrics_cf : public gr_block gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); protected: - trellis_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE); + trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); private: - gr_constellation_sptr d_constellation; + digital_constellation_sptr d_constellation; trellis_metric_type_t d_TYPE; unsigned int d_O; unsigned int d_D; - friend trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE); + friend trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); }; diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.i b/gr-trellis/src/lib/trellis_constellation_metrics_cf.i index f863453f2..c17522b11 100644 --- a/gr-trellis/src/lib/trellis_constellation_metrics_cf.i +++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.i @@ -24,10 +24,10 @@ GR_SWIG_BLOCK_MAGIC(trellis,constellation_metrics_cf); -trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE); +trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); class trellis_constellation_metrics_cf : public gr_block { private: - trellis_constellation_metrics_cf (gr_constellation_sptr constellation, trellis_metric_type_t TYPE); + trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE); }; |