diff --git a/grc/gsm_block_tree.xml b/grc/gsm_block_tree.xml index 99628d6..5a0fbc0 100644 --- a/grc/gsm_block_tree.xml +++ b/grc/gsm_block_tree.xml @@ -58,10 +58,8 @@ gsm_extract_system_info gsm_extract_immediate_assignment gsm_controlled_rotator_cc - gsm_controlled_const_source_f gsm_controlled_fractional_resampler_cc gsm_message_printer - gsm_clock_offset_corrector gsm_clock_offset_corrector_tagged gsm_tmsi_dumper diff --git a/grc/misc_utils/CMakeLists.txt b/grc/misc_utils/CMakeLists.txt index a64d2eb..7bdf894 100644 --- a/grc/misc_utils/CMakeLists.txt +++ b/grc/misc_utils/CMakeLists.txt @@ -21,10 +21,8 @@ install(FILES gsm_extract_system_info.xml gsm_extract_immediate_assignment.xml gsm_controlled_rotator_cc.xml - gsm_controlled_const_source_f.xml gsm_message_printer.xml gsm_bursts_printer.xml - gsm_clock_offset_corrector.xml gsm_clock_offset_corrector_tagged.xml gsm_tmsi_dumper.xml gsm_burst_file_sink.xml diff --git a/grc/misc_utils/gsm_clock_offset_corrector.xml b/grc/misc_utils/gsm_clock_offset_corrector.xml deleted file mode 100644 index 1a58397..0000000 --- a/grc/misc_utils/gsm_clock_offset_corrector.xml +++ /dev/null @@ -1,47 +0,0 @@ - - Clock Offset Corrector - gsm_clock_offset_corrector - import grgsm - grgsm.clock_offset_corrector( - fc=$fc, - ppm=$ppm, - samp_rate_in=$samp_rate_in, -) - set_fc($fc) - set_ppm($ppm) - set_samp_rate_in($samp_rate_in) - - fc - fc - fc - float - - - ppm - ppm - ppm - float - - - samp_rate_in - samp_rate_in - samp_rate_in - float - - - in - complex - 1 - - - ppm_in - message - True - - - out - complex - 1 - - Piotr Krysik - diff --git a/grc/misc_utils/gsm_controlled_const_source_f.xml b/grc/misc_utils/gsm_controlled_const_source_f.xml deleted file mode 100644 index 603fc5c..0000000 --- a/grc/misc_utils/gsm_controlled_const_source_f.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - Controlled Const Source - gsm_controlled_const_source_f - import grgsm - grgsm.controlled_const_source_f($constant) - set_constant($constant) - - - constant - constant - 0 - float - - - - constant_msg - message - 1 - - - - out - float - - diff --git a/hier_blocks/misc_utils/gsm_clock_offset_corrector.grc b/hier_blocks/misc_utils/gsm_clock_offset_corrector.grc deleted file mode 100644 index 2222d7e..0000000 --- a/hier_blocks/misc_utils/gsm_clock_offset_corrector.grc +++ /dev/null @@ -1,797 +0,0 @@ - - - - Thu Nov 6 10:22:20 2014 - - options - - author - Piotr Krysik - - - window_size - 2280, 1024 - - - category - GSM - - - comment - - - - description - - - - _enabled - True - - - _coordinate - (10, 10) - - - _rotation - 0 - - - generate_options - hb - - - hier_block_src_path - .: - - - id - clock_offset_corrector - - - max_nouts - 0 - - - qt_qss_theme - - - - realtime_scheduling - - - - run_command - {python} -u {filename} - - - run_options - prompt - - - run - True - - - thread_safe_setters - - - - title - Clock offset corrector - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (736, 19) - - - _rotation - 0 - - - id - samp_rate_out - - - value - samp_rate_in - - - - blocks_add_const_vxx - - alias - - - - comment - - - - const - samp_rate_in/samp_rate_out - - - affinity - - - - _enabled - 0 - - - _coordinate - (552, 331) - - - _rotation - 0 - - - id - blocks_add_const_vxx_0 - - - type - float - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - vlen - 1 - - - - blocks_multiply_const_vxx - - alias - - - - comment - - - - const - fc/samp_rate_out*(2*math.pi)/1e6 - - - affinity - - - - _enabled - True - - - _coordinate - (432, 220) - - - _rotation - 0 - - - id - blocks_multiply_const_vxx_0 - - - type - float - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - vlen - 1 - - - - blocks_multiply_const_vxx - - alias - - - - comment - - - - const - 1.0e-6*samp_rate_in/samp_rate_out - - - affinity - - - - _enabled - 0 - - - _coordinate - (392, 331) - - - _rotation - 0 - - - id - blocks_multiply_const_vxx_0_0 - - - type - float - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - vlen - 1 - - - - parameter - - alias - - - - comment - - - - _enabled - True - - - _coordinate - (274, 19) - - - _rotation - 0 - - - id - fc - - - label - fc - - - short_id - - - - type - eng_float - - - value - 936.6e6 - - - - fractional_resampler_xx - - alias - - - - comment - - - - affinity - - - - _enabled - 0 - - - _coordinate - (592, 537) - - - _rotation - 0 - - - id - fractional_resampler_xx_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - phase_shift - 0 - - - resamp_ratio - samp_rate_in/samp_rate_out - - - type - complex - - - - gsm_controlled_const_source_f - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - _coordinate - (184, 220) - - - _rotation - 0 - - - id - gsm_controlled_const_source_f_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - constant - ppm - - - - gsm_controlled_rotator_cc - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - _coordinate - (952, 193) - - - _rotation - 0 - - - id - gsm_controlled_rotator_cc_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - phase_inc - 0 - - - samp_rate - samp_rate_out - - - - import - - alias - - - - comment - - - - _enabled - True - - - _coordinate - (11, 125) - - - _rotation - 0 - - - id - math_imp - - - import - import math - - - - pad_sink - - comment - - - - _enabled - True - - - _coordinate - (1168, 204) - - - _rotation - 0 - - - id - pad_sink_1 - - - type - complex - - - label - out - - - num_streams - 1 - - - optional - False - - - vlen - 1 - - - - pad_source - - comment - - - - _enabled - True - - - _coordinate - (32, 188) - - - _rotation - 0 - - - id - pad_source_0 - - - label - in - - - num_streams - 1 - - - optional - False - - - type - complex - - - vlen - 1 - - - - parameter - - alias - - - - comment - - - - _enabled - True - - - _coordinate - (496, 19) - - - _rotation - 0 - - - id - ppm - - - label - ppm - - - short_id - - - - type - eng_float - - - value - 0 - - - - pad_source - - comment - - - - _enabled - True - - - _coordinate - (32, 244) - - - _rotation - 0 - - - id - ppm_in - - - label - ppm_in - - - num_streams - 1 - - - optional - True - - - type - message - - - vlen - 1 - - - - parameter - - alias - - - - comment - - - - _enabled - True - - - _coordinate - (368, 19) - - - _rotation - 0 - - - id - samp_rate_in - - - label - samp_rate_in - - - short_id - - - - type - eng_float - - - value - 1625000.0/6.0*4.0 - - - - parameter - - alias - - - - comment - - - - _enabled - False - - - _coordinate - (592, 20) - - - _rotation - 0 - - - id - samp_rate_out - - - label - samp_rate_out - - - short_id - - - - type - eng_float - - - value - 1625000.0/6.0*4.0 - - - - blocks_add_const_vxx_0 - fractional_resampler_xx_0 - 0 - 1 - - - blocks_multiply_const_vxx_0 - gsm_controlled_rotator_cc_0 - 0 - 1 - - - blocks_multiply_const_vxx_0_0 - blocks_add_const_vxx_0 - 0 - 0 - - - fractional_resampler_xx_0 - gsm_controlled_rotator_cc_0 - 0 - 0 - - - gsm_controlled_const_source_f_0 - blocks_multiply_const_vxx_0 - 0 - 0 - - - gsm_controlled_const_source_f_0 - blocks_multiply_const_vxx_0_0 - 0 - 0 - - - gsm_controlled_rotator_cc_0 - pad_sink_1 - 0 - 0 - - - pad_source_0 - fractional_resampler_xx_0 - 0 - 0 - - - pad_source_0 - gsm_controlled_rotator_cc_0 - 0 - 0 - - - ppm_in - gsm_controlled_const_source_f_0 - out - constant_msg - - diff --git a/include/grgsm/CMakeLists.txt b/include/grgsm/CMakeLists.txt index 210320a..dc9b191 100644 --- a/include/grgsm/CMakeLists.txt +++ b/include/grgsm/CMakeLists.txt @@ -23,9 +23,7 @@ install(FILES plotting.hpp api.h - gsmtap.h - msg_to_tag.h - controlled_fractional_resampler_cc.h DESTINATION include/grgsm + gsmtap.h DESTINATION include/grgsm ) add_subdirectory(decoding) diff --git a/include/grgsm/misc_utils/CMakeLists.txt b/include/grgsm/misc_utils/CMakeLists.txt index d85ac21..d21dcca 100644 --- a/include/grgsm/misc_utils/CMakeLists.txt +++ b/include/grgsm/misc_utils/CMakeLists.txt @@ -29,7 +29,8 @@ install(FILES extract_system_info.h extract_immediate_assignment.h controlled_rotator_cc.h - controlled_const_source_f.h message_printer.h - tmsi_dumper.h DESTINATION include/grgsm/misc_utils + tmsi_dumper.h + msg_to_tag.h + controlled_fractional_resampler_cc.h DESTINATION include/grgsm/misc_utils ) diff --git a/include/grgsm/misc_utils/controlled_const_source_f.h b/include/grgsm/misc_utils/controlled_const_source_f.h deleted file mode 100644 index 235c731..0000000 --- a/include/grgsm/misc_utils/controlled_const_source_f.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik - * @section LICENSE - * - * Gr-gsm 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. - * - * Gr-gsm 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 gr-gsm; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_H -#define INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_H - -#include -#include - -namespace gr { - namespace gsm { - - /*! - * \brief <+description of block+> - * \ingroup gsm - * - */ - class GRGSM_API controlled_const_source_f : virtual public gr::sync_block - { - public: - typedef boost::shared_ptr sptr; - - /*! - * \brief Return a shared_ptr to a new instance of gsm::controlled_const_source_f. - * - * To avoid accidental use of raw pointers, gsm::controlled_const_source_f's - * constructor is in a private implementation - * class. gsm::controlled_const_source_f::make is the public interface for - * creating new instances. - */ - static sptr make(float constant); - virtual void set_constant(float constant) = 0; - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_H */ - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 35195e0..73fef92 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -50,7 +50,6 @@ list(APPEND grgsm_sources flow_control/burst_fnr_filter_impl.cc flow_control/dummy_burst_filter_impl.cc misc_utils/controlled_rotator_cc_impl.cc - misc_utils/controlled_const_source_f_impl.cc misc_utils/controlled_fractional_resampler_cc_impl.cc misc_utils/msg_to_tag_impl.cc misc_utils/message_printer_impl.cc diff --git a/lib/misc_utils/controlled_const_source_f_impl.cc b/lib/misc_utils/controlled_const_source_f_impl.cc deleted file mode 100644 index ee8d0ae..0000000 --- a/lib/misc_utils/controlled_const_source_f_impl.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik - * @section LICENSE - * - * Gr-gsm 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. - * - * Gr-gsm 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 gr-gsm; 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 -#include "controlled_const_source_f_impl.h" - -namespace gr { - namespace gsm { - - controlled_const_source_f::sptr - controlled_const_source_f::make(float constant) - { - return gnuradio::get_initial_sptr - (new controlled_const_source_f_impl(constant)); - } - - void controlled_const_source_f_impl::set_constant_msg(pmt::pmt_t msg){ - if(pmt::is_real(msg)){ - set_constant(pmt::to_double(msg)); - } - } - - /* - * The private constructor - */ - controlled_const_source_f_impl::controlled_const_source_f_impl(float constant) - : gr::sync_block("controlled_const_source_f", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(float))) - { - set_constant(constant); - message_port_register_in(pmt::mp("constant_msg")); - set_msg_handler(pmt::mp("constant_msg"), boost::bind(&controlled_const_source_f_impl::set_constant_msg, this, _1)); - } - - /* - * Our virtual destructor. - */ - controlled_const_source_f_impl::~controlled_const_source_f_impl() - { - } - - int - controlled_const_source_f_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - float *optr = (float*)output_items[0]; - float t; - - t = d_constant; - std::fill_n(optr, noutput_items, t); - - return noutput_items; - } - - void controlled_const_source_f_impl::set_constant(float constant){ - d_constant = constant; - } - - } /* namespace gsm */ -} /* namespace gr */ - diff --git a/lib/misc_utils/controlled_const_source_f_impl.h b/lib/misc_utils/controlled_const_source_f_impl.h deleted file mode 100644 index 36a6258..0000000 --- a/lib/misc_utils/controlled_const_source_f_impl.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- c++ -*- */ -/* - * @file - * @author Piotr Krysik - * @section LICENSE - * - * Gr-gsm 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. - * - * Gr-gsm 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 gr-gsm; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_IMPL_H -#define INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_IMPL_H - -#include - -namespace gr { - namespace gsm { - - class controlled_const_source_f_impl : public controlled_const_source_f - { - private: - float d_constant; - void set_constant_msg(pmt::pmt_t msg); - - public: - controlled_const_source_f_impl(float constant); - ~controlled_const_source_f_impl(); - - // Where all the action really happens - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - virtual void set_constant(float constant); - }; - - } // namespace gsm -} // namespace gr - -#endif /* INCLUDED_GSM_CONTROLLED_CONST_SOURCE_F_IMPL_H */ - diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index bee42a8..89157ed 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -41,7 +41,6 @@ GR_PYTHON_INSTALL( receiver/fcch_detector.py receiver/chirpz.py misc_utils/arfcn.py - misc_utils/clock_offset_corrector.py misc_utils/clock_offset_corrector_tagged.py misc_utils/hier_block.py DESTINATION ${GR_PYTHON_DIR}/grgsm ) diff --git a/python/__init__.py b/python/__init__.py index 2e35f6c..76c6b99 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -50,7 +50,6 @@ from hier_block import hier_block from fcch_burst_tagger import fcch_burst_tagger from sch_detector import sch_detector from fcch_detector import fcch_detector -from clock_offset_corrector import clock_offset_corrector from clock_offset_corrector_tagged import clock_offset_corrector_tagged from gsm_input import gsm_input from gsm_wideband_input import gsm_wideband_input diff --git a/python/misc_utils/clock_offset_corrector.py b/python/misc_utils/clock_offset_corrector.py deleted file mode 100644 index ce222a0..0000000 --- a/python/misc_utils/clock_offset_corrector.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: Clock offset corrector -# Author: Piotr Krysik -# Generated: Wed Nov 19 08:38:40 2014 -################################################## - -from gnuradio import blocks -from gnuradio import gr -from gnuradio.filter import firdes -import grgsm -import math - -class clock_offset_corrector(grgsm.hier_block): - - def __init__(self, fc=936.6e6, ppm=0, samp_rate_in=1625000.0/6.0*4.0): - grgsm.hier_block.__init__( - self, "Clock offset corrector", - gr.io_signature(1, 1, gr.sizeof_gr_complex*1), - gr.io_signature(1, 1, gr.sizeof_gr_complex*1), - ) - self.message_port_register_hier_in("ppm_in") - - ################################################## - # Parameters - ################################################## - self.fc = fc - self.ppm = ppm - self.samp_rate_in = samp_rate_in - - ################################################## - # Variables - ################################################## - self.samp_rate_out = samp_rate_out = samp_rate_in - - ################################################## - # Blocks - ################################################## - self.gsm_controlled_rotator_cc_0 = grgsm.controlled_rotator_cc(0,samp_rate_out) - self.gsm_controlled_const_source_f_0 = grgsm.controlled_const_source_f(ppm) - self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((fc/samp_rate_out*(2*math.pi)/1e6, )) - - ################################################## - # Connections - ################################################## - self.msg_connect((self, 'ppm_in'), (self.gsm_controlled_const_source_f_0, 'constant_msg')) - self.connect((self.blocks_multiply_const_vxx_0, 0), (self.gsm_controlled_rotator_cc_0, 1)) - self.connect((self.gsm_controlled_const_source_f_0, 0), (self.blocks_multiply_const_vxx_0, 0)) - self.connect((self.gsm_controlled_rotator_cc_0, 0), (self, 0)) - self.connect((self, 0), (self.gsm_controlled_rotator_cc_0, 0)) - - def get_fc(self): - return self.fc - - def set_fc(self, fc): - self.fc = fc - self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, )) - - def get_ppm(self): - return self.ppm - - def set_ppm(self, ppm): - self.ppm = ppm - self.gsm_controlled_const_source_f_0.set_constant(self.ppm) - - def get_samp_rate_in(self): - return self.samp_rate_in - - def set_samp_rate_in(self, samp_rate_in): - self.samp_rate_in = samp_rate_in - self.set_samp_rate_out(self.samp_rate_in) - - def get_samp_rate_out(self): - return self.samp_rate_out - - def set_samp_rate_out(self, samp_rate_out): - self.samp_rate_out = samp_rate_out - self.gsm_controlled_rotator_cc_0.set_samp_rate(self.samp_rate_out) - self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, )) diff --git a/swig/grgsm_swig.i b/swig/grgsm_swig.i index 39fc3d4..3233e18 100644 --- a/swig/grgsm_swig.i +++ b/swig/grgsm_swig.i @@ -23,7 +23,6 @@ #include "grgsm/flow_control/burst_fnr_filter.h" #include "grgsm/flow_control/dummy_burst_filter.h" #include "grgsm/misc_utils/bursts_printer.h" -#include "grgsm/misc_utils/controlled_const_source_f.h" #include "grgsm/misc_utils/controlled_rotator_cc.h" #include "grgsm/misc_utils/extract_system_info.h" #include "grgsm/misc_utils/extract_immediate_assignment.h" @@ -86,8 +85,6 @@ GR_SWIG_BLOCK_MAGIC2(gsm, extract_system_info); GR_SWIG_BLOCK_MAGIC2(gsm, extract_immediate_assignment); %include "grgsm/misc_utils/controlled_rotator_cc.h" GR_SWIG_BLOCK_MAGIC2(gsm, controlled_rotator_cc); -%include "grgsm/misc_utils/controlled_const_source_f.h" -GR_SWIG_BLOCK_MAGIC2(gsm, controlled_const_source_f); %include "grgsm/misc_utils/message_printer.h" GR_SWIG_BLOCK_MAGIC2(gsm, message_printer); %include "grgsm/misc_utils/tmsi_dumper.h"