fine-tune agc

This commit is contained in:
Jakob Ketterl 2021-07-20 17:58:32 +02:00
parent b242f09d5d
commit aeca8265c3
2 changed files with 10 additions and 4 deletions

View File

@ -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),
]

View File

@ -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)