fix initial demodulator parameters

This commit is contained in:
Jakob Ketterl 2021-07-19 19:48:18 +02:00
parent 5bb14a8997
commit f03a6c127e
2 changed files with 5 additions and 2 deletions

View File

@ -605,7 +605,7 @@ class Dsp(DirewolfConfigSubscriber):
self.high_cut = high_cut
if self.running:
if self.pycsdr_chain is not None and isinstance(self.pycsdr_chain, DemodulatorChain):
self.pycsdr_chain.setBandpass(low_cut, high_cut)
self.pycsdr_chain.setBandpass(float(self.low_cut) / self.if_samp_rate(), float(self.high_cut) / self.if_samp_rate())
else:
self.pipes["bpf_pipe"].write(
"%g %g\n" % (float(self.low_cut) / self.if_samp_rate(), float(self.high_cut) / self.if_samp_rate())
@ -724,6 +724,9 @@ class Dsp(DirewolfConfigSubscriber):
chain = self.chain(self.demodulator)
if self.pycsdr_enabled and isinstance(chain, DemodulatorChain):
self.set_squelch_level(self.squelch_level)
self.set_bpf(self.low_cut, self.high_cut)
self.set_offset_freq(self.offset_freq)
chain.setInput(self.buffer)
self.output.send_output("audio", chain.getOutput().read)
return

View File

@ -19,7 +19,7 @@ class DemodulatorChain(Chain):
self.decimation = FirDecimate(decimation, transition)
bp_transition = 320.0 / if_samp_rate
self.bandpass = Bandpass(bp_transition, use_fft=True)
self.bandpass = Bandpass(transition=bp_transition, use_fft=True)
self.squelch = Squelch(5)