openwebrx-clone/csdr/chain/am.py

25 lines
686 B
Python
Raw Normal View History

2021-07-19 21:32:03 +00:00
from csdr.chain import Chain
from csdr.chain.demodulator import Demodulator
from pycsdr.modules import AmDemod, DcBlock, Agc, Convert
2021-07-20 15:58:32 +00:00
from pycsdr.types import Format, AgcProfile
2021-07-19 21:32:03 +00:00
class Am(Demodulator):
def __init__(self):
2021-07-20 15:58:32 +00:00
agc = Agc(Format.FLOAT)
agc.setProfile(AgcProfile.SLOW)
agc.setInitialGain(200)
2021-07-19 21:32:03 +00:00
workers = [
AmDemod(),
DcBlock(),
# empty chain as placeholder for the "last decimation"
Chain(),
2021-07-20 15:58:32 +00:00
agc,
2021-07-19 21:32:03 +00:00
Convert(Format.FLOAT, Format.SHORT),
]
super().__init__(*workers)
def setLastDecimation(self, decimation: Chain):
self.replace(2, decimation)