sosfilter: fix case if no notch is defined

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
Timofey Titovets
2025-11-16 05:16:58 +01:00
committed by KevinOConnor
parent 79189203e2
commit 900c908db8

View File

@@ -40,6 +40,8 @@ class DigitalFilter:
if lowpass: if lowpass:
self.filter_sections.append( self.filter_sections.append(
self._butter(lowpass, "lowpass", lowpass_order)) self._butter(lowpass, "lowpass", lowpass_order))
if notches is None:
notches = []
for notch_freq in notches: for notch_freq in notches:
self.filter_sections.append(self._notch(notch_freq, notch_quality)) self.filter_sections.append(self._notch(notch_freq, notch_quality))
if len(self.filter_sections) > 0: if len(self.filter_sections) > 0: