summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <ikj1234i@yahoo.com>2020-07-18 19:34:01 -0400
committerMax <ikj1234i@yahoo.com>2020-07-18 19:34:01 -0400
commita5df0ec044b4053bc4a42094424aac88de102c52 (patch)
tree233fc71e020a3c78613cfcb1eab6f7a711579c4c
parent94dc7536e609abe57baadcd73299421b3635dd61 (diff)
fix disctap if rate
-rwxr-xr-xop25/gr-op25_repeater/apps/multi_rx.py1
-rw-r--r--op25/gr-op25_repeater/apps/p25_demodulator.py16
-rwxr-xr-xop25/gr-op25_repeater/apps/rx.py7
3 files changed, 18 insertions, 6 deletions
diff --git a/op25/gr-op25_repeater/apps/multi_rx.py b/op25/gr-op25_repeater/apps/multi_rx.py
index 4ad70ca..eef7d62 100755
--- a/op25/gr-op25_repeater/apps/multi_rx.py
+++ b/op25/gr-op25_repeater/apps/multi_rx.py
@@ -135,6 +135,7 @@ class channel(object):
self.demod = p25_demodulator.p25_demod_fb(
input_rate = dev.sample_rate,
filter_type = config['filter_type'],
+ if_rate = config['if_rate'],
symbol_rate = self.symbol_rate)
else:
self.demod = p25_demodulator.p25_demod_cb(
diff --git a/op25/gr-op25_repeater/apps/p25_demodulator.py b/op25/gr-op25_repeater/apps/p25_demodulator.py
index 7195cd0..64c8eb0 100644
--- a/op25/gr-op25_repeater/apps/p25_demodulator.py
+++ b/op25/gr-op25_repeater/apps/p25_demodulator.py
@@ -166,6 +166,7 @@ class p25_demod_fb(p25_demod_base):
input_rate = None,
filter_type = None,
excess_bw = _def_excess_bw,
+ if_rate = _def_if_rate,
symbol_rate = _def_symbol_rate):
"""
Hierarchical block for P25 demodulation.
@@ -179,12 +180,21 @@ class p25_demod_fb(p25_demod_base):
gr.io_signature(1, 1, gr.sizeof_float), # Input signature
gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
- p25_demod_base.__init__(self, if_rate=input_rate, symbol_rate=symbol_rate, filter_type=filter_type)
+ p25_demod_base.__init__(self, if_rate=if_rate, symbol_rate=symbol_rate, filter_type=filter_type)
self.input_rate = input_rate
+ self.if_rate = if_rate
self.float_sink = None
-
- self.connect(self, self.baseband_amp, self.symbol_filter, self.fsk4_demod, self.slicer, self)
+ if input_rate != if_rate:
+ assert if_rate < input_rate
+ assert input_rate % if_rate == 0 ### input rate must be multiple of if rate
+ decim = input_rate // if_rate
+ maxf = min(if_rate // 2, 6000) ### lpf cutoff at most 6 KHz
+ lpf_coeffs = filter.firdes.low_pass(1.0, input_rate, maxf, maxf//8, filter.firdes.WIN_HAMMING)
+ self.bb_decim = filter.fir_filter_fff(decim, lpf_coeffs)
+ self.connect(self, self.bb_decim, self.baseband_amp, self.symbol_filter, self.fsk4_demod, self.slicer, self)
+ else:
+ self.connect(self, self.baseband_amp, self.symbol_filter, self.fsk4_demod, self.slicer, self)
def disconnect_float(self):
# assumes lock held or init
diff --git a/op25/gr-op25_repeater/apps/rx.py b/op25/gr-op25_repeater/apps/rx.py
index 9208226..d67994b 100755
--- a/op25/gr-op25_repeater/apps/rx.py
+++ b/op25/gr-op25_repeater/apps/rx.py
@@ -215,6 +215,7 @@ class p25_rx_block (gr.top_block):
global WIRESHARK_PORT
sps = 5 # samples / symbol
+ if_rate = sps * 4800
self.rx_q = gr.msg_queue(100)
udp_port = 0
@@ -234,7 +235,7 @@ class p25_rx_block (gr.top_block):
self.xor_cache = {}
if self.baseband_input:
- self.demod = p25_demodulator.p25_demod_fb(input_rate=capture_rate, excess_bw=self.options.excess_bw)
+ self.demod = p25_demodulator.p25_demod_fb(input_rate=capture_rate, excess_bw=self.options.excess_bw,if_rate=if_rate)
else: # complex input
# local osc
self.lo_freq = self.options.offset
@@ -244,7 +245,7 @@ class p25_rx_block (gr.top_block):
demod_type = self.options.demod_type,
relative_freq = self.lo_freq,
offset = self.options.offset,
- if_rate = sps * 4800,
+ if_rate = if_rate,
gain_mu = self.options.gain_mu,
costas_alpha = self.options.costas_alpha,
excess_bw = self.options.excess_bw,
@@ -260,7 +261,7 @@ class p25_rx_block (gr.top_block):
self.connect(source, self.demod, self.decoder)
if self.baseband_input:
- sps = int(capture_rate / 4800)
+ sps = if_rate // 4800
plot_modes = []
if self.options.plot_mode is not None:
plot_modes = self.options.plot_mode.split(',')