diff options
-rw-r--r-- | gr-digital/grc/digital_block_tree.xml | 43 | ||||
-rw-r--r-- | gr-digital/grc/digital_clock_recovery_mm_xx.xml | 2 | ||||
-rw-r--r-- | gr-digital/grc/digital_cma_equalizer_cc.xml | 2 | ||||
-rw-r--r-- | gr-digital/grc/digital_constellation_decoder_cb.xml | 2 | ||||
-rw-r--r-- | gr-digital/grc/digital_constellation_receiver_cb.xml | 2 | ||||
-rw-r--r-- | gr-digital/grc/digital_correlate_access_code_tag_bb.xml | 36 | ||||
-rw-r--r-- | gr-digital/grc/digital_lms_dd_equalizer_cc.xml | 2 | ||||
-rw-r--r-- | gr-digital/grc/digital_mpsk_receiver_cc.xml | 20 | ||||
-rw-r--r-- | gr-digital/grc/digital_ofdm_frame_sink.xml | 79 | ||||
-rw-r--r-- | gr-digital/grc/digital_packet_sink.xml | 1 | ||||
-rw-r--r-- | gr-digital/grc/digital_pfb_clock_sync.xml | 2 | ||||
-rw-r--r-- | gr-digital/include/digital/constellation.h | 22 | ||||
-rw-r--r-- | gr-digital/include/digital/ofdm_frame_sink.h | 4 | ||||
-rw-r--r-- | gr-digital/lib/constellation.cc | 16 | ||||
-rw-r--r-- | gr-digital/lib/ofdm_frame_sink_impl.cc | 23 | ||||
-rw-r--r-- | gr-digital/lib/ofdm_frame_sink_impl.h | 20 | ||||
-rw-r--r-- | gr-digital/python/ofdm.py | 30 |
17 files changed, 225 insertions, 81 deletions
diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml index 8f5ac3bd29..f8bb3871d6 100644 --- a/gr-digital/grc/digital_block_tree.xml +++ b/gr-digital/grc/digital_block_tree.xml @@ -30,26 +30,52 @@ <name></name> <!-- Blank for Root Name --> <cat> <name>Coding</name> - <block>additive_scrambler_bb</block> + <block>digital_additive_scrambler_bb</block> + <block>digital_descrambler_bb</block> + <block>digital_scrambler_bb</block> </cat> <cat> <name>Converters</name> - <block>binary_slicer_fb</block> + <block>digital_binary_slicer_fb</block> + <block>digital_chunks_to_symbols_xx</block> + <block>digital_diff_decoder_bb</block> + <block>digital_diff_encoder_bb</block> + <block>digital_diff_phasor_cc</block> + <block>digital_map_bb</block> </cat> <cat> <name>Digital</name> - <block>constellation_decoder_cb</block> - <block>constellation_receiver_cb</block> + <block>digital_constellation_decoder_cb</block> + <block>digital_constellation_receiver_cb</block> + <block>digital_correlate_access_code_bb</block> + <block>digital_correlate_access_code_tag_bb</block> + <block>digital_framer_sink_1</block> + <block>digital_mpsk_snr_est_cc</block> + <block>digital_mpsk_receiver_cc</block> + <block>digital_packet_sink</block> + <block>digital_pn_correlator_cc</block> + <block>digital_simple_framer</block> + </cat> + <cat> + <name>Probes</name> + <block>digital_probe_density_b</block> + <block>digital_probe_mpsk_snr_est_c</block> + </cat> + <cat> + <name>Sources</name> + <block>digital_glfsr_source_x</block> </cat> <cat> <name>Synchronizers</name> - <block>clock_recovery_mm_xx</block> - <block>pfb_clock_sync_xxx</block> + <block>digital_clock_recovery_mm_xx</block> + <block>digital_costas_loop_cc</block> + <block>digital_fll_band_edge_cc</block> + <block>digital_pfb_clock_sync_xxx</block> </cat> <cat> <name>Equalizers</name> - <block>cma_equalizer_cc</block> - <block>lms_dd_equalizer_cc</block> + <block>digital_cma_equalizer_cc</block> + <block>digital_lms_dd_equalizer_cc</block> </cat> <cat> <name>Digital Modulators</name> @@ -70,6 +96,7 @@ <block>digital_ofdm_demod</block> <block>digital_ofdm_cyclic_prefixer</block> <block>digital_ofdm_frame_acquisition</block> + <block>digital_ofdm_frame_sink</block> <block>digital_ofdm_insert_preamble</block> <block>digital_ofdm_sampler</block> <block>digital_ofdm_sync_pn</block> diff --git a/gr-digital/grc/digital_clock_recovery_mm_xx.xml b/gr-digital/grc/digital_clock_recovery_mm_xx.xml index d6f0fd185a..d9c5ea4ff8 100644 --- a/gr-digital/grc/digital_clock_recovery_mm_xx.xml +++ b/gr-digital/grc/digital_clock_recovery_mm_xx.xml @@ -6,7 +6,7 @@ --> <block> <name>Clock Recovery MM</name> - <key>clock_recovery_mm_xx</key> + <key>digital_clock_recovery_mm_xx</key> <import>from gnuradio import digital</import> <make>digital.clock_recovery_mm_$(type.fcn)($omega, $gain_omega, $mu, $gain_mu, $omega_relative_limit)</make> <callback>set_omega($omega)</callback> diff --git a/gr-digital/grc/digital_cma_equalizer_cc.xml b/gr-digital/grc/digital_cma_equalizer_cc.xml index 1184eb109c..118c18e294 100644 --- a/gr-digital/grc/digital_cma_equalizer_cc.xml +++ b/gr-digital/grc/digital_cma_equalizer_cc.xml @@ -6,7 +6,7 @@ --> <block> <name>CMA Equalizer</name> - <key>cma_equalizer_cc</key> + <key>digital_cma_equalizer_cc</key> <import>from gnuradio import digital</import> <make>digital.cma_equalizer_cc($num_taps, $modulus, $mu, $sps)</make> <callback>set_gain($mu)</callback> diff --git a/gr-digital/grc/digital_constellation_decoder_cb.xml b/gr-digital/grc/digital_constellation_decoder_cb.xml index f3390c131c..c7353e2888 100644 --- a/gr-digital/grc/digital_constellation_decoder_cb.xml +++ b/gr-digital/grc/digital_constellation_decoder_cb.xml @@ -6,7 +6,7 @@ --> <block> <name>Constellation Decoder</name> - <key>constellation_decoder_cb</key> + <key>digital_constellation_decoder_cb</key> <import>from gnuradio import digital</import> <make>digital.constellation_decoder_cb($constellation)</make> <param> diff --git a/gr-digital/grc/digital_constellation_receiver_cb.xml b/gr-digital/grc/digital_constellation_receiver_cb.xml index fcb71ba40d..36c8e1b309 100644 --- a/gr-digital/grc/digital_constellation_receiver_cb.xml +++ b/gr-digital/grc/digital_constellation_receiver_cb.xml @@ -6,7 +6,7 @@ --> <block> <name>Constellation Receiver</name> - <key>constellation_receiver_cb</key> + <key>digital_constellation_receiver_cb</key> <import>from gnuradio import digital</import> <make>digital.constellation_receiver_cb($constellation, $loop_bw, $fmin, $fmax)</make> <param> diff --git a/gr-digital/grc/digital_correlate_access_code_tag_bb.xml b/gr-digital/grc/digital_correlate_access_code_tag_bb.xml new file mode 100644 index 0000000000..7d43f1b3f1 --- /dev/null +++ b/gr-digital/grc/digital_correlate_access_code_tag_bb.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Correlate Access Code +################################################### + --> +<block> + <name>Correlate Access Code - Tag</name> + <key>digital_correlate_access_code_tag_bb</key> + <import>from gnuradio import digital</import> + <make>digital.correlate_access_code_tag_bb($access_code, $threshold, $tagname)</make> + <param> + <name>Access Code</name> + <key>access_code</key> + <value>101010</value> + <type>string</type> + </param> + <param> + <name>Threshold</name> + <key>threshold</key> + <type>int</type> + </param> + <param> + <name>Tag Name</name> + <key>tagname</key> + <type>string</type> + </param> + <sink> + <name>in</name> + <type>byte</type> + </sink> + <source> + <name>out</name> + <type>byte</type> + </source> +</block> diff --git a/gr-digital/grc/digital_lms_dd_equalizer_cc.xml b/gr-digital/grc/digital_lms_dd_equalizer_cc.xml index 3332ce6c4d..0fd7d523b8 100644 --- a/gr-digital/grc/digital_lms_dd_equalizer_cc.xml +++ b/gr-digital/grc/digital_lms_dd_equalizer_cc.xml @@ -6,7 +6,7 @@ --> <block> <name>LMS DD Equalizer</name> - <key>lms_dd_equalizer_cc</key> + <key>digital_lms_dd_equalizer_cc</key> <import>from gnuradio import digital</import> <make>digital.lms_dd_equalizer_cc($num_taps, $mu, $sps, $cnst)</make> <callback>set_gain($mu)</callback> diff --git a/gr-digital/grc/digital_mpsk_receiver_cc.xml b/gr-digital/grc/digital_mpsk_receiver_cc.xml index bd738fccc3..a9b66b7a19 100644 --- a/gr-digital/grc/digital_mpsk_receiver_cc.xml +++ b/gr-digital/grc/digital_mpsk_receiver_cc.xml @@ -17,61 +17,61 @@ <param> <name>M</name> <key>M</key> - <value>4</value> + <value>4</value> <type>int</type> </param> <param> <name>Theta</name> <key>theta</key> - <value>0</value> + <value>0</value> <type>real</type> </param> <param> <name>Loop Bandwidth</name> <key>w</key> - <value>cmath.pi/100.0</value> + <value>cmath.pi/100.0</value> <type>real</type> </param> <param> <name>Min Freq</name> <key>fmin</key> - <value>-0.5</value> + <value>-0.5</value> <type>real</type> </param> <param> <name>Max Freq</name> <key>fmax</key> - <value>0.5</value> + <value>0.5</value> <type>real</type> </param> <param> <name>Mu</name> <key>mu</key> - <value>0.25</value> + <value>0.25</value> <type>real</type> </param> <param> <name>Gain Mu</name> <key>gain_mu</key> - <value>0.01</value> + <value>0.01</value> <type>real</type> </param> <param> <name>Omega</name> <key>omega</key> - <value>2</value> + <value>2</value> <type>real</type> </param> <param> <name>Gain Omega</name> <key>gain_omega</key> - <value>0.001</value> + <value>0.001</value> <type>real</type> </param> <param> <name>Omega Relative Limit</name> <key>omega_relative_limit</key> - <value>0.001</value> + <value>0.001</value> <type>real</type> </param> <sink> diff --git a/gr-digital/grc/digital_ofdm_frame_sink.xml b/gr-digital/grc/digital_ofdm_frame_sink.xml new file mode 100644 index 0000000000..64c69ec0ad --- /dev/null +++ b/gr-digital/grc/digital_ofdm_frame_sink.xml @@ -0,0 +1,79 @@ +<?xml version="1.0"?> +<!-- + Copyright 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. +--> + +<!-- +################################################### +##OFDM Frame Sink +################################################### + --> +<block> + <name>OFDM Frame Sink</name> + <key>digital_ofdm_frame_sink</key> + <import>from gnuradio import digital</import> + <make>digital.ofdm_frame_sink($syms, $vals, $queue, $occ_tones, $ph_gain, $frq_gain)</make> + <param> + <name>Symbol Points</name> + <key>syms</key> + <type>complex_vector</type> + </param> + <param> + <name>Symbol Values</name> + <key>vals</key> + <type>int_vector</type> + </param> + <param> + <name>Message Queue</name> + <key>queue</key> + <type>raw</type> + </param> + <param> + <name>Occupied Tones</name> + <key>occ_tones</key> + <type>int</type> + </param> + <param> + <name>Phase Gain</name> + <key>ph_gain</key> + <value>0.25</value> + <type>real</type> + </param> + <param> + <name>Freq. Gain</name> + <key>frq_gain</key> + <value>0.015625</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>complex</type> + <vlen>$occ_tones</vlen> + </sink> + <sink> + <name>flag</name> + <type>byte</type> + </sink> + <source> + <name>out</name> + <type>complex</type> + <vlen>$occ_tones</vlen> + </source> +</block> diff --git a/gr-digital/grc/digital_packet_sink.xml b/gr-digital/grc/digital_packet_sink.xml index e9231bd059..2c6653d7ec 100644 --- a/gr-digital/grc/digital_packet_sink.xml +++ b/gr-digital/grc/digital_packet_sink.xml @@ -22,6 +22,7 @@ <param> <name>Threshold</name> <key>threshold</key> + <value>-1</value> <type>int</type> </param> <sink> diff --git a/gr-digital/grc/digital_pfb_clock_sync.xml b/gr-digital/grc/digital_pfb_clock_sync.xml index 97581ad34c..9e2a4cd5ef 100644 --- a/gr-digital/grc/digital_pfb_clock_sync.xml +++ b/gr-digital/grc/digital_pfb_clock_sync.xml @@ -6,7 +6,7 @@ --> <block> <name>Polyphase Clock Sync</name> - <key>pfb_clock_sync_xxx</key> + <key>digital_pfb_clock_sync_xxx</key> <import>from gnuradio import digital</import> <make>digital.pfb_clock_sync_$(type)($sps, $alpha, $taps, $filter_size, $init_phase, $max_dev, $osps) self.$(id).set_beta($beta)</make> diff --git a/gr-digital/include/digital/constellation.h b/gr-digital/include/digital/constellation.h index 1acc6bdc8b..4e0bff2fb3 100644 --- a/gr-digital/include/digital/constellation.h +++ b/gr-digital/include/digital/constellation.h @@ -61,7 +61,7 @@ namespace gr { { public: constellation(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); constellation(); @@ -98,7 +98,7 @@ namespace gr { //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding) void set_pre_diff_code(bool a) { d_apply_pre_diff_code = a;} //! Returns the encoding to apply before differential encoding. - std::vector<unsigned int> pre_diff_code() { return d_pre_diff_code;} + std::vector<int> pre_diff_code() { return d_pre_diff_code;} //! Returns the order of rotational symmetry. unsigned int rotational_symmetry() { return d_rotational_symmetry;} //! Returns the number of complex numbers in a single symbol. @@ -121,7 +121,7 @@ namespace gr { protected: std::vector<gr_complex> d_constellation; - std::vector<unsigned int> d_pre_diff_code; + std::vector<int> d_pre_diff_code; bool d_apply_pre_diff_code; unsigned int d_rotational_symmetry; unsigned int d_dimensionality; @@ -152,7 +152,7 @@ namespace gr { // public constructor static sptr make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); @@ -163,7 +163,7 @@ namespace gr { private: constellation_calcdist(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality); }; @@ -186,7 +186,7 @@ namespace gr { public: constellation_sector(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality, unsigned int n_sectors); @@ -203,7 +203,7 @@ namespace gr { unsigned int n_sectors; private: - std::vector<unsigned int> sector_values; + std::vector<int> sector_values; }; /************************************************************/ @@ -234,7 +234,7 @@ namespace gr { // public constructor static constellation_rect::sptr make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, @@ -254,7 +254,7 @@ namespace gr { float d_width_imag_sectors; constellation_rect(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, @@ -286,7 +286,7 @@ namespace gr { // public constructor static sptr make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int n_sectors); ~constellation_psk(); @@ -298,7 +298,7 @@ namespace gr { private: constellation_psk(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int n_sectors); }; diff --git a/gr-digital/include/digital/ofdm_frame_sink.h b/gr-digital/include/digital/ofdm_frame_sink.h index 71f986dc7c..2b4bbe6480 100644 --- a/gr-digital/include/digital/ofdm_frame_sink.h +++ b/gr-digital/include/digital/ofdm_frame_sink.h @@ -59,9 +59,9 @@ namespace gr { * \param freq_gain gain of the frequency tracking loop */ static sptr make(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out, + const std::vector<char> &sym_value_out, gr_msg_queue_sptr target_queue, - unsigned int occupied_tones, + int occupied_tones, float phase_gain=0.25, float freq_gain=0.25*0.25/4); }; diff --git a/gr-digital/lib/constellation.cc b/gr-digital/lib/constellation.cc index 21008218b9..e73b2c8a43 100644 --- a/gr-digital/lib/constellation.cc +++ b/gr-digital/lib/constellation.cc @@ -42,7 +42,7 @@ namespace gr { // Base Constellation Class constellation::constellation(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality) : d_constellation(constell), @@ -227,7 +227,7 @@ namespace gr { constellation_calcdist::sptr constellation_calcdist::make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality) { @@ -237,7 +237,7 @@ namespace gr { } constellation_calcdist::constellation_calcdist(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality) : constellation(constell, pre_diff_code, rotational_symmetry, dimensionality) @@ -256,7 +256,7 @@ namespace gr { constellation_sector::constellation_sector(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int dimensionality, unsigned int n_sectors) : @@ -293,7 +293,7 @@ namespace gr { constellation_rect::sptr constellation_rect::make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, @@ -309,7 +309,7 @@ namespace gr { } constellation_rect::constellation_rect(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int rotational_symmetry, unsigned int real_sectors, unsigned int imag_sectors, float width_real_sectors, float width_imag_sectors) : @@ -367,7 +367,7 @@ namespace gr { constellation_psk::sptr constellation_psk::make(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int n_sectors) { return constellation_psk::sptr(new constellation_psk @@ -376,7 +376,7 @@ namespace gr { } constellation_psk::constellation_psk(std::vector<gr_complex> constell, - std::vector<unsigned int> pre_diff_code, + std::vector<int> pre_diff_code, unsigned int n_sectors) : constellation_sector(constell, pre_diff_code, constell.size(), 1, n_sectors) { diff --git a/gr-digital/lib/ofdm_frame_sink_impl.cc b/gr-digital/lib/ofdm_frame_sink_impl.cc index 71c287e21b..d2f00d3a45 100644 --- a/gr-digital/lib/ofdm_frame_sink_impl.cc +++ b/gr-digital/lib/ofdm_frame_sink_impl.cc @@ -86,7 +86,7 @@ namespace gr { d_packetlen, d_packet_whitener_offset); } - unsigned char + char ofdm_frame_sink_impl::slicer(const gr_complex x) { unsigned int table_size = d_sym_value_out.size(); @@ -105,7 +105,7 @@ namespace gr { } unsigned int ofdm_frame_sink_impl::demapper(const gr_complex *in, - unsigned char *out) + char *out) { unsigned int i=0, bytes_produced=0; gr_complex carrier; @@ -131,7 +131,7 @@ namespace gr { d_derotated_output[i] = sigrot; } - unsigned char bits = slicer(sigrot); + char bits = slicer(sigrot); gr_complex closest_sym = d_sym_position[bits]; @@ -185,9 +185,9 @@ namespace gr { ofdm_frame_sink::sptr ofdm_frame_sink::make(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out, + const std::vector<char> &sym_value_out, gr_msg_queue_sptr target_queue, - unsigned int occupied_carriers, + int occupied_carriers, float phase_gain, float freq_gain) { return gnuradio::get_initial_sptr @@ -197,9 +197,9 @@ namespace gr { } ofdm_frame_sink_impl::ofdm_frame_sink_impl(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out, + const std::vector<char> &sym_value_out, gr_msg_queue_sptr target_queue, - unsigned int occupied_carriers, + int occupied_carriers, float phase_gain, float freq_gain) : gr_sync_block("ofdm_frame_sink", gr_make_io_signature2(2, 2, sizeof(gr_complex)*occupied_carriers, sizeof(char)), @@ -247,7 +247,8 @@ namespace gr { // because we are only dealing with the occupied_carriers // at this point, the diff_left in the following compensates // for any offset from the 0th carrier introduced - unsigned int i,j,k; + int i; + unsigned int j,k; for(i = 0; i < (d_occupied_carriers/4)+diff_left; i++) { char c = carriers[i]; for(j = 0; j < 4; j++) { @@ -259,11 +260,11 @@ namespace gr { } // make sure we stay in the limit currently imposed by the occupied_carriers - if(d_subcarrier_map.size() > d_occupied_carriers) { + if(d_subcarrier_map.size() > (size_t)d_occupied_carriers) { throw std::invalid_argument("ofdm_frame_sink_impl: subcarriers allocated exceeds size of occupied carriers"); } - d_bytes_out = new unsigned char[d_occupied_carriers]; + d_bytes_out = new char[d_occupied_carriers]; d_dfe.resize(occupied_carriers); fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0)); @@ -279,7 +280,7 @@ namespace gr { bool ofdm_frame_sink_impl::set_sym_value_out(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out) + const std::vector<char> &sym_value_out) { if(sym_position.size() != sym_value_out.size()) return false; diff --git a/gr-digital/lib/ofdm_frame_sink_impl.h b/gr-digital/lib/ofdm_frame_sink_impl.h index c81940b5f1..49d5d6b5c0 100644 --- a/gr-digital/lib/ofdm_frame_sink_impl.h +++ b/gr-digital/lib/ofdm_frame_sink_impl.h @@ -41,13 +41,13 @@ namespace gr { unsigned int d_header; // header bits int d_headerbytelen_cnt; // how many so far - unsigned char *d_bytes_out; // hold the current bytes produced by the demapper + char *d_bytes_out; // hold the current bytes produced by the demapper - unsigned int d_occupied_carriers; + int d_occupied_carriers; unsigned int d_byte_offset; unsigned int d_partial_byte; - unsigned char d_packet[MAX_PKT_LEN]; // assembled payload + char d_packet[MAX_PKT_LEN]; // assembled payload int d_packetlen; // length of packet int d_packet_whitener_offset; // offset into whitener string to use int d_packetlen_cnt; // how many so far @@ -55,11 +55,11 @@ namespace gr { gr_complex * d_derotated_output; // Pointer to output stream to send deroated symbols out std::vector<gr_complex> d_sym_position; - std::vector<unsigned char> d_sym_value_out; + std::vector<char> d_sym_value_out; std::vector<gr_complex> d_dfe; unsigned int d_nbits; - unsigned char d_resid; + char d_resid; unsigned int d_nresid; float d_phase; float d_freq; @@ -80,18 +80,18 @@ namespace gr { return ((d_header >> 16) ^ (d_header & 0xffff)) == 0; } - unsigned char slicer(const gr_complex x); + char slicer(const gr_complex x); unsigned int demapper(const gr_complex *in, - unsigned char *out); + char *out); bool set_sym_value_out(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out); + const std::vector<char> &sym_value_out); public: ofdm_frame_sink_impl(const std::vector<gr_complex> &sym_position, - const std::vector<unsigned char> &sym_value_out, + const std::vector<char> &sym_value_out, gr_msg_queue_sptr target_queue, - unsigned int occupied_tones, + int occupied_tones, float phase_gain=0.25, float freq_gain=0.25*0.25/4); ~ofdm_frame_sink_impl(); diff --git a/gr-digital/python/ofdm.py b/gr-digital/python/ofdm.py index 9f57920efc..00f52e3730 100644 --- a/gr-digital/python/ofdm.py +++ b/gr-digital/python/ofdm.py @@ -21,8 +21,8 @@ # import math -from gnuradio import gr -import digital_swig +from gnuradio import gr, fft +import digital_swig as digital import ofdm_packet_utils from ofdm_receiver import ofdm_receiver import gnuradio.gr.gr_threading as _threading @@ -97,16 +97,16 @@ class ofdm_mod(gr.hier_block2): constel = qam.qam_constellation(arity) rotated_const = map(lambda pt: pt * rot, constel.points()) #print rotated_const - self._pkt_input = digital_swig.ofdm_mapper_bcv(rotated_const, - msgq_limit, - options.occupied_tones, - options.fft_length) + self._pkt_input = digital.ofdm_mapper_bcv(rotated_const, + msgq_limit, + options.occupied_tones, + options.fft_length) - self.preambles = digital_swig.ofdm_insert_preamble(self._fft_length, - padded_preambles) - self.ifft = gr.fft_vcc(self._fft_length, False, win, True) - self.cp_adder = digital_swig.ofdm_cyclic_prefixer(self._fft_length, - symbol_length) + self.preambles = digital.ofdm_insert_preamble(self._fft_length, + padded_preambles) + self.ifft = fft.fft_vcc(self._fft_length, False, win, True) + self.cp_adder = digital.ofdm_cyclic_prefixer(self._fft_length, + symbol_length) self.scale = gr.multiply_const_cc(1.0 / math.sqrt(self._fft_length)) self.connect((self._pkt_input, 0), (self.preambles, 0)) @@ -240,10 +240,10 @@ class ofdm_demod(gr.hier_block2): phgain = 0.25 frgain = phgain*phgain / 4.0 - self.ofdm_demod = digital_swig.ofdm_frame_sink(rotated_const, range(arity), - self._rcvd_pktq, - self._occupied_tones, - phgain, frgain) + self.ofdm_demod = digital.ofdm_frame_sink(rotated_const, range(arity), + self._rcvd_pktq, + self._occupied_tones, + phgain, frgain) self.connect(self, self.ofdm_recv) self.connect((self.ofdm_recv, 0), (self.ofdm_demod, 0)) |