diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-02-21 19:34:27 -0500 |
commit | 4f479665bc9f04e52b047cb270772ee61e319a59 (patch) | |
tree | 09a018da0d2c14f160520707ecc2a2ff6ae8e1f1 | |
parent | 7b4a518bfe47fb1d0b2a32fc5c93ed0157d2dc6c (diff) |
blocks: removing blocks from gnuradio-core.
delay, rms, packed_to_unpacked, unpacked_to_packed.
66 files changed, 273 insertions, 2144 deletions
diff --git a/docs/sphinx/source/gr/converter_blk.rst b/docs/sphinx/source/gr/converter_blk.rst index 98cfcfee9f..81d159ece0 100644 --- a/docs/sphinx/source/gr/converter_blk.rst +++ b/docs/sphinx/source/gr/converter_blk.rst @@ -9,9 +9,3 @@ gnuradio.gr: Type Conversions .. autooldblock:: gnuradio.gr.complex_to_mag_squared .. autooldblock:: gnuradio.gr.complex_to_arg .. autooldblock:: gnuradio.gr.unpack_k_bits_bb -.. autooldblock:: gnuradio.gr.packed_to_unpacked_bb -.. autooldblock:: gnuradio.gr.packed_to_unpacked_ii -.. autooldblock:: gnuradio.gr.packed_to_unpacked_ss -.. autooldblock:: gnuradio.gr.unpacked_to_packed_bb -.. autooldblock:: gnuradio.gr.unpacked_to_packed_ii -.. autooldblock:: gnuradio.gr.unpacked_to_packed_ss diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst index d946d46879..f4804f1fd0 100644 --- a/docs/sphinx/source/gr/index.rst +++ b/docs/sphinx/source/gr/index.rst @@ -108,15 +108,6 @@ Filters gnuradio.gr.pfb_decimator_ccf gnuradio.gr.pfb_interpolator_ccf -Mathematics -^^^^^^^^^^^ - -.. autosummary:: - :nosignatures: - - gnuradio.gr.rms_cf - gnuradio.gr.rms_ff - Information Coding and Decoding ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -142,12 +133,6 @@ Type Conversions gnuradio.gr.complex_to_mag_squared gnuradio.gr.complex_to_arg gnuradio.gr.unpack_k_bits_bb - gnuradio.gr.packed_to_unpacked_bb - gnuradio.gr.packed_to_unpacked_ii - gnuradio.gr.packed_to_unpacked_ss - gnuradio.gr.unpacked_to_packed_bb - gnuradio.gr.unpacked_to_packed_ii - gnuradio.gr.unpacked_to_packed_ss Signal Level Control (AGC) ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -186,7 +171,6 @@ Miscellaneous Blocks :nosignatures: gnuradio.gr.copy - gnuradio.gr.delay gnuradio.gr.kludge_copy gnuradio.gr.nop gnuradio.gr.pa_2x2_phase_combiner diff --git a/docs/sphinx/source/gr/math_blk.rst b/docs/sphinx/source/gr/math_blk.rst deleted file mode 100644 index 208318def2..0000000000 --- a/docs/sphinx/source/gr/math_blk.rst +++ /dev/null @@ -1,5 +0,0 @@ -gnuradio.gr: Mathematics -======================== - -.. autooldblock:: gnuradio.gr.rms_cf -.. autooldblock:: gnuradio.gr.rms_ff diff --git a/docs/sphinx/source/gr/misc_blk.rst b/docs/sphinx/source/gr/misc_blk.rst index 56bcb7fbde..4c1a0ee551 100644 --- a/docs/sphinx/source/gr/misc_blk.rst +++ b/docs/sphinx/source/gr/misc_blk.rst @@ -2,7 +2,6 @@ gnuradio.gr: Miscellaneous Blocks ================================= .. autooldblock:: gnuradio.gr.copy -.. autooldblock:: gnuradio.gr.delay .. autooldblock:: gnuradio.gr.kludge_copy .. autooldblock:: gnuradio.gr.nop .. autooldblock:: gnuradio.gr.pa_2x2_phase_combiner diff --git a/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc b/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc index 5891500860..15452e5399 100644 --- a/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc +++ b/gnuradio-core/src/examples/ctrlport/pfb_sync_test-qt.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Feb 14 15:27:16 2013</timestamp> + <timestamp>Thu Feb 21 19:08:22 2013</timestamp> <block> <key>options</key> <param> @@ -130,37 +130,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(623, 64)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -409,6 +378,10 @@ <value>2</value> </param> <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> <key>gui_hint</key> <value></value> </param> @@ -640,26 +613,22 @@ </param> </block> <block> - <key>gr_file_source</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>gr_file_source_0</value> + <value>gr_throttle_0</value> </param> <param> <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>file</key> - <value>/dev/urandom</value> + <value>True</value> </param> <param> <key>type</key> <value>byte</value> </param> <param> - <key>repeat</key> - <value>True</value> + <key>samples_per_second</key> + <value>samp_rate</value> </param> <param> <key>vlen</key> @@ -667,7 +636,7 @@ </param> <param> <key>_coordinate</key> - <value>(228, 56)</value> + <value>(623, 64)</value> </param> <param> <key>_rotation</key> @@ -702,7 +671,42 @@ </param> <param> <key>_coordinate</key> - <value>(235, 126)</value> + <value>(234, 126)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_file_source</key> + <param> + <key>id</key> + <value>gr_file_source_0</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>file</key> + <value>/dev/urandom</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(228, 56)</value> </param> <param> <key>_rotation</key> @@ -710,10 +714,10 @@ </param> </block> <block> - <key>gr_packed_to_unpacked_xx</key> + <key>blocks_packed_to_unpacked_xx</key> <param> <key>id</key> - <value>gr_packed_to_unpacked_xx_0</value> + <value>blocks_packed_to_unpacked_xx_0</value> </param> <param> <key>_enabled</key> @@ -737,7 +741,7 @@ </param> <param> <key>_coordinate</key> - <value>(408, 56)</value> + <value>(419, 56)</value> </param> <param> <key>_rotation</key> @@ -745,12 +749,6 @@ </param> </block> <connection> - <source_block_id>gr_packed_to_unpacked_xx_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_throttle_0</source_block_id> <sink_block_id>digital_psk_mod_0</sink_block_id> <source_key>0</source_key> @@ -763,12 +761,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_file_source_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id> <sink_block_id>qtgui_const_sink_x_0</sink_block_id> <source_key>0</source_key> @@ -805,8 +797,20 @@ <sink_key>0</sink_key> </connection> <connection> + <source_block_id>blocks_packed_to_unpacked_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> <source_block_id>gr_vector_source_x_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>gr_file_source_0</source_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc b/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc index 0e470a619d..36238e5c18 100644 --- a/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc +++ b/gnuradio-core/src/examples/ctrlport/pfb_sync_test.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Feb 6 17:02:42 2013</timestamp> + <timestamp>Thu Feb 21 19:08:39 2013</timestamp> <block> <key>options</key> <param> @@ -363,107 +363,6 @@ </param> </block> <block> - <key>gr_file_source</key> - <param> - <key>id</key> - <value>gr_file_source_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>file</key> - <value>/dev/urandom</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>repeat</key> - <value>True</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(228, 56)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_packed_to_unpacked_xx</key> - <param> - <key>id</key> - <value>gr_packed_to_unpacked_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>bits_per_chunk</key> - <value>8</value> - </param> - <param> - <key>endianness</key> - <value>gr.GR_MSB_FIRST</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(408, 56)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>byte</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(623, 64)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>digital_pfb_clock_sync_xxx</key> <param> <key>id</key> @@ -623,18 +522,107 @@ <value>0</value> </param> </block> - <connection> - <source_block_id>gr_packed_to_unpacked_xx_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_file_source_0</source_block_id> - <sink_block_id>gr_packed_to_unpacked_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> + <block> + <key>gr_file_source</key> + <param> + <key>id</key> + <value>gr_file_source_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>file</key> + <value>/dev/urandom</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(229, 56)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(623, 64)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_packed_to_unpacked_xx</key> + <param> + <key>id</key> + <value>blocks_packed_to_unpacked_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>bits_per_chunk</key> + <value>8</value> + </param> + <param> + <key>endianness</key> + <value>gr.GR_MSB_FIRST</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(415, 56)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>gr_throttle_0</source_block_id> <sink_block_id>digital_psk_mod_0</sink_block_id> @@ -665,4 +653,16 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>gr_file_source_0</source_block_id> + <sink_block_id>blocks_packed_to_unpacked_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_packed_to_unpacked_xx_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index c562224009..de75dee7b8 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -105,7 +105,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt_nco.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_fxpt_vco.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_log2_const.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_math.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_misc.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_nco.h @@ -152,7 +151,6 @@ set(gr_core_general_triple_threats gr_complex_to_interleaved_short gr_complex_to_xxx gr_copy - gr_delay gr_endian_swap gr_fake_channel_coder_pp gr_feval @@ -170,8 +168,6 @@ set(gr_core_general_triple_threats gr_random_pdu gr_regenerate_bb gr_remez - gr_rms_cf - gr_rms_ff gr_skiphead gr_stretch_ff gr_test diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 53dcac6fb6..092582475d 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -38,10 +38,7 @@ //#include <gr_endianness.h> #include <gr_endian_swap.h> #include <gr_firdes.h> -#include <gr_delay.h> #include <gr_random_pdu.h> -#include <gr_rms_cf.h> -#include <gr_rms_ff.h> #include <gr_fake_channel_coder_pp.h> #include <gr_throttle.h> #include <gr_transcendental.h> @@ -87,10 +84,7 @@ //%include "gr_endianness.i" %include "gr_endian_swap.i" %include "gr_firdes.i" -%include "gr_delay.i" %include "gr_random_pdu.i" -%include "gr_rms_cf.i" -%include "gr_rms_ff.i" %include "gr_fake_channel_coder_pp.i" %include "gr_throttle.i" %include "gr_transcendental.i" diff --git a/gnuradio-core/src/lib/general/general_generated.i b/gnuradio-core/src/lib/general/general_generated.i index 251406c99e..900237214e 100644 --- a/gnuradio-core/src/lib/general/general_generated.i +++ b/gnuradio-core/src/lib/general/general_generated.i @@ -6,9 +6,6 @@ #include <gr_mute_ff.h> #include <gr_mute_ii.h> #include <gr_mute_ss.h> -#include <gr_packed_to_unpacked_bb.h> -#include <gr_packed_to_unpacked_ii.h> -#include <gr_packed_to_unpacked_ss.h> #include <gr_probe_signal_b.h> #include <gr_probe_signal_s.h> #include <gr_probe_signal_i.h> @@ -19,9 +16,6 @@ #include <gr_probe_signal_vi.h> #include <gr_probe_signal_vf.h> #include <gr_probe_signal_vc.h> -#include <gr_unpacked_to_packed_bb.h> -#include <gr_unpacked_to_packed_ii.h> -#include <gr_unpacked_to_packed_ss.h> #include <gr_vector_sink_b.h> #include <gr_vector_sink_c.h> #include <gr_vector_sink_f.h> @@ -38,9 +32,6 @@ %include <gr_mute_ff.i> %include <gr_mute_ii.i> %include <gr_mute_ss.i> -%include <gr_packed_to_unpacked_bb.i> -%include <gr_packed_to_unpacked_ii.i> -%include <gr_packed_to_unpacked_ss.i> %include <gr_probe_signal_b.i> %include <gr_probe_signal_s.i> %include <gr_probe_signal_i.i> @@ -51,9 +42,6 @@ %include <gr_probe_signal_vi.i> %include <gr_probe_signal_vf.i> %include <gr_probe_signal_vc.i> -%include <gr_unpacked_to_packed_bb.i> -%include <gr_unpacked_to_packed_ii.i> -%include <gr_unpacked_to_packed_ss.i> %include <gr_vector_sink_b.i> %include <gr_vector_sink_c.i> %include <gr_vector_sink_f.i> diff --git a/gnuradio-core/src/lib/general/gr_delay.cc b/gnuradio-core/src/lib/general/gr_delay.cc deleted file mode 100644 index 8f728948df..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.cc +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2010,2012 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_delay.h> -#include <gr_io_signature.h> -#include <string.h> - -gr_delay_sptr -gr_make_delay (size_t itemsize, int delay) -{ - return gnuradio::get_initial_sptr(new gr_delay (itemsize, delay)); -} - -gr_delay::gr_delay (size_t itemsize, int delay) - : gr_block ("delay", - gr_make_io_signature (1, -1, itemsize), - gr_make_io_signature (1, -1, itemsize)), - d_itemsize(itemsize) -{ - set_delay(delay); - d_delta = 0; -} - -void -gr_delay::forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - // make sure all inputs have noutput_items available - unsigned ninputs = ninput_items_required.size (); - for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = noutput_items; -} - -void -gr_delay::set_delay (int d) -{ - // only set a new delta if there is a change in the delay; this - // protects from quickly-repeated calls to this function that would - // end with d_delta=0. - if(d != delay()) { - gruel::scoped_lock l(d_mutex_delay); - int old = delay(); - set_history(d+1); - d_delta += delay() - old; - } -} - -int -gr_delay::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - gruel::scoped_lock l(d_mutex_delay); - assert(input_items.size() == output_items.size()); - - const char *iptr; - char *optr; - int cons, ret; - - // No change in delay; just memcpy ins to outs - if(d_delta == 0) { - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memcpy(optr, iptr, noutput_items*d_itemsize); - } - cons = noutput_items; - ret = noutput_items; - } - - // Skip over d_delta items on the input - else if(d_delta < 0) { - int n_to_copy, n_adj; - int delta = -d_delta; - n_to_copy = std::max(0, noutput_items-delta); - n_adj = std::min(delta, noutput_items); - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memcpy(optr, iptr+delta*d_itemsize, n_to_copy*d_itemsize); - } - cons = noutput_items; - ret = n_to_copy; - delta -= n_adj; - d_delta = -delta; - } - - //produce but not consume (inserts zeros) - else { // d_delta > 0 - int n_from_input, n_padding; - n_from_input = std::max(0, noutput_items-d_delta); - n_padding = std::min(d_delta, noutput_items); - for(size_t i = 0; i < input_items.size(); i++) { - iptr = (const char *) input_items[i]; - optr = (char *) output_items[i]; - std::memset(optr, 0, n_padding*d_itemsize); - std::memcpy(optr, iptr, n_from_input*d_itemsize); - } - cons = n_from_input; - ret = noutput_items; - d_delta -= n_padding; - } - - consume_each(cons); - return ret; -} diff --git a/gnuradio-core/src/lib/general/gr_delay.h b/gnuradio-core/src/lib/general/gr_delay.h deleted file mode 100644 index ed05c47f43..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2012 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_GR_DELAY_H -#define INCLUDED_GR_DELAY_H - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gruel/thread.h> - -class gr_delay; -typedef boost::shared_ptr<gr_delay> gr_delay_sptr; - -GR_CORE_API gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - -/*! - * \brief delay the input by a certain number of samples - * \ingroup misc_blk - */ -class GR_CORE_API gr_delay : public gr_block -{ - friend GR_CORE_API gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - - gr_delay (size_t itemsize, int delay); - - void forecast (int noutput_items, gr_vector_int &ninput_items_required); - - size_t d_itemsize; - int d_delta; - gruel::mutex d_mutex_delay; - - public: - int delay () const { return history()-1; } - void set_delay (int delay); - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_delay.i b/gnuradio-core/src/lib/general/gr_delay.i deleted file mode 100644 index f3d49891d7..0000000000 --- a/gnuradio-core/src/lib/general/gr_delay.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 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(gr,delay) - - gr_delay_sptr gr_make_delay (size_t itemsize, int delay); - -class gr_delay : public gr_block -{ - private: - gr_delay (size_t itemsize, int delay); - - public: - int delay() const { return history()-1; } - void set_delay (int delay) { set_history(delay+1); } -}; diff --git a/gnuradio-core/src/lib/general/gr_log2_const.h b/gnuradio-core/src/lib/general/gr_log2_const.h deleted file mode 100644 index 40afcf8b80..0000000000 --- a/gnuradio-core/src/lib/general/gr_log2_const.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - - -/* - * a bit of template hackery... - */ -#ifndef INCLUDED_GR_LOG2_CONST_H -#define INCLUDED_GR_LOG2_CONST_H - -#include <gr_core_api.h> -#include <assert.h> - -template<unsigned int k> static inline int gr_log2_const() { assert(0); return 0; } - -template<> inline int gr_log2_const<1>() { return 0; } -template<> inline int gr_log2_const<2>() { return 1; } -template<> inline int gr_log2_const<4>() { return 2; } -template<> inline int gr_log2_const<8>() { return 3; } -template<> inline int gr_log2_const<16>() { return 4; } -template<> inline int gr_log2_const<32>() { return 5; } -template<> inline int gr_log2_const<64>() { return 6; } -template<> inline int gr_log2_const<128>() { return 7; } -template<> inline int gr_log2_const<256>() { return 8; } -template<> inline int gr_log2_const<512>() { return 9; } -template<> inline int gr_log2_const<1024>(){ return 10; } - -#endif /* INCLUDED_GR_LOG2_CONST_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.cc b/gnuradio-core/src/lib/general/gr_rms_cf.cc deleted file mode 100644 index 44eb2221ea..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_rms_cf.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_rms_cf_sptr -gr_make_rms_cf(double alpha) -{ - return gnuradio::get_initial_sptr(new gr_rms_cf(alpha)); -} - -gr_rms_cf::gr_rms_cf (double alpha) - : gr_sync_block ("rms_cf", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha) -{ - -} - -gr_rms_cf::~gr_rms_cf() -{ -} - - -int -gr_rms_cf::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - double f = d_iir.filter(mag_sqrd); - out[i] = sqrt(f); - } - - return noutput_items; -} - -void -gr_rms_cf::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.h b/gnuradio-core/src/lib/general/gr_rms_cf.h deleted file mode 100644 index 9e701aa6a0..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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_GR_RMS_CF_H -#define INCLUDED_GR_RMS_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_rms_cf; -typedef boost::shared_ptr<gr_rms_cf> gr_rms_cf_sptr; - -GR_CORE_API gr_rms_cf_sptr -gr_make_rms_cf (double alpha = 0.0001); - -/*! - * \brief RMS average power - * \ingroup math_blk - */ -class GR_CORE_API gr_rms_cf : public gr_sync_block -{ - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - - friend GR_CORE_API gr_rms_cf_sptr - gr_make_rms_cf (double alpha); - - gr_rms_cf (double alpha); - -public: - ~gr_rms_cf (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool unmuted () const { return d_unmuted; } - - void set_alpha (double alpha); -}; - -#endif /* INCLUDED_GR_RMS_CF_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_cf.i b/gnuradio-core/src/lib/general/gr_rms_cf.i deleted file mode 100644 index a668200eef..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_cf.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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(gr,rms_cf); - -gr_rms_cf_sptr -gr_make_rms_cf (double alpha = 0.0001); - -class gr_rms_cf : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - void set_alpha (double alpha); -}; diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.cc b/gnuradio-core/src/lib/general/gr_rms_ff.cc deleted file mode 100644 index 233f419cd2..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_rms_ff.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_rms_ff_sptr -gr_make_rms_ff(double alpha) -{ - return gnuradio::get_initial_sptr(new gr_rms_ff(alpha)); -} - -gr_rms_ff::gr_rms_ff (double alpha) - : gr_sync_block ("rms_ff", - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha) -{ - -} - -gr_rms_ff::~gr_rms_ff() -{ -} - - -int -gr_rms_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i]*in[i]; - double f = d_iir.filter(mag_sqrd); - out[i] = sqrt(f); - } - - return noutput_items; -} - -void -gr_rms_ff::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.h b/gnuradio-core/src/lib/general/gr_rms_ff.h deleted file mode 100644 index 30cf7f9d9f..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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_GR_RMS_FF_H -#define INCLUDED_GR_RMS_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_rms_ff; -typedef boost::shared_ptr<gr_rms_ff> gr_rms_ff_sptr; - -GR_CORE_API gr_rms_ff_sptr -gr_make_rms_ff (double alpha = 0.0001); - -/*! - * \brief RMS average power - * \ingroup math_blk - */ -class GR_CORE_API gr_rms_ff : public gr_sync_block -{ - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - - friend GR_CORE_API gr_rms_ff_sptr - gr_make_rms_ff (double alpha); - - gr_rms_ff (double alpha); - -public: - ~gr_rms_ff (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool unmuted () const { return d_unmuted; } - - void set_alpha (double alpha); -}; - -#endif /* INCLUDED_GR_RMS_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_rms_ff.i b/gnuradio-core/src/lib/general/gr_rms_ff.i deleted file mode 100644 index 00b03f5d4b..0000000000 --- a/gnuradio-core/src/lib/general/gr_rms_ff.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 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(gr,rms_ff); - -gr_rms_ff_sptr -gr_make_rms_ff (double alpha = 0.0001); - -class gr_rms_ff : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - void set_alpha (double alpha); -}; diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index d018876183..5d5b2536c3 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -90,8 +90,6 @@ expand_h_cc_i(gr_probe_signal_vX b s i f c) expand_h_cc_i(gr_mute_XX ss ii ff cc) expand_h_cc_i(gr_moving_average_XX ss ii ff cc) -expand_h_cc_i(gr_unpacked_to_packed_XX bb ss ii) -expand_h_cc_i(gr_packed_to_unpacked_XX bb ss ii) expand_h_cc_i(gr_sample_and_hold_XX bb ss ii ff) expand_h_cc_i(gr_argmax_XX fs is ss) expand_h_cc_i(gr_max_XX ff ii ss) diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 6a04a75d72..ba9f7625e1 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -46,8 +46,6 @@ reg_roots = [ # other blocks others = ( - ('gr_unpacked_to_packed_XX', ('bb','ss','ii')), - ('gr_packed_to_unpacked_XX', ('bb','ss','ii')), ('gr_sample_and_hold_XX', ('bb','ss','ii','ff')), ('gr_argmax_XX', ('fs','is','ss')), ('gr_max_XX', ('ff','ii','ss')), diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t deleted file mode 100644 index 75e53c4ca1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.cc.t +++ /dev/null @@ -1,137 +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. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> -#include <gr_log2_const.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@I_TYPE@) * 8; -static const unsigned int LOG2_L_TYPE = gr_log2_const<sizeof(@I_TYPE@) * 8>(); - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate ((1.0 * BITS_PER_TYPE) / bits_per_chunk); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - - int input_required = (int) ceil((d_index + noutput_items * d_bits_per_chunk) / (1.0 * BITS_PER_TYPE)); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - //printf("Forecast wants %d needs %d\n",noutput_items,ninput_items_required[i]); - } -} - -unsigned int -get_bit_le (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>(bit_addr&(BITS_PER_TYPE-1)))&1; -} - -unsigned int -get_bit_be (const @I_TYPE@ *in_vector,unsigned int bit_addr) -{ - @I_TYPE@ x = in_vector[bit_addr>>LOG2_L_TYPE]; - return (x>>((BITS_PER_TYPE-1)-(bit_addr&(BITS_PER_TYPE-1))))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m < nstreams; m++){ - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp = d_index; - - // per stream processing - - switch (d_endianness){ - - case GR_MSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here msb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_be(in, index_tmp); - out[i] = x; - } - break; - - case GR_LSB_FIRST: - for (int i = 0; i < noutput_items; i++){ - //printf("here lsb %d\n",i); - @O_TYPE@ x = 0; - for(unsigned int j=0; j<d_bits_per_chunk; j++, index_tmp++) - x = (x<<1) | get_bit_le(in, index_tmp); - out[i] = x; - } - break; - - default: - assert(0); - } - - //printf("almost got to end\n"); - assert(ninput_items[m] >= (int) ((d_index+(BITS_PER_TYPE-1))>>LOG2_L_TYPE)); - } - - d_index = index_tmp; - consume_each (d_index >> LOG2_L_TYPE); - d_index = d_index & (BITS_PER_TYPE-1); - //printf("got to end\n"); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t deleted file mode 100644 index e95771b371..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.h.t +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_unpacked_to_packed_XX. - * - * The bits in the bytes or shorts input stream are grouped into chunks of - * \p bits_per_chunk bits and each resulting chunk is written right- - * justified to the output stream of bytes or shorts. - * All b or 16 bits of the each input bytes or short are processed. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX_ followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into - * arbitrary float or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ - -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } - -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t b/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_packed_to_unpacked_XX.i.t +++ /dev/null @@ -1,33 +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. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t deleted file mode 100644 index ed2b713dbb..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.cc.t +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 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. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <assert.h> - -static const unsigned int BITS_PER_TYPE = sizeof(@O_TYPE@) * 8; - - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness) -{ - return @SPTR_NAME@ - (new @NAME@ (bits_per_chunk,endianness)); -} - -@NAME@::@NAME@ (unsigned int bits_per_chunk, - gr_endianness_t endianness) - : gr_block ("@BASE_NAME@", - gr_make_io_signature (1, -1, sizeof (@I_TYPE@)), - gr_make_io_signature (1, -1, sizeof (@O_TYPE@))), - d_bits_per_chunk(bits_per_chunk),d_endianness(endianness),d_index(0) -{ - assert (bits_per_chunk <= BITS_PER_TYPE); - assert (bits_per_chunk > 0); - - set_relative_rate (bits_per_chunk/(1.0 * BITS_PER_TYPE)); -} - -void -@NAME@::forecast(int noutput_items, gr_vector_int &ninput_items_required) -{ - int input_required = (int) ceil( (d_index+noutput_items * 1.0 * BITS_PER_TYPE)/d_bits_per_chunk); - unsigned ninputs = ninput_items_required.size(); - for (unsigned int i = 0; i < ninputs; i++) { - ninput_items_required[i] = input_required; - } -} - -unsigned int -get_bit_be1 (const @I_TYPE@ *in_vector,unsigned int bit_addr, unsigned int bits_per_chunk) { - unsigned int byte_addr = (int)bit_addr/bits_per_chunk; - @I_TYPE@ x = in_vector[byte_addr]; - unsigned int residue = bit_addr - byte_addr * bits_per_chunk; - //printf("Bit addr %d byte addr %d residue %d val %d\n",bit_addr,byte_addr,residue,(x>>(bits_per_chunk-1-residue))&1); - return (x >> (bits_per_chunk-1-residue))&1; -} - -int -@NAME@::general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - unsigned int index_tmp = d_index; - - assert (input_items.size() == output_items.size()); - int nstreams = input_items.size(); - - for (int m=0; m< nstreams; m++) { - const @I_TYPE@ *in = (@I_TYPE@ *) input_items[m]; - @O_TYPE@ *out = (@O_TYPE@ *) output_items[m]; - index_tmp=d_index; - - // per stream processing - - //assert((ninput_items[m]-d_index)*d_bits_per_chunk >= noutput_items*BITS_PER_TYPE); - - switch(d_endianness){ - - case GR_MSB_FIRST: - for(int i=0;i<noutput_items;i++) { - @O_TYPE@ tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp<<1) | get_bit_be1(in,index_tmp,d_bits_per_chunk); - index_tmp++; - } - out[i] = tmp; - } - break; - - case GR_LSB_FIRST: - for(int i=0;i<noutput_items;i++) { - unsigned long tmp=0; - for(unsigned int j=0; j<BITS_PER_TYPE; j++) { - tmp = (tmp>>1)| (get_bit_be1(in,index_tmp,d_bits_per_chunk)<<(BITS_PER_TYPE-1)); - index_tmp++; - } - out[i] = tmp; - } - break; - - default: - assert(0); - } - } - - d_index = index_tmp; - consume_each ((int)(d_index/d_bits_per_chunk)); - d_index = d_index%d_bits_per_chunk; - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t deleted file mode 100644 index a7b7b54df9..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.h.t +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 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. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_block.h> -#include <gr_endianness.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -GR_CORE_API @SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -/*! - * \brief Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. - * \ingroup converter_blk - * - * input: stream of @I_TYPE@; output: stream of @O_TYPE@ - * - * This is the inverse of gr_packed_to_unpacked_XX. - * - * The low \p bits_per_chunk bits are extracted from each input byte or short. - * These bits are then packed densely into the output bytes or shorts, such that - * all 8 or 16 bits of the output bytes or shorts are filled with valid input bits. - * The right thing is done if bits_per_chunk is not a power of two. - * - * The combination of gr_packed_to_unpacked_XX followed by - * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the - * general case of mapping from a stream of bytes or shorts into arbitrary float - * or complex symbols. - * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa gr_chunks_to_symbols_bf, gr_chunks_to_symbols_bc. - * \sa gr_chunks_to_symbols_sf, gr_chunks_to_symbols_sc. - */ -class GR_CORE_API @NAME@ : public gr_block -{ - friend GR_CORE_API @SPTR_NAME@ - gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - - unsigned int d_bits_per_chunk; - gr_endianness_t d_endianness; - unsigned int d_index; - - public: - void forecast(int noutput_items, gr_vector_int &ninput_items_required); - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool check_topology(int ninputs, int noutputs) { return ninputs == noutputs; } -}; - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t b/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t deleted file mode 100644 index 1e978956a1..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_unpacked_to_packed_XX.i.t +++ /dev/null @@ -1,33 +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. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@SPTR_NAME@ -gr_make_@BASE_NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); - -class @NAME@ : public gr_block -{ - @NAME@ (unsigned int bits_per_chunk, gr_endianness_t endianness); -}; diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py b/gnuradio-core/src/python/gnuradio/gr/qa_delay.py deleted file mode 100755 index 0d0bc1330f..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 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. -# - -from gnuradio import gr, gr_unittest -import math - -class test_delay (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000 (self): - delta_t = 0 - tb = self.tb - src_data = [float(x) for x in range(0, 100)] - expected_result = tuple(delta_t*[0.0] + src_data) - - src = gr.vector_source_f(src_data) - op = gr.delay(gr.sizeof_float, delta_t) - dst = gr.vector_sink_f () - - tb.connect (src, op, dst) - tb.run () - dst_data = dst.data () - self.assertEqual (expected_result, dst_data) - - def test_010 (self): - delta_t = 10 - tb = self.tb - src_data = [float(x) for x in range(0, 100)] - expected_result = tuple(delta_t*[0.0] + src_data) - - src = gr.vector_source_f(src_data) - op = gr.delay(gr.sizeof_float, delta_t) - dst = gr.vector_sink_f () - - tb.connect (src, op, dst) - tb.run () - dst_data = dst.data () - self.assertEqual (expected_result, dst_data) - -if __name__ == '__main__': - gr_unittest.run(test_delay, "test_delay.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py b/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py deleted file mode 100755 index 08accd0ad1..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py +++ /dev/null @@ -1,405 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2010 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. -# - -from gnuradio import gr, gr_unittest -import random - -class test_packing(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block () - - def tearDown(self): - self.tb = None - - def test_001(self): - """ - Test stream_to_streams. - """ - src_data = (0x80,) - expected_results = (1,0,0,0,0,0,0,0) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_002(self): - """ - Test stream_to_streams. - """ - src_data = (0x80,) - expected_results = (0,0,0,0,0,0,0, 1) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_003(self): - """ - Test stream_to_streams. - """ - src_data = (0x11,) - expected_results = (4, 2) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(3, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_004(self): - """ - Test stream_to_streams. - """ - src_data = (0x11,) - expected_results = (0, 4) - src = gr.vector_source_b(src_data,False) - op = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_005(self): - """ - Test stream_to_streams. - """ - src_data = (1,0,0,0,0,0,1,0,0,1,0,1,1,0,1,0) - expected_results = (0x82,0x5a) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_006(self): - """ - Test stream_to_streams. - """ - src_data = (0,1,0,0,0,0,0,1,0,1,0,1,1,0,1,0) - expected_results = (0x82,0x5a) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - - def test_007(self): - """ - Test stream_to_streams. - """ - src_data = (4, 2, 0,0,0) - expected_results = (0x11,) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(3, gr.GR_LSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_008(self): - """ - Test stream_to_streams. - """ - src_data = (0, 4, 2,0,0) - expected_results = (0x11,) - src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op) - - dst = gr.vector_sink_b() - self.tb.connect(op, dst) - - self.tb.run() - - self.assertEqual(expected_results, dst.data()) - - def test_009(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(202): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - - self.assertEqual(expected_results[0:201], dst.data()) - - def test_010(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(56): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results[0:201], dst.data()) - - def test_011(self): - """ - Test stream_to_streams. - """ - - random.seed(0) - src_data = [] - for i in xrange(56): - src_data.append((random.randint(0,255))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_b() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results[0:201], dst.data()) - - - # tests on shorts - - def test_100a(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_100b(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_101a(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_101b(self): - """ - test short version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**15,2**15-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_s(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_s() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - # tests on ints - - def test_200a(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_200b(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_201a(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_MSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - def test_201b(self): - """ - test int version - """ - random.seed(0) - src_data = [] - for i in xrange(100): - src_data.append((random.randint(-2**31,2**31-1))) - src_data = tuple(src_data) - expected_results = src_data - src = gr.vector_source_i(tuple(src_data),False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) - self.tb.connect(src, op1, op2) - dst = gr.vector_sink_i() - self.tb.connect(op2, dst) - - self.tb.run() - self.assertEqual(expected_results, dst.data()) - - -if __name__ == '__main__': - gr_unittest.run(test_packing, "test_packing.xml") - diff --git a/gr-audio/examples/grc/cvsd_sweep.grc b/gr-audio/examples/grc/cvsd_sweep.grc index 88629f15c2..c0cd99ba1e 100644 --- a/gr-audio/examples/grc/cvsd_sweep.grc +++ b/gr-audio/examples/grc/cvsd_sweep.grc @@ -169,7 +169,7 @@ </param> </block> <block> - <key>gr_packed_to_unpacked_xx</key> + <key>blocks_packed_to_unpacked_xx</key> <param> <key>id</key> <value>p2u</value> diff --git a/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t index 9ab8b8bdfc..c00a27527e 100644 --- a/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t +++ b/gr-blocks/include/blocks/packed_to_unpacked_XX.h.t @@ -47,7 +47,7 @@ namespace gr { * processed. The right thing is done if bits_per_chunk is not a * power of two. * - * The combination of gr_packed_to_unpacked_XX_ followed by + * The combination of gr::blocks::packed_to_unpacked_XX_ followed by * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the * general case of mapping from a stream of bytes or shorts into * arbitrary float or complex symbols. diff --git a/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t index 749f0e00f9..d570785a68 100644 --- a/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t +++ b/gr-blocks/include/blocks/unpacked_to_packed_XX.h.t @@ -46,7 +46,7 @@ namespace gr { * output bytes or shorts are filled with valid input bits. The * right thing is done if bits_per_chunk is not a power of two. * - * The combination of gr_packed_to_unpacked_XX followed by + * The combination of gr::blocks::packed_to_unpacked_XX followed by * gr_chunks_to_symbols_Xf or gr_chunks_to_symbols_Xc handles the * general case of mapping from a stream of bytes or shorts into * arbitrary float or complex symbols. diff --git a/gr-blocks/python/qa_packed_to_unpacked.py b/gr-blocks/python/qa_packed_to_unpacked.py index 98a02e78f6..d84f5dbd37 100755 --- a/gr-blocks/python/qa_packed_to_unpacked.py +++ b/gr-blocks/python/qa_packed_to_unpacked.py @@ -62,7 +62,7 @@ class test_packing(gr_unittest.TestCase): src_data = (0x11,) expected_results = (4, 2) src = gr.vector_source_b(src_data, False) - op = gr.packed_to_unpacked_bb(3, gr.GR_LSB_FIRST) + op = blocks.packed_to_unpacked_bb(3, gr.GR_LSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -75,7 +75,7 @@ class test_packing(gr_unittest.TestCase): src_data = (0x11,) expected_results = (0, 4) src = gr.vector_source_b(src_data, False) - op = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) + op = blocks.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -88,7 +88,7 @@ class test_packing(gr_unittest.TestCase): src_data = (1,0,0,0,0,0,1,0,0,1,0,1,1,0,1,0) expected_results = (0x82, 0x5a) src = gr.vector_source_b(src_data, False) - op = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) + op = blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -101,7 +101,7 @@ class test_packing(gr_unittest.TestCase): src_data = (0,1,0,0,0,0,0,1,0,1,0,1,1,0,1,0) expected_results = (0x82, 0x5a) src = gr.vector_source_b(src_data, False) - op = gr.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) + op = blocks.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -114,7 +114,7 @@ class test_packing(gr_unittest.TestCase): src_data = (4, 2, 0,0,0) expected_results = (0x11,) src = gr.vector_source_b(src_data, False) - op = gr.unpacked_to_packed_bb(3, gr.GR_LSB_FIRST) + op = blocks.unpacked_to_packed_bb(3, gr.GR_LSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -127,7 +127,7 @@ class test_packing(gr_unittest.TestCase): src_data = (0, 4, 2,0,0) expected_results = (0x11,) src = gr.vector_source_b(src_data,False) - op = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) + op = blocks.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op) @@ -145,8 +145,8 @@ class test_packing(gr_unittest.TestCase): expected_results = src_data src = gr.vector_source_b(tuple(src_data), False) - op1 = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op1, op2) @@ -163,8 +163,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_b(tuple(src_data), False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_bb(7, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_bb(7, gr.GR_MSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op1, op2) @@ -181,8 +181,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_b(tuple(src_data),False) - op1 = gr.packed_to_unpacked_bb(7, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_bb(7, gr.GR_LSB_FIRST) + op1 = blocks.packed_to_unpacked_bb(7, gr.GR_LSB_FIRST) + op2 = blocks.unpacked_to_packed_bb(7, gr.GR_LSB_FIRST) dst = gr.vector_sink_b() self.tb.connect(src, op1, op2) @@ -201,8 +201,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_s(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_ss(1, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_ss(1, gr.GR_MSB_FIRST) dst = gr.vector_sink_s() self.tb.connect(src, op1, op2) @@ -219,8 +219,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_s(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ss(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(1, gr.GR_LSB_FIRST) + op1 = blocks.packed_to_unpacked_ss(1, gr.GR_LSB_FIRST) + op2 = blocks.unpacked_to_packed_ss(1, gr.GR_LSB_FIRST) dst = gr.vector_sink_s() self.tb.connect(src, op1, op2) @@ -237,8 +237,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_s(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_ss(8, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_ss(8, gr.GR_MSB_FIRST) dst = gr.vector_sink_s() self.tb.connect(src, op1, op2) @@ -255,8 +255,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_s(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ss(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ss(8, gr.GR_LSB_FIRST) + op1 = blocks.packed_to_unpacked_ss(8, gr.GR_LSB_FIRST) + op2 = blocks.unpacked_to_packed_ss(8, gr.GR_LSB_FIRST) dst = gr.vector_sink_s() self.tb.connect(src, op1, op2) @@ -275,8 +275,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_ii(1, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_ii(1, gr.GR_MSB_FIRST) dst = gr.vector_sink_i() self.tb.connect(src, op1, op2) @@ -293,8 +293,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ii(1, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(1, gr.GR_LSB_FIRST) + op1 = blocks.packed_to_unpacked_ii(1, gr.GR_LSB_FIRST) + op2 = blocks.unpacked_to_packed_ii(1, gr.GR_LSB_FIRST) dst = gr.vector_sink_i() self.tb.connect(src, op1, op2) @@ -311,8 +311,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_MSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_MSB_FIRST) + op1 = blocks.packed_to_unpacked_ii(8, gr.GR_MSB_FIRST) + op2 = blocks.unpacked_to_packed_ii(8, gr.GR_MSB_FIRST) dst = gr.vector_sink_i() self.tb.connect(src, op1, op2) @@ -329,8 +329,8 @@ class test_packing(gr_unittest.TestCase): src_data = tuple(src_data) expected_results = src_data src = gr.vector_source_i(tuple(src_data), False) - op1 = gr.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) - op2 = gr.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) + op1 = blocks.packed_to_unpacked_ii(8, gr.GR_LSB_FIRST) + op2 = blocks.unpacked_to_packed_ii(8, gr.GR_LSB_FIRST) dst = gr.vector_sink_i() self.tb.connect(src, op1, op2) diff --git a/gr-digital/examples/narrowband/digital_bert_tx.py b/gr-digital/examples/narrowband/digital_bert_tx.py index 5559f8698e..3be9d68f87 100755 --- a/gr-digital/examples/narrowband/digital_bert_tx.py +++ b/gr-digital/examples/narrowband/digital_bert_tx.py @@ -51,7 +51,7 @@ class bert_transmit(gr.hier_block2): gray_coded, excess_bw, verbose, log) - self._pack = gr.unpacked_to_packed_bb(self._mod.bits_per_symbol(), gr.GR_MSB_FIRST) + self._pack = blocks.unpacked_to_packed_bb(self._mod.bits_per_symbol(), gr.GR_MSB_FIRST) self.connect(self._bits, self._scrambler, self._pack, self._mod, self) diff --git a/gr-digital/include/digital/chunks_to_symbols_XX.h.t b/gr-digital/include/digital/chunks_to_symbols_XX.h.t index 341afabbab..6ad10ae261 100644 --- a/gr-digital/include/digital/chunks_to_symbols_XX.h.t +++ b/gr-digital/include/digital/chunks_to_symbols_XX.h.t @@ -41,15 +41,15 @@ namespace gr { * * out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1 * - * The combination of gr_packed_to_unpacked_XX followed by + * The combination of gr::blocks::packed_to_unpacked_XX followed by * digital_chunks_to_symbols_XY handles the general case of mapping * from a stream of bytes or shorts into arbitrary float * or complex symbols. * - * \sa gr_packed_to_unpacked_bb, gr_unpacked_to_packed_bb, - * \sa gr_packed_to_unpacked_ss, gr_unpacked_to_packed_ss, - * \sa digital_chunks_to_symbols_bf, digital_chunks_to_symbols_bc. - * \sa digital_chunks_to_symbols_sf, digital_chunks_to_symbols_sc. + * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb, + * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss, + * \sa gr::digital::chunks_to_symbols_bf, gr::digital::chunks_to_symbols_bc. + * \sa gr::digital::chunks_to_symbols_sf, gr::digital::chunks_to_symbols_sc. */ class DIGITAL_API @NAME@ : virtual public gr_sync_interpolator diff --git a/gr-digital/python/cpm.py b/gr-digital/python/cpm.py index 1929a73d30..a9915ba91a 100644 --- a/gr-digital/python/cpm.py +++ b/gr-digital/python/cpm.py @@ -117,7 +117,7 @@ class cpm_mod(gr.hier_block2): sensitivity = 2 * pi * h_numerator / h_denominator / samples_per_symbol # Unpack Bytes into bits_per_symbol groups - self.B2s = gr.packed_to_unpacked_bb(bits_per_symbol,gr.GR_MSB_FIRST) + self.B2s = blocks.packed_to_unpacked_bb(bits_per_symbol,gr.GR_MSB_FIRST) # Turn it into symmetric PAM data. diff --git a/gr-digital/python/generic_mod_demod.py b/gr-digital/python/generic_mod_demod.py index b71118ebcb..a5d1d9eb37 100644 --- a/gr-digital/python/generic_mod_demod.py +++ b/gr-digital/python/generic_mod_demod.py @@ -32,6 +32,11 @@ import digital_swig as digital import math try: + from gnuradio import blocks +except ImportError: + import blocks_swig as blocks + +try: from gnuradio import filter except ImportError: import filter_swig as filter @@ -126,7 +131,7 @@ class generic_mod(gr.hier_block2): # turn bytes into k-bit vectors self.bytes2chunks = \ - gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST) + blocks.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST) if self.pre_diff_code: self.symbol_mapper = digital.map_bb(self._constellation.pre_diff_code()) @@ -149,13 +154,13 @@ class generic_mod(gr.hier_block2): self.rrc_taps) # Connect - blocks = [self, self.bytes2chunks] + self._blocks = [self, self.bytes2chunks] if self.pre_diff_code: - blocks.append(self.symbol_mapper) + self._blocks.append(self.symbol_mapper) if differential: - blocks.append(self.diffenc) - blocks += [self.chunks2symbols, self.rrc_filter, self] - self.connect(*blocks) + self._blocks.append(self.diffenc) + self._blocks += [self.chunks2symbols, self.rrc_filter, self] + self.connect(*self._blocks) if verbose: self._print_verbage() diff --git a/gr-digital/python/gfsk.py b/gr-digital/python/gfsk.py index 42d65d36ce..e4aeef8ef9 100644 --- a/gr-digital/python/gfsk.py +++ b/gr-digital/python/gfsk.py @@ -99,7 +99,7 @@ class gfsk_mod(gr.hier_block2): # Turn it into NRZ data. #self.nrz = digital.bytes_to_syms() - self.unpack = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) + self.unpack = blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) self.nrz = digital.chunks_to_symbols_bf([-1, 1]) # Form Gaussian filter diff --git a/gr-digital/python/gmsk.py b/gr-digital/python/gmsk.py index c0f5c439aa..a90e49a521 100644 --- a/gr-digital/python/gmsk.py +++ b/gr-digital/python/gmsk.py @@ -25,6 +25,7 @@ # See gnuradio-examples/python/digital for examples from gnuradio import gr +from gnuradio import blocks from gnuradio import analog import modulation_utils import digital_swig as digital @@ -97,7 +98,7 @@ class gmsk_mod(gr.hier_block2): # Turn it into NRZ data. #self.nrz = digital.bytes_to_syms() - self.unpack = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) + self.unpack = blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) self.nrz = digital.chunks_to_symbols_bf([-1, 1], 1) # Form Gaussian filter diff --git a/gr-digital/python/ofdm_sync_ml.py b/gr-digital/python/ofdm_sync_ml.py index 885531f66a..895ab767a0 100644 --- a/gr-digital/python/ofdm_sync_ml.py +++ b/gr-digital/python/ofdm_sync_ml.py @@ -58,7 +58,7 @@ class ofdm_sync_ml(gr.hier_block2): self.connect(self, self.input) # Create a delay line - self.delay = gr.delay(gr.sizeof_gr_complex, fft_length) + self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length) self.connect(self.input, self.delay) # magnitude squared blocks diff --git a/gr-digital/python/ofdm_sync_pn.py b/gr-digital/python/ofdm_sync_pn.py index fb011bf252..cddd1b31da 100644 --- a/gr-digital/python/ofdm_sync_pn.py +++ b/gr-digital/python/ofdm_sync_pn.py @@ -52,7 +52,7 @@ class ofdm_sync_pn(gr.hier_block2): # PN Sync # Create a delay line - self.delay = gr.delay(gr.sizeof_gr_complex, fft_length/2) + self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length/2) # Correlation from ML Sync self.conjg = blocks.conjugate_cc(); diff --git a/gr-digital/python/ofdm_sync_pnac.py b/gr-digital/python/ofdm_sync_pnac.py index 9b0302ffbb..f6627a4aba 100644 --- a/gr-digital/python/ofdm_sync_pnac.py +++ b/gr-digital/python/ofdm_sync_pnac.py @@ -72,7 +72,7 @@ class ofdm_sync_pnac(gr.hier_block2): self.crosscorr_filter = filter.fir_filter_ccc(1, kstime) # Create a delay line - self.delay = gr.delay(gr.sizeof_gr_complex, fft_length/2) + self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length/2) # Correlation from ML Sync self.conjg = blocks.conjugate_cc(); diff --git a/gr-digital/python/qa_constellation.py b/gr-digital/python/qa_constellation.py index 3c109cfe82..12dbca232f 100755 --- a/gr-digital/python/qa_constellation.py +++ b/gr-digital/python/qa_constellation.py @@ -174,12 +174,12 @@ class mod_demod(gr.hier_block2): self.blocks = [self] # We expect a stream of unpacked bits. # First step is to pack them. - self.blocks.append(gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)) + self.blocks.append(blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)) # Second step we unpack them such that we have k bits in each byte where # each constellation symbol hold k bits. self.blocks.append( - gr.packed_to_unpacked_bb(self.constellation.bits_per_symbol(), - gr.GR_MSB_FIRST)) + blocks.packed_to_unpacked_bb(self.constellation.bits_per_symbol(), + gr.GR_MSB_FIRST)) # Apply any pre-differential coding # Gray-coding is done here if we're also using differential coding. if self.constellation.apply_pre_diff_code(): diff --git a/gr-digital/python/qa_constellation_receiver.py b/gr-digital/python/qa_constellation_receiver.py index 254a8240d4..ff0154d740 100755 --- a/gr-digital/python/qa_constellation_receiver.py +++ b/gr-digital/python/qa_constellation_receiver.py @@ -150,7 +150,7 @@ class rec_test_tb(gr.top_block): self.src_data = tuple([rndm.randint(0,1) for i in range(0, data_length)]) else: self.src_data = src_data - packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) + packer = blocks.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) src = gr.vector_source_b(self.src_data) mod = generic_mod(constellation, differential=differential) # Channel diff --git a/gr-digital/python/qa_simple_correlator.py b/gr-digital/python/qa_simple_correlator.py index 292dfd69fc..ff0faeb415 100755 --- a/gr-digital/python/qa_simple_correlator.py +++ b/gr-digital/python/qa_simple_correlator.py @@ -46,7 +46,7 @@ class test_simple_correlator(gr_unittest.TestCase): src = gr.vector_source_b(expected_result) frame = digital.simple_framer(4) - unpack = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) + unpack = blocks.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) expand = filter.interp_fir_filter_fff(8, taps) b2f = blocks.char_to_float() mult2 = blocks.multiply_const_ff(2) diff --git a/gr-trellis/doc/gr-trellis.xml b/gr-trellis/doc/gr-trellis.xml index 083c2f1637..42bd54b32c 100644 --- a/gr-trellis/doc/gr-trellis.xml +++ b/gr-trellis/doc/gr-trellis.xml @@ -572,7 +572,7 @@ and an initial state (which is set to 0 in this example). 15 # TX 16 src = gr.lfsr_32k_source_s() 17 src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - 18 s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + 18 s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality 19 enc = trellis.encoder_ss(f,0) # initial state = 0 </programlisting> @@ -646,7 +646,7 @@ are then packed to shorts and compared with the transmitted sequence. </para> <programlisting> 28 va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - 29 fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + 29 fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts 30 dst = gr.check_lfsr_32k_s(); </programlisting> diff --git a/gr-trellis/doc/test_tcm.py b/gr-trellis/doc/test_tcm.py index 641e7dd6db..aa84f55bee 100644 --- a/gr-trellis/doc/test_tcm.py +++ b/gr-trellis/doc/test_tcm.py @@ -21,7 +21,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality enc = trellis.encoder_ss(f,0) # initial state = 0 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -32,7 +32,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s(); tb.connect (src,src_head,s2fsmi,enc,mod) diff --git a/gr-trellis/doc/test_tcm.py.xml b/gr-trellis/doc/test_tcm.py.xml index 29052faebc..96a8042ff7 100644 --- a/gr-trellis/doc/test_tcm.py.xml +++ b/gr-trellis/doc/test_tcm.py.xml @@ -17,7 +17,7 @@ 15 # TX 16 src = gr.lfsr_32k_source_s() 17 src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - 18 s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + 18 s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality 19 enc = trellis.encoder_ss(f,0) # initial state = 0 20 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) 21 @@ -28,7 +28,7 @@ 26 # RX 27 metrics = trellis.metrics_f(f.O(),dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi 28 va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - 29 fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + 29 fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts 30 dst = gr.check_lfsr_32k_s(); 31 32 tb.connect (src,src_head,s2fsmi,enc,mod) diff --git a/gr-trellis/examples/python/test_pccc_turbo1.py b/gr-trellis/examples/python/test_pccc_turbo1.py index 121659ccf5..bb596f1818 100755 --- a/gr-trellis/examples/python/test_pccc_turbo1.py +++ b/gr-trellis/examples/python/test_pccc_turbo1.py @@ -21,7 +21,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality #src = gr.vector_source_s([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],False) enc = trellis.pccc_encoder_ss(fo,0,fi,0,interleaver,K) code = gr.vector_sink_s() @@ -36,7 +36,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, scale = blocks.multiply_const_ff(1.0/N0) dec = trellis.pccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM) - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() tb.connect (src,src_head,s2fsmi,enc,mod) diff --git a/gr-trellis/examples/python/test_sccc_hard.py b/gr-trellis/examples/python/test_sccc_hard.py index 8676a6064d..ec1fdd1bc5 100755 --- a/gr-trellis/examples/python/test_sccc_hard.py +++ b/gr-trellis/examples/python/test_sccc_hard.py @@ -21,7 +21,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality enc_out = trellis.encoder_ss(fo,0) # initial state = 0 inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short) enc_in = trellis.encoder_ss(fi,0) # initial state = 0 @@ -37,7 +37,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, deinter = trellis.permutation(interleaver.K(),interleaver.DEINTER(),1,gr.sizeof_short) metrics_out = trellis.metrics_s(fo.O(),1,[0,1,2,3],digital.TRELLIS_HARD_SYMBOL) # data preprocessing to generate metrics for outer Viterbi (hard decisions) va_out = trellis.viterbi_s(fo,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_sccc_soft.py b/gr-trellis/examples/python/test_sccc_soft.py index 1885934a46..f663c9befd 100755 --- a/gr-trellis/examples/python/test_sccc_soft.py +++ b/gr-trellis/examples/python/test_sccc_soft.py @@ -21,7 +21,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality enc_out = trellis.encoder_ss(fo,0) # initial state = 0 inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short) enc_in = trellis.encoder_ss(fi,0) # initial state = 0 @@ -37,7 +37,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, siso_in = trellis.siso_f(fi,K,0,-1,True,False,trellis.TRELLIS_MIN_SUM) # Put -1 if the Initial/Final states are not set. deinter = trellis.permutation(interleaver.K(),interleaver.DEINTER(),fi.I(),gr.sizeof_float) va_out = trellis.viterbi_s(fo,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_sccc_turbo.py b/gr-trellis/examples/python/test_sccc_turbo.py index 677c07a05c..cd974e9941 100755 --- a/gr-trellis/examples/python/test_sccc_turbo.py +++ b/gr-trellis/examples/python/test_sccc_turbo.py @@ -61,7 +61,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality enc_out = trellis.encoder_ss(fo,0) # initial state = 0 inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short) enc_in = trellis.encoder_ss(fi,0) # initial state = 0 @@ -74,7 +74,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) #(head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_SUM_PRODUCT) - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_sccc_turbo1.py b/gr-trellis/examples/python/test_sccc_turbo1.py index 62a0b6e318..93833ec7df 100755 --- a/gr-trellis/examples/python/test_sccc_turbo1.py +++ b/gr-trellis/examples/python/test_sccc_turbo1.py @@ -20,7 +20,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K) mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -30,7 +30,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # RX dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN,1.0) - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() #tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_sccc_turbo2.py b/gr-trellis/examples/python/test_sccc_turbo2.py index 510748a68a..116a2ca6b2 100755 --- a/gr-trellis/examples/python/test_sccc_turbo2.py +++ b/gr-trellis/examples/python/test_sccc_turbo2.py @@ -20,7 +20,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K) mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -32,7 +32,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO scale = blocks.multiply_const_ff(1.0/N0) dec = trellis.sccc_decoder_s(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM) - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() #tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_tcm.py b/gr-trellis/examples/python/test_tcm.py index aca06f783e..8a815ae12a 100755 --- a/gr-trellis/examples/python/test_tcm.py +++ b/gr-trellis/examples/python/test_tcm.py @@ -27,8 +27,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): #src = gr.vector_source_s(packet,False) src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - #b2s = gr.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + #b2s = blocks.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality enc = trellis.encoder_ss(f,0) # initial state = 0 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -39,8 +39,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts - #s2b = gr.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + #s2b = blocks.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits #dst = gr.vector_sink_s(); dst = gr.check_lfsr_32k_s() diff --git a/gr-trellis/examples/python/test_tcm_bit.py b/gr-trellis/examples/python/test_tcm_bit.py index 4438db91ac..6308df1d09 100755 --- a/gr-trellis/examples/python/test_tcm_bit.py +++ b/gr-trellis/examples/python/test_tcm_bit.py @@ -27,8 +27,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): src = gr.vector_source_s(packet,False) #src = gr.lfsr_32k_source_s() #src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - b2s = gr.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + b2s = blocks.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality enc = trellis.encoder_ss(f,0) # initial state = 0 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -41,8 +41,8 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts - s2b = gr.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + s2b = blocks.packed_to_unpacked_ss(1,gr.GR_MSB_FIRST) # unpack shorts to bits dst = gr.vector_sink_s(); #dst = gr.check_lfsr_32k_s(); diff --git a/gr-trellis/examples/python/test_tcm_combined.py b/gr-trellis/examples/python/test_tcm_combined.py index a0cd58c6df..198d038ce3 100755 --- a/gr-trellis/examples/python/test_tcm_combined.py +++ b/gr-trellis/examples/python/test_tcm_combined.py @@ -21,7 +21,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality enc = trellis.encoder_ss(f,0) # initial state = 0 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -33,7 +33,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # RX va = trellis.viterbi_combined_fs(f,K,0,-1,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s(); diff --git a/gr-trellis/examples/python/test_tcm_parallel.py b/gr-trellis/examples/python/test_tcm_parallel.py index 0bd6f739c1..d2527956e9 100755 --- a/gr-trellis/examples/python/test_tcm_parallel.py +++ b/gr-trellis/examples/python/test_tcm_parallel.py @@ -21,7 +21,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16*P) # packet size in shorts - s2fsmi=gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + s2fsmi=blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality s2p = blocks.stream_to_streams(gr.sizeof_short,P) # serial to parallel enc = trellis.encoder_ss(f,0) # initiali state = 0 mod = digital.chunks_to_symbols_sf(constellation,dimensionality) @@ -37,7 +37,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. p2s = block.streams_to_stream(gr.sizeof_short,P) # parallel to serial - fsmi2s=gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s=blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s() tb.connect (src,src_head,s2fsmi,s2p) diff --git a/gr-trellis/examples/python/test_turbo_equalization.py b/gr-trellis/examples/python/test_turbo_equalization.py index b0889bdcef..41361fd3db 100755 --- a/gr-trellis/examples/python/test_turbo_equalization.py +++ b/gr-trellis/examples/python/test_turbo_equalization.py @@ -59,7 +59,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the iouter FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the iouter FSM input cardinality enc_out = trellis.encoder_ss(fo,0) # initial state = 0 inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short) enc_in = trellis.encoder_ss(fi,0) # initial state = 0 @@ -72,7 +72,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s(); tb.connect (src,src_head,s2fsmi,enc_out,inter,enc_in,mod) diff --git a/gr-trellis/examples/python/test_viterbi_equalization.py b/gr-trellis/examples/python/test_viterbi_equalization.py index 21236d2870..f83125136c 100755 --- a/gr-trellis/examples/python/test_viterbi_equalization.py +++ b/gr-trellis/examples/python/test_viterbi_equalization.py @@ -19,7 +19,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): # TX src = gr.lfsr_32k_source_s() src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality enc = trellis.encoder_ss(f,0) # initial state = 0 # essentially here we implement the combination of modulation and channel as a memoryless modulation (the memory induced by the channel is hidden in the FSM) mod = digital.chunks_to_symbols_sf(tot_constellation,dimensionality) @@ -31,7 +31,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): # RX metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi va = trellis.viterbi_s(f,K,0,-1) # Put -1 if the Initial/Final states are not set. - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack FSM input symbols to shorts dst = gr.check_lfsr_32k_s(); tb.connect (src,src_head,s2fsmi,enc,mod) diff --git a/gr-trellis/python/qa_trellis.py b/gr-trellis/python/qa_trellis.py index 0e1ddc61b2..983a749af6 100755 --- a/gr-trellis/python/qa_trellis.py +++ b/gr-trellis/python/qa_trellis.py @@ -110,7 +110,7 @@ class trellis_tb(gr.top_block): # packet size in shorts src_head = gr.head (gr.sizeof_short, packet_size/16) # unpack shorts to symbols compatible with the FSM input cardinality - s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST) + s2fsmi = blocks.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST) # initial FSM state = 0 enc = trellis.encoder_ss(f, 0) mod = digital.chunks_to_symbols_sc(constellation.points(), 1) @@ -125,7 +125,7 @@ class trellis_tb(gr.top_block): # Put -1 if the Initial/Final states are not set. va = trellis.viterbi_s(f, K, 0, -1) # pack FSM input symbols to shorts - fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST) + fsmi2s = blocks.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST) # check the output self.dst = gr.check_lfsr_32k_s() diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index e51b1f72b0..d9b5eb80d8 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -49,7 +49,6 @@ <block>gr_max_xx</block> <block>gr_argmax_xx</block> - <block>gr_rms_xx</block> <block>gr_vector_insert_x</block> @@ -73,8 +72,6 @@ </cat> <cat> <name>Misc Conversions</name> - <block>gr_unpacked_to_packed_xx</block> - <block>gr_packed_to_unpacked_xx</block> <block>gr_unpack_k_bits_bb</block> <block>gr_pack_k_bits_bb</block> </cat> @@ -127,7 +124,6 @@ <block>import</block> <block>gr_throttle</block> - <block>gr_delay</block> <block>blks2_selector</block> <block>blks2_valve</block> diff --git a/grc/blocks/gr_delay.xml b/grc/blocks/gr_delay.xml deleted file mode 100644 index 5cc411a782..0000000000 --- a/grc/blocks/gr_delay.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Delay -################################################### - --> -<block> - <name>Delay</name> - <key>gr_delay</key> - <import>from gnuradio import gr</import> - <make>gr.delay($type.size*$vlen, $delay)</make> - <callback>set_delay($delay)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>size:gr.sizeof_gr_complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>size:gr.sizeof_float</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>size:gr.sizeof_int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>size:gr.sizeof_short</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>size:gr.sizeof_char</opt> - </option> - </param> - <param> - <name>Delay</name> - <key>delay</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Num Ports</name> - <key>num_ports</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$num_ports > 0</check> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_ports</nports> - </sink> - <source> - <name>out</name> - <type>$type</type> - <vlen>$vlen</vlen> - <nports>$num_ports</nports> - </source> -</block> diff --git a/grc/blocks/gr_packed_to_unpacked_xx.xml b/grc/blocks/gr_packed_to_unpacked_xx.xml deleted file mode 100644 index c1477dd9ca..0000000000 --- a/grc/blocks/gr_packed_to_unpacked_xx.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Packed to Unpacked -################################################### - --> -<block> - <name>Packed to Unpacked</name> - <key>gr_packed_to_unpacked_xx</key> - <import>from gnuradio import gr</import> - <make>gr.packed_to_unpacked_$(type.fcn)($bits_per_chunk, $endianness)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:ii</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:ss</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:bb</opt> - </option> - </param> - <param> - <name>Bits per Chunk</name> - <key>bits_per_chunk</key> - <value>2</value> - <type>int</type> - </param> - <param> - <name>Endianness</name> - <key>endianness</key> - <type>int</type> - <option> - <name>MSB</name> - <key>gr.GR_MSB_FIRST</key> - </option> - <option> - <name>LSB</name> - <key>gr.GR_LSB_FIRST</key> - </option> - </param> - <param> - <name>Num Ports</name> - <key>num_ports</key> - <value>1</value> - <type>int</type> - </param> - <check>$num_ports > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <nports>$num_ports</nports> - </sink> - <source> - <name>out</name> - <type>$type</type> - <nports>$num_ports</nports> - </source> -</block> diff --git a/grc/blocks/gr_rms_xx.xml b/grc/blocks/gr_rms_xx.xml deleted file mode 100644 index 1e0947192b..0000000000 --- a/grc/blocks/gr_rms_xx.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##RMS -################################################### - --> -<block> - <name>RMS</name> - <key>gr_rms_xx</key> - <import>from gnuradio import gr</import> - <make>gr.rms_$(type.fcn)f($alpha)</make> - <callback>set_alpha($alpha)</callback> - <param> - <name>Input Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/grc/blocks/gr_unpacked_to_packed_xx.xml b/grc/blocks/gr_unpacked_to_packed_xx.xml deleted file mode 100644 index 427c800824..0000000000 --- a/grc/blocks/gr_unpacked_to_packed_xx.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Unpacked to Packed -################################################### - --> -<block> - <name>Unpacked to Packed</name> - <key>gr_unpacked_to_packed_xx</key> - <import>from gnuradio import gr</import> - <make>gr.unpacked_to_packed_$(type.fcn)($bits_per_chunk, $endianness)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:ii</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:ss</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:bb</opt> - </option> - </param> - <param> - <name>Bits per Chunk</name> - <key>bits_per_chunk</key> - <value>2</value> - <type>int</type> - </param> - <param> - <name>Endianness</name> - <key>endianness</key> - <type>int</type> - <option> - <name>MSB</name> - <key>gr.GR_MSB_FIRST</key> - </option> - <option> - <name>LSB</name> - <key>gr.GR_LSB_FIRST</key> - </option> - </param> - <param> - <name>Num Ports</name> - <key>num_ports</key> - <value>1</value> - <type>int</type> - </param> - <check>$num_ports > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <nports>$num_ports</nports> - </sink> - <source> - <name>out</name> - <type>$type</type> - <nports>$num_ports</nports> - </source> -</block> |