2021-07-24 20:25:41 +00:00
|
|
|
from csdr.chain import Chain
|
2021-07-19 17:04:14 +00:00
|
|
|
from pycsdr.modules import FmDemod, Limit, NfmDeemphasis, Agc, Convert
|
2021-07-20 15:58:32 +00:00
|
|
|
from pycsdr.types import Format, AgcProfile
|
2021-07-19 17:04:14 +00:00
|
|
|
|
|
|
|
|
2021-07-24 20:25:41 +00:00
|
|
|
class Fm(Chain):
|
2021-07-19 17:04:14 +00:00
|
|
|
def __init__(self, sampleRate: int):
|
2021-07-20 15:58:32 +00:00
|
|
|
agc = Agc(Format.FLOAT)
|
|
|
|
agc.setProfile(AgcProfile.SLOW)
|
|
|
|
agc.setMaxGain(3)
|
2021-07-19 17:04:14 +00:00
|
|
|
workers = [
|
|
|
|
FmDemod(),
|
|
|
|
Limit(),
|
|
|
|
NfmDeemphasis(sampleRate),
|
2021-07-20 15:58:32 +00:00
|
|
|
agc,
|
2021-07-19 17:04:14 +00:00
|
|
|
Convert(Format.FLOAT, Format.SHORT),
|
|
|
|
]
|
|
|
|
super().__init__(*workers)
|