diff --git a/csdr/csdr.py b/csdr/csdr.py index 832d442..07be0f3 100644 --- a/csdr/csdr.py +++ b/csdr/csdr.py @@ -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))) diff --git a/owrx/feature.py b/owrx/feature.py index a9c44f2..abb98a0 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -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") diff --git a/owrx/modes.py b/owrx/modes.py index f455268..bd930b8 100644 --- a/owrx/modes.py +++ b/owrx/modes.py @@ -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),