Merge pull request #203 from ptrkrysik/development

Development
This commit is contained in:
Piotr Krysik 2016-07-15 14:42:11 +02:00 committed by GitHub
commit 55ea0d33f2
97 changed files with 2681 additions and 916 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ build
*.pyo
.unittests
build/
debian/tmp/
debian/files

View File

@ -5,7 +5,7 @@ language: ruby
env:
#- DOCKERFILE=tests/dockerfiles/Debian_Jessie.docker IMGNAME=debjess-grgsm
#- DOCKERFILE=tests/dockerfiles/Ubuntu_15_04.docker IMGNAME=ubu15.04-grgsm
- DOCKERFILE=tests/dockerfiles/Debian_testing.docker IMGNAME=debtest-grgsm
#- DOCKERFILE=tests/dockerfiles/Debian_testing.docker IMGNAME=debtest-grgsm
- DOCKERFILE=tests/dockerfiles/Ubuntu_16_04.docker IMGNAME=ubu16.04-grgsm
services:

View File

@ -72,6 +72,8 @@ if(SWIG_FOUND)
if("${SWIG_VERSION}" VERSION_GREATER "1.3.30")
set(SWIG_VERSION_CHECK TRUE)
endif()
else()
message(FATAL_ERROR "SWIG required to compile gr-gsm")
endif(SWIG_FOUND)
@ -99,7 +101,7 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
########################################################################
# Find gnuradio build dependencies
########################################################################
set(GR_REQUIRED_COMPONENTS RUNTIME PMT)
set(GR_REQUIRED_COMPONENTS RUNTIME FILTER PMT)
find_package(Gnuradio)
find_package(Volk)
find_package(CppUnit)
@ -138,14 +140,14 @@ include_directories(
${CMAKE_BINARY_DIR}/include
${Boost_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${GNURADIO_ALL_INCLUDE_DIRS}
${LIBOSMOCORE_INCLUDE_DIR}
)
link_directories(
${Boost_LIBRARY_DIRS}
${CPPUNIT_LIBRARY_DIRS}
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${GNURADIO_ALL_LIBRARY_DIRS}
)
# Set component parameters

View File

@ -1,4 +0,0 @@
# Packaging gr-gsm
## This is a work in progress...
* Run the build.sh script!

View File

@ -26,7 +26,7 @@ https://groups.google.com/forum/#!forum/gr-gsm/join
Development
===========
New features are accepted through github's pull requests. When creating pull request try to make it adress one topic (addition of a feature x, corretion of bug y).
New features are accepted through github's pull requests. When creating pull request try to make it adress one topic (addition of a feature x, correction of bug y).
If you wish to develop something for gr-gsm but don't know exactly what, then look for issues with label "Enhancement". Select one that you feel you are able to complete. After that claim it by commenting in the comment section of the issue. If there is any additional information about gr-gsm needed by you to make completing the task easier - just ask.

View File

@ -74,7 +74,7 @@ class grgsm_decoder(gr.top_block):
self.receiver = grgsm.receiver(4, ([0]), ([]))
if self.fc is not None:
self.input_adapter = grgsm.gsm_input(ppm=0, osr=4, fc=self.fc, samp_rate_in=samp_rate)
self.offset_control = grgsm.clock_offset_control(self.fc)
self.offset_control = grgsm.clock_offset_control(self.fc, self.samp_rate)
else:
self.input_adapter = grgsm.gsm_input(ppm=0, osr=4, samp_rate_in=samp_rate)
@ -126,7 +126,7 @@ class grgsm_decoder(gr.top_block):
self.connect((self.file_source, 0), (self.input_adapter, 0))
self.connect((self.input_adapter, 0), (self.receiver, 0))
if self.fc is not None:
self.msg_connect(self.offset_control, "ppm", self.input_adapter, "ppm_in")
self.msg_connect(self.offset_control, "ctrl", self.input_adapter, "ctrl_in")
self.msg_connect(self.receiver, "measurements", self.offset_control, "measurements")
self.msg_connect(self.receiver, "C0", self.dummy_burst_filter, "in")

View File

@ -1,8 +1,11 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Gr-gsm Livemon
# Generated: Wed Sep 2 21:46:35 2015
# Author: Piotr Krysik
# Description: Interactive monitor of a single C0 channel with analysis performed by Wireshark (command to run wireshark: sudo wireshark -k -f udp -Y gsmtap -i lo)
# Generated: Fri Jul 15 13:18:50 2016
##################################################
if __name__ == '__main__':
@ -35,14 +38,14 @@ import time
class grgsm_livemon(gr.top_block, Qt.QWidget):
def __init__(self, fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, args=""):
def __init__(self, args="", fc=939.4e6, gain=30, ppm=0, samp_rate=2000000.052982, shiftoff=400e3):
gr.top_block.__init__(self, "Gr-gsm Livemon")
Qt.QWidget.__init__(self)
self.setWindowTitle("Gr-gsm Livemon")
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
@ -61,6 +64,7 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
##################################################
# Parameters
##################################################
self.args = args
self.fc = fc
self.gain = gain
self.ppm = ppm
@ -109,40 +113,43 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
)
self.qtgui_freq_sink_x_0.set_update_time(0.10)
self.qtgui_freq_sink_x_0.set_y_axis(-140, 10)
# self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
# self.qtgui_freq_sink_x_0.enable_autoscale(False)
# self.qtgui_freq_sink_x_0.enable_grid(False)
# self.qtgui_freq_sink_x_0.set_fft_average(1.0)
# self.qtgui_freq_sink_x_0.enable_control_panel(False)
#
# if not True:
# self.qtgui_freq_sink_x_0.disable_legend()
#
# if complex == type(float()):
# self.qtgui_freq_sink_x_0.set_plot_pos_half(not True)
#
# labels = ["", "", "", "", "",
# "", "", "", "", ""]
# widths = [1, 1, 1, 1, 1,
# 1, 1, 1, 1, 1]
# colors = ["blue", "red", "green", "black", "cyan",
# "magenta", "yellow", "dark red", "dark green", "dark blue"]
# alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
# 1.0, 1.0, 1.0, 1.0, 1.0]
# for i in xrange(1):
# if len(labels[i]) == 0:
# self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i))
# else:
# self.qtgui_freq_sink_x_0.set_line_label(i, labels[i])
# self.qtgui_freq_sink_x_0.set_line_width(i, widths[i])
# self.qtgui_freq_sink_x_0.set_line_color(i, colors[i])
# self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i])
self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
self.qtgui_freq_sink_x_0.enable_autoscale(False)
self.qtgui_freq_sink_x_0.enable_grid(False)
self.qtgui_freq_sink_x_0.set_fft_average(1.0)
self.qtgui_freq_sink_x_0.enable_control_panel(False)
if not True:
self.qtgui_freq_sink_x_0.disable_legend()
if "complex" == "float" or "complex" == "msg_float":
self.qtgui_freq_sink_x_0.set_plot_pos_half(not True)
labels = ["", "", "", "", "",
"", "", "", "", ""]
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
colors = ["blue", "red", "green", "black", "cyan",
"magenta", "yellow", "dark red", "dark green", "dark blue"]
alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0]
for i in xrange(1):
if len(labels[i]) == 0:
self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i))
else:
self.qtgui_freq_sink_x_0.set_line_label(i, labels[i])
self.qtgui_freq_sink_x_0.set_line_width(i, widths[i])
self.qtgui_freq_sink_x_0.set_line_color(i, colors[i])
self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i])
self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win)
self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(1)
self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([]))
self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False)
self.gsm_sdcch8_demapper_0 = grgsm.gsm_sdcch8_demapper(
timeslot_nr=1,
)
self.gsm_receiver_0 = grgsm.receiver(4, ([0]), ([]), False)
self.gsm_message_printer_1 = grgsm.message_printer(pmt.intern(""), False,
False, False)
self.gsm_input_0 = grgsm.gsm_input(
ppm=0,
osr=4,
@ -152,17 +159,19 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.gsm_decryption_0 = grgsm.decryption(([]), 1)
self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder()
self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff)
self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(0)
self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000)
self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000)
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff, samp_rate)
self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(
timeslot_nr=0,
)
self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", "4729", 10000, False)
self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False)
self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate)
##################################################
# Connections
##################################################
self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ppm'), (self.gsm_input_0, 'ppm_in'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus'))
self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.gsm_message_printer_1, 'msgs'))
self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus'))
@ -182,6 +191,13 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.settings.setValue("geometry", self.saveGeometry())
event.accept()
def get_args(self):
return self.args
def set_args(self, args):
self.args = args
def get_fc(self):
return self.fc
@ -210,9 +226,9 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_rotator_cc_0.set_phase_inc(-2*pi*self.shiftoff/self.samp_rate)
self.gsm_input_0.set_samp_rate_in(self.samp_rate)
self.qtgui_freq_sink_x_0.set_frequency_range(self.fc_slider, self.samp_rate)
self.rtlsdr_source_0.set_sample_rate(self.samp_rate)
self.gsm_input_0.set_samp_rate_in(self.samp_rate)
def get_shiftoff(self):
return self.shiftoff
@ -246,28 +262,40 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.rtlsdr_source_0.set_center_freq(self.fc_slider-self.shiftoff, 0)
if __name__ == '__main__':
def argument_parser():
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
parser.add_option("-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(939.4e6),
parser.add_option(
"", "--args", dest="args", type="string", default="",
help="Set Device Arguments [default=%default]")
parser.add_option(
"-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(939.4e6),
help="Set fc [default=%default]")
parser.add_option("-g", "--gain", dest="gain", type="eng_float", default=eng_notation.num_to_str(30),
parser.add_option(
"-g", "--gain", dest="gain", type="eng_float", default=eng_notation.num_to_str(30),
help="Set gain [default=%default]")
parser.add_option("-p", "--ppm", dest="ppm", type="intx", default=0,
parser.add_option(
"-p", "--ppm", dest="ppm", type="intx", default=0,
help="Set ppm [default=%default]")
parser.add_option("-s", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(2000000.052982),
parser.add_option(
"-s", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(2000000.052982),
help="Set samp_rate [default=%default]")
parser.add_option("-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
parser.add_option(
"-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
help="Set shiftoff [default=%default]")
parser.add_option("", "--args", dest="args", type="string", default="",
help="Set device arguments [default=%default]")
(options, args) = parser.parse_args()
# from distutils.version import StrictVersion
# if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
# Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
Qt.QApplication.setGraphicsSystem(gr.prefs().get_string('qtgui','style','raster'))
return parser
def main(top_block_cls=grgsm_livemon, options=None):
if options is None:
options, _ = argument_parser().parse_args()
from distutils.version import StrictVersion
if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
tb = grgsm_livemon(fc=options.fc, gain=options.gain, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, args=options.args)
tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff)
tb.start()
tb.show()
@ -276,4 +304,7 @@ if __name__ == '__main__':
tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.exec_()
tb = None # to clean up Qt widgets
if __name__ == '__main__':
main()

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.8'?>
<?grc format='1' created='3.7.9'?>
<flow_graph>
<timestamp>Sat Dec 13 10:49:59 2014</timestamp>
<block>
@ -8,10 +8,6 @@
<key>author</key>
<value>Piotr Krysik</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>window_size</key>
<value>2280, 1024</value>
@ -44,6 +40,10 @@
<key>generate_options</key>
<value>qt_gui</value>
</param>
<param>
<key>hier_block_src_path</key>
<value>.:</value>
</param>
<param>
<key>id</key>
<value>grgsm_livemon</value>
@ -52,10 +52,18 @@
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>qt_qss_theme</key>
<value></value>
</param>
<param>
<key>realtime_scheduling</key>
<value></value>
</param>
<param>
<key>run_command</key>
<value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
<value>prompt</value>
@ -594,14 +602,6 @@
<key>timeslot_nr</key>
<value>0</value>
</param>
<param>
<key>channel_types</key>
<value>[1,2,2,2,2,2,2,2,2,2]</value>
</param>
<param>
<key>starts_fn_mod51</key>
<value>[2,6,12,16,22,26,32,36,42,46]</value>
</param>
</block>
<block>
<key>gsm_clock_offset_control</key>
@ -645,6 +645,10 @@
<key>fc</key>
<value>fc-shiftoff</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate</value>
</param>
</block>
<block>
<key>gsm_control_channels_decoder</key>
@ -970,14 +974,6 @@
<key>timeslot_nr</key>
<value>1</value>
</param>
<param>
<key>channel_types</key>
<value>[8,8,8,8,8,8,8,8,136,136,136,136]</value>
</param>
<param>
<key>starts_fn_mod51</key>
<value>[0,4,8,12,16,20,24,28,32,36,40,44]</value>
</param>
</block>
<block>
<key>import</key>
@ -2854,8 +2850,8 @@
<connection>
<source_block_id>gsm_clock_offset_control_0</source_block_id>
<sink_block_id>gsm_input_0</sink_block_id>
<source_key>ppm</source_key>
<sink_key>ppm_in</sink_key>
<source_key>ctrl</source_key>
<sink_key>ctrl_in</sink_key>
</connection>
<connection>
<source_block_id>gsm_control_channels_decoder_0</source_block_id>

View File

@ -76,7 +76,7 @@ class receiver_with_decoder(grgsm.hier_block):
samp_rate_in=samp_rate,
)
self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc)
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc, samp_rate)
self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(0)
##################################################
@ -84,7 +84,7 @@ class receiver_with_decoder(grgsm.hier_block):
##################################################
self.msg_connect(self.gsm_bcch_ccch_demapper_0, 'bursts', self, 'bursts')
self.msg_connect(self.gsm_bcch_ccch_demapper_0, 'bursts', self.gsm_control_channels_decoder_0, 'bursts')
self.msg_connect(self.gsm_clock_offset_control_0, 'ppm', self.gsm_input_0, 'ppm_in')
self.msg_connect(self.gsm_clock_offset_control_0, 'ctrl', self.gsm_input_0, 'ctrl_in')
self.msg_connect(self.gsm_control_channels_decoder_0, 'msgs', self, 'msgs')
self.msg_connect(self.gsm_receiver_0, 'C0', self.gsm_bcch_ccch_demapper_0, 'bursts')
self.msg_connect(self.gsm_receiver_0, 'measurements', self.gsm_clock_offset_control_0, 'measurements')

View File

@ -1,21 +0,0 @@
#!/bin/bash
# First, get into the right directory
THISPATH=$(dirname "$BASH_SOURCE")
cd $THISPATH
# Now, we check to see that the version env var is set
${CPACK_PACKAGE_VERSION:?"Need to set CPACK_PACKAGE_VERSION env var!"}
export $CPACK_DEBIAN_PACKAGE_ARCHITECTURE=`dpkg --print-architecture`
# OK, now we get down to the business of building...
rm -rf ./build
mkdir build
cd build
cmake ..
make package
cpack -G DEB
mv ./*.deb ../installer-packages
echo "If you've gotten to this point, the package has been built"
echo "and exists at "$THISPATH"/installer-packages"
echo "Don't forget to add and commit the new package, and tag the commit!"

View File

@ -1,8 +1,11 @@
#!/bin/bash
VERSION=0.40
cd ../..
tar -acf gr-gsm_0.3.orig.tar.gz gr-gsm
tar -acf gr-gsm_${VERSION}.orig.tar.gz gr-gsm
cd gr-gsm
debuild -S -sa
#pdebuild
cd ..
dput ppa:ptrkrysik/gr-gsm gr-gsm_0.3-0ppa0_source.changes
dput ppa:ptrkrysik/gr-gsm gr-gsm_${VERSION}-0ppa0_source.changes

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
gr-gsm (0.3-0ppa0) xenial; urgency=low
gr-gsm (0.40-0ppa0) xenial; urgency=low
* Initial upload!

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

26
debian/control vendored
View File

@ -1,13 +1,23 @@
Source: gr-gsm
Section: devel
Section: libdevel
Priority: optional
Maintainer: Your Name <your.email@some.where>
Build-Depends: cmake, build-essential, python-scipy, gnuradio-dev, gr-osmosdr, libosmocore-dev
Maintainer: Piotr Krysik <ptrkrysik@gmail.com>
Build-Depends: cmake,
debhelper (>= 9.0.0~),
pkg-config,
python-scipy,
gnuradio-dev,
libosmocore-dev,
python-dev,
swig
X-Python-Version: >= 2.7, << 2.8
Standards-Version: 3.9.7
Homepage: http://github.com/ptrkrysik/gr-gsm/
Vcs-Git: git://github.com/ptrkrysik/gr-gsm.git
Vcs-Browser: https://github.com/ptrkrysik/gr-gsm/
Homepage: http://www.yourhomepage.org
Package: gr-gsm
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, gnuradio, gr-osmosdr, python-scipy
Description: First test-package
Long description of greet-the-world.
It can span multiple lines!
Pre-Depends: ${misc:Pre-Depends}
Depends: gnuradio, gr-osmosdr, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
Description: Gnuradio blocks and tools for receiving GSM transmissions

32
debian/rules vendored
View File

@ -1,27 +1,15 @@
#!/usr/bin/make -f
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_MULTIARCH
BUILDDIR = build
%:
dh $@ --with python2 --parallel
# secondly called by launchpad
build:
mkdir $(BUILDDIR);
cd $(BUILDDIR); cmake -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr ..
make -C $(BUILDDIR)
override_dh_auto_configure:
dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -DPythonLibs_FIND_VERSION:STRING="2.7" -DPYTHON_EXECUTABLE:STRING="/usr/bin/python"
# thirdly called by launchpad
binary: binary-indep binary-arch
override_dh_auto_install:
dh_auto_install
rm -f debian/gr-gsm/usr/lib/python2.7/dist-packages/grgsm/*pyc
rm -f debian/gr-gsm/usr/lib/python2.7/dist-packages/grgsm/*pyo
binary-indep:
# nothing to be done
binary-arch:
cd $(BUILDDIR); cmake -P cmake_install.cmake
mkdir debian/tmp/DEBIAN
dpkg-gencontrol -pgr-gsm
dpkg --build debian/tmp ..
# firstly called by launchpad
clean:
rm -rf $(BUILDDIR)
.PHONY: binary binary-arch binary-indep clean

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

@ -1 +1 @@
Subproject commit 9446043efe0fe6883e4e962261230c9034ac71a9
Subproject commit 405c987b2bdb76bcfb0951e7aa90c8fb75f2f8dd

View File

@ -24,6 +24,5 @@ add_subdirectory(receiver)
add_subdirectory(flow_control)
add_subdirectory(misc_utils)
install(FILES
gsm_block_tree.xml
grgsm_msg_to_tag.xml DESTINATION share/gnuradio/grc/blocks
gsm_block_tree.xml DESTINATION share/gnuradio/grc/blocks
)

View File

@ -3,7 +3,7 @@
<name>TCH/F decoder</name>
<key>gsm_tch_f_decoder</key>
<import>import grgsm</import>
<make>grgsm.tch_f_decoder($mode, $file, $boundary_check)</make>
<make>grgsm.tch_f_decoder($mode, $boundary_check)</make>
<param>
<name>TCH coding mode</name>
@ -50,16 +50,10 @@
<key>grgsm.TCH_AFS4_75</key>
</option>
</param>
<param>
<name>destination file</name>
<key>file</key>
<value>/tmp/speech.gsm</value>
<type>file_open</type>
</param>
<param>
<name>Voice boundary detection</name>
<key>boundary_check</key>
<value>True</value>
<value>False</value>
<type>bool</type>
<option>
<name>False</name>
@ -80,7 +74,12 @@
<type>message</type>
<optional>1</optional>
</source>
<source>
<name>voice</name>
<type>message</type>
<optional>1</optional>
</source>
<doc>
If "Voice boundary detection" is enabled, then only bursts are decoded as voice where

View File

@ -1,5 +1,5 @@
<block>
<name>BCCH + CCCH demapper</name>
<name>BCCH + CCCH Demapper</name>
<key>gsm_bcch_ccch_demapper</key>
<category></category>
<import>import grgsm</import>

View File

@ -1,5 +1,5 @@
<block>
<name>BCCH + CCCH + SDCCH/4 demapper</name>
<name>BCCH + CCCH + SDCCH/4 Demapper</name>
<key>gsm_bcch_ccch_sdcch4_demapper</key>
<category></category>
<import>import grgsm</import>

View File

@ -1,5 +1,5 @@
<block>
<name>SDCCH/8 demapper</name>
<name>SDCCH/8 Demapper</name>
<key>gsm_sdcch8_demapper</key>
<category></category>
<import>import grgsm</import>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>TCH/F chans demapper</name>
<name>TCH/F Demapper</name>
<key>gsm_tch_f_chans_demapper</key>
<import>import grgsm</import>
<make>grgsm.tch_f_chans_demapper($timeslot_nr)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Universal ctrl chans demapper</name>
<name>Universal Control Channels Demapper</name>
<key>gsm_universal_ctrl_chans_demapper</key>
<import>import grgsm</import>
<make>grgsm.universal_ctrl_chans_demapper($timeslot_nr, $downlink_starts_fn_mod51, $downlink_channel_types, $downlink_subslots, $uplink_starts_fn_mod51, $uplink_channel_types, $uplink_subslots)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst framenumber filter</name>
<name>Burst Framenumber Filter</name>
<key>gsm_burst_fnr_filter</key>
<import>import grgsm</import>
<make>grgsm.burst_fnr_filter($mode, $fnr)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst SDCCH subslot filter</name>
<name>Burst SDCCH Subslot Filter</name>
<key>gsm_burst_sdcch_subslot_filter</key>
<import>import grgsm</import>
<make>grgsm.burst_sdcch_subslot_filter($mode, $subslot)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst SDCCH subslot splitter</name>
<name>Burst SDCCH Subslot Splitter</name>
<key>gsm_burst_sdcch_subslot_splitter</key>
<import>import grgsm</import>
<make>grgsm.burst_sdcch_subslot_splitter(

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst timeslot filter</name>
<name>Burst Timeslot Filter</name>
<key>gsm_burst_timeslot_filter</key>
<import>import grgsm</import>
<make>grgsm.burst_timeslot_filter($timeslot)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst timeslot splitter</name>
<name>Burst Timeslot Splitter</name>
<key>gsm_burst_timeslot_splitter</key>
<import>import grgsm</import>
<make>grgsm.burst_timeslot_splitter()</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Dummy burst filter</name>
<name>Dummy Burst Filter</name>
<key>gsm_dummy_burst_filter</key>
<import>import grgsm</import>
<make>grgsm.dummy_burst_filter()</make>

View File

@ -1,38 +0,0 @@
<?xml version="1.0"?>
<block>
<name>msg_to_tag</name>
<key>grgsm_msg_to_tag</key>
<category>grgsm</category>
<import>import grgsm</import>
<make>grgsm.msg_to_tag()</make>
<!-- Make one 'param' node for every Parameter you want settable from the GUI.
Sub-nodes:
* name
* key (makes the value accessible as $keyname, e.g. in the make node)
* type -->
<param>
<name>...</name>
<key>...</key>
<type>...</type>
</param>
<!-- Make one 'sink' node per input. Sub-nodes:
* name (an identifier for the GUI)
* type
* vlen
* optional (set to 1 for optional inputs) -->
<sink>
<name>in</name>
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
</sink>
<!-- Make one 'source' node per output. Sub-nodes:
* name (an identifier for the GUI)
* type
* vlen
* optional (set to 1 for optional inputs) -->
<source>
<name>out</name>
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
</source>
</block>

View File

@ -59,8 +59,10 @@
<block>gsm_extract_immediate_assignment</block>
<block>gsm_controlled_rotator_cc</block>
<block>gsm_controlled_const_source_f</block>
<block>gsm_controlled_fractional_resampler_cc</block>
<block>gsm_message_printer</block>
<block>gsm_clock_offset_corrector</block>
<block>gsm_clock_offset_corrector_tagged</block>
<block>gsm_tmsi_dumper</block>
</cat>
</cat>

View File

@ -25,9 +25,12 @@ install(FILES
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
gsm_burst_file_source.xml
gsm_message_file_sink.xml
gsm_message_file_source.xml DESTINATION share/gnuradio/grc/blocks
gsm_message_file_source.xml
gsm_msg_to_tag.xml
gsm_controlled_fractional_resampler_cc.xml DESTINATION share/gnuradio/grc/blocks
)

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst file sink</name>
<name>Burst File Sink</name>
<key>gsm_burst_file_sink</key>
<import>import grgsm</import>
<make>grgsm.burst_file_sink($filename)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst file source</name>
<name>Burst File Source</name>
<key>gsm_burst_file_source</key>
<import>import grgsm</import>
<make>grgsm.burst_file_source($filename)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Bursts printer</name>
<name>Bursts Printer</name>
<key>gsm_bursts_printer</key>
<import>import grgsm</import>
<import>import pmt</import>

View File

@ -1,5 +1,5 @@
<block>
<name>Clock offset corrector</name>
<name>Clock Offset Corrector</name>
<key>gsm_clock_offset_corrector</key>
<import>import grgsm</import>
<make>grgsm.clock_offset_corrector(

View File

@ -0,0 +1,50 @@
<block>
<name>Clock Offset Corrector Tagged</name>
<key>gsm_clock_offset_corrector_tagged</key>
<import>from clock_offset_corrector_tagged import clock_offset_corrector_tagged # grc-generated hier_block</import>
<make>grgsm.clock_offset_corrector_tagged(
fc=$fc,
ppm=$ppm,
samp_rate_in=$samp_rate_in,
)</make>
<callback>set_fc($fc)</callback>
<callback>set_ppm($ppm)</callback>
<callback>set_samp_rate_in($samp_rate_in)</callback>
<param>
<name>fc</name>
<key>fc</key>
<value>fc</value>
<type>float</type>
</param>
<param>
<name>ppm</name>
<key>ppm</key>
<value>ppm</value>
<type>float</type>
</param>
<param>
<name>samp_rate_in</name>
<key>samp_rate_in</key>
<value>samp_rate_in</value>
<type>float</type>
</param>
<sink>
<name>ctrl</name>
<type>message</type>
<optional>1</optional>
</sink>
<sink>
<name>in</name>
<type>complex</type>
<vlen>1</vlen>
</sink>
<source>
<name>out</name>
<type>complex</type>
<vlen>1</vlen>
</source>
<doc>Piotr Krysik
Clock offset corrector with blocks that use tags to switch offsets
</doc>
<grc_source>gr-gsm/hier_blocks/misc_utils/gsm_clock_offset_corrector_tagged.grc</grc_source>
</block>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Controlled const source</name>
<name>Controlled Const Source</name>
<key>gsm_controlled_const_source_f</key>
<import>import grgsm</import>
<make>grgsm.controlled_const_source_f($constant)</make>

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<block>
<name>Controlled Fractional Resampler</name>
<key>gsm_controlled_fractional_resampler_cc</key>
<import>import grgsm</import>
<make>grgsm.controlled_fractional_resampler_cc($phase_shift, $resamp_ratio)</make>
<callback>set_resamp_ratio($resamp_ratio)</callback>
<param>
<name>Phase Shift</name>
<key>phase_shift</key>
<type>real</type>
</param>
<param>
<name>Resampling Ratio</name>
<key>resamp_ratio</key>
<type>real</type>
</param>
<sink>
<name>in</name>
<type>complex</type>
</sink>
<source>
<name>out</name>
<type>complex</type>
</source>
</block>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Controlled rotator</name>
<name>Controlled Rotator</name>
<key>gsm_controlled_rotator_cc</key>
<import>import grgsm</import>
<make>grgsm.controlled_rotator_cc($phase_inc,$samp_rate)</make>
@ -27,6 +27,7 @@
<sink>
<name>phase_inc</name>
<type>float</type>
<optional>1</optional>
</sink>
<source>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Extract immediate assignment</name>
<name>Extract Immediate Assignment</name>
<key>gsm_extract_immediate_assignment</key>
<import>import grgsm</import>
<make>grgsm.extract_immediate_assignment($print_immediate_assignments, $ignore_gprs, $unique_references)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Extract system info</name>
<name>Extract System Info</name>
<key>gsm_extract_system_info</key>
<import>import grgsm</import>
<make>grgsm.extract_system_info()</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Message file sink</name>
<name>Message File Sink</name>
<key>gsm_message_file_sink</key>
<import>import grgsm</import>
<make>grgsm.message_file_sink($filename)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Message file source</name>
<name>Message File Source</name>
<key>gsm_message_file_source</key>
<import>import grgsm</import>
<make>grgsm.message_file_source($filename)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Message printer</name>
<name>Message Printer</name>
<key>gsm_message_printer</key>
<import>import grgsm</import>
<import>import pmt</import>

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<block>
<name>Message To Tag</name>
<key>gsm_msg_to_tag</key>
<import>import grgsm</import>
<make>grgsm.msg_to_tag()</make>
<sink>
<name>in</name>
<type>complex</type>
</sink>
<sink>
<name>msg</name>
<type>message</type>
<optional>1</optional>
</sink>
<source>
<name>out</name>
<type>complex</type>
</source>
</block>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst sink</name>
<name>Burst Sink</name>
<key>gsm_burst_sink</key>
<import>import grgsm</import>
<make>grgsm.burst_sink()</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>Burst source</name>
<name>Burst Source</name>
<key>gsm_burst_source</key>
<import>import grgsm</import>
<make>grgsm.burst_source($framenumbers, $timeslots, $bursts)</make>

View File

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<block>
<name>GSM clock offset control</name>
<name>GSM Clock Offset Control</name>
<key>gsm_clock_offset_control</key>
<import>import grgsm</import>
<make>grgsm.clock_offset_control($fc)</make>
<make>grgsm.clock_offset_control($fc, $samp_rate)</make>
<callback></callback>
<param>
<name>fc</name>
@ -12,13 +12,20 @@
<type>float</type>
</param>
<param>
<name>samp_rate</name>
<key>samp_rate</key>
<value>samp_rate</value>
<type>float</type>
</param>
<sink>
<name>measurements</name>
<type>message</type>
</sink>
<source>
<name>ppm</name>
<name>ctrl</name>
<type>message</type>
<optional>1</optional>
</source>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>CX channel hopper</name>
<name>CX Channel Hopper</name>
<key>gsm_cx_channel_hopper</key>
<import>import grgsm</import>
<make>grgsm.cx_channel_hopper($ma, $maio, $hsn)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>FCCH burst tagger</name>
<name>FCCH Burst Tagger</name>
<key>gsm_fcch_burst_tagger</key>
<import>import grgsm</import>
<make>grgsm.fcch_burst_tagger($OSR)</make>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>FCCH bursts detector</name>
<name>FCCH Bursts Detector</name>
<key>gsm_fcch_detector</key>
<import>import grgsm</import>
<make>grgsm.fcch_detector($OSR)</make>

View File

@ -1,5 +1,5 @@
<block>
<name>GSM input adaptor</name>
<name>GSM Input Adaptor</name>
<key>gsm_input</key>
<category></category>
<import>import grgsm</import>
@ -47,7 +47,7 @@
<vlen>1</vlen>
</sink>
<sink>
<name>ppm_in</name>
<name>ctrl_in</name>
<type>message</type>
<optional>True</optional>
</sink>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<block>
<name>SCH bursts detector</name>
<name>SCH Bursts Detector</name>
<key>gsm_sch_detector</key>
<import>import grgsm</import>
<make>grgsm.sch_detector($OSR)</make>

View File

@ -1,5 +1,5 @@
<block>
<name>GSM wideband input adaptor</name>
<name>GSM Wideband Input Adaptor</name>
<key>gsm_wideband_input</key>
<category></category>
<import>import grgsm</import>

View File

@ -0,0 +1,494 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.9'?>
<flow_graph>
<timestamp>Thu Nov 6 10:22:20 2014</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value>Piotr Krysik</value>
</param>
<param>
<key>window_size</key>
<value>2280, 1024</value>
</param>
<param>
<key>category</key>
<value>GSM</value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>description</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(10, 10)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>generate_options</key>
<value>hb</value>
</param>
<param>
<key>hier_block_src_path</key>
<value>.:</value>
</param>
<param>
<key>id</key>
<value>clock_offset_corrector_new</value>
</param>
<param>
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>qt_qss_theme</key>
<value></value>
</param>
<param>
<key>realtime_scheduling</key>
<value></value>
</param>
<param>
<key>run_command</key>
<value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
<value>prompt</value>
</param>
<param>
<key>run</key>
<value>True</value>
</param>
<param>
<key>thread_safe_setters</key>
<value></value>
</param>
<param>
<key>title</key>
<value>Clock offset corrector</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(736, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_out</value>
</param>
<param>
<key>value</key>
<value>samp_rate_in</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(32, 244)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ctrl_in</value>
</param>
<param>
<key>label</key>
<value>ctrl_in</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>message</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(274, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>fc</value>
</param>
<param>
<key>label</key>
<value>fc</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>936.6e6</value>
</param>
</block>
<block>
<key>grgsm_msg_to_tag</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(192, 193)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>grgsm_msg_to_tag_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
</block>
<block>
<key>import</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(11, 125)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>math_imp</value>
</param>
<param>
<key>import</key>
<value>import math</value>
</param>
</block>
<block>
<key>pad_sink</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1168, 204)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_sink_1</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>label</key>
<value>out</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(32, 188)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_source_0</value>
</param>
<param>
<key>label</key>
<value>in</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(496, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ppm</value>
</param>
<param>
<key>label</key>
<value>ppm</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(368, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_in</value>
</param>
<param>
<key>label</key>
<value>samp_rate_in</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*4.0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(592, 20)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_out</value>
</param>
<param>
<key>label</key>
<value>samp_rate_out</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*4.0</value>
</param>
</block>
<connection>
<source_block_id>ctrl_in</source_block_id>
<sink_block_id>grgsm_msg_to_tag_0</sink_block_id>
<source_key>out</source_key>
<sink_key>msg</sink_key>
</connection>
<connection>
<source_block_id>pad_source_0</source_block_id>
<sink_block_id>grgsm_msg_to_tag_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
</flow_graph>

View File

@ -0,0 +1,606 @@
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.9'?>
<flow_graph>
<timestamp>Thu Nov 6 10:22:20 2014</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value>Piotr Krysik</value>
</param>
<param>
<key>window_size</key>
<value>2280, 1024</value>
</param>
<param>
<key>category</key>
<value>GSM</value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>description</key>
<value>Clock offset corrector with blocks that use tags to switch offsets</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(10, 10)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>generate_options</key>
<value>hb</value>
</param>
<param>
<key>hier_block_src_path</key>
<value>.:</value>
</param>
<param>
<key>id</key>
<value>clock_offset_corrector_tagged</value>
</param>
<param>
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>qt_qss_theme</key>
<value></value>
</param>
<param>
<key>realtime_scheduling</key>
<value></value>
</param>
<param>
<key>run_command</key>
<value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
<value>prompt</value>
</param>
<param>
<key>run</key>
<value>True</value>
</param>
<param>
<key>thread_safe_setters</key>
<value></value>
</param>
<param>
<key>title</key>
<value>Clock offset corrector tagged</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(736, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_out</value>
</param>
<param>
<key>value</key>
<value>samp_rate_in</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(32, 244)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ctrl</value>
</param>
<param>
<key>label</key>
<value>ctrl</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>message</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(274, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>fc</value>
</param>
<param>
<key>label</key>
<value>fc</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>936.6e6</value>
</param>
</block>
<block>
<key>grgsm_controlled_fractional_resampler_cc</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(328, 197)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>grgsm_controlled_fractional_resampler_cc_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>phase_shift</key>
<value>0</value>
</param>
<param>
<key>resamp_ratio</key>
<value>1.0</value>
</param>
</block>
<block>
<key>grgsm_msg_to_tag</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(192, 193)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>grgsm_msg_to_tag_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
</block>
<block>
<key>gsm_controlled_rotator_cc</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(608, 209)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>gsm_controlled_rotator_cc_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>phase_inc</key>
<value>ppm/1.0e6*2*math.pi*fc/samp_rate_in</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_out</value>
</param>
</block>
<block>
<key>import</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(11, 125)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>math_imp</value>
</param>
<param>
<key>import</key>
<value>import math</value>
</param>
</block>
<block>
<key>pad_sink</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(784, 220)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_sink_1</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>label</key>
<value>out</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(32, 188)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_source_0</value>
</param>
<param>
<key>label</key>
<value>in</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(496, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ppm</value>
</param>
<param>
<key>label</key>
<value>ppm</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(368, 19)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_in</value>
</param>
<param>
<key>label</key>
<value>samp_rate_in</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*4.0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(592, 20)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_out</value>
</param>
<param>
<key>label</key>
<value>samp_rate_out</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*4.0</value>
</param>
</block>
<connection>
<source_block_id>ctrl</source_block_id>
<sink_block_id>grgsm_msg_to_tag_0</sink_block_id>
<source_key>out</source_key>
<sink_key>msg</sink_key>
</connection>
<connection>
<source_block_id>grgsm_controlled_fractional_resampler_cc_0</source_block_id>
<sink_block_id>gsm_controlled_rotator_cc_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>grgsm_msg_to_tag_0</source_block_id>
<sink_block_id>grgsm_controlled_fractional_resampler_cc_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>gsm_controlled_rotator_cc_0</source_block_id>
<sink_block_id>pad_sink_1</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>pad_source_0</source_block_id>
<sink_block_id>grgsm_msg_to_tag_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
</flow_graph>

View File

@ -1,41 +1,69 @@
<?xml version='1.0' encoding='ASCII'?>
<?grc format='1' created='3.7.6'?>
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.9'?>
<flow_graph>
<timestamp>Thu Nov 6 14:41:06 2014</timestamp>
<block>
<key>options</key>
<param>
<key>id</key>
<value>gsm_input</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>title</key>
<value>GSM input adaptor</value>
</param>
<param>
<key>author</key>
<value>Piotr Krysik</value>
</param>
<param>
<key>description</key>
<value>Adaptor of input stream for the GSM receiver. Contains frequency ofset corrector doing also resampling to integer multiplies of GSM sample rate and LP filter filtering GSM channel.</value>
</param>
<param>
<key>window_size</key>
<value>1280, 1024</value>
</param>
<param>
<key>category</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>description</key>
<value>Adaptor of input stream for the GSM receiver. Contains frequency ofset corrector doing also resampling to integer multiplies of GSM sample rate and LP filter filtering GSM channel.</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(10, 10)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>generate_options</key>
<value>hb</value>
</param>
<param>
<key>category</key>
<key>hier_block_src_path</key>
<value>.:</value>
</param>
<param>
<key>id</key>
<value>gsm_input</value>
</param>
<param>
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>qt_qss_theme</key>
<value></value>
</param>
<param>
<key>realtime_scheduling</key>
<value></value>
</param>
<param>
<key>run_command</key>
<value>{python} -u {filename}</value>
</param>
<param>
<key>run_options</key>
<value>prompt</value>
@ -45,44 +73,24 @@
<value>True</value>
</param>
<param>
<key>max_nouts</key>
<value>0</value>
</param>
<param>
<key>realtime_scheduling</key>
<key>thread_safe_setters</key>
<value></value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(10, 10)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
<key>title</key>
<value>GSM input adaptor</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>id</key>
<value>samp_rate_out</value>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*osr</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(632, 19)</value>
@ -91,115 +99,72 @@
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>id</key>
<value>ppm</value>
<value>samp_rate_out</value>
</param>
<param>
<key>value</key>
<value>1625000.0/6.0*osr</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value>ppm</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(453, 22)</value>
<value>(56, 188)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>id</key>
<value>osr</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
<value>ctrl_in</value>
</param>
<param>
<key>label</key>
<value>OSR</value>
<value>ctrl_in</value>
</param>
<param>
<key>value</key>
<value>4</value>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>intx</value>
<value>message</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(541, 23)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>id</key>
<value>fc</value>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value>fc</value>
</param>
<param>
<key>value</key>
<value>940e6</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(231, 22)</value>
@ -208,94 +173,35 @@
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>id</key>
<value>samp_rate_in</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
<value>fc</value>
</param>
<param>
<key>label</key>
<value>samp_rate_in</value>
</param>
<param>
<key>value</key>
<value>1e6</value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
<value>fc</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>940e6</value>
</param>
</block>
<block>
<key>fractional_resampler_xx</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
<value>(328, 22)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>low_pass_filter</key>
<param>
<key>id</key>
<value>low_pass_filter_0_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>fir_filter_ccf</value>
</param>
<param>
<key>decim</key>
<value>1</value>
</param>
<param>
<key>interp</key>
<value>1</value>
</param>
<param>
<key>gain</key>
<value>1</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_out</value>
</param>
<param>
<key>cutoff_freq</key>
<value>125e3</value>
</param>
<param>
<key>width</key>
<value>5e3</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
<param>
<key>beta</key>
<value>6.76</value>
</param>
<param>
<key>alias</key>
<key>comment</key>
<value></value>
</param>
<param>
@ -303,75 +209,29 @@
<value></value>
</param>
<param>
<key>minoutbuf</key>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(488, 217)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>fractional_resampler_xx_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(704, 179)</value>
</param>
<param>
<key>_rotation</key>
<key>minoutbuf</key>
<value>0</value>
</param>
</block>
<block>
<key>pad_sink</key>
<param>
<key>id</key>
<value>pad_sink_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value>out</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(904, 227)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>fractional_resampler_xx</key>
<param>
<key>id</key>
<value>fractional_resampler_xx_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>phase_shift</key>
<value>0</value>
@ -380,119 +240,49 @@
<key>resamp_ratio</key>
<value>samp_rate_in/samp_rate_out</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
</block>
<block>
<key>gsm_clock_offset_corrector_tagged</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>minoutbuf</key>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(224, 198)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>gsm_clock_offset_corrector_tagged_0</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>_coordinate</key>
<value>(488, 216)</value>
</param>
<param>
<key>_rotation</key>
<key>minoutbuf</key>
<value>0</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>id</key>
<value>pad_source_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value>in</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>_coordinate</key>
<value>(56, 179)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>id</key>
<value>ppm_in</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>label</key>
<value>ppm_in</value>
</param>
<param>
<key>type</key>
<value>message</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(56, 243)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
</block>
<block>
<key>gsm_clock_offset_corrector</key>
<param>
<key>id</key>
<value>gsm_clock_offset_corrector_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>fc</key>
<value>fc</value>
@ -505,36 +295,302 @@
<key>samp_rate_in</key>
<value>samp_rate_in</value>
</param>
</block>
<block>
<key>low_pass_filter</key>
<param>
<key>beta</key>
<value>6.76</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>minoutbuf</key>
<key>cutoff_freq</key>
<value>125e3</value>
</param>
<param>
<key>decim</key>
<value>1</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>type</key>
<value>fir_filter_ccf</value>
</param>
<param>
<key>_coordinate</key>
<value>(712, 186)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>1</value>
</param>
<param>
<key>id</key>
<value>low_pass_filter_0_0</value>
</param>
<param>
<key>interp</key>
<value>1</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate_out</value>
</param>
<param>
<key>width</key>
<value>5e3</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(280, 195)</value>
<value>(541, 23)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>osr</value>
</param>
<param>
<key>label</key>
<value>OSR</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>intx</value>
</param>
<param>
<key>value</key>
<value>4</value>
</param>
</block>
<block>
<key>pad_sink</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(904, 228)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_sink_0</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>label</key>
<value>out</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>pad_source</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(56, 236)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pad_source_0</value>
</param>
<param>
<key>label</key>
<value>in</value>
</param>
<param>
<key>num_streams</key>
<value>1</value>
</param>
<param>
<key>optional</key>
<value>False</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>vlen</key>
<value>1</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(453, 22)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>ppm</value>
</param>
<param>
<key>label</key>
<value>ppm</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>0</value>
</param>
</block>
<block>
<key>parameter</key>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(328, 22)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>samp_rate_in</value>
</param>
<param>
<key>label</key>
<value>samp_rate_in</value>
</param>
<param>
<key>short_id</key>
<value></value>
</param>
<param>
<key>type</key>
<value>eng_float</value>
</param>
<param>
<key>value</key>
<value>1e6</value>
</param>
</block>
<connection>
<source_block_id>low_pass_filter_0_0</source_block_id>
<sink_block_id>pad_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
<source_block_id>ctrl_in</source_block_id>
<sink_block_id>gsm_clock_offset_corrector_tagged_0</sink_block_id>
<source_key>out</source_key>
<sink_key>ctrl</sink_key>
</connection>
<connection>
<source_block_id>fractional_resampler_xx_0</source_block_id>
@ -543,21 +599,21 @@
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>gsm_clock_offset_corrector_0</source_block_id>
<source_block_id>gsm_clock_offset_corrector_tagged_0</source_block_id>
<sink_block_id>fractional_resampler_xx_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>pad_source_0</source_block_id>
<sink_block_id>gsm_clock_offset_corrector_0</sink_block_id>
<source_block_id>low_pass_filter_0_0</source_block_id>
<sink_block_id>pad_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>ppm_in</source_block_id>
<sink_block_id>gsm_clock_offset_corrector_0</sink_block_id>
<source_block_id>pad_source_0</source_block_id>
<sink_block_id>gsm_clock_offset_corrector_tagged_0</sink_block_id>
<source_key>0</source_key>
<sink_key>ppm_in</sink_key>
<sink_key>0</sink_key>
</connection>
</flow_graph>

View File

@ -24,7 +24,8 @@ install(FILES
plotting.hpp
api.h
gsmtap.h
msg_to_tag.h DESTINATION include/grgsm
msg_to_tag.h
controlled_fractional_resampler_cc.h DESTINATION include/grgsm
)
add_subdirectory(decoding)

View File

@ -0,0 +1,64 @@
/* -*- c++ -*- */
/* @file
* @author Piotr Krysik <ptrkrysik@gmail.com>
* @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_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_H
#define INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_H
#include <grgsm/api.h>
#include <gnuradio/block.h>
//#include <gnuradio/filter/fractional_resampler_cc.h>
namespace gr {
namespace gsm {
/*!
* \brief <+description of block+>
* \ingroup grgsm
*
*/
class GRGSM_API controlled_fractional_resampler_cc : virtual public block
{
public:
typedef boost::shared_ptr<controlled_fractional_resampler_cc> sptr;
/*!
* \brief Return a shared_ptr to a new instance of grgsm::controlled_fractional_resampler_cc.
*
* To avoid accidental use of raw pointers, grgsm::controlled_fractional_resampler_cc's
* constructor is in a private implementation
* class. grgsm::controlled_fractional_resampler_cc::make is the public interface for
* creating new instances.
*/
static sptr make(float phase_shift, float resamp_ratio);
virtual float mu() const = 0;
virtual float resamp_ratio() const = 0;
virtual void set_mu (float mu) = 0;
virtual void set_resamp_ratio(float resamp_ratio) = 0;
};
} // namespace grgsm
} // namespace gr
#endif /* INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_H */

