aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2016-12-29 13:01:48 +0100
committerPiotr Krysik <ptrkrysik@gmail.com>2016-12-29 13:01:48 +0100
commit25ae3e2066e589f7faf2ddf9b1811697583233ac (patch)
tree7960e68e3060d07ff25ff31c75539bdc15488ff4 /apps
parent694ed81d7bd7f55e020897ac07d852542e7cb78e (diff)
parentddd096e6b4e41adbf448657ebd7630fb98687f99 (diff)
Merge branch '213-3digit-mnc' of https://github.com/romankh/gr-gsm into libosmocore_integration
Diffstat (limited to 'apps')
-rwxr-xr-xapps/grgsm_decode7
-rwxr-xr-xapps/grgsm_scanner4
-rwxr-xr-xapps/helpers/grgsm_capture.py4
3 files changed, 10 insertions, 5 deletions
diff --git a/apps/grgsm_decode b/apps/grgsm_decode
index 94a2ba0..18536c3 100755
--- a/apps/grgsm_decode
+++ b/apps/grgsm_decode
@@ -39,6 +39,7 @@ class grgsm_decoder(gr.top_block):
cfile=None, fc=None, samp_rate=2e6,
a5=1, a5_kc=None,
speech_file=None, speech_codec=None,
+ enable_voice_boundary_detection=False,
verbose=False,
print_bursts=False, ppm=0):
@@ -62,6 +63,7 @@ class grgsm_decoder(gr.top_block):
self.speech_codec = speech_codec
self.verbose = verbose
self.print_bursts = print_bursts
+ self.enable_voice_boundary_detection = enable_voice_boundary_detection
##################################################
# Blocks
@@ -95,7 +97,7 @@ class grgsm_decoder(gr.top_block):
self.sdcch8_demapper = grgsm.gsm_sdcch8_demapper(self.timeslot)
elif self.chan_mode == 'TCHF':
self.tch_f_demapper = grgsm.tch_f_chans_demapper(self.timeslot)
- self.tch_f_decoder = grgsm.tch_f_decoder(speech_codec)
+ self.tch_f_decoder = grgsm.tch_f_decoder(speech_codec, enable_voice_boundary_detection)
self.tch_f_pdu_to_tagged_stream = blocks.pdu_to_tagged_stream(blocks.byte_t, "packet_len")
self.tch_f_file_sink = blocks.file_sink(gr.sizeof_char*1, speech_file, False)
@@ -317,6 +319,8 @@ if __name__ == '__main__':
"Valid options are " + ", ".join(tch_codecs.keys()))
tch_options.add_option("-o", "--output-tch", dest="speech_output_file", default="/tmp/speech.au.gsm",
help="TCH/F speech output file [default=%default].")
+ tch_options.add_option("--voice-boundary", dest="enable_voice_boundary_detection", action="store_true",
+ help="Enable voice boundary detection for traffic channels. This can help reduce noice in the output.")
parser.add_option_group(tch_options)
# parse
@@ -378,6 +382,7 @@ if __name__ == '__main__':
cfile=options.cfile, fc=fc, samp_rate=options.samp_rate,
a5=options.a5, a5_kc=kc,
speech_file=options.speech_output_file, speech_codec=tch_codecs.get(options.speech_codec),
+ enable_voice_boundary_detection=options.enable_voice_boundary_detection,
verbose=options.verbose,
print_bursts=options.print_bursts, ppm=options.ppm)
diff --git a/apps/grgsm_scanner b/apps/grgsm_scanner
index acd48d9..1688310 100755
--- a/apps/grgsm_scanner
+++ b/apps/grgsm_scanner
@@ -220,7 +220,7 @@ class wideband_scanner(gr.top_block):
# correction of central frequency
# if the receiver has large frequency offset
# the value of this variable should be set close to that offset in ppm
- self.rtlsdr_source.set_freq_corr(options.ppm, 0)
+ self.rtlsdr_source.set_freq_corr(ppm, 0)
self.rtlsdr_source.set_dc_offset_mode(2, 0)
self.rtlsdr_source.set_iq_balance_mode(0, 0)
@@ -230,7 +230,7 @@ class wideband_scanner(gr.top_block):
self.head = blocks.head(gr.sizeof_gr_complex * 1, int(rec_len * sample_rate))
# shift again by -0.1MHz in order to align channel center in 0Hz
- self.blocks_rotator_cc = blocks.rotator_cc(-2 * pi * 0.1e6 / options.samp_rate)
+ self.blocks_rotator_cc = blocks.rotator_cc(-2 * pi * 0.1e6 / sample_rate)
self.wideband_receiver = wideband_receiver(OSR=4, fc=carrier_frequency, samp_rate=sample_rate)
self.gsm_extract_system_info = grgsm.extract_system_info()
diff --git a/apps/helpers/grgsm_capture.py b/apps/helpers/grgsm_capture.py
index caea805..a71c2c8 100755
--- a/apps/helpers/grgsm_capture.py
+++ b/apps/helpers/grgsm_capture.py
@@ -86,7 +86,7 @@ class grgsm_capture(gr.top_block):
fc=fc,
samp_rate_in=samp_rate,
)
- self.gsm_clock_offset_control = grgsm.clock_offset_control(fc-shiftoff, sample_rate, osr=4)
+ self.gsm_clock_offset_control = grgsm.clock_offset_control(fc-shiftoff, samp_rate, osr=4)
if self.burst_file:
self.gsm_burst_file_sink = grgsm.burst_file_sink(self.burst_file)
@@ -115,7 +115,7 @@ class grgsm_capture(gr.top_block):
if self.verbose or self.burst_file:
self.connect((self.gsm_input, 0), (self.gsm_receiver, 0))
self.connect((self.blocks_rotator, 0), (self.gsm_input, 0))
- self.msg_connect(self.gsm_clock_offset_control, "ppm", self.gsm_input, "ppm_in")
+ self.msg_connect(self.gsm_clock_offset_control, "ctrl", self.gsm_input, "ctrl_in")
self.msg_connect(self.gsm_receiver, "measurements", self.gsm_clock_offset_control, "measurements")
if self.burst_file: