Removing extra copy of DscDemodulator.
This commit is contained in:
parent
ca2e77b301
commit
f147509af9
|
|
@ -284,37 +284,3 @@ class DscDemodulator(SecondaryDemodulator, SecondarySelectorChain):
|
|||
loop_gain = self.sampleRate / self.getBandwidth() / 5
|
||||
self.replace(2, Lowpass(Format.FLOAT, cutoff))
|
||||
self.replace(3, TimingRecovery(Format.FLOAT, secondary_samples_per_bit, loop_gain, 10))
|
||||
|
||||
|
||||
class DscDemodulator(SecondaryDemodulator, SecondarySelectorChain):
|
||||
def __init__(self, baudRate, bandWidth, invert=False):
|
||||
self.baudRate = baudRate
|
||||
self.bandWidth = bandWidth
|
||||
self.invert = invert
|
||||
# this is an assumption, we will adjust in setSampleRate
|
||||
self.sampleRate = 12000
|
||||
secondary_samples_per_bit = int(round(self.sampleRate / self.baudRate))
|
||||
cutoff = self.baudRate / self.sampleRate
|
||||
loop_gain = self.sampleRate / self.getBandwidth() / 5
|
||||
workers = [
|
||||
Agc(Format.COMPLEX_FLOAT),
|
||||
FmDemod(),
|
||||
Lowpass(Format.FLOAT, cutoff),
|
||||
TimingRecovery(Format.FLOAT, secondary_samples_per_bit, loop_gain, 10),
|
||||
Ccir493Decoder(fec=True, invert=invert),
|
||||
DscDecoder(),
|
||||
]
|
||||
super().__init__(workers)
|
||||
|
||||
def getBandwidth(self) -> float:
|
||||
return self.bandWidth
|
||||
|
||||
def setSampleRate(self, sampleRate: int) -> None:
|
||||
if sampleRate == self.sampleRate:
|
||||
return
|
||||
self.sampleRate = sampleRate
|
||||
secondary_samples_per_bit = int(round(self.sampleRate / self.baudRate))
|
||||
cutoff = self.baudRate / self.sampleRate
|
||||
loop_gain = self.sampleRate / self.getBandwidth() / 5
|
||||
self.replace(2, Lowpass(Format.FLOAT, cutoff))
|
||||
self.replace(3, TimingRecovery(Format.FLOAT, secondary_samples_per_bit, loop_gain, 10))
|
||||
|
|
|
|||
Loading…
Reference in New Issue