diff --git a/csdr/chain/am.py b/csdr/chain/am.py index 550032b..64416e5 100644 --- a/csdr/chain/am.py +++ b/csdr/chain/am.py @@ -1,17 +1,20 @@ from csdr.chain import Chain from csdr.chain.demodulator import Demodulator from pycsdr.modules import AmDemod, DcBlock, Agc, Convert -from pycsdr.types import Format +from pycsdr.types import Format, AgcProfile class Am(Demodulator): def __init__(self): + agc = Agc(Format.FLOAT) + agc.setProfile(AgcProfile.SLOW) + agc.setInitialGain(200) workers = [ AmDemod(), DcBlock(), # empty chain as placeholder for the "last decimation" Chain(), - Agc(Format.FLOAT), + agc, Convert(Format.FLOAT, Format.SHORT), ] diff --git a/csdr/chain/fm.py b/csdr/chain/fm.py index 62e535e..f5ef6bd 100644 --- a/csdr/chain/fm.py +++ b/csdr/chain/fm.py @@ -1,17 +1,20 @@ from csdr.chain.demodulator import Demodulator, Chain from pycsdr.modules import FmDemod, Limit, NfmDeemphasis, Agc, Convert -from pycsdr.types import Format +from pycsdr.types import Format, AgcProfile class Fm(Demodulator): def __init__(self, sampleRate: int): + agc = Agc(Format.FLOAT) + agc.setProfile(AgcProfile.SLOW) + agc.setMaxGain(3) workers = [ FmDemod(), Limit(), # empty chain as placeholder for the "last decimation" Chain(), NfmDeemphasis(sampleRate), - Agc(Format.FLOAT), + agc, Convert(Format.FLOAT, Format.SHORT), ] super().__init__(*workers)