diff options
-rw-r--r-- | gnuradio-core/src/guile/tests/general_ctors.test | 6 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/Makefile.am | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/general/general.i | 2 | ||||
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gr/Makefile.am | 1 | ||||
-rw-r--r-- | gr-digital/lib/Makefile.am | 2 | ||||
-rw-r--r-- | gr-digital/lib/digital_correlate_access_code_bb.cc (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc) | 25 | ||||
-rw-r--r-- | gr-digital/lib/digital_correlate_access_code_bb.h (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h) | 26 | ||||
-rw-r--r-- | gr-digital/python/Makefile.am | 4 | ||||
-rwxr-xr-x | gr-digital/python/qa_correlate_access_code.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py) | 7 | ||||
-rw-r--r-- | gr-digital/swig/Makefile.am | 1 | ||||
-rw-r--r-- | gr-digital/swig/digital_correlate_access_code_bb.i (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i) | 18 | ||||
-rw-r--r-- | gr-digital/swig/digital_swig.i | 18 |
12 files changed, 55 insertions, 58 deletions
diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 26233b253..06cd39533 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -100,12 +100,6 @@ ;;; ./general/gr_copy.h (pass-if (true? (gr:copy 1))) -;;; ./general/gr_correlate_access_code_bb.h -(pass-if (true? (gr:correlate-access-code-bb "foo" 0))) -(pass-if-throw "confirm throw correlate-access-code-bb" #t - (true? (gr:correlate-access-code-bb - "00000000000000000000000000000000000000000000000000000000000000000" 0))) - ;;; ./general/gr_cpfsk_bc.h (pass-if (true? (gr:cpfsk-bc 1 1 1))) diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index f3244d4db..ed6717c4d 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -53,7 +53,6 @@ libgeneral_la_SOURCES = \ gr_complex_to_xxx.cc \ gr_conjugate_cc.cc \ gr_copy.cc \ - gr_correlate_access_code_bb.cc \ gr_count_bits.cc \ gr_cpfsk_bc.cc \ gr_crc32.cc \ @@ -204,7 +203,6 @@ grinclude_HEADERS = \ gr_complex_to_xxx.h \ gr_conjugate_cc.h \ gr_copy.h \ - gr_correlate_access_code_bb.h \ gr_count_bits.h \ gr_cpfsk_bc.h \ gr_crc32.h \ @@ -372,7 +370,6 @@ swiginclude_HEADERS = \ gr_complex_to_xxx.i \ gr_conjugate_cc.i \ gr_copy.i \ - gr_correlate_access_code_bb.i \ gr_cpfsk_bc.i \ gr_crc32.i \ gr_ctcss_squelch_ff.i \ diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 37e304481..d4bad60b8 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -105,7 +105,6 @@ #include <gr_test_types.h> #include <gr_test.h> #include <gr_unpack_k_bits_bb.h> -#include <gr_correlate_access_code_bb.h> #include <gr_diff_phasor_cc.h> #include <gr_diff_encoder_bb.h> #include <gr_diff_decoder_bb.h> @@ -225,7 +224,6 @@ %include "gr_test_types.h" %include "gr_test.i" %include "gr_unpack_k_bits_bb.i" -%include "gr_correlate_access_code_bb.i" %include "gr_diff_phasor_cc.i" %include "gr_diff_encoder_bb.i" %include "gr_diff_decoder_bb.i" diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index 640baf6f7..7bf1c0827 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -51,7 +51,6 @@ noinst_PYTHON = \ qa_classify.py \ qa_complex_to_xxx.py \ qa_copy.py \ - qa_correlate_access_code.py \ qa_delay.py \ qa_dc_blocker.py \ qa_diff_encoder.py \ diff --git a/gr-digital/lib/Makefile.am b/gr-digital/lib/Makefile.am index 3d39d15da..acefa1ef9 100644 --- a/gr-digital/lib/Makefile.am +++ b/gr-digital/lib/Makefile.am @@ -31,6 +31,7 @@ grinclude_HEADERS = \ digital_constellation.h \ digital_constellation_receiver_cb.h \ digital_constellation_decoder_cb.h \ + digital_correlate_access_code_bb.h \ digital_costas_loop_cc.h \ digital_cma_equalizer_cc.h \ digital_lms_dd_equalizer_cc.h \ @@ -46,6 +47,7 @@ libgnuradio_digital_la_SOURCES = \ digital_constellation.cc \ digital_constellation_receiver_cb.cc \ digital_constellation_decoder_cb.cc \ + digital_correlate_access_code_bb.cc \ digital_costas_loop_cc.cc \ digital_cma_equalizer_cc.cc \ digital_lms_dd_equalizer_cc.cc \ diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc b/gr-digital/lib/digital_correlate_access_code_bb.cc index 15f673411..f21b57d92 100644 --- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc +++ b/gr-digital/lib/digital_correlate_access_code_bb.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. + * Copyright 2004,2006,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,7 +24,7 @@ #include "config.h" #endif -#include <gr_correlate_access_code_bb.h> +#include <digital_correlate_access_code_bb.h> #include <gr_io_signature.h> #include <stdexcept> #include <gr_count_bits.h> @@ -34,14 +34,15 @@ #define VERBOSE 0 -gr_correlate_access_code_bb_sptr -gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) +digital_correlate_access_code_bb_sptr +digital_make_correlate_access_code_bb (const std::string &access_code, int threshold) { - return gnuradio::get_initial_sptr(new gr_correlate_access_code_bb (access_code, threshold)); + return gnuradio::get_initial_sptr(new digital_correlate_access_code_bb + (access_code, threshold)); } -gr_correlate_access_code_bb::gr_correlate_access_code_bb ( +digital_correlate_access_code_bb::digital_correlate_access_code_bb ( const std::string &access_code, int threshold) : gr_sync_block ("correlate_access_code_bb", gr_make_io_signature (1, 1, sizeof(char)), @@ -51,17 +52,17 @@ gr_correlate_access_code_bb::gr_correlate_access_code_bb ( { if (!set_access_code(access_code)){ - fprintf(stderr, "gr_correlate_access_code_bb: access_code is > 64 bits\n"); + fprintf(stderr, "digital_correlate_access_code_bb: access_code is > 64 bits\n"); throw std::out_of_range ("access_code is > 64 bits"); } } -gr_correlate_access_code_bb::~gr_correlate_access_code_bb () +digital_correlate_access_code_bb::~digital_correlate_access_code_bb () { } bool -gr_correlate_access_code_bb::set_access_code( +digital_correlate_access_code_bb::set_access_code( const std::string &access_code) { unsigned len = access_code.length(); // # of bytes in string @@ -84,9 +85,9 @@ gr_correlate_access_code_bb::set_access_code( } int -gr_correlate_access_code_bb::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) +digital_correlate_access_code_bb::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { const unsigned char *in = (const unsigned char *) input_items[0]; unsigned char *out = (unsigned char *) output_items[0]; diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h b/gr-digital/lib/digital_correlate_access_code_bb.h index 581713c14..2607ae84c 100644 --- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h +++ b/gr-digital/lib/digital_correlate_access_code_bb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005,2006,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,21 +20,21 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H -#define INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H +#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H +#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H #include <gr_sync_block.h> #include <string> -class gr_correlate_access_code_bb; -typedef boost::shared_ptr<gr_correlate_access_code_bb> gr_correlate_access_code_bb_sptr; +class digital_correlate_access_code_bb; +typedef boost::shared_ptr<digital_correlate_access_code_bb> digital_correlate_access_code_bb_sptr; /*! * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100" * \param threshold maximum number of bits that may be wrong */ -gr_correlate_access_code_bb_sptr -gr_make_correlate_access_code_bb (const std::string &access_code, int threshold); +digital_correlate_access_code_bb_sptr +digital_make_correlate_access_code_bb (const std::string &access_code, int threshold); /*! * \brief Examine input for specified access code, one bit at a time. @@ -49,10 +49,10 @@ gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) * 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 gr_correlate_access_code_bb : public gr_sync_block +class digital_correlate_access_code_bb : public gr_sync_block { - friend gr_correlate_access_code_bb_sptr - gr_make_correlate_access_code_bb (const std::string &access_code, int threshold); + friend digital_correlate_access_code_bb_sptr + digital_make_correlate_access_code_bb (const std::string &access_code, int threshold); private: unsigned long long d_access_code; // access code to locate start of packet // access code is left justified in the word @@ -64,10 +64,10 @@ class gr_correlate_access_code_bb : public gr_sync_block unsigned int d_threshold; // how many bits may be wrong in sync vector protected: - gr_correlate_access_code_bb(const std::string &access_code, int threshold); + digital_correlate_access_code_bb(const std::string &access_code, int threshold); public: - ~gr_correlate_access_code_bb(); + ~digital_correlate_access_code_bb(); int work(int noutput_items, gr_vector_const_void_star &input_items, @@ -80,4 +80,4 @@ class gr_correlate_access_code_bb : public gr_sync_block bool set_access_code (const std::string &access_code); }; -#endif /* INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H */ +#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H */ diff --git a/gr-digital/python/Makefile.am b/gr-digital/python/Makefile.am index e0cf477c5..0f68c6ded 100644 --- a/gr-digital/python/Makefile.am +++ b/gr-digital/python/Makefile.am @@ -37,7 +37,9 @@ noinst_PYTHON = \ qa_constellation.py \ qa_constellation_receiver.py \ qa_constellation_decoder_cb.py \ - qa_costas_loop_cc.py + qa_correlate_access_code.py \ + qa_costas_loop_cc.py \ + qa_lms_equalizer.py digital_PYTHON = \ __init__.py \ diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py b/gr-digital/python/qa_correlate_access_code.py index b3575f4e6..6b6f25051 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py +++ b/gr-digital/python/qa_correlate_access_code.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006,2007,2010 Free Software Foundation, Inc. +# Copyright 2006,2007,2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,6 +21,7 @@ # from gnuradio import gr, gr_unittest +import digital_swig import math default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC' @@ -52,7 +53,7 @@ class test_correlate_access_code(gr_unittest.TestCase): src_data = (1, 0, 1, 1, 1, 1, 0, 1, 1) + pad + (0,) * 7 expected_result = pad + (1, 0, 1, 1, 3, 1, 0, 1, 1, 2) + (0,) * 6 src = gr.vector_source_b (src_data) - op = gr.correlate_access_code_bb("1011", 0) + op = digital_swig.correlate_access_code_bb("1011", 0) dst = gr.vector_sink_b () self.tb.connect (src, op, dst) self.tb.run () @@ -69,7 +70,7 @@ class test_correlate_access_code(gr_unittest.TestCase): src_data = code + (1, 0, 1, 1) + pad expected_result = pad + code + (3, 0, 1, 1) src = gr.vector_source_b (src_data) - op = gr.correlate_access_code_bb(access_code, 0) + op = digital_swig.correlate_access_code_bb(access_code, 0) dst = gr.vector_sink_b () self.tb.connect (src, op, dst) self.tb.run () diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am index aad63ee44..df8f184b3 100644 --- a/gr-digital/swig/Makefile.am +++ b/gr-digital/swig/Makefile.am @@ -64,6 +64,7 @@ digital_swig_swiginclude_headers = \ 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_lms_dd_equalizer_cc.i \ diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i b/gr-digital/swig/digital_correlate_access_code_bb.i index bec4282f1..01087b8e9 100644 --- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i +++ b/gr-digital/swig/digital_correlate_access_code_bb.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,14 +20,14 @@ * Boston, MA 02110-1301, USA. */ -GR_SWIG_BLOCK_MAGIC(gr,correlate_access_code_bb); +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 */ -gr_correlate_access_code_bb_sptr -gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) +digital_correlate_access_code_bb_sptr +digital_make_correlate_access_code_bb (const std::string &access_code, int threshold) throw(std::out_of_range); /*! @@ -43,15 +43,15 @@ gr_make_correlate_access_code_bb (const std::string &access_code, int threshold) * 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 gr_correlate_access_code_bb : public gr_sync_block +class digital_correlate_access_code_bb : public gr_sync_block { - friend gr_correlate_access_code_bb_sptr - gr_make_correlate_access_code_bb (const std::string &access_code, int threshold); + friend digital_correlate_access_code_bb_sptr + digital_make_correlate_access_code_bb (const std::string &access_code, int threshold); protected: - gr_correlate_access_code_bb(const std::string &access_code, int threshold); + digital_correlate_access_code_bb(const std::string &access_code, int threshold); public: - ~gr_correlate_access_code_bb(); + ~digital_correlate_access_code_bb(); /*! * \param access_code is represented with 1 byte per bit, e.g., "010101010111000100" diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i index dd4f3c02c..23459a1e5 100644 --- a/gr-digital/swig/digital_swig.i +++ b/gr-digital/swig/digital_swig.i @@ -23,23 +23,25 @@ %{ #include "digital_binary_slicer_fb.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_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_binary_slicer_fb.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_kurtotic_equalizer_cc.i" -%include "digital_constellation_receiver_cb.i" -%include "digital_constellation_decoder_cb.i" +%include "digital_lms_dd_equalizer_cc.i" #if SWIGGUILE %scheme %{ |