From aeca8265c3ba365038ef8a8264d49adf4bbbcc25 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 20 Jul 2021 17:58:32 +0200 Subject: [PATCH] fine-tune agc --- csdr/chain/am.py | 7 +++++-- csdr/chain/fm.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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)