Adding FLdigi Navtex decoder, packaged into app by Franco.
This commit is contained in:
parent
bcc817d8f8
commit
9354e77af6
|
|
@ -1,6 +1,6 @@
|
|||
from csdr.chain.demodulator import ServiceDemodulator, DialFrequencyReceiver, FixedIfSampleRateChain
|
||||
from csdr.module.toolbox import Rtl433Module, MultimonModule, DumpHfdlModule, DumpVdl2Module, Dump1090Module, AcarsDecModule
|
||||
from pycsdr.modules import FmDemod, AudioResampler, Convert, Agc, Squelch
|
||||
from csdr.chain.demodulator import ServiceDemodulator, DialFrequencyReceiver, FixedIfSampleRateChain, SecondaryDemodulator, SecondarySelectorChain
|
||||
from csdr.module.toolbox import Rtl433Module, MultimonModule, DumpHfdlModule, DumpVdl2Module, Dump1090Module, AcarsDecModule, NavtexModule
|
||||
from pycsdr.modules import FmDemod, AudioResampler, Convert, Agc, Squelch, Shift, RealPart
|
||||
from pycsdr.types import Format
|
||||
from owrx.toolbox import TextParser, PageParser, SelCallParser, IsmParser
|
||||
from owrx.aircraft import HfdlParser, Vdl2Parser, AdsbParser, AcarsParser
|
||||
|
|
@ -188,3 +188,29 @@ class AcarsDemodulator(ServiceDemodulator, DialFrequencyReceiver):
|
|||
|
||||
def setDialFrequency(self, frequency: int) -> None:
|
||||
self.parser.setDialFrequency(frequency)
|
||||
|
||||
|
||||
class NavtexDemodulator(SecondaryDemodulator, SecondarySelectorChain):
|
||||
def __init__(self):
|
||||
self.sampleRate = 12500
|
||||
self.bandWidth = 340
|
||||
self.offset = 1000
|
||||
workers = [
|
||||
Shift(float(self.offset - self.bandWidth/2) / self.sampleRate),
|
||||
RealPart(),
|
||||
Agc(Format.FLOAT),
|
||||
Convert(Format.FLOAT, Format.SHORT),
|
||||
NavtexModule(self.sampleRate),
|
||||
]
|
||||
# Connect all the workers
|
||||
super().__init__(workers)
|
||||
|
||||
def getBandwidth(self) -> float:
|
||||
return self.bandWidth
|
||||
|
||||
def setSampleRate(self, sampleRate: int) -> None:
|
||||
if sampleRate == self.sampleRate:
|
||||
return
|
||||
self.sampleRate = sampleRate
|
||||
self.replace(0, Shift(float(self.offset - self.bandWidth/2) / self.sampleRate))
|
||||
self.replace(4, NavtexModule(self.sampleRate))
|
||||
|
|
|
|||
|
|
@ -146,3 +146,18 @@ class AcarsDecModule(PopenModule):
|
|||
header[40:43] = bytes([0, 0xFF, 0xFF, 0xFF])
|
||||
# Send .WAV file header to the process
|
||||
self.process.stdin.write(header)
|
||||
|
||||
|
||||
class NavtexModule(PopenModule):
|
||||
def __init__(self, sampleRate: int = 12000):
|
||||
self.sampleRate = sampleRate
|
||||
super().__init__()
|
||||
|
||||
def getCommand(self):
|
||||
return [ "navtex_rx_from_file", str(self.sampleRate) ]
|
||||
|
||||
def getInputFormat(self) -> Format:
|
||||
return Format.SHORT
|
||||
|
||||
def getOutputFormat(self) -> Format:
|
||||
return Format.CHAR
|
||||
|
|
|
|||
|
|
@ -663,6 +663,9 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
|||
elif mod == "sitorb":
|
||||
from csdr.chain.digimodes import SitorBDemodulator
|
||||
return SitorBDemodulator(100, 170)
|
||||
elif mod == "navtex":
|
||||
from csdr.chain.toolbox import NavtexDemodulator
|
||||
return NavtexDemodulator()
|
||||
elif mod == "cwdecoder":
|
||||
from csdr.chain.digimodes import CwDemodulator
|
||||
return CwDemodulator(75.0)
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ class Modes(object):
|
|||
DigitalMode("rtty450", "RTTY-450 (50N)", underlying=["usb", "lsb"]),
|
||||
DigitalMode("rtty85", "RTTY-85 (50N)", underlying=["usb", "lsb"]),
|
||||
DigitalMode("sitorb", "SITOR-B", underlying=["usb"]),
|
||||
DigitalMode("navtex", "Navtex", underlying=["usb"]),
|
||||
WsjtMode("ft8", "FT8"),
|
||||
WsjtMode("ft4", "FT4"),
|
||||
WsjtMode("jt65", "JT65"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue