diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-08-09 20:30:09 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-08-09 20:30:09 -0400 |
commit | 38069c9ac14b44597ee053486ca00838c758a47c (patch) | |
tree | 7baa0e3e8fee6913b168fe1f915ffa05891a1d11 /gr-digital/include/digital | |
parent | 9d8c03e8d6bd322661765e7ebc740dbdd743b798 (diff) |
digital: converting to new pimpl standard for 3.7.
Structure is basically set up. Additive scrambler converted.
Diffstat (limited to 'gr-digital/include/digital')
-rw-r--r-- | gr-digital/include/digital/CMakeLists.txt | 128 | ||||
-rw-r--r-- | gr-digital/include/digital/additive_scrambler_bb.h | 74 | ||||
-rw-r--r-- | gr-digital/include/digital/api.h | 33 |
3 files changed, 235 insertions, 0 deletions
diff --git a/gr-digital/include/digital/CMakeLists.txt b/gr-digital/include/digital/CMakeLists.txt new file mode 100644 index 0000000000..c6384ecd6e --- /dev/null +++ b/gr-digital/include/digital/CMakeLists.txt @@ -0,0 +1,128 @@ +# Copyright 2011,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. + +######################################################################## +# generate helper scripts to expand templated files +######################################################################## +include(GrPython) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " +#!${PYTHON_EXECUTABLE} + +import sys, os, re +sys.path.append('${GR_CORE_PYTHONPATH}') +os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}' +os.chdir('${CMAKE_CURRENT_BINARY_DIR}') + +if __name__ == '__main__': + import build_utils + root, inp = sys.argv[1:3] + for sig in sys.argv[3:]: + name = re.sub ('X+', sig, root) + d = build_utils.standard_dict2(name, sig, 'digital') + build_utils.expand_template(d, inp) + +") + +macro(expand_h root) + #make a list of all the generated files + unset(expanded_files_h) + foreach(sig ${ARGN}) + string(REGEX REPLACE "X+" ${sig} name ${root}) + list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h) + endforeach(sig) + + #create a command to generate the files + add_custom_command( + OUTPUT ${expanded_files_h} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t + COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} + ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py + ${root} ${root}.h.t ${ARGN} + ) + + #install rules for the generated h files + list(APPEND generated_includes ${expanded_files_h}) +endmacro(expand_h) + +######################################################################## +# Invoke macro to generate various sources +####################################################################### +#expand_h(chunks_to_symbols_XX bf bc sf sc if ic) + +add_custom_target(digital_generated_includes DEPENDS + ${generated_includes} +) + +######################################################################## +# Install header files +######################################################################## +install(FILES + ${digital_generated_includes} + api.h +# impl_glfsr.h +# impl_mpsk_snr_est.h + additive_scrambler_bb.h +# binary_slicer_fb.h +# bytes_to_syms.h +# clock_recovery_mm_cc.h +# clock_recovery_mm_ff.h +# cma_equalizer_cc.h +# cpmmod_bc.h +# constellation.h +# constellation_receiver_cb.h +# constellation_decoder_cb.h +# correlate_access_code_bb.h +# correlate_access_code_tag_bb.h +# costas_loop_cc.h +# crc32.h +# descrambler_bb.h +# diff_decoder_bb.h +# diff_encoder_bb.h +# diff_phasor_cc.h +# framer_sink_1.h +# fll_band_edge_cc.h +# glfsr_source_b.h +# glfsr_source_f.h +# gmskmod_bc.h +# lms_dd_equalizer_cc.h +# kurtotic_equalizer_cc.h +# map_bb.h +# metric_type.h +# mpsk_receiver_cc.h +# mpsk_snr_est_cc.h +# ofdm_cyclic_prefixer.h +# ofdm_frame_acquisition.h +# ofdm_frame_sink.h +# ofdm_insert_preamble.h +# ofdm_mapper_bcv.h +# ofdm_sampler.h +# packet_sink.h +# pfb_clock_sync_ccf.h +# pfb_clock_sync_fff.h +# pn_correlator_cc.h +# probe_density_b.h +# probe_mpsk_snr_est_c.h +# scrambler_bb.h +# simple_framer.h +# simple_framer_sync.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/digital + COMPONENT "digital_devel" +) + diff --git a/gr-digital/include/digital/additive_scrambler_bb.h b/gr-digital/include/digital/additive_scrambler_bb.h new file mode 100644 index 0000000000..b7322f6a0b --- /dev/null +++ b/gr-digital/include/digital/additive_scrambler_bb.h @@ -0,0 +1,74 @@ +/* -*- c++ -*- */ +/* + * Copyright 2008,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. + */ + +#ifndef INCLUDED_DIGITAL_ADDITIVE_SCRAMBLER_BB_H +#define INCLUDED_DIGITAL_ADDITIVE_SCRAMBLER_BB_H + +#include <digital/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace digital { + + /*! + * \ingroup coding_blk + * + * Scramble an input stream using an LFSR. This block works on the + * LSB only of the input data stream, i.e., on an "unpacked + * binary" stream, and produces the same format on its output. + */ + class DIGITAL_API additive_scrambler_bb : virtual public gr_sync_block + { + public: + // gr::digital::additive_scrambler_bb::sptr + typedef boost::shared_ptr<additive_scrambler_bb> sptr; + + /*! + * \brief Create additive scrambler. + * + * Scramble an input stream using an LFSR. This block works on + * the LSB only of the input data stream, i.e., on an "unpacked + * binary" stream, and produces the same format on its output. + * + * \param mask Polynomial mask for LFSR + * \param seed Initial shift register contents + * \param len Shift register length + * \param count Number of bits after which shift register is reset, 0=never + * + * The scrambler works by XORing the incoming bit stream by the + * output of the LFSR. Optionally, after 'count' bits have been + * processed, the shift register is reset to the seed value. + * This allows processing fixed length vectors of samples. + */ + static sptr make(int mask, int seed, int len, int count); + + virtual int mask() const = 0; + virtual int seed() const = 0; + virtual int len() const = 0; + virtual int count() const = 0; + }; + + } /* namespace digital */ +} /* namespace gr */ + + +#endif /* INCLUDED_DIGITAL_ADDITIVE_SCRAMBLER_BB_H */ diff --git a/gr-digital/include/digital/api.h b/gr-digital/include/digital/api.h new file mode 100644 index 0000000000..d45ace13f2 --- /dev/null +++ b/gr-digital/include/digital/api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_DIGITAL_API_H +#define INCLUDED_DIGITAL_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_digital_EXPORTS +# define DIGITAL_API __GR_ATTR_EXPORT +#else +# define DIGITAL_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_DIGITAL_API_H */ |