get freedv back by modeling a corresponding module and chain
This commit is contained in:
parent
1c937e147e
commit
e5b120311d
28
csdr/chain/freedv.py
Normal file
28
csdr/chain/freedv.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from csdr.chain.demodulator import BaseDemodulatorChain, FixedIfSampleRateChain, FixedAudioRateChain
|
||||||
|
from owrx.freedv import FreeDVModule
|
||||||
|
from pycsdr.modules import RealPart, Agc, Convert
|
||||||
|
from pycsdr.types import Format
|
||||||
|
|
||||||
|
|
||||||
|
class FreeDV(BaseDemodulatorChain, FixedIfSampleRateChain, FixedAudioRateChain):
|
||||||
|
def __init__(self):
|
||||||
|
agc = Agc(Format.SHORT)
|
||||||
|
agc.setMaxGain(30)
|
||||||
|
agc.setInitialGain(3)
|
||||||
|
workers = [
|
||||||
|
RealPart(),
|
||||||
|
Agc(Format.FLOAT),
|
||||||
|
Convert(Format.FLOAT, Format.SHORT),
|
||||||
|
FreeDVModule(),
|
||||||
|
agc,
|
||||||
|
]
|
||||||
|
super().__init__(workers)
|
||||||
|
|
||||||
|
def getFixedIfSampleRate(self) -> int:
|
||||||
|
return 8000
|
||||||
|
|
||||||
|
def getFixedAudioRate(self) -> int:
|
||||||
|
return 8000
|
||||||
|
|
||||||
|
def supportsSquelch(self) -> bool:
|
||||||
|
return False
|
@ -12,6 +12,7 @@ from csdr.chain.clientaudio import ClientAudioChain
|
|||||||
from csdr.chain.analog import NFm, WFm, Am, Ssb
|
from csdr.chain.analog import NFm, WFm, Am, Ssb
|
||||||
from csdr.chain.digiham import DigihamChain, Dmr, Dstar, Nxdn, Ysf
|
from csdr.chain.digiham import DigihamChain, Dmr, Dstar, Nxdn, Ysf
|
||||||
from csdr.chain.m17 import M17Chain
|
from csdr.chain.m17 import M17Chain
|
||||||
|
from csdr.chain.freedv import FreeDV
|
||||||
from csdr.chain.drm import Drm
|
from csdr.chain.drm import Drm
|
||||||
from csdr.chain.fft import FftChain
|
from csdr.chain.fft import FftChain
|
||||||
from csdr.chain.digimodes import AudioChopperDemodulator, PacketDemodulator, PocsagDemodulator
|
from csdr.chain.digimodes import AudioChopperDemodulator, PacketDemodulator, PocsagDemodulator
|
||||||
@ -452,6 +453,8 @@ class DspManager(Output, SdrSourceEventClient):
|
|||||||
return M17Chain()
|
return M17Chain()
|
||||||
elif demod == "drm":
|
elif demod == "drm":
|
||||||
return Drm()
|
return Drm()
|
||||||
|
elif demod == "freedv":
|
||||||
|
return FreeDV()
|
||||||
|
|
||||||
def setDemodulator(self, mod):
|
def setDemodulator(self, mod):
|
||||||
demodulator = self._getDemodulator(mod)
|
demodulator = self._getDemodulator(mod)
|
||||||
|
13
owrx/freedv.py
Normal file
13
owrx/freedv.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from pycsdr.types import Format
|
||||||
|
from csdr.module import PopenModule
|
||||||
|
|
||||||
|
|
||||||
|
class FreeDVModule(PopenModule):
|
||||||
|
def getInputFormat(self) -> Format:
|
||||||
|
return Format.SHORT
|
||||||
|
|
||||||
|
def getOutputFormat(self) -> Format:
|
||||||
|
return Format.SHORT
|
||||||
|
|
||||||
|
def getCommand(self):
|
||||||
|
return ["freedv_rx", "1600", "-", "-"]
|
Loading…
Reference in New Issue
Block a user