fix disctap if rate
This commit is contained in:
parent
94dc7536e6
commit
a5df0ec044
|
@ -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(
|
||||
|
|
|
@ -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,11 +180,20 @@ 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
|
||||
|
||||
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):
|
||||
|
|
|
@ -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(',')
|
||||
|
|
Loading…
Reference in New Issue