compensate oversampling with the prefilter of csdr

This commit is contained in:
Jakob Ketterl 2020-08-08 22:51:03 +02:00
parent f0b3a50c23
commit 7f57e4f45c

View File

@ -261,9 +261,12 @@ class dsp(object):
if not self.output.supports_type("audio"): if not self.output.supports_type("audio"):
return chain return chain
# safe some cpu cycles... no need to decimate if decimation factor is 1 # safe some cpu cycles... no need to decimate if decimation factor is 1
last_decimation_block = ( last_decimation_block = []
["csdr fractional_decimator_ff {last_decimation}"] if self.last_decimation != 1.0 else [] if self.last_decimation >= 2.0:
) # activate prefilter if signal has been oversampled, e.g. WFM
last_decimation_block = ["csdr fractional_decimator_ff {last_decimation} 12 --prefilter"]
elif self.last_decimation >= 1.0:
last_decimation_block = ["csdr fractional_decimator_ff {last_decimation}"]
if which == "nfm": if which == "nfm":
chain += ["csdr fmdemod_quadri_cf", "csdr limit_ff"] chain += ["csdr fmdemod_quadri_cf", "csdr limit_ff"]
chain += last_decimation_block chain += last_decimation_block
@ -275,7 +278,10 @@ class dsp(object):
else: else:
chain += ["csdr convert_f_s16"] chain += ["csdr convert_f_s16"]
elif which == "wfm": elif which == "wfm":
chain += ["csdr fmdemod_quadri_cf", "csdr limit_ff"] chain += [
"csdr fmdemod_quadri_cf",
"csdr limit_ff",
]
chain += last_decimation_block chain += last_decimation_block
chain += [ chain += [
"csdr deemphasis_wfm_ff {audio_rate} 50e-6", "csdr deemphasis_wfm_ff {audio_rate} 50e-6",