dmr tdma slot filter control

This commit is contained in:
Jakob Ketterl 2021-08-07 00:09:40 +02:00
parent 8e945d4149
commit 2b3123c7cb
3 changed files with 11 additions and 0 deletions

View File

@ -671,6 +671,8 @@ class Dsp(DirewolfConfigSubscriber):
def set_dmr_filter(self, filter): def set_dmr_filter(self, filter):
if self.has_pipe("dmr_control_pipe"): if self.has_pipe("dmr_control_pipe"):
self.pipes["dmr_control_pipe"].write("{0}\n".format(filter)) self.pipes["dmr_control_pipe"].write("{0}\n".format(filter))
if self.pycsdr_enabled and self.pycsdr_chain is not None and isinstance(self.pycsdr_chain, DemodulatorChain):
self.pycsdr_chain.setDmrFilter(filter)
def set_wfm_deemphasis_tau(self, tau): def set_wfm_deemphasis_tau(self, tau):
if self.wfm_deemphasis_tau == tau: if self.wfm_deemphasis_tau == tau:

View File

@ -1,6 +1,7 @@
from csdr.chain import Chain from csdr.chain import Chain
from pycsdr.modules import Shift, FirDecimate, Bandpass, Squelch, FractionalDecimator, Writer from pycsdr.modules import Shift, FirDecimate, Bandpass, Squelch, FractionalDecimator, Writer
from pycsdr.types import Format from pycsdr.types import Format
from csdr.chain.digiham import Dmr
class DemodulatorChain(Chain): class DemodulatorChain(Chain):
@ -49,6 +50,10 @@ class DemodulatorChain(Chain):
def setMetaWriter(self, writer: Writer): def setMetaWriter(self, writer: Writer):
self.demodulator.setMetaWriter(writer) self.demodulator.setMetaWriter(writer)
def setDmrFilter(self, filter: int) -> None:
if isinstance(self.demodulator, Dmr):
self.demodulator.setSlotFilter(filter)
def _getDecimation(self, input_rate, output_rate): def _getDecimation(self, input_rate, output_rate):
if output_rate <= 0: if output_rate <= 0:
raise ValueError("invalid output rate: {rate}".format(rate=output_rate)) raise ValueError("invalid output rate: {rate}".format(rate=output_rate))

View File

@ -42,9 +42,13 @@ class Nxdn(DigihamChain):
self.mbeMode = Modes.NxdnMode self.mbeMode = Modes.NxdnMode
super().__init__(codecserver) super().__init__(codecserver)
class Dmr(DigihamChain): class Dmr(DigihamChain):
def __init__(self, codecserver: str = ""): def __init__(self, codecserver: str = ""):
self.fskDemodulator = GfskDemodulator(samplesPerSymbol=10) self.fskDemodulator = GfskDemodulator(samplesPerSymbol=10)
self.decoder = DmrDecoder() self.decoder = DmrDecoder()
self.mbeMode = Modes.DmrMode self.mbeMode = Modes.DmrMode
super().__init__(codecserver) super().__init__(codecserver)
def setSlotFilter(self, filter: int) -> None:
self.decoder.setSlotFilter(filter)