aboutsummaryrefslogtreecommitdiffstats
path: root/python/receiver
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2016-07-17 22:48:35 +0200
committerPiotr Krysik <ptrkrysik@gmail.com>2016-07-17 22:48:35 +0200
commit83afe7390fadd13cb8636ac4da1bafb9a73a5521 (patch)
tree5ac105f23da8880f433a343fd4721844c3d0cc1c /python/receiver
parenta94adb186438498dcc6513cc68d8f2ee4155e6f5 (diff)
Changed clock offset controller and company in order to remove from the gsm_input one of the resamplers.
Diffstat (limited to 'python/receiver')
-rw-r--r--python/receiver/gsm_input.py53
1 files changed, 29 insertions, 24 deletions
diff --git a/python/receiver/gsm_input.py b/python/receiver/gsm_input.py
index b18a631..c179635 100644
--- a/python/receiver/gsm_input.py
+++ b/python/receiver/gsm_input.py
@@ -1,66 +1,65 @@
-#!/usr/bin/env python
+# -*- coding: utf-8 -*-
##################################################
-# Gnuradio Python Flow Graph
+# GNU Radio Python Flow Graph
# Title: GSM input adaptor
# Author: Piotr Krysik
# Description: 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.
-# Generated: Wed Nov 19 08:23:52 2014
+# Generated: Sun Jul 17 17:36:46 2016
##################################################
from gnuradio import filter
from gnuradio import gr
from gnuradio.filter import firdes
-from distutils.version import LooseVersion as version
import grgsm
+
class gsm_input(grgsm.hier_block):
- def __init__(self, ppm=0, osr=4, fc=940e6, samp_rate_in=1e6):
- grgsm.hier_block.__init__(
+ def __init__(self, fc=940e6, osr=4, ppm=0, samp_rate_in=1e6):
+ gr.hier_block2.__init__(
self, "GSM input adaptor",
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_in")
##################################################
# Parameters
##################################################
- self.ppm = ppm
- self.osr = osr
self.fc = fc
+ self.osr = osr
+ self.ppm = ppm
self.samp_rate_in = samp_rate_in
##################################################
# Variables
##################################################
- self.samp_rate_out = samp_rate_out = 1625000.0/6.0*osr
+ self.gsm_symb_rate = gsm_symb_rate = 1625000.0/6.0
+ self.samp_rate_out = samp_rate_out = gsm_symb_rate*osr
+ print "samp_rate_in ",samp_rate_in," samp_rate_out",samp_rate_out
##################################################
# Blocks
##################################################
- 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_tagged_0 = grgsm.clock_offset_corrector_tagged(
fc=fc,
- ppm=ppm,
samp_rate_in=samp_rate_in,
+ ppm=ppm,
+ osr=osr,
)
- self.fractional_resampler_xx_0 = filter.fractional_resampler_cc(0, samp_rate_in/samp_rate_out)
##################################################
# Connections
##################################################
- 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_tagged_0, 0), (self.fractional_resampler_xx_0, 0))
- self.connect((self, 0), (self.gsm_clock_offset_corrector_tagged_0, 0))
+ self.msg_connect((self, 'ctrl_in'), (self.gsm_clock_offset_corrector_tagged_0, 'ctrl'))
+ self.connect((self.gsm_clock_offset_corrector_tagged_0, 0), (self.low_pass_filter_0_0, 0))
+ self.connect((self.low_pass_filter_0_0, 0), (self, 0))
+ self.connect((self, 0), (self.gsm_clock_offset_corrector_tagged_0, 0))
- ##################################################
- # Asynch Message Connections
- ##################################################
- self.msg_connect((self, 'ctrl_in'), (self.gsm_clock_offset_corrector_tagged_0, 'ctrl'))
+ def get_fc(self):
+ return self.fc
def set_fc(self, fc):
self.fc = fc
@@ -71,7 +70,8 @@ class gsm_input(grgsm.hier_block):
def set_osr(self, osr):
self.osr = osr
- self.set_samp_rate_out(1625000.0/6.0*self.osr)
+ self.set_samp_rate_out(self.gsm_symb_rate*self.osr)
+ self.gsm_clock_offset_corrector_tagged_0.set_osr(self.osr)
def get_ppm(self):
return self.ppm
@@ -86,12 +86,17 @@ class gsm_input(grgsm.hier_block):
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)
+
+ def get_gsm_symb_rate(self):
+ return self.gsm_symb_rate
+
+ def set_gsm_symb_rate(self, gsm_symb_rate):
+ self.gsm_symb_rate = gsm_symb_rate
+ self.set_samp_rate_out(self.gsm_symb_rate*self.osr)
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.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))