View File

@ -62,7 +62,7 @@ namespace gr {
* class. gsm::tch_f_decoder::make is the public interface for
* creating new instances.
*/
static sptr make(tch_mode mode, const std::string &file, bool boundary_check=true);
static sptr make(tch_mode mode, bool boundary_check=false);
};

View File

@ -28,7 +28,7 @@
#include <gnuradio/sync_block.h>
namespace gr {
namespace grgsm {
namespace gsm {
/*!
* \brief <+description of block+>
@ -39,7 +39,6 @@ namespace gr {
{
public:
typedef boost::shared_ptr<msg_to_tag> sptr;
/*!
* \brief Return a shared_ptr to a new instance of grgsm::msg_to_tag.
*

View File

@ -49,8 +49,9 @@ namespace gr {
* class. gsm::clock_offset_control::make is the public interface for
* creating new instances.
*/
static sptr make(float fc);
virtual void set_fc(float fc) = 0;
static sptr make(float fc, float samp_rate);
virtual void set_fc(float fc) = 0;
virtual void set_samp_rate(float samp_rate) = 0;
};
} // namespace gsm

View File

@ -26,7 +26,6 @@
#include <grgsm/api.h>
#include <gnuradio/block.h>
#include <gnuradio/feval.h>
#include <gnuradio/sync_block.h>
#include <vector>

View File

@ -31,9 +31,6 @@ list(APPEND grgsm_sources
receiver/sch.c
receiver/clock_offset_control_impl.cc
receiver/cx_channel_hopper_impl.cc
misc_utils/bursts_printer_impl.cc
misc_utils/extract_system_info_impl.cc
misc_utils/extract_immediate_assignment_impl.cc
demapping/universal_ctrl_chans_demapper_impl.cc
demapping/tch_f_chans_demapper_impl.cc
decoding/control_channels_decoder_impl.cc
@ -54,23 +51,27 @@ list(APPEND grgsm_sources
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
misc_utils/tmsi_dumper_impl.cc
misc_utils/burst_file_sink_impl.cc
misc_utils/burst_file_source_impl.cc
misc_utils/message_file_sink_impl.cc
misc_utils/message_file_source_impl.cc
misc_utils/message_file_source_impl.cc
misc_utils/bursts_printer_impl.cc
misc_utils/extract_system_info_impl.cc
misc_utils/extract_immediate_assignment_impl.cc
qa_utils/burst_sink_impl.cc
qa_utils/burst_source_impl.cc
qa_utils/message_source_impl.cc
qa_utils/message_sink_impl.cc
decryption/decryption_impl.cc
msg_to_tag_impl.cc
)
add_library(grgsm SHARED ${grgsm_sources})
target_link_libraries(grgsm ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES} ${LIBOSMOCORE_LIBRARIES}
target_link_libraries(grgsm ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${VOLK_LIBRARIES} ${LIBOSMOCORE_LIBRARIES}
# libraries required by plotting.h - have troubles to be installed by pybombs
# boost_iostreams
# boost_system

View File

@ -35,16 +35,16 @@ namespace gr {
namespace gsm {
tch_f_decoder::sptr
tch_f_decoder::make(tch_mode mode, const std::string &file, bool boundary_check)
tch_f_decoder::make(tch_mode mode, bool boundary_check)
{
return gnuradio::get_initial_sptr
(new tch_f_decoder_impl(mode, file, boundary_check));
(new tch_f_decoder_impl(mode, boundary_check));
}
/*
* Constructor
*/
tch_f_decoder_impl::tch_f_decoder_impl(tch_mode mode, const std::string &file, bool boundary_check)
tch_f_decoder_impl::tch_f_decoder_impl(tch_mode mode, bool boundary_check)
: gr::block("tch_f_decoder",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0)),
@ -52,6 +52,7 @@ namespace gr {
d_collected_bursts_num(0),
d_boundary_check(boundary_check),
d_boundary_decode(!boundary_check),
d_header_sent(false),
mBlockCoder(0x10004820009ULL, 40, 224),
mU(228),
mP(mU.segment(184,40)),
@ -65,18 +66,11 @@ namespace gr {
mClass1A_d(mTCHD.head(50)),
mTCHParity(0x0b, 3, 50)
{
d_speech_file = fopen( file.c_str(), "wb" );
if (d_speech_file == NULL)
{
throw std::runtime_error("TCH/F Decoder: can't open file\n");
}
const unsigned char amr_nb_magic[6] = { 0x23, 0x21, 0x41, 0x4d, 0x52, 0x0a };
if (d_tch_mode != TCH_FS)
{
fwrite(amr_nb_magic, 1, 6, d_speech_file);
}
//setup input/output ports
message_port_register_in(pmt::mp("bursts"));
set_msg_handler(pmt::mp("bursts"), boost::bind(&tch_f_decoder_impl::decode, this, _1));
message_port_register_out(pmt::mp("msgs"));
message_port_register_out(pmt::mp("voice"));
int j, k, B;
for (k = 0; k < CONV_SIZE; k++)
@ -86,11 +80,6 @@ namespace gr {
interleave_trans[k] = B * 114 + j;
}
//setup input/output ports
message_port_register_in(pmt::mp("bursts"));
set_msg_handler(pmt::mp("bursts"), boost::bind(&tch_f_decoder_impl::decode, this, _1));
message_port_register_out(pmt::mp("msgs"));
setCodingMode(mode);
}
@ -100,9 +89,20 @@ namespace gr {
void tch_f_decoder_impl::decode(pmt::pmt_t msg)
{
if(!d_header_sent)
{
if (d_tch_mode != TCH_FS)
{
const unsigned char amr_nb_magic[7] = "#!AMR\n";
message_port_pub(pmt::mp("voice"), pmt::cons(pmt::PMT_NIL, pmt::make_blob(amr_nb_magic,6)));
}
d_header_sent = true;
}
d_bursts[d_collected_bursts_num] = msg;
d_collected_bursts_num++;
bool stolen = false;
if (d_collected_bursts_num == 8)
@ -249,7 +249,7 @@ namespace gr {
return;
}
// Decode voice frames and write to file
// Decode voice frames and send to the output
if (d_tch_mode == TCH_FS || d_tch_mode == TCH_EFR)
{
mVR204Coder.decode(mClass1_c, mTCHU);
@ -329,7 +329,7 @@ namespace gr {
amrFrame.pack(frameBuffer);
}
fwrite(frameBuffer, 1 , mTCHFrameLength, d_speech_file);
message_port_pub(pmt::mp("voice"), pmt::cons(pmt::PMT_NIL, pmt::make_blob(frameBuffer,mTCHFrameLength)));
}
}
else
@ -378,7 +378,7 @@ namespace gr {
// mTCHD.unmap(mAMRBitOrder, payload.size(), payload);
mTCHD.copyTo(payload);
amrFrame.pack(frameBuffer);
fwrite(frameBuffer, 1 , mAMRFrameLth, d_speech_file);
message_port_pub(pmt::mp("voice"), pmt::cons(pmt::PMT_NIL, pmt::make_blob(frameBuffer,mAMRFrameLth)));
}
}
}

View File

@ -52,10 +52,10 @@ namespace gr {
unsigned int d_collected_bursts_num;
unsigned short interleave_trans[CONV_SIZE];
pmt::pmt_t d_bursts[8];
FILE * d_speech_file;
enum tch_mode d_tch_mode;
bool d_boundary_check;
bool d_boundary_decode;
bool d_header_sent;
BitVector mU;
BitVector mP;
@ -89,7 +89,7 @@ namespace gr {
void decode(pmt::pmt_t msg);
void setCodingMode(tch_mode mode);
public:
tch_f_decoder_impl(tch_mode mode, const std::string &file, bool boundary_check=true);
tch_f_decoder_impl(tch_mode mode, bool boundary_check=false);
~tch_f_decoder_impl();
};

View File

@ -0,0 +1,182 @@
/* -*- c++ -*- */
/* @file
* @author Piotr Krysik <ptrkrysik@gmail.com>
* @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 <gnuradio/io_signature.h>
#include "controlled_fractional_resampler_cc_impl.h"
#include <stdexcept>
namespace gr {
namespace gsm {
controlled_fractional_resampler_cc::sptr
controlled_fractional_resampler_cc::make(float phase_shift, float resamp_ratio)
{
return gnuradio::get_initial_sptr
(new controlled_fractional_resampler_cc_impl(phase_shift, resamp_ratio));
}
controlled_fractional_resampler_cc_impl::controlled_fractional_resampler_cc_impl
(float phase_shift, float resamp_ratio)
: block("controlled_fractional_resampler_cc",
io_signature::make(1, 1, sizeof(gr_complex)),
io_signature::make(1, 1, sizeof(gr_complex))),
d_mu(phase_shift), d_mu_inc(resamp_ratio),
d_resamp(new mmse_fir_interpolator_cc())
{
this->set_tag_propagation_policy(TPP_DONT);
if(resamp_ratio <= 0)
throw std::out_of_range("resampling ratio must be > 0");
if(phase_shift < 0 || phase_shift > 1)
throw std::out_of_range("phase shift ratio must be > 0 and < 1");
set_relative_rate(1.0 / resamp_ratio);
}
controlled_fractional_resampler_cc_impl::~controlled_fractional_resampler_cc_impl()
{
delete d_resamp;
}
void
controlled_fractional_resampler_cc_impl::forecast(int noutput_items,
gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size();
for(unsigned i=0; i < ninputs; i++) {
ninput_items_required[i] =
(int)ceil((noutput_items * d_mu_inc) + d_resamp->ntaps());
}
}
int
controlled_fractional_resampler_cc_impl::general_work(int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const gr_complex *in = (const gr_complex*)input_items[0];
gr_complex *out = (gr_complex*)output_items[0];
uint64_t processed_in = 0; //input samples processed in the last call to resample function
uint64_t processed_in_sum = 0; //input samples processed during a whole call to general_work function
uint64_t produced_out_sum = 0; //output samples produced during a whole call to general_work function
std::vector<tag_t> set_resamp_ratio_tags;
pmt::pmt_t key = pmt::string_to_symbol("set_resamp_ratio");
get_tags_in_window(set_resamp_ratio_tags, 0, 0, ninput_items[0]);
bool all_output_samples_produced = false;
for(std::vector<tag_t>::iterator i_tag = set_resamp_ratio_tags.begin(); i_tag < set_resamp_ratio_tags.end(); i_tag++)
{
uint64_t tag_offset_rel = i_tag->offset - nitems_read(0);
if(pmt::symbol_to_string(i_tag->key) == "set_resamp_ratio")
{
uint64_t samples_to_produce = static_cast<uint64_t>(round(static_cast<double>(tag_offset_rel-processed_in_sum)/d_mu_inc)); //tu może być problem - bo to jest głupota przy d_mu_inc różnym od 1.0
if( (samples_to_produce + produced_out_sum) > noutput_items)
{
samples_to_produce = noutput_items - produced_out_sum;
all_output_samples_produced = true;
}
processed_in = resample(in, processed_in_sum, out, produced_out_sum, samples_to_produce);
processed_in_sum = processed_in_sum + processed_in;
produced_out_sum = produced_out_sum + samples_to_produce;
if(all_output_samples_produced)
{
break;
} else {
add_item_tag(0, produced_out_sum + nitems_written(0), i_tag->key, i_tag->value);
set_resamp_ratio(pmt::to_double(i_tag->value));
}
} else {
uint64_t out_samples_to_tag = round(static_cast<double>(tag_offset_rel-processed_in_sum)/d_mu_inc);
if( (out_samples_to_tag + produced_out_sum) <= noutput_items)
{
add_item_tag(0, produced_out_sum + out_samples_to_tag + nitems_written(0), i_tag->key, i_tag->value);
}
}
}
if(!all_output_samples_produced)
{
processed_in = resample(in, processed_in_sum, out, produced_out_sum, (noutput_items-produced_out_sum));
processed_in_sum = processed_in_sum + processed_in;
}
consume_each(processed_in_sum);
return noutput_items;
}
inline uint64_t
controlled_fractional_resampler_cc_impl::resample(const gr_complex *in, uint64_t first_in_sample, gr_complex *out, uint64_t first_out_sample, uint64_t samples_to_produce)
{
int ii = first_in_sample;
int oo = first_out_sample;
while(oo < (first_out_sample+samples_to_produce)) //produce samples_to_produce number of samples
{
out[oo++] = d_resamp->interpolate(&in[ii], d_mu);
double s = d_mu + d_mu_inc;
double f = floor(s);
int incr = (int)f;
d_mu = s - f;
ii += incr;
}
return ii-first_in_sample; //number of input samples processed
}
float
controlled_fractional_resampler_cc_impl::mu() const
{
return d_mu;
}
float
controlled_fractional_resampler_cc_impl::resamp_ratio() const
{
return d_mu_inc;
}
void
controlled_fractional_resampler_cc_impl::set_mu(float mu)
{
d_mu = mu;
}
void
controlled_fractional_resampler_cc_impl::set_resamp_ratio(float resamp_ratio)
{
d_mu_inc = resamp_ratio;
set_relative_rate(1.0 / resamp_ratio);
}
} /* namespace grgsm */
} /* namespace gr */

View File

@ -0,0 +1,72 @@
/* -*- c++ -*- */
/* @file
* @author Piotr Krysik <ptrkrysik@gmail.com>
* @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_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H
#define INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H
#include <grgsm/controlled_fractional_resampler_cc.h>
//#include <gnuradio/filter/fractional_resampler_cc.h>
#include <gnuradio/filter/mmse_fir_interpolator_cc.h>
using namespace gr::filter;
namespace gr {
namespace gsm {
class controlled_fractional_resampler_cc_impl : public controlled_fractional_resampler_cc
{
private:
float d_mu;
float d_mu_inc;
mmse_fir_interpolator_cc *d_resamp;
inline uint64_t resample(const gr_complex *in,
uint64_t first_in_sample,
gr_complex *out,
uint64_t first_out_sample,
uint64_t samples_to_produce);
public:
controlled_fractional_resampler_cc_impl(float phase_shift,
float resamp_ratio);
~controlled_fractional_resampler_cc_impl();
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);
float mu() const;
float resamp_ratio() const;
void set_mu(float mu);
void set_resamp_ratio(float resamp_ratio);
};
} // namespace grgsm
} // namespace gr
#endif /* INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H */

View File

@ -74,10 +74,8 @@ namespace gr {
controlled_rotator_cc_impl::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];
gr_complex *out = (gr_complex *)output_items[0];
{
//process phase_inc input
if(input_items.size() == 2) {
int ii=0;
const float *pp = (const float *)input_items[1];
@ -101,10 +99,38 @@ namespace gr {
ii++;
}
}
d_r.rotateN(out, const_cast<gr_complex *>(in), noutput_items); //const_cast<gr_complex *> is workaround old implementation of rotateN that is still present in ubuntu 14.04 packages
return noutput_items;
}
//get complex input and output
const gr_complex *in = (const gr_complex *)input_items[0];
gr_complex *out = (gr_complex *)output_items[0];
//get tags
uint64_t processed_in = 0;
uint64_t produced_out = 0;
std::vector<tag_t> set_phase_inc_tags;
pmt::pmt_t key = pmt::string_to_symbol("set_phase_inc");
get_tags_in_window(set_phase_inc_tags, 0, 0, noutput_items, key);
for(std::vector<tag_t>::iterator i_tag = set_phase_inc_tags.begin(); i_tag < set_phase_inc_tags.end(); i_tag++){
uint64_t tag_offset_rel = i_tag->offset-nitems_read(0);
set_phase_inc(pmt::to_double(i_tag->value));
uint64_t samples_to_process = tag_offset_rel-processed_in;
d_r.rotateN((out+produced_out), const_cast<gr_complex *>(in+processed_in), samples_to_process);
processed_in = processed_in + samples_to_process;
produced_out = produced_out + samples_to_process;
// std::cout << "Rotator, phase inc: " << pmt::to_double(i_tag->value) << std::endl;
float freq_offset_setting = (pmt::to_double(i_tag->value) / (2*M_PI)) * d_samp_rate; //send stream tag with a new value of the frequency offset
pmt::pmt_t key = pmt::string_to_symbol("setting_freq_offset");
pmt::pmt_t value = pmt::from_double(freq_offset_setting);
add_item_tag(0,i_tag->offset, key, value);
}
d_r.rotateN((out+produced_out), const_cast<gr_complex *>(in+processed_in), (noutput_items-produced_out)); //const_cast<gr_complex *> is workaround old implementation of rotateN that is still present in ubuntu 14.04 packages
return noutput_items;
}
} /* namespace gsm */
} /* namespace gr */

View File

@ -42,6 +42,7 @@ namespace gr {
virtual void set_phase_inc(double phase_inc);
virtual void set_samp_rate(double samp_rate);
// Where all the action really happens
int work(int noutput_items,
gr_vector_const_void_star &input_items,

View File

@ -25,11 +25,10 @@
#endif
#include <gnuradio/io_signature.h>
//#include <gnuradio/msg_queue.h>
#include "msg_to_tag_impl.h"
namespace gr {
namespace grgsm {
namespace gsm {
msg_to_tag::sptr
msg_to_tag::make()
@ -38,9 +37,16 @@ namespace gr {
(new msg_to_tag_impl());
}
// void msg_to_tag_impl::queue_msg(pmt::pmt_t msg){
//
// }
void msg_to_tag_impl::queue_msg(pmt::pmt_t msg){
if(pmt::is_dict(msg)){
try {
pmt::pmt_t keys = pmt::dict_keys(msg);
} catch (const pmt::wrong_type &e) {
msg = pmt::dict_add(pmt::make_dict(), pmt::car(msg), pmt::cdr(msg));
}
}
d_msg_queue.push_back(msg);
}
/*
* The private constructor
@ -48,10 +54,10 @@ namespace gr {
msg_to_tag_impl::msg_to_tag_impl()
: gr::sync_block("msg_to_tag",
gr::io_signature::make(1, 1, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex)))
gr::io_signature::make(1, 1, sizeof(gr_complex)))
{
message_port_register_in(pmt::mp("msg"));
// set_msg_handler(pmt::mp("msg"), boost::bind(&msg_to_tag::queue_msg, this, _1));
message_port_register_in(pmt::mp("msg"));
set_msg_handler(pmt::mp("msg"), boost::bind(&msg_to_tag_impl::queue_msg, this, _1));
}
/*
@ -66,11 +72,24 @@ namespace gr {
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const gr_complex *in = (const gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
while(!d_msg_queue.empty()){
pmt::pmt_t msg(d_msg_queue.front());
d_msg_queue.pop_front();
if(pmt::is_dict(msg)){
pmt::pmt_t klist(pmt::dict_keys(msg));
for (size_t i = 0; i < pmt::length(klist); i++) {
pmt::pmt_t k(pmt::nth(i, klist));
pmt::pmt_t v(pmt::dict_ref(msg, k, pmt::PMT_NIL));
add_item_tag(0, nitems_written(0), k, v, alias_pmt());
}
} else if(pmt::is_number(msg)) {
add_item_tag(0, nitems_written(0), pmt::intern(""), msg, alias_pmt());
} else if(pmt::is_symbol(msg)) {
add_item_tag(0, nitems_written(0), msg, pmt::intern(""), alias_pmt());
}
}
// Do <+signal processing+>
memcpy(out, in, sizeof(gr_complex)*noutput_items);
memcpy(output_items[0], input_items[0], sizeof(gr_complex)*noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}

View File

@ -26,16 +26,17 @@
#include <grgsm/msg_to_tag.h>
namespace gr {
namespace grgsm {
namespace gsm {
class msg_to_tag_impl : public msg_to_tag
{
private:
// Nothing to declare in this block.
std::deque<pmt::pmt_t> d_msg_queue;
public:
msg_to_tag_impl();
~msg_to_tag_impl();
void queue_msg(pmt::pmt_t msg);
// Where all the action really happens
int work(int noutput_items,

View File

@ -33,17 +33,17 @@ namespace gr
namespace gsm
{
clock_offset_control::sptr
clock_offset_control::make(float fc)
clock_offset_control::make(float fc, float samp_rate)
{
return gnuradio::get_initial_sptr
(new clock_offset_control_impl(fc));
(new clock_offset_control_impl(fc, samp_rate));
}
/*
* The private constructor
*/
clock_offset_control_impl::clock_offset_control_impl(float fc)
clock_offset_control_impl::clock_offset_control_impl(float fc, float samp_rate)
: gr::block("clock_offset_control",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0))
@ -51,9 +51,10 @@ clock_offset_control_impl::clock_offset_control_impl(float fc)
{
message_port_register_in(pmt::mp("measurements"));
set_msg_handler(pmt::mp("measurements"), boost::bind(&clock_offset_control_impl::process_measurement, this, _1));
message_port_register_out(pmt::mp("ppm"));
message_port_register_out(pmt::mp("ctrl"));
set_fc(fc);
set_samp_rate(samp_rate);
d_alfa = 0.3;
d_ppm_estimate = -1e6;
d_last_ppm_estimate = -1e6;
@ -77,6 +78,11 @@ void clock_offset_control_impl::set_fc(float fc)
d_fc = fc;
}
void clock_offset_control_impl::set_samp_rate(float samp_rate)
{
d_samp_rate = samp_rate;
}
void clock_offset_control_impl::process_measurement(pmt::pmt_t msg)
{
if(pmt::is_tuple(msg))
@ -103,66 +109,76 @@ void clock_offset_control_impl::process_measurement(pmt::pmt_t msg)
float ppm = -freq_offset/d_fc*1.0e6;
std::string state = pmt::symbol_to_string(pmt::tuple_ref(msg,2));
d_last_state = state;
if(std::abs(ppm) > 100.0) //safeguard against flawed measurements
if(std::abs(ppm) < 100.0) //safeguard against flawed measurements
{
ppm=0;
reset();
}
if(state == "fcch_search")
{
pmt::pmt_t msg_ppm = pmt::from_double(ppm);
message_port_pub(pmt::intern("ppm"), msg_ppm);
d_last_fcch_time = d_current_time;
}
else
if (state == "synchronized")
{
d_last_fcch_time = d_current_time;
if(d_first_measurement)
if(state == "fcch_search")
{
d_ppm_estimate = ppm;
d_first_measurement = false;
}
else
send_ctrl_messages(ppm);
d_last_fcch_time = d_current_time;
}
else
if (state == "synchronized")
{
d_ppm_estimate = (1-d_alfa)*d_ppm_estimate+d_alfa*ppm;
}
if(d_counter == 5)
{
d_counter = 0;
if(std::abs(d_last_ppm_estimate-d_ppm_estimate) > 0.1)
d_last_fcch_time = d_current_time;
if(d_first_measurement)
{
pmt::pmt_t msg_ppm = pmt::from_double(ppm);
message_port_pub(pmt::intern("ppm"), msg_ppm);
d_last_ppm_estimate = d_ppm_estimate;
d_ppm_estimate = ppm;
d_first_measurement = false;
}
else
{
d_ppm_estimate = (1-d_alfa)*d_ppm_estimate+d_alfa*ppm;
}
if(d_counter == 5)
{
d_counter = 0;
if(std::abs(d_last_ppm_estimate-d_ppm_estimate) > 0.1)
{
// pmt::pmt_t msg_ppm = pmt::from_double(ppm);
// message_port_pub(pmt::intern("ppm"), msg_ppm);
send_ctrl_messages(ppm);
d_last_ppm_estimate = d_ppm_estimate;
}
}
else
{
d_counter=d_counter+1;
}
}
else
if(state == "sync_loss")
{
d_counter=d_counter+1;
reset();
// pmt::pmt_t msg_ppm = pmt::from_double(0.0);
// message_port_pub(pmt::intern("ppm"), msg_ppm);
send_ctrl_messages(0);
}
}
else
if(state == "sync_loss")
{
reset();
pmt::pmt_t msg_ppm = pmt::from_double(0.0);
message_port_pub(pmt::intern("ppm"), msg_ppm);
}
}
}
}
}
void clock_offset_control_impl::send_ctrl_messages(float ppm)
{
// pmt::pmt_t msg_ppm = pmt::from_double(ppm);
// message_port_pub(pmt::intern("ctrl"), msg_ppm);
// d_last_fcch_time = d_current_time;
pmt::pmt_t msg_set_phase_inc = pmt::cons(pmt::intern("set_phase_inc"), pmt::from_double(2*M_PI*d_fc/d_samp_rate*ppm/1.0e6));
message_port_pub(pmt::intern("ctrl"), msg_set_phase_inc);
pmt::pmt_t msg_set_resamp_ratio = pmt::cons(pmt::intern("set_resamp_ratio"), pmt::from_double(1+ppm/1.0e6));
message_port_pub(pmt::intern("ctrl"), msg_set_resamp_ratio);
}
void clock_offset_control_impl::timed_reset()
{
reset();
pmt::pmt_t msg_ppm = pmt::from_double(0.0);
message_port_pub(pmt::intern("ppm"), msg_ppm);
send_ctrl_messages(0);
}
void clock_offset_control_impl::reset()
{
d_ppm_estimate = -1e6;

View File

@ -32,9 +32,10 @@ namespace gr {
{
private:
float d_fc;
float d_samp_rate;
float d_alfa;
float d_ppm_estimate;
float d_last_ppm_estimate;
float d_last_ppm_estimate;
bool d_first_measurement;
int d_counter;
std::string d_last_state;
@ -43,13 +44,15 @@ namespace gr {
bool d_first_time;
void process_measurement(pmt::pmt_t msg);
void send_ctrl_messages(float ppm);
void timed_reset();
void reset();
public:
clock_offset_control_impl(float fc);
clock_offset_control_impl(float fc, float samp_rate);
~clock_offset_control_impl();
virtual void set_fc(float fc);
virtual void set_samp_rate(float samp_rate);
};
} // namespace gsm
} // namespace gr

View File

@ -143,7 +143,9 @@ namespace gr {
gsmtap_hdr *header = (gsmtap_hdr *)pmt::blob_data(header_plus_burst);
uint32_t frame_nr = be32toh(header->frame_number);
uint16_t frame_ca = be16toh(header->arfcn);
uint16_t frame_ca = be16toh(header->arfcn) & 0x3FFF; //change highest bits to '0'
//in order to leave only ARFCN number
int mai = calculate_ma_sfh(d_maio, d_hsn, d_narfcn, frame_nr);
if(d_ma[mai] == (int)frame_ca) {

View File

@ -41,7 +41,8 @@ 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.py
misc_utils/clock_offset_corrector_tagged.py
misc_utils/hier_block.py DESTINATION ${GR_PYTHON_DIR}/grgsm
)
@ -61,5 +62,6 @@ GR_ADD_TEST(qa_burst_timeslot_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE
GR_ADD_TEST(qa_burst_sdcch_subslot_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_burst_sdcch_subslot_filter.py)
GR_ADD_TEST(qa_burst_fnr_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_burst_fnr_filter.py)
GR_ADD_TEST(qa_dummy_burst_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_dummy_burst_filter.py)
GR_ADD_TEST(qa_arfcn ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_arfcn.py)
GR_ADD_TEST(qa_msg_to_tag ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_msg_to_tag.py)
#GR_ADD_TEST(qa_arfcn ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_arfcn.py)
#GR_ADD_TEST(qa_msg_to_tag ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_msg_to_tag.py)
#GR_ADD_TEST(qa_controlled_fractional_resampler_cc ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_controlled_fractional_resampler_cc.py)

View File

@ -51,6 +51,7 @@ 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
from gsm_bcch_ccch_demapper import gsm_bcch_ccch_demapper

View File

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Description: Clock offset corrector with blocks that use tags to switch offsets
# Generated: Fri Jul 15 10:09:22 2016
##################################################
from gnuradio import gr
from gnuradio.filter import firdes
import grgsm
import math
class clock_offset_corrector_tagged(grgsm.hier_block):
def __init__(self, fc=936.6e6, ppm=0, samp_rate_in=1625000.0/6.0*4.0):
gr.hier_block2.__init__(
self, "Clock offset corrector tagged",
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("ctrl")
##################################################
# 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(ppm/1.0e6*2*math.pi*fc/samp_rate_in,samp_rate_out)
self.grgsm_msg_to_tag_0 = grgsm.msg_to_tag()
self.grgsm_controlled_fractional_resampler_cc_0 = grgsm.controlled_fractional_resampler_cc(0, 1.0)
##################################################
# Connections
##################################################
self.msg_connect((self, 'ctrl'), (self.grgsm_msg_to_tag_0, 'msg'))
self.connect((self.grgsm_controlled_fractional_resampler_cc_0, 0), (self.gsm_controlled_rotator_cc_0, 0))
self.connect((self.grgsm_msg_to_tag_0, 0), (self.grgsm_controlled_fractional_resampler_cc_0, 0))
self.connect((self.gsm_controlled_rotator_cc_0, 0), (self, 0))
self.connect((self, 0), (self.grgsm_msg_to_tag_0, 0))
def get_fc(self):
return self.fc
def set_fc(self, fc):
self.fc = fc
self.gsm_controlled_rotator_cc_0.set_phase_inc(self.ppm/1.0e6*2*math.pi*self.fc/self.samp_rate_in)
def get_ppm(self):
return self.ppm
def set_ppm(self, ppm):
self.ppm = ppm
self.gsm_controlled_rotator_cc_0.set_phase_inc(self.ppm/1.0e6*2*math.pi*self.fc/self.samp_rate_in)
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)
self.gsm_controlled_rotator_cc_0.set_phase_inc(self.ppm/1.0e6*2*math.pi*self.fc/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)

View File

@ -22,7 +22,8 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import arfcn
import os
import sys
@ -30,257 +31,257 @@ import sys
class qa_arfcn (gr_unittest.TestCase):
def test_001_is_valid_arfcn(self):
self.assertTrue(grgsm.arfcn.is_valid_arfcn(259, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(277, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(293, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(258, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(294, 'GSM450'))
self.assertTrue(arfcn.is_valid_arfcn(259, 'GSM450'))
self.assertTrue(arfcn.is_valid_arfcn(277, 'GSM450'))
self.assertTrue(arfcn.is_valid_arfcn(293, 'GSM450'))
self.assertFalse(arfcn.is_valid_arfcn(258, 'GSM450'))
self.assertFalse(arfcn.is_valid_arfcn(294, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(306, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(323, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(340, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(305, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(341, 'GSM480'))
self.assertTrue(arfcn.is_valid_arfcn(306, 'GSM480'))
self.assertTrue(arfcn.is_valid_arfcn(323, 'GSM480'))
self.assertTrue(arfcn.is_valid_arfcn(340, 'GSM480'))
self.assertFalse(arfcn.is_valid_arfcn(305, 'GSM480'))
self.assertFalse(arfcn.is_valid_arfcn(341, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(128, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(199, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(251, 'GSM850'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(127, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(251, 'GSM480'))
self.assertTrue(arfcn.is_valid_arfcn(128, 'GSM850'))
self.assertTrue(arfcn.is_valid_arfcn(199, 'GSM850'))
self.assertTrue(arfcn.is_valid_arfcn(251, 'GSM850'))
self.assertFalse(arfcn.is_valid_arfcn(127, 'GSM480'))
self.assertFalse(arfcn.is_valid_arfcn(251, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(1, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(63, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(124, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(0, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(125, 'P-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(1, 'P-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(63, 'P-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(124, 'P-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(0, 'P-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(125, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(975, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(999, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(1023, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(974, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(1024, 'E-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(975, 'E-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(999, 'E-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(1023, 'E-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(974, 'E-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(1024, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(955, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(989, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(1023, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(954, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(1024, 'R-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(955, 'R-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(989, 'R-GSM'))
self.assertTrue(arfcn.is_valid_arfcn(1023, 'R-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(954, 'R-GSM'))
self.assertFalse(arfcn.is_valid_arfcn(1024, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(512, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(732, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(885, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(511, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(886, 'DCS1800'))
self.assertTrue(arfcn.is_valid_arfcn(512, 'DCS1800'))
self.assertTrue(arfcn.is_valid_arfcn(732, 'DCS1800'))
self.assertTrue(arfcn.is_valid_arfcn(885, 'DCS1800'))
self.assertFalse(arfcn.is_valid_arfcn(511, 'DCS1800'))
self.assertFalse(arfcn.is_valid_arfcn(886, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(512, 'PCS1900'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(691, 'PCS1900'))
self.assertTrue(grgsm.arfcn.is_valid_arfcn(810, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(511, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_arfcn(811, 'PCS1900'))
self.assertTrue(arfcn.is_valid_arfcn(512, 'PCS1900'))
self.assertTrue(arfcn.is_valid_arfcn(691, 'PCS1900'))
self.assertTrue(arfcn.is_valid_arfcn(810, 'PCS1900'))
self.assertFalse(arfcn.is_valid_arfcn(511, 'PCS1900'))
self.assertFalse(arfcn.is_valid_arfcn(811, 'PCS1900'))
def test_002_is_valid_uplink(self):
self.assertTrue(grgsm.arfcn.is_valid_uplink(450.6e6, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(457.4e6, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(450.4e6, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(457.6e6, 'GSM450'))
self.assertTrue(arfcn.is_valid_uplink(450.6e6, 'GSM450'))
self.assertTrue(arfcn.is_valid_uplink(457.4e6, 'GSM450'))
self.assertFalse(arfcn.is_valid_uplink(450.4e6, 'GSM450'))
self.assertFalse(arfcn.is_valid_uplink(457.6e6, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(479e6, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(485.8e6, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(478.8e6, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(486e6, 'GSM480'))
self.assertTrue(arfcn.is_valid_uplink(479e6, 'GSM480'))
self.assertTrue(arfcn.is_valid_uplink(485.8e6, 'GSM480'))
self.assertFalse(arfcn.is_valid_uplink(478.8e6, 'GSM480'))
self.assertFalse(arfcn.is_valid_uplink(486e6, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(824.2e6, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(848.8e6, 'GSM850'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(824e6, 'GSM850'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(849e6, 'GSM850'))
self.assertTrue(arfcn.is_valid_uplink(824.2e6, 'GSM850'))
self.assertTrue(arfcn.is_valid_uplink(848.8e6, 'GSM850'))
self.assertFalse(arfcn.is_valid_uplink(824e6, 'GSM850'))
self.assertFalse(arfcn.is_valid_uplink(849e6, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(890.2e6, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(914.8e6, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(890e6, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(915e6, 'P-GSM'))
self.assertTrue(arfcn.is_valid_uplink(890.2e6, 'P-GSM'))
self.assertTrue(arfcn.is_valid_uplink(914.8e6, 'P-GSM'))
self.assertFalse(arfcn.is_valid_uplink(890e6, 'P-GSM'))
self.assertFalse(arfcn.is_valid_uplink(915e6, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(880.2e6, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(889.8e6, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(880e6, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(890e6, 'E-GSM'))
self.assertTrue(arfcn.is_valid_uplink(880.2e6, 'E-GSM'))
self.assertTrue(arfcn.is_valid_uplink(889.8e6, 'E-GSM'))
self.assertFalse(arfcn.is_valid_uplink(880e6, 'E-GSM'))
self.assertFalse(arfcn.is_valid_uplink(890e6, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(876.2e6, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(889.8e6, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(876e6, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(890e6, 'R-GSM'))
self.assertTrue(arfcn.is_valid_uplink(876.2e6, 'R-GSM'))
self.assertTrue(arfcn.is_valid_uplink(889.8e6, 'R-GSM'))
self.assertFalse(arfcn.is_valid_uplink(876e6, 'R-GSM'))
self.assertFalse(arfcn.is_valid_uplink(890e6, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(1710.2e6, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(1784.8e6, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(1710e6, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(1785e6, 'DCS1800'))
self.assertTrue(arfcn.is_valid_uplink(1710.2e6, 'DCS1800'))
self.assertTrue(arfcn.is_valid_uplink(1784.8e6, 'DCS1800'))
self.assertFalse(arfcn.is_valid_uplink(1710e6, 'DCS1800'))
self.assertFalse(arfcn.is_valid_uplink(1785e6, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(1850.2e6, 'PCS1900'))
self.assertTrue(grgsm.arfcn.is_valid_uplink(1909.8e6, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(1850e6, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_uplink(1910e6, 'PCS1900'))
self.assertTrue(arfcn.is_valid_uplink(1850.2e6, 'PCS1900'))
self.assertTrue(arfcn.is_valid_uplink(1909.8e6, 'PCS1900'))
self.assertFalse(arfcn.is_valid_uplink(1850e6, 'PCS1900'))
self.assertFalse(arfcn.is_valid_uplink(1910e6, 'PCS1900'))
def test_003_is_valid_downlink(self):
self.assertTrue(grgsm.arfcn.is_valid_downlink(460.6e6, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(467.4e6, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(460.4e6, 'GSM450'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(467.6e6, 'GSM450'))
self.assertTrue(arfcn.is_valid_downlink(460.6e6, 'GSM450'))
self.assertTrue(arfcn.is_valid_downlink(467.4e6, 'GSM450'))
self.assertFalse(arfcn.is_valid_downlink(460.4e6, 'GSM450'))
self.assertFalse(arfcn.is_valid_downlink(467.6e6, 'GSM450'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(489e6, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(495.8e6, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(488.8e6, 'GSM480'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(496e6, 'GSM480'))
self.assertTrue(arfcn.is_valid_downlink(489e6, 'GSM480'))
self.assertTrue(arfcn.is_valid_downlink(495.8e6, 'GSM480'))
self.assertFalse(arfcn.is_valid_downlink(488.8e6, 'GSM480'))
self.assertFalse(arfcn.is_valid_downlink(496e6, 'GSM480'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(869.2e6, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(893.8e6, 'GSM850'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(869e6, 'GSM850'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(894e6, 'GSM850'))
self.assertTrue(arfcn.is_valid_downlink(869.2e6, 'GSM850'))
self.assertTrue(arfcn.is_valid_downlink(893.8e6, 'GSM850'))
self.assertFalse(arfcn.is_valid_downlink(869e6, 'GSM850'))
self.assertFalse(arfcn.is_valid_downlink(894e6, 'GSM850'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(935.2e6, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(959.8e6, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(935e6, 'P-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(960e6, 'P-GSM'))
self.assertTrue(arfcn.is_valid_downlink(935.2e6, 'P-GSM'))
self.assertTrue(arfcn.is_valid_downlink(959.8e6, 'P-GSM'))
self.assertFalse(arfcn.is_valid_downlink(935e6, 'P-GSM'))
self.assertFalse(arfcn.is_valid_downlink(960e6, 'P-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(925.2e6, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(934.8e6, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(925e6, 'E-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(935e6, 'E-GSM'))
self.assertTrue(arfcn.is_valid_downlink(925.2e6, 'E-GSM'))
self.assertTrue(arfcn.is_valid_downlink(934.8e6, 'E-GSM'))
self.assertFalse(arfcn.is_valid_downlink(925e6, 'E-GSM'))
self.assertFalse(arfcn.is_valid_downlink(935e6, 'E-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(921.2e6, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(934.8e6, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(921e6, 'R-GSM'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(935e6, 'R-GSM'))
self.assertTrue(arfcn.is_valid_downlink(921.2e6, 'R-GSM'))
self.assertTrue(arfcn.is_valid_downlink(934.8e6, 'R-GSM'))
self.assertFalse(arfcn.is_valid_downlink(921e6, 'R-GSM'))
self.assertFalse(arfcn.is_valid_downlink(935e6, 'R-GSM'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(1805.2e6, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(1879.8e6, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(1805e6, 'DCS1800'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(1880e6, 'DCS1800'))
self.assertTrue(arfcn.is_valid_downlink(1805.2e6, 'DCS1800'))
self.assertTrue(arfcn.is_valid_downlink(1879.8e6, 'DCS1800'))
self.assertFalse(arfcn.is_valid_downlink(1805e6, 'DCS1800'))
self.assertFalse(arfcn.is_valid_downlink(1880e6, 'DCS1800'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(1930.2e6, 'PCS1900'))
self.assertTrue(grgsm.arfcn.is_valid_downlink(1989.8e6, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(1930e6, 'PCS1900'))
self.assertFalse(grgsm.arfcn.is_valid_downlink(1990e6, 'PCS1900'))
self.assertTrue(arfcn.is_valid_downlink(1930.2e6, 'PCS1900'))
self.assertTrue(arfcn.is_valid_downlink(1989.8e6, 'PCS1900'))
self.assertFalse(arfcn.is_valid_downlink(1930e6, 'PCS1900'))
self.assertFalse(arfcn.is_valid_downlink(1990e6, 'PCS1900'))
def test_004_arfcn2uplink(self):
self.assertEqual(450.6e6, grgsm.arfcn.arfcn2uplink(259, 'GSM450'))
self.assertEqual(457.4e6, grgsm.arfcn.arfcn2uplink(293, 'GSM450'))
self.assertEqual(450.6e6, arfcn.arfcn2uplink(259, 'GSM450'))
self.assertEqual(457.4e6, arfcn.arfcn2uplink(293, 'GSM450'))
self.assertEqual(479e6, grgsm.arfcn.arfcn2uplink(306, 'GSM480'))
self.assertEqual(485.8e6, grgsm.arfcn.arfcn2uplink(340, 'GSM480'))
self.assertEqual(479e6, arfcn.arfcn2uplink(306, 'GSM480'))
self.assertEqual(485.8e6, arfcn.arfcn2uplink(340, 'GSM480'))
self.assertEqual(824.2e6, grgsm.arfcn.arfcn2uplink(128, 'GSM850'))
self.assertEqual(848.8e6, grgsm.arfcn.arfcn2uplink(251, 'GSM850'))
self.assertEqual(824.2e6, arfcn.arfcn2uplink(128, 'GSM850'))
self.assertEqual(848.8e6, arfcn.arfcn2uplink(251, 'GSM850'))
self.assertEqual(890.2e6, grgsm.arfcn.arfcn2uplink(1, 'P-GSM'))
self.assertEqual(914.8e6, grgsm.arfcn.arfcn2uplink(124, 'P-GSM'))
self.assertEqual(890.2e6, arfcn.arfcn2uplink(1, 'P-GSM'))
self.assertEqual(914.8e6, arfcn.arfcn2uplink(124, 'P-GSM'))
self.assertEqual(880.2e6, grgsm.arfcn.arfcn2uplink(975, 'E-GSM'))
self.assertEqual(889.8e6, grgsm.arfcn.arfcn2uplink(1023, 'E-GSM'))
self.assertEqual(880.2e6, arfcn.arfcn2uplink(975, 'E-GSM'))
self.assertEqual(889.8e6, arfcn.arfcn2uplink(1023, 'E-GSM'))
self.assertEqual(876.2e6, grgsm.arfcn.arfcn2uplink(955, 'R-GSM'))
self.assertEqual(889.8e6, grgsm.arfcn.arfcn2uplink(1023, 'R-GSM'))
self.assertEqual(876.2e6, arfcn.arfcn2uplink(955, 'R-GSM'))
self.assertEqual(889.8e6, arfcn.arfcn2uplink(1023, 'R-GSM'))
self.assertEqual(1710.2e6, grgsm.arfcn.arfcn2uplink(512, 'DCS1800'))
self.assertEqual(1784.8e6, grgsm.arfcn.arfcn2uplink(885, 'DCS1800'))
self.assertEqual(1710.2e6, arfcn.arfcn2uplink(512, 'DCS1800'))
self.assertEqual(1784.8e6, arfcn.arfcn2uplink(885, 'DCS1800'))
self.assertEqual(1850.2e6, grgsm.arfcn.arfcn2uplink(512, 'PCS1900'))
self.assertEqual(1909.8e6, grgsm.arfcn.arfcn2uplink(810, 'PCS1900'))
self.assertEqual(1850.2e6, arfcn.arfcn2uplink(512, 'PCS1900'))
self.assertEqual(1909.8e6, arfcn.arfcn2uplink(810, 'PCS1900'))
def test_005_arfcn2downlink(self):
self.assertEqual(460.6e6, grgsm.arfcn.arfcn2downlink(259, 'GSM450'))
self.assertEqual(467.4e6, grgsm.arfcn.arfcn2downlink(293, 'GSM450'))
self.assertEqual(460.6e6, arfcn.arfcn2downlink(259, 'GSM450'))
self.assertEqual(467.4e6, arfcn.arfcn2downlink(293, 'GSM450'))
self.assertEqual(489e6, grgsm.arfcn.arfcn2downlink(306, 'GSM480'))
self.assertEqual(495.8e6, grgsm.arfcn.arfcn2downlink(340, 'GSM480'))
self.assertEqual(489e6, arfcn.arfcn2downlink(306, 'GSM480'))
self.assertEqual(495.8e6, arfcn.arfcn2downlink(340, 'GSM480'))
self.assertEqual(869.2e6, grgsm.arfcn.arfcn2downlink(128, 'GSM850'))
self.assertEqual(893.8e6, grgsm.arfcn.arfcn2downlink(251, 'GSM850'))
self.assertEqual(869.2e6, arfcn.arfcn2downlink(128, 'GSM850'))
self.assertEqual(893.8e6, arfcn.arfcn2downlink(251, 'GSM850'))
self.assertEqual(935.2e6, grgsm.arfcn.arfcn2downlink(1, 'P-GSM'))
self.assertEqual(959.8e6, grgsm.arfcn.arfcn2downlink(124, 'P-GSM'))
self.assertEqual(935.2e6, arfcn.arfcn2downlink(1, 'P-GSM'))
self.assertEqual(959.8e6, arfcn.arfcn2downlink(124, 'P-GSM'))
self.assertEqual(925.2e6, grgsm.arfcn.arfcn2downlink(975, 'E-GSM'))
self.assertEqual(934.8e6, grgsm.arfcn.arfcn2downlink(1023, 'E-GSM'))
self.assertEqual(925.2e6, arfcn.arfcn2downlink(975, 'E-GSM'))
self.assertEqual(934.8e6, arfcn.arfcn2downlink(1023, 'E-GSM'))
self.assertEqual(921.2e6, grgsm.arfcn.arfcn2downlink(955, 'R-GSM'))
self.assertEqual(934.8e6, grgsm.arfcn.arfcn2downlink(1023, 'R-GSM'))
self.assertEqual(921.2e6, arfcn.arfcn2downlink(955, 'R-GSM'))
self.assertEqual(934.8e6, arfcn.arfcn2downlink(1023, 'R-GSM'))
self.assertEqual(1805.2e6, grgsm.arfcn.arfcn2downlink(512, 'DCS1800'))
self.assertEqual(1879.8e6, grgsm.arfcn.arfcn2downlink(885, 'DCS1800'))
self.assertEqual(1805.2e6, arfcn.arfcn2downlink(512, 'DCS1800'))
self.assertEqual(1879.8e6, arfcn.arfcn2downlink(885, 'DCS1800'))
self.assertEqual(1930.2e6, grgsm.arfcn.arfcn2downlink(512, 'PCS1900'))
self.assertEqual(1989.8e6, grgsm.arfcn.arfcn2downlink(810, 'PCS1900'))
self.assertEqual(1930.2e6, arfcn.arfcn2downlink(512, 'PCS1900'))
self.assertEqual(1989.8e6, arfcn.arfcn2downlink(810, 'PCS1900'))
def test_006_uplink2arfcn(self):
self.assertEqual(259, grgsm.arfcn.uplink2arfcn(450.6e6, 'GSM450'))
self.assertEqual(293, grgsm.arfcn.uplink2arfcn(457.4e6, 'GSM450'))
self.assertEqual(259, arfcn.uplink2arfcn(450.6e6, 'GSM450'))
self.assertEqual(293, arfcn.uplink2arfcn(457.4e6, 'GSM450'))
self.assertEqual(306, grgsm.arfcn.uplink2arfcn(479e6, 'GSM480'))
self.assertEqual(340, grgsm.arfcn.uplink2arfcn(485.8e6, 'GSM480'))
self.assertEqual(306, arfcn.uplink2arfcn(479e6, 'GSM480'))
self.assertEqual(340, arfcn.uplink2arfcn(485.8e6, 'GSM480'))
self.assertEqual(128, grgsm.arfcn.uplink2arfcn(824.2e6, 'GSM850'))
self.assertEqual(251, grgsm.arfcn.uplink2arfcn(848.8e6, 'GSM850'))
self.assertEqual(128, arfcn.uplink2arfcn(824.2e6, 'GSM850'))
self.assertEqual(251, arfcn.uplink2arfcn(848.8e6, 'GSM850'))
self.assertEqual(1, grgsm.arfcn.uplink2arfcn(890.2e6, 'P-GSM'))
self.assertEqual(124, grgsm.arfcn.uplink2arfcn(914.8e6, 'P-GSM'))
self.assertEqual(1, arfcn.uplink2arfcn(890.2e6, 'P-GSM'))
self.assertEqual(124, arfcn.uplink2arfcn(914.8e6, 'P-GSM'))
self.assertEqual(975, grgsm.arfcn.uplink2arfcn(880.2e6, 'E-GSM'))
self.assertEqual(1023, grgsm.arfcn.uplink2arfcn(889.8e6, 'E-GSM'))
self.assertEqual(975, arfcn.uplink2arfcn(880.2e6, 'E-GSM'))
self.assertEqual(1023, arfcn.uplink2arfcn(889.8e6, 'E-GSM'))
self.assertEqual(955, grgsm.arfcn.uplink2arfcn(876.2e6, 'R-GSM'))
self.assertEqual(1023, grgsm.arfcn.uplink2arfcn(889.8e6, 'R-GSM'))
self.assertEqual(955, arfcn.uplink2arfcn(876.2e6, 'R-GSM'))
self.assertEqual(1023, arfcn.uplink2arfcn(889.8e6, 'R-GSM'))
self.assertEqual(512, grgsm.arfcn.uplink2arfcn(1710.2e6, 'DCS1800'))
self.assertEqual(885, grgsm.arfcn.uplink2arfcn(1784.8e6, 'DCS1800'))
self.assertEqual(512, arfcn.uplink2arfcn(1710.2e6, 'DCS1800'))
self.assertEqual(885, arfcn.uplink2arfcn(1784.8e6, 'DCS1800'))
self.assertEqual(512, grgsm.arfcn.uplink2arfcn(1850.2e6, 'PCS1900'))
self.assertEqual(810, grgsm.arfcn.uplink2arfcn(1909.8e6, 'PCS1900'))
self.assertEqual(512, arfcn.uplink2arfcn(1850.2e6, 'PCS1900'))
self.assertEqual(810, arfcn.uplink2arfcn(1909.8e6, 'PCS1900'))
def test_007_downlink2arfcn(self):
self.assertEqual(259, grgsm.arfcn.downlink2arfcn(460.6e6, 'GSM450'))
self.assertEqual(293, grgsm.arfcn.downlink2arfcn(467.4e6, 'GSM450'))
self.assertEqual(259, arfcn.downlink2arfcn(460.6e6, 'GSM450'))
self.assertEqual(293, arfcn.downlink2arfcn(467.4e6, 'GSM450'))
self.assertEqual(306, grgsm.arfcn.downlink2arfcn(489e6, 'GSM480'))
self.assertEqual(340, grgsm.arfcn.downlink2arfcn(495.8e6, 'GSM480'))
self.assertEqual(306, arfcn.downlink2arfcn(489e6, 'GSM480'))
self.assertEqual(340, arfcn.downlink2arfcn(495.8e6, 'GSM480'))
self.assertEqual(128, grgsm.arfcn.downlink2arfcn(869.2e6, 'GSM850'))
self.assertEqual(251, grgsm.arfcn.downlink2arfcn(893.8e6, 'GSM850'))
self.assertEqual(128, arfcn.downlink2arfcn(869.2e6, 'GSM850'))
self.assertEqual(251, arfcn.downlink2arfcn(893.8e6, 'GSM850'))
self.assertEqual(1, grgsm.arfcn.downlink2arfcn(935.2e6, 'P-GSM'))
self.assertEqual(124, grgsm.arfcn.downlink2arfcn(959.8e6, 'P-GSM'))
self.assertEqual(1, arfcn.downlink2arfcn(935.2e6, 'P-GSM'))
self.assertEqual(124, arfcn.downlink2arfcn(959.8e6, 'P-GSM'))
self.assertEqual(975, grgsm.arfcn.downlink2arfcn(925.2e6, 'E-GSM'))
self.assertEqual(1023, grgsm.arfcn.downlink2arfcn(934.8e6, 'E-GSM'))
self.assertEqual(975, arfcn.downlink2arfcn(925.2e6, 'E-GSM'))
self.assertEqual(1023, arfcn.downlink2arfcn(934.8e6, 'E-GSM'))
self.assertEqual(955, grgsm.arfcn.downlink2arfcn(921.2e6, 'R-GSM'))
self.assertEqual(1023, grgsm.arfcn.downlink2arfcn(934.8e6, 'R-GSM'))
self.assertEqual(955, arfcn.downlink2arfcn(921.2e6, 'R-GSM'))
self.assertEqual(1023, arfcn.downlink2arfcn(934.8e6, 'R-GSM'))
self.assertEqual(512, grgsm.arfcn.downlink2arfcn(1805.2e6, 'DCS1800'))
self.assertEqual(885, grgsm.arfcn.downlink2arfcn(1879.8e6, 'DCS1800'))
self.assertEqual(512, arfcn.downlink2arfcn(1805.2e6, 'DCS1800'))
self.assertEqual(885, arfcn.downlink2arfcn(1879.8e6, 'DCS1800'))
self.assertEqual(512, grgsm.arfcn.downlink2arfcn(1930.2e6, 'PCS1900'))
self.assertEqual(810, grgsm.arfcn.downlink2arfcn(1989.8e6, 'PCS1900'))
self.assertEqual(512, arfcn.downlink2arfcn(1930.2e6, 'PCS1900'))
self.assertEqual(810, arfcn.downlink2arfcn(1989.8e6, 'PCS1900'))
def test_008_firstarfcn(self):
self.assertEqual(259, grgsm.arfcn.get_first_arfcn('GSM450'))
self.assertEqual(306, grgsm.arfcn.get_first_arfcn('GSM480'))
self.assertEqual(128, grgsm.arfcn.get_first_arfcn('GSM850'))
self.assertEqual(1, grgsm.arfcn.get_first_arfcn('P-GSM'))
self.assertEqual(975, grgsm.arfcn.get_first_arfcn('E-GSM'))
self.assertEqual(955, grgsm.arfcn.get_first_arfcn('R-GSM'))
self.assertEqual(512, grgsm.arfcn.get_first_arfcn('DCS1800'))
self.assertEqual(512, grgsm.arfcn.get_first_arfcn('PCS1900'))
self.assertEqual(259, arfcn.get_first_arfcn('GSM450'))
self.assertEqual(306, arfcn.get_first_arfcn('GSM480'))
self.assertEqual(128, arfcn.get_first_arfcn('GSM850'))
self.assertEqual(1, arfcn.get_first_arfcn('P-GSM'))
self.assertEqual(975, arfcn.get_first_arfcn('E-GSM'))
self.assertEqual(955, arfcn.get_first_arfcn('R-GSM'))
self.assertEqual(512, arfcn.get_first_arfcn('DCS1800'))
self.assertEqual(512, arfcn.get_first_arfcn('PCS1900'))
def test_009_firstarfcn(self):
self.assertEqual(293, grgsm.arfcn.get_last_arfcn('GSM450'))
self.assertEqual(340, grgsm.arfcn.get_last_arfcn('GSM480'))
self.assertEqual(251, grgsm.arfcn.get_last_arfcn('GSM850'))
self.assertEqual(124, grgsm.arfcn.get_last_arfcn('P-GSM'))
self.assertEqual(1023, grgsm.arfcn.get_last_arfcn('E-GSM'))
self.assertEqual(1023, grgsm.arfcn.get_last_arfcn('R-GSM'))
self.assertEqual(885, grgsm.arfcn.get_last_arfcn('DCS1800'))
self.assertEqual(810, grgsm.arfcn.get_last_arfcn('PCS1900'))
self.assertEqual(293, arfcn.get_last_arfcn('GSM450'))
self.assertEqual(340, arfcn.get_last_arfcn('GSM480'))
self.assertEqual(251, arfcn.get_last_arfcn('GSM850'))
self.assertEqual(124, arfcn.get_last_arfcn('P-GSM'))
self.assertEqual(1023, arfcn.get_last_arfcn('E-GSM'))
self.assertEqual(1023, arfcn.get_last_arfcn('R-GSM'))
self.assertEqual(885, arfcn.get_last_arfcn('DCS1800'))
self.assertEqual(810, arfcn.get_last_arfcn('PCS1900'))
if __name__ == '__main__':
gr_unittest.run(qa_arfcn, "qa_arfcn.xml")

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import pmt
class qa_burst_fnr_filter (gr_unittest.TestCase):

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import os
import pmt
import sys

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
class qa_burst_sdcch_subslot_filter (gr_unittest.TestCase):
# 102 random bursts as test input

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import pmt
class qa_burst_sdcch_subslot_splitter (gr_unittest.TestCase):

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import pmt
class qa_burst_timeslot_filter (gr_unittest.TestCase):

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import pmt
class qa_burst_timeslot_splitter (gr_unittest.TestCase):

View File

@ -0,0 +1,43 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @file
# @author Piotr Krysik <ptrkrysik@gmail.com>
# @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.
#
#
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import grgsm_swig as grgsm
class qa_controlled_fractional_resampler_cc (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_t (self):
# set up fg
self.tb.run ()
# check data
if __name__ == '__main__':
gr_unittest.run(qa_controlled_fractional_resampler_cc, "qa_controlled_fractional_resampler_cc.xml")

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import pmt
class qa_decryption (gr_unittest.TestCase):

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
class qa_dummy_burst_filter (gr_unittest.TestCase):

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import os
import pmt
import sys

View File

@ -22,7 +22,7 @@
#
from gnuradio import gr, gr_unittest, blocks
import grgsm
import grgsm_swig as grgsm
import os
import pmt
import sys

View File

@ -38,11 +38,11 @@ class gsm_input(grgsm.hier_block):
##################################################
# Blocks
##################################################
self.message_port_register_hier_in("ppm_in")
self.message_port_register_hier_in("ctrl_in")
self.low_pass_filter_0_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, samp_rate_out, 125e3, 5e3, firdes.WIN_HAMMING, 6.76))
self.gsm_clock_offset_corrector_0 = grgsm.clock_offset_corrector(
self.gsm_clock_offset_corrector_tagged_0 = grgsm.clock_offset_corrector_tagged(
fc=fc,
ppm=ppm,
samp_rate_in=samp_rate_in,
@ -54,21 +54,17 @@ class gsm_input(grgsm.hier_block):
##################################################
self.connect((self.low_pass_filter_0_0, 0), (self, 0))
self.connect((self.fractional_resampler_xx_0, 0), (self.low_pass_filter_0_0, 0))
self.connect((self.gsm_clock_offset_corrector_0, 0), (self.fractional_resampler_xx_0, 0))
self.connect((self, 0), (self.gsm_clock_offset_corrector_0, 0))
self.connect((self.gsm_clock_offset_corrector_tagged_0, 0), (self.fractional_resampler_xx_0, 0))
self.connect((self, 0), (self.gsm_clock_offset_corrector_tagged_0, 0))
##################################################
# Asynch Message Connections
##################################################
self.msg_connect(self, "ppm_in", self.gsm_clock_offset_corrector_0, "ppm_in")
self.msg_connect((self, 'ctrl_in'), (self.gsm_clock_offset_corrector_tagged_0, 'ctrl'))
def get_ppm(self):
return self.ppm
def set_ppm(self, ppm):
self.ppm = ppm
self.gsm_clock_offset_corrector_0.set_ppm(self.ppm)
def set_fc(self, fc):
self.fc = fc
self.gsm_clock_offset_corrector_tagged_0.set_fc(self.fc)
def get_osr(self):
return self.osr
@ -77,26 +73,25 @@ class gsm_input(grgsm.hier_block):
self.osr = osr
self.set_samp_rate_out(1625000.0/6.0*self.osr)
def get_fc(self):
return self.fc
def get_ppm(self):
return self.ppm
def set_fc(self, fc):
self.fc = fc
self.gsm_clock_offset_corrector_0.set_fc(self.fc)
def set_ppm(self, ppm):
self.ppm = ppm
self.gsm_clock_offset_corrector_tagged_0.set_ppm(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.gsm_clock_offset_corrector_tagged_0.set_samp_rate_in(self.samp_rate_in)
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.gsm_clock_offset_corrector_0.set_samp_rate_in(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.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate_out, 125e3, 5e3, firdes.WIN_HAMMING, 6.76))
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate_out, 125e3, 5e3, firdes.WIN_HAMMING, 6.76))

View File

@ -38,6 +38,7 @@
#include "grgsm/misc_utils/message_file_sink.h"
#include "grgsm/misc_utils/message_file_source.h"
#include "grgsm/msg_to_tag.h"
#include "grgsm/controlled_fractional_resampler_cc.h"
%}
%include "grgsm/receiver/receiver.h"
@ -105,4 +106,6 @@ GR_SWIG_BLOCK_MAGIC2(gsm, message_source);
%include "grgsm/qa_utils/message_sink.h"
GR_SWIG_BLOCK_MAGIC2(gsm, message_sink);
%include "grgsm/msg_to_tag.h"
GR_SWIG_BLOCK_MAGIC2(grgsm, msg_to_tag);
GR_SWIG_BLOCK_MAGIC2(gsm, msg_to_tag);
%include "grgsm/controlled_fractional_resampler_cc.h"
GR_SWIG_BLOCK_MAGIC2(gsm, controlled_fractional_resampler_cc);

View File

@ -0,0 +1,13 @@
FROM ubuntu:16.04
MAINTAINER Ash Wilson
RUN apt-get update && apt-get install -y \
software-properties-common
RUN add-apt-repository -y ppa:ptrkrysik/gr-gsm
RUN apt-get update && apt-get install -y \
gr-gsm
COPY ./ /src/
RUN ls /src

View File

@ -1,3 +1,5 @@
860902 1329872: 15 06 21 00 01 f0 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
860906 1330004: 15 06 21 00 01 f0 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
860912 1330176: 15 06 21 00 01 f0 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
860916 1330308: 15 06 21 00 01 f0 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
860922 1330506: 15 06 21 00 01 f0 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b