From 11a360607079269c52132aeb53e5b49ba5e391c2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 25 Jul 2021 23:38:24 +0200 Subject: [PATCH] use the new cutoff parameter to compensate the fractional decimator --- csdr/chain/demodulator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csdr/chain/demodulator.py b/csdr/chain/demodulator.py index c389e73..ba23161 100644 --- a/csdr/chain/demodulator.py +++ b/csdr/chain/demodulator.py @@ -10,7 +10,10 @@ class DemodulatorChain(Chain): decimation, fraction = self._getDecimation(samp_rate, audioRate) if_samp_rate = samp_rate / decimation transition = 0.15 * (if_samp_rate / float(samp_rate)) - self.decimation = FirDecimate(decimation, transition) + # set the cutoff on the fist decimation stage lower so that the resulting output + # is already prepared for the second (fractional) decimation stage. + # this spares us a second filter. + self.decimation = FirDecimate(decimation, transition, 0.5 * decimation / (samp_rate / audioRate)) bp_transition = 320.0 / audioRate self.bandpass = Bandpass(transition=bp_transition, use_fft=True)