initial work on freedv / codec2 support, refs #126

This commit is contained in:
Jakob Ketterl 2020-07-28 00:28:20 +02:00
parent 9b187140ff
commit 7e5409160e
3 changed files with 17 additions and 1 deletions

View File

@ -301,6 +301,15 @@ class dsp(object):
chain += ["csdr amdemod_cf", "csdr fastdcblock_ff"]
chain += last_decimation_block
chain += ["csdr agc_ff", "csdr limit_ff", "csdr convert_f_s16"]
elif which == "freedv":
chain += ["csdr realpart_cf"]
chain += last_decimation_block
chain += [
"csdr agc_ff",
"csdr convert_f_s16",
"freedv_rx 1600 - -",
"sox -t raw -r 8000 -e signed-integer -b 16 -c 1 --buffer 32 - -t raw -r {output_rate} -e signed-integer -b 16 -c 1 - ",
]
elif which == "ssb":
chain += ["csdr realpart_cf"]
chain += last_decimation_block
@ -571,6 +580,8 @@ class dsp(object):
return 48000
elif self.isWsjtMode() or self.isJs8():
return 12000
elif self.get_demodulator() == "freedv":
return 8000
return self.get_output_rate()
def isDigitalVoice(self, demodulator=None):
@ -664,7 +675,7 @@ class dsp(object):
def set_squelch_level(self, squelch_level):
self.squelch_level = squelch_level
# no squelch required on digital voice modes
actual_squelch = -150 if self.isDigitalVoice() or self.isPacket() or self.isPocsag() else self.squelch_level
actual_squelch = -150 if self.isDigitalVoice() or self.isPacket() or self.isPocsag() or self.get_demodulator() == "freedv" else self.squelch_level
if self.running:
self.pipes["squelch_pipe"].write("%g\n" % (self.convertToLinear(actual_squelch)))

View File

@ -39,6 +39,7 @@ class FeatureDetector(object):
# optional features and their requirements
"digital_voice_digiham": ["digiham", "sox"],
"digital_voice_dsd": ["dsd", "sox", "digiham"],
"digital_voice_freedv": ["freedv_rx", "sox"],
"wsjt-x": ["wsjtx", "sox"],
"packet": ["direwolf", "sox"],
"pocsag": ["digiham", "sox"],
@ -401,3 +402,6 @@ class FeatureDetector(object):
You can find instructions and downloads [here](https://o28.sischa.net/fifisdr/trac/wiki/De%3Arockprog).
"""
return self.command_is_runnable("rockprog")
def has_freedv_rx(self):
return self.command_is_runnable("freedv_rx")

View File

@ -48,6 +48,7 @@ class Modes(object):
AnalogMode("dstar", "DStar", bandpass=Bandpass(-3250, 3250), requirements=["digital_voice_dsd"], squelch=False),
AnalogMode("nxdn", "NXDN", bandpass=Bandpass(-3250, 3250), requirements=["digital_voice_dsd"], squelch=False),
AnalogMode("ysf", "YSF", bandpass=Bandpass(-4000, 4000), requirements=["digital_voice_digiham"], squelch=False),
AnalogMode("freedv", "FDV", bandpass=Bandpass(300, 3000), requirements=["digital_voice_freedv"], squelch=False),
DigitalMode("bpsk31", "BPSK31", underlying=["usb"]),
DigitalMode("bpsk63", "BPSK63", underlying=["usb"]),
DigitalMode("ft8", "FT8", underlying=["usb"], requirements=["wsjt-x"], service=True),