From 3c7381032a105195d1e4aadd8f02f201bb522917 Mon Sep 17 00:00:00 2001 From: ptrkrysik Date: Sat, 4 Apr 2015 12:20:50 +0200 Subject: [PATCH] Removed redundant CMakeList.txt --- CMakeLists.txt | 14 ++-- include/CMakeLists.txt | 20 ----- python/receiver/clock_offset_control.py | 101 ------------------------ 3 files changed, 7 insertions(+), 128 deletions(-) delete mode 100644 include/CMakeLists.txt delete mode 100644 python/receiver/clock_offset_control.py diff --git a/CMakeLists.txt b/CMakeLists.txt index c6abc58..e0dff42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ set(Boost_ADDITIONAL_VERSIONS find_package(Boost "1.35" COMPONENTS filesystem system) if(NOT Boost_FOUND) - message(FATAL_ERROR "Boost required to compile gsm") + message(FATAL_ERROR "Boost required to compile gr-gsm") endif() ######################################################################## @@ -71,7 +71,7 @@ include(GrPlatform) #define LIB_SUFFIX set(GR_RUNTIME_DIR bin) set(GR_LIBRARY_DIR lib${LIB_SUFFIX}) set(GR_INCLUDE_DIR include/grgsm) -set(GR_INCLUDE_DIR include/ggrsm/misc_utils) +set(GR_INCLUDE_DIR include/grgsm/misc_utils) set(GR_INCLUDE_DIR include/grgsm/receiver) set(GR_INCLUDE_DIR include/grgsm/demapping) set(GR_INCLUDE_DIR include/grgsm/decoding) @@ -95,13 +95,13 @@ find_package(CppUnit) find_package(Doxygen) if(NOT GNURADIO_RUNTIME_FOUND) - message(FATAL_ERROR "GnuRadio Runtime required to compile gsm") + message(FATAL_ERROR "GnuRadio Runtime required to compile gr-gsm") endif() if(NOT VOLK_FOUND) - message(FATAL_ERROR "Volk library required to compile gsm") + message(FATAL_ERROR "Volk library required to compile gr-gsm") endif() if(NOT CPPUNIT_FOUND) - message(FATAL_ERROR "CppUnit required to compile gsm") + message(FATAL_ERROR "CppUnit required to compile gr-gsm") endif() ######################################################################## @@ -151,7 +151,7 @@ add_custom_target(uninstall ######################################################################## # Add subdirectories ######################################################################## -add_subdirectory(include) +add_subdirectory(include/grgsm) add_subdirectory(lib) add_subdirectory(swig) add_subdirectory(python) @@ -162,6 +162,6 @@ add_subdirectory(docs) ######################################################################## # Install cmake search helper for this library ######################################################################## -install(FILES cmake/Modules/gsmConfig.cmake +install(FILES cmake/Modules/gr-gsmConfig.cmake DESTINATION lib${LIB_SUFFIX}/cmake/grgsm ) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index a7c18dd..0000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -add_subdirectory(grgsm) diff --git a/python/receiver/clock_offset_control.py b/python/receiver/clock_offset_control.py deleted file mode 100644 index 5f328a9..0000000 --- a/python/receiver/clock_offset_control.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# Copyright 2014 Piotr Krysik -# -# This 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. -# -# This software 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 this software; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from numpy import * -from gnuradio import gr -import pmt -from threading import Timer - -class clock_offset_control(gr.basic_block): - """ - docstring for block clock_offset_control - """ - def __init__(self, fc): - gr.basic_block.__init__(self, - name="gsm_clock_offset_control", - in_sig=[], - out_sig=[]) - self.fc = fc - self.message_port_register_in(pmt.intern("measurements")) - self.set_msg_handler(pmt.intern("measurements"), self.process_measurement) - self.message_port_register_out(pmt.intern("ppm")) - self.alfa = 0.3 - self.ppm_estimate = -1e6 - self.first_measurement = True - self.counter = 0 - self.last_state = "" - self.timer = Timer(0.5, self.timed_reset) - self.last_ppm_estimate = -1e6 - - def process_measurement(self,msg): - if pmt.is_tuple(msg): - key = pmt.symbol_to_string(pmt.tuple_ref(msg,0)) - if key == "freq_offset": - freq_offset = pmt.to_double(pmt.tuple_ref(msg,1)) - ppm = -freq_offset/self.fc*1.0e6 - state = pmt.symbol_to_string(pmt.tuple_ref(msg,2)) - - self.last_state = state - - if abs(ppm) > 100: #safeguard against flawed measurements - ppm = 0 - self.reset() - - if state == "fcch_search": - msg_ppm = pmt.from_double(ppm) - self.message_port_pub(pmt.intern("ppm"), msg_ppm) - self.timer.cancel() - self.timer = Timer(0.5, self.timed_reset) - self.timer.start() - elif state == "synchronized": - self.timer.cancel() - if self.first_measurement: - self.ppm_estimate = ppm - self.first_measurement = False - else: - self.ppm_estimate = (1-self.alfa)*self.ppm_estimate+self.alfa*ppm - - if self.counter == 5: - self.counter = 0 - if abs(self.last_ppm_estimate-self.ppm_estimate) > 0.1: - msg_ppm = pmt.from_double(ppm) - self.message_port_pub(pmt.intern("ppm"), msg_ppm) - self.last_ppm_estimate = self.ppm_estimate - else: - self.counter=self.counter+1 - elif state == "sync_loss": - self.reset() - msg_ppm = pmt.from_double(0.0) - self.message_port_pub(pmt.intern("ppm"), msg_ppm) - - - def timed_reset(self): - if self.last_state != "synchronized": -# print "conditional reset" - self.reset() - msg_ppm = pmt.from_double(0.0) - self.message_port_pub(pmt.intern("ppm"), msg_ppm) - - def reset(self): - self.ppm_estimate = -1e6 - self.counter = 0 - self.first_measurement = True -