implement nxdn chain using new digiham components

This commit is contained in:
Jakob Ketterl 2021-07-31 00:10:10 +02:00
parent 1c91c6dcc1
commit f8f2740c77
2 changed files with 25 additions and 9 deletions

View File

@ -41,7 +41,7 @@ from csdr.chain.demodulator import DemodulatorChain
from csdr.chain.fm import NFm, WFm
from csdr.chain.am import Am
from csdr.chain.ssb import Ssb
from csdr.chain.digiham import Dstar
from csdr.chain.digiham import Dstar, Nxdn
from csdr.chain.clientaudio import ClientAudioChain
import logging
@ -142,6 +142,9 @@ class Dsp(DirewolfConfigSubscriber):
elif which == "dstar":
self.pycsdr_chain = DemodulatorChain(self.samp_rate, 48000, 0.0, Dstar(self.codecserver))
return self.pycsdr_chain
elif which == "nxdn":
self.pycsdr_chain = DemodulatorChain(self.samp_rate, 48000, 0.0, Nxdn(self.codecserver))
return self.pycsdr_chain
chain = ["nc -v 127.0.0.1 {nc_port}"]
chain += ["csdr shift_addfast_cc --fifo {shift_pipe}"]

View File

@ -1,31 +1,44 @@
from csdr.chain import Chain
from pycsdr.modules import FmDemod
from digiham.modules import DstarDecoder, DcBlock, FskDemodulator, DigitalVoiceFilter, MbeSynthesizer, NarrowRrcFilter, NxdnDecoder
from pycsdr.modules import FmDemod, Agc
from pycsdr.types import Format
from digiham.modules import DstarDecoder, DcBlock, FskDemodulator, GfskDemodulator, DigitalVoiceFilter, MbeSynthesizer, NarrowRrcFilter, NxdnDecoder
from digiham.ambe import Modes
class Dstar(Chain):
def __init__(self, codecserver: str = ""):
if codecserver is None:
codecserver = ""
agc = Agc(Format.SHORT)
agc.setMaxGain(30)
agc.setInitialGain(3)
workers = [
FmDemod(),
DcBlock(),
FskDemodulator(samplesPerSymbol=10),
DstarDecoder(),
MbeSynthesizer(codecserver),
DigitalVoiceFilter()
MbeSynthesizer(Modes.DStarMode, codecserver),
DigitalVoiceFilter(),
agc
]
super().__init__(*workers)
class Nxdn(Chain):
def __init__(self, codecserver: str = ""):
if codecserver is None:
codecserver = ""
agc = Agc(Format.SHORT)
agc.setMaxGain(30)
agc.setInitialGain(3)
workers = [
FmDemod(),
DcBlock(),
NarrowRrcFilter(),
# todo: switch out with gfsk
FskDemodulator(samplesPerSymbol=20),
GfskDemodulator(samplesPerSymbol=20),
NxdnDecoder(),
MbeSynthesizer(codecserver),
DigitalVoiceFilter()
MbeSynthesizer(Modes.NxdnMode, codecserver),
DigitalVoiceFilter(),
agc,
]
super().__init__(*workers